HDFS-15751. Add documentation for msync() API to filesystem.md. Contributed by Konstantin V Shvachko.
Reviewed-by: He Xiaoqiao <hexiaoqiao@apache.org> Reviewed-by: Chao Sun <sunchao@apache.org>
This commit is contained in:
parent
6e2493f48e
commit
5d0eb4c6f0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue