Class StateStoreFileImpl
java.lang.Object
org.apache.hadoop.hdfs.server.federation.store.driver.StateStoreDriver
org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreBaseImpl
org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreSerializableImpl
org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreFileBaseImpl
org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreFileImpl
- All Implemented Interfaces:
StateStoreRecordOperations
StateStoreDriver implementation based on a local file.
-
Field Summary
FieldsFields inherited from class org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreSerializableImpl
COLON_MARK, SLASH_MARK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the State Store driver connection.protected booleanCheck if a path exists.getChildren(String path) Get the children for a path.protected intprotected <T extends BaseRecord>
BufferedReaderGet the reader of a record for the file system.protected StringGet root directory.<T extends BaseRecord>
BufferedWriterGet the writer of a record for the file system.protected booleanMake a directory.protected booleanRemove a file.protected booleanRename a file.Methods inherited from class org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreFileBaseImpl
get, initDriver, initRecordStorage, isDriverReady, isOldTempRecord, putAll, remove, removeAll, setInitializedMethods inherited from class org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreSerializableImpl
getOriginalPrimaryKey, getPrimaryKey, init, newRecord, serialize, serializeStringMethods inherited from class org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreBaseImpl
get, getMultiple, put, remove, remove, removeMultipleMethods inherited from class org.apache.hadoop.hdfs.server.federation.store.driver.StateStoreDriver
getConf, getIdentifier, getMetrics, getTime, handleOverwriteAndDelete, verifyDriverReady
-
Field Details
-
FEDERATION_STORE_FILE_DIRECTORY
Configuration keys.- See Also:
-
-
Constructor Details
-
StateStoreFileImpl
public StateStoreFileImpl()
-
-
Method Details
-
exists
Description copied from class:StateStoreFileBaseImplCheck if a path exists.- Specified by:
existsin classStateStoreFileBaseImpl- Parameters:
path- Path to check.- Returns:
- If the path exists.
-
mkdir
Description copied from class:StateStoreFileBaseImplMake a directory.- Specified by:
mkdirin classStateStoreFileBaseImpl- Parameters:
path- Path of the directory to create.- Returns:
- If the directory was created.
-
rename
Description copied from class:StateStoreFileBaseImplRename a file. This should be atomic.- Specified by:
renamein classStateStoreFileBaseImpl- Parameters:
src- Source name.dst- Destination name.- Returns:
- If the rename was successful.
-
remove
Description copied from class:StateStoreFileBaseImplRemove a file.- Specified by:
removein classStateStoreFileBaseImpl- Parameters:
path- Path for the file to remove- Returns:
- If the file was removed.
-
getRootDir
Description copied from class:StateStoreFileBaseImplGet root directory.- Specified by:
getRootDirin classStateStoreFileBaseImpl- Returns:
- Root directory.
-
getConcurrentFilesAccessNumThreads
protected int getConcurrentFilesAccessNumThreads()- Specified by:
getConcurrentFilesAccessNumThreadsin classStateStoreFileBaseImpl
-
getReader
Description copied from class:StateStoreFileBaseImplGet the reader of a record for the file system.- Specified by:
getReaderin classStateStoreFileBaseImpl- Type Parameters:
T- Type of the state store record.- Parameters:
filename- Path of the record to read.- Returns:
- Reader for the record.
-
getWriter
Description copied from class:StateStoreFileBaseImplGet the writer of a record for the file system.- Specified by:
getWriterin classStateStoreFileBaseImpl- Type Parameters:
T- Type of the state store record.- Parameters:
filename- Path of the record to write.- Returns:
- Writer for the record.
-
close
Description copied from class:StateStoreDriverClose the State Store driver connection.- Overrides:
closein classStateStoreFileBaseImpl- Throws:
Exception- if something goes wrong while closing the state store driver connection.
-
getChildren
Description copied from class:StateStoreFileBaseImplGet the children for a path.- Specified by:
getChildrenin classStateStoreFileBaseImpl- Parameters:
path- Path to check.- Returns:
- List of children.
-