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 and Description
    --- | ---
    `protected static String` | `DEFAULT_DIR_NAME`
    `protected static String` | `EDITLOG_FILENAME`
    `protected static org.apache.commons.logging.Log` | `LOG`
    `protected static String` | `MIRROR_FILENAME`

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

      `fs, fsWorkingPath, manager`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 Detail

    - #### LOG

          protected static final org.apache.commons.logging.Log 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 Detail

    - #### 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 `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      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`
      Throws:
        `IOException`

    - #### 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`
      Throws:
        `IOException`

    - #### removeClusterNodeLabels

          public void removeClusterNodeLabels(Collection<String> labels)
                                       throws IOException

      Description copied from interface: `NodeLabelsStore`
      Remove labels.
      Specified by:
        `removeClusterNodeLabels` in interface `NodeLabelsStore`
      Throws:
        `IOException`

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

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.