StateStoreFileImpl (Apache Hadoop HDFS-RBF 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.federation.store.driver.impl, class: StateStoreFileImpl

Package org.apache.hadoop.hdfs.server.federation.store.driver.impl

# 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`

public class StateStoreFileImpl extends StateStoreFileBaseImpl
StateStoreDriver implementation based on a local file.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `FEDERATION_STORE_FILE_DIRECTORY`
  Configuration keys.

  ### Fields inherited from class org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreSerializableImpl

  `COLON_MARK, SLASH_MARK`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StateStoreFileImpl()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  Close the State Store driver connection.
  `protected boolean`
  `exists(String path)`
  Check if a path exists.
  `protected List<String>`
  `getChildren(String path)`
  Get the children for a path.
  `protected int`
  `getConcurrentFilesAccessNumThreads()`
  `protected <T extends BaseRecord>
  BufferedReader`
  `getReader(String filename)`
  Get the reader of a record for the file system.
  `protected String`
  `getRootDir()`
  Get root directory.
  `<T extends BaseRecord>
  BufferedWriter`
  `getWriter(String filename)`
  Get the writer of a record for the file system.
  `protected boolean`
  `mkdir(String path)`
  Make a directory.
  `protected boolean`
  `remove(String path)`
  Remove a file.
  `protected boolean`
  `rename(String src, String dst)`
  Rename a file.

  ### Methods inherited from class org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreFileBaseImpl

  `get, initDriver, initRecordStorage, isDriverReady, isOldTempRecord, putAll, remove, removeAll, setInitialized`

  ### Methods inherited from class org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreSerializableImpl

  `getOriginalPrimaryKey, getPrimaryKey, init, newRecord, serialize, serializeString`

  ### Methods inherited from class org.apache.hadoop.hdfs.server.federation.store.driver.impl.StateStoreBaseImpl

  `get, getMultiple, put, remove, remove, removeMultiple`

  ### Methods inherited from class org.apache.hadoop.hdfs.server.federation.store.driver.StateStoreDriver

  `getConf, getIdentifier, getMetrics, getTime, handleOverwriteAndDelete, verifyDriverReady`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### FEDERATION_STORE_FILE_DIRECTORY

    public static final String FEDERATION_STORE_FILE_DIRECTORY
    Configuration keys.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### StateStoreFileImpl

    public StateStoreFileImpl()

- ## Method Details

  - ### exists

    protected boolean exists(String path)
    Description copied from class: `StateStoreFileBaseImpl`
    Check if a path exists.
    Specified by:
      `exists` in class `StateStoreFileBaseImpl`
    Parameters:
      `path` - Path to check.
    Returns:
      If the path exists.

  - ### mkdir

    protected boolean mkdir(String path)
    Description copied from class: `StateStoreFileBaseImpl`
    Make a directory.
    Specified by:
      `mkdir` in class `StateStoreFileBaseImpl`
    Parameters:
      `path` - Path of the directory to create.
    Returns:
      If the directory was created.

  - ### rename

    protected boolean rename(String src, String dst)
    Description copied from class: `StateStoreFileBaseImpl`
    Rename a file. This should be atomic.
    Specified by:
      `rename` in class `StateStoreFileBaseImpl`
    Parameters:
      `src` - Source name.
      `dst` - Destination name.
    Returns:
      If the rename was successful.

  - ### remove

    protected boolean remove(String path)
    Description copied from class: `StateStoreFileBaseImpl`
    Remove a file.
    Specified by:
      `remove` in class `StateStoreFileBaseImpl`
    Parameters:
      `path` - Path for the file to remove
    Returns:
      If the file was removed.

  - ### getRootDir

    protected String getRootDir()
    Description copied from class: `StateStoreFileBaseImpl`
    Get root directory.
    Specified by:
      `getRootDir` in class `StateStoreFileBaseImpl`
    Returns:
      Root directory.

  - ### getConcurrentFilesAccessNumThreads

    protected int getConcurrentFilesAccessNumThreads()
    Specified by:
      `getConcurrentFilesAccessNumThreads` in class `StateStoreFileBaseImpl`

  - ### getReader

    protected <T extends BaseRecord> BufferedReader getReader(String filename)
    Description copied from class: `StateStoreFileBaseImpl`
    Get the reader of a record for the file system.
    Specified by:
      `getReader` in class `StateStoreFileBaseImpl`
    Type Parameters:
      `T` - Type of the state store record.
    Parameters:
      `filename` - Path of the record to read.
    Returns:
      Reader for the record.

  - ### getWriter

    @VisibleForTesting public <T extends BaseRecord> BufferedWriter getWriter(String filename)
    Description copied from class: `StateStoreFileBaseImpl`
    Get the writer of a record for the file system.
    Specified by:
      `getWriter` in class `StateStoreFileBaseImpl`
    Type Parameters:
      `T` - Type of the state store record.
    Parameters:
      `filename` - Path of the record to write.
    Returns:
      Writer for the record.

  - ### close

    public void close() throws Exception
    Description copied from class: `StateStoreDriver`
    Close the State Store driver connection.
    Overrides:
      `close` in class `StateStoreFileBaseImpl`
    Throws:
      `Exception` - if something goes wrong while closing the state store driver connection.

  - ### getChildren

    protected List<String> getChildren(String path)
    Description copied from class: `StateStoreFileBaseImpl`
    Get the children for a path.
    Specified by:
      `getChildren` in class `StateStoreFileBaseImpl`
    Parameters:
      `path` - Path to check.
    Returns:
      List of children.