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

Package org.apache.hadoop.yarn.nodelabels

# Interface NodeLabelsStore

All Superinterfaces:
  `AutoCloseable`, `Closeable`

All Known Implementing Classes:
  `FileSystemNodeLabelsStore`, `NonAppendableFSNodeLabelStore`

public interface NodeLabelsStore extends Closeable
Interface class for Node label store.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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 interface java.io.Closeable

  `close`

- ## Method Details

  - ### updateNodeToLabelsMappings

    void updateNodeToLabelsMappings(Map<org.apache.hadoop.yarn.api.records.NodeId,Set<String>> nodeToLabels) throws IOException
    Store node -> label.
    Parameters:
      `nodeToLabels` - node to labels mapping.
    Throws:
      `IOException` - io error occur.

  - ### storeNewClusterNodeLabels

    void storeNewClusterNodeLabels(List<org.apache.hadoop.yarn.api.records.NodeLabel> labels) throws IOException
    Store new labels.
    Parameters:
      `labels` - labels.
    Throws:
      `IOException` - io error occur.

  - ### removeClusterNodeLabels

    void removeClusterNodeLabels(Collection<String> labels) throws IOException
    Remove labels.
    Parameters:
      `labels` - labels.
    Throws:
      `IOException` - io error occur.

  - ### recover

    void recover() throws IOException, org.apache.hadoop.yarn.exceptions.YarnException
    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.
    Throws:
      `IOException` - io error occur.
      `org.apache.hadoop.yarn.exceptions.YarnException` - exceptions from yarn servers.

  - ### init

    void init(org.apache.hadoop.conf.Configuration conf, CommonNodeLabelsManager mgr) throws Exception
    Throws:
      `Exception`