Workflow of Create and Read File Operations in GFS
Understand how GFS manages concurrent file creation and reading operations.
We'll cover the following
Since the GFS is a system that stores and retrieves data from files at a large scale, we must know how it performs different file operations. We listed the file operations that it supports in this lesson. This lesson focuses on the create and read file operations. The rest of the operations are discussed in the upcoming lessons.
Create a file
To create a file, the client needs to connect to the manager node. The manager creates a file in the directory specified by the client and updates the
A read lock is acquired on the directory name (full path to the directory) to make sure that the directory in which the file is being created is not deleted or renamed by another client during the file creation operation.
A write lock is acquired on the file name (full path to the file) to serialize the creation of two or more files with the same name.
The manager releases the locks acquired by an operation when it is done with that operation and has responded to the client. The following illustration shows the workflow for file creating operations.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.