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
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final org.slf4j.Loggerprotected static final StringFields inherited from class org.apache.hadoop.yarn.nodelabels.store.AbstractFSNodeStore
fs, fsWorkingPath, manager -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidinit(org.apache.hadoop.conf.Configuration conf, CommonNodeLabelsManager mgr) voidrecover()Recover labels and node to labels mappings from store, but if ignoreNodeToLabelsMappings is true then node to labels mappings should not be recovered.voidremoveClusterNodeLabels(Collection<String> labels) Remove labels.voidstoreNewClusterNodeLabels(List<org.apache.hadoop.yarn.api.records.NodeLabel> labels) Store new labels.voidupdateNodeToLabelsMappings(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
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
DEFAULT_DIR_NAME
- See Also:
-
MIRROR_FILENAME
- See Also:
-
EDITLOG_FILENAME
- See Also:
-
-
Method Details
-
init
public void init(org.apache.hadoop.conf.Configuration conf, CommonNodeLabelsManager mgr) throws Exception - Specified by:
initin interfaceNodeLabelsStore- Throws:
Exception
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
updateNodeToLabelsMappings
public void updateNodeToLabelsMappings(Map<org.apache.hadoop.yarn.api.records.NodeId, Set<String>> nodeToLabels) throws IOExceptionDescription copied from interface:NodeLabelsStoreStore node -> label.- Specified by:
updateNodeToLabelsMappingsin interfaceNodeLabelsStore- 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:NodeLabelsStoreStore new labels.- Specified by:
storeNewClusterNodeLabelsin interfaceNodeLabelsStore- Parameters:
labels- labels.- Throws:
IOException- io error occur.
-
removeClusterNodeLabels
Description copied from interface:NodeLabelsStoreRemove labels.- Specified by:
removeClusterNodeLabelsin interfaceNodeLabelsStore- Parameters:
labels- labels.- Throws:
IOException- io error occur.
-
recover
Description copied from interface:NodeLabelsStoreRecover 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:
recoverin interfaceNodeLabelsStore- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- exceptions from yarn servers.IOException- io error occur.
-