Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
HDFS-15751. Add documentation for msync() API to filesystem.md. Contr…
Browse files Browse the repository at this point in the history
…ibuted by Konstantin V Shvachko.

Reviewed-by: He Xiaoqiao <[email protected]>
Reviewed-by: Chao Sun <[email protected]>
  • Loading branch information
Hexiaoqiao committed Jan 3, 2021
1 parent 67c274b commit 7a3bc90
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,36 @@ for both files and directories, MUST always return `true` to the `isEncrypted()`
predicate. This can be done by setting the `encrypted` flag to true when creating
the `FileStatus` instance.


### `msync()`

Synchronize metadata state of the client with the latest state of the metadata
service of the FileSystem.

In highly available FileSystems standby service can be used as a read-only
metadata replica. This call is essential to guarantee consistency of
reads from the standby replica and to avoid stale reads.

It is currently only implemented for HDFS and others will just throw
`UnsupportedOperationException`.

#### Preconditions


#### Postconditions

This call internally records the state of the metadata service at the time of
the call. This guarantees consistency of subsequent reads from any metadata
replica. It assures the client will never access the state of the metadata that
preceded the recorded state.

#### HDFS implementation notes

HDFS supports `msync()` in HA mode by calling the Active NameNode and requesting
its latest journal transaction ID. For more details see HDFS documentation
[Consistent Reads from HDFS Observer NameNode](https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/ObserverNameNode.html)


### `Path getHomeDirectory()`

The function `getHomeDirectory` returns the home directory for the FileSystem
Expand Down

0 comments on commit 7a3bc90

Please sign in to comment.