FileSystemNodeLabelsStore (Apache Hadoop YARN Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn.nodelabels, class: FileSystemNodeLabelsStore

Package org.apache.hadoop.yarn.nodelabels

# Class FileSystemNodeLabelsStore

java.lang.Object
org.apache.hadoop.yarn.nodelabels.store.AbstractFSNodeStore<CommonNodeLabelsManager>
org.apache.hadoop.yarn.nodelabels.FileSystemNodeLabelsStore

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `NodeLabelsStore`

Direct Known Subclasses:
  `NonAppendableFSNodeLabelStore`

public class FileSystemNodeLabelsStore extends AbstractFSNodeStore<CommonNodeLabelsManager> implements NodeLabelsStore
FileSystemNodeLabelsStore for storing node labels.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.hadoop.yarn.nodelabels.store.AbstractFSNodeStore

  `AbstractFSNodeStore.StoreSchema`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final String`
  `DEFAULT_DIR_NAME`
  `protected static final String`
  `EDITLOG_FILENAME`
  `protected static final org.slf4j.Logger`
  `LOG`
  `protected static final String`
  `MIRROR_FILENAME`

  ### Fields inherited from class org.apache.hadoop.yarn.nodelabels.store.AbstractFSNodeStore

  `fs, fsWorkingPath, manager`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `void`
  `init(org.apache.hadoop.conf.Configuration conf, CommonNodeLabelsManager mgr)`
  `void`
  `recover()`
  Recover labels and node to labels mappings from store, but if ignoreNodeToLabelsMappings is true then node to labels mappings should not be recovered.
  `void`
  `removeClusterNodeLabels(Collection<String> labels)`
  Remove labels.
  `void`
  `storeNewClusterNodeLabels(List<org.apache.hadoop.yarn.api.records.NodeLabel> labels)`
  Store new labels.
  `void`
  `updateNodeToLabelsMappings(Map<org.apache.hadoop.yarn.api.records.NodeId,Set<String>> nodeToLabels)`
  Store node -> label.

  ### Methods inherited from class org.apache.hadoop.yarn.nodelabels.store.AbstractFSNodeStore

  `closeFSStore, ensureAppendEditLogFile, ensureCloseEditlogFile, getFs, getFsWorkingPath, getStoreType, initFileSystem, initStore, loadFromMirror, loadManagerFromEditLog, recoverFromStore, setFs, writeToLog`

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

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

- ## Field Details

  - ### LOG

    protected static final org.slf4j.Logger LOG

  - ### DEFAULT_DIR_NAME

    protected static final String DEFAULT_DIR_NAME
    See Also:
      - Constant Field Values

  - ### MIRROR_FILENAME

    protected static final String MIRROR_FILENAME
    See Also:
      - Constant Field Values

  - ### EDITLOG_FILENAME

    protected static final String EDITLOG_FILENAME
    See Also:
      - Constant Field Values

- ## Method Details

  - ### init

    public void init(org.apache.hadoop.conf.Configuration conf, CommonNodeLabelsManager mgr) throws Exception
    Specified by:
      `init` in interface `NodeLabelsStore`
    Throws:
      `Exception`

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Throws:
      `IOException`

  - ### updateNodeToLabelsMappings

    public void updateNodeToLabelsMappings(Map<org.apache.hadoop.yarn.api.records.NodeId,Set<String>> nodeToLabels) throws IOException
    Description copied from interface: `NodeLabelsStore`
    Store node -> label.
    Specified by:
      `updateNodeToLabelsMappings` in interface `NodeLabelsStore`
    Parameters:
      `nodeToLabels` - node to labels mapping.
    Throws:
      `IOException` - io error occur.

  - ### storeNewClusterNodeLabels

    public void storeNewClusterNodeLabels(List<org.apache.hadoop.yarn.api.records.NodeLabel> labels) throws IOException
    Description copied from interface: `NodeLabelsStore`
    Store new labels.
    Specified by:
      `storeNewClusterNodeLabels` in interface `NodeLabelsStore`
    Parameters:
      `labels` - labels.
    Throws:
      `IOException` - io error occur.

  - ### removeClusterNodeLabels

    public void removeClusterNodeLabels(Collection<String> labels) throws IOException
    Description copied from interface: `NodeLabelsStore`
    Remove labels.
    Specified by:
      `removeClusterNodeLabels` in interface `NodeLabelsStore`
    Parameters:
      `labels` - labels.
    Throws:
      `IOException` - io error occur.

  - ### recover

    public void recover() throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
    Description copied from interface: `NodeLabelsStore`
    Recover labels and node to labels mappings from store, but if ignoreNodeToLabelsMappings is true then node to labels mappings should not be recovered. In case of Distributed NodeLabels setup ignoreNodeToLabelsMappings will be set to true and recover will be invoked as RM will collect the node labels from NM through registration/HB.
    Specified by:
      `recover` in interface `NodeLabelsStore`
    Throws:
      `org.apache.hadoop.yarn.exceptions.YarnException` - exceptions from yarn servers.
      `IOException` - io error occur.