public class NodeAttributesManagerImpl
extends org.apache.hadoop.yarn.nodelabels.NodeAttributesManager
| Modifier and Type | Class and Description | 
|---|---|
| static class  | NodeAttributesManagerImpl.HostA  Hostcan have multipleNodes. | 
| Modifier and Type | Field and Description | 
|---|---|
| static String | EMPTY_ATTRIBUTE_VALUEIf a user doesn't specify value for a label, then empty string is
 considered as default. | 
| protected static org.slf4j.Logger | LOG | 
| Constructor and Description | 
|---|
| NodeAttributesManagerImpl() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | activateNode(org.apache.hadoop.yarn.api.records.NodeId nodeId,
            org.apache.hadoop.yarn.api.records.Resource resource) | 
| void | addNodeAttributes(Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> nodeAttributeMapping) | 
| void | deactivateNode(org.apache.hadoop.yarn.api.records.NodeId nodeId) | 
| Map<org.apache.hadoop.yarn.api.records.NodeAttribute,org.apache.hadoop.yarn.nodelabels.AttributeValue> | getAttributesForNode(String hostName) | 
| Map<org.apache.hadoop.yarn.api.records.NodeAttributeKey,Map<String,org.apache.hadoop.yarn.nodelabels.AttributeValue>> | getAttributesToNodes(Set<org.apache.hadoop.yarn.api.records.NodeAttributeKey> attributes) | 
| Set<org.apache.hadoop.yarn.api.records.NodeAttribute> | getClusterNodeAttributes(Set<String> prefix) | 
| Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> | getNodesToAttributes(Set<String> hostNames) | 
| List<org.apache.hadoop.yarn.server.api.protocolrecords.NodeToAttributes> | getNodeToAttributes(Set<String> prefix) | 
| org.apache.hadoop.yarn.api.records.Resource | getResourceByAttribute(org.apache.hadoop.yarn.api.records.NodeAttribute attribute) | 
| protected void | handleStoreEvent(NodeAttributesStoreEvent event) | 
| protected void | initDispatcher(org.apache.hadoop.conf.Configuration conf) | 
| protected void | initNodeAttributeStore(org.apache.hadoop.conf.Configuration conf) | 
| protected void | internalUpdateAttributesOnNodes(Map<String,Map<org.apache.hadoop.yarn.api.records.NodeAttribute,org.apache.hadoop.yarn.nodelabels.AttributeValue>> nodeAttributeMapping,
                               org.apache.hadoop.yarn.server.api.protocolrecords.AttributeMappingOperationType op,
                               Map<org.apache.hadoop.yarn.api.records.NodeAttributeKey,org.apache.hadoop.yarn.nodelabels.RMNodeAttribute> newAttributesToBeAdded,
                               String attributePrefix) | 
| protected String | normalizeAttributeValue(String value) | 
| void | refreshNodeAttributesToScheduler(org.apache.hadoop.yarn.api.records.NodeId nodeId)Refresh node attributes on a given node during RM recovery. | 
| void | removeNodeAttributes(Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> nodeAttributeMapping) | 
| void | replaceNodeAttributes(String prefix,
                     Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> nodeAttributeMapping) | 
| protected void | serviceStart() | 
| protected void | serviceStop() | 
| void | setRMContext(RMContext context) | 
| protected void | startDispatcher() | 
| protected void | stopDispatcher() | 
| void | updateNodeResource(org.apache.hadoop.yarn.api.records.NodeId node,
                  org.apache.hadoop.yarn.api.records.Resource newResource) | 
| protected Map<String,Map<org.apache.hadoop.yarn.api.records.NodeAttribute,org.apache.hadoop.yarn.nodelabels.AttributeValue>> | validate(Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> nodeAttributeMapping,
        Map<org.apache.hadoop.yarn.api.records.NodeAttributeKey,org.apache.hadoop.yarn.nodelabels.RMNodeAttribute> newAttributesToBeAdded,
        boolean isRemoveOperation) | 
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopprotected static final org.slf4j.Logger LOG
public static final String EMPTY_ATTRIBUTE_VALUE
protected void initDispatcher(org.apache.hadoop.conf.Configuration conf)
protected void startDispatcher()
protected void serviceStart()
                     throws Exception
serviceStart in class org.apache.hadoop.service.AbstractServiceExceptionprotected void initNodeAttributeStore(org.apache.hadoop.conf.Configuration conf)
                               throws Exception
Exceptionprotected void internalUpdateAttributesOnNodes(Map<String,Map<org.apache.hadoop.yarn.api.records.NodeAttribute,org.apache.hadoop.yarn.nodelabels.AttributeValue>> nodeAttributeMapping, org.apache.hadoop.yarn.server.api.protocolrecords.AttributeMappingOperationType op, Map<org.apache.hadoop.yarn.api.records.NodeAttributeKey,org.apache.hadoop.yarn.nodelabels.RMNodeAttribute> newAttributesToBeAdded, String attributePrefix)
protected Map<String,Map<org.apache.hadoop.yarn.api.records.NodeAttribute,org.apache.hadoop.yarn.nodelabels.AttributeValue>> validate(Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> nodeAttributeMapping, Map<org.apache.hadoop.yarn.api.records.NodeAttributeKey,org.apache.hadoop.yarn.nodelabels.RMNodeAttribute> newAttributesToBeAdded, boolean isRemoveOperation) throws IOException
nodeAttributeMapping - newAttributesToBeAdded - isRemoveOperation - : to indicate whether its a remove operation.IOException - : on invalid mapping in the current request or against
           already existing NodeAttributes.public Set<org.apache.hadoop.yarn.api.records.NodeAttribute> getClusterNodeAttributes(Set<String> prefix)
getClusterNodeAttributes in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManagerpublic Map<org.apache.hadoop.yarn.api.records.NodeAttributeKey,Map<String,org.apache.hadoop.yarn.nodelabels.AttributeValue>> getAttributesToNodes(Set<org.apache.hadoop.yarn.api.records.NodeAttributeKey> attributes)
getAttributesToNodes in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManagerpublic org.apache.hadoop.yarn.api.records.Resource getResourceByAttribute(org.apache.hadoop.yarn.api.records.NodeAttribute attribute)
public Map<org.apache.hadoop.yarn.api.records.NodeAttribute,org.apache.hadoop.yarn.nodelabels.AttributeValue> getAttributesForNode(String hostName)
getAttributesForNode in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManagerpublic List<org.apache.hadoop.yarn.server.api.protocolrecords.NodeToAttributes> getNodeToAttributes(Set<String> prefix)
getNodeToAttributes in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManagerpublic Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> getNodesToAttributes(Set<String> hostNames)
getNodesToAttributes in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManagerpublic void activateNode(org.apache.hadoop.yarn.api.records.NodeId nodeId,
                         org.apache.hadoop.yarn.api.records.Resource resource)
public void deactivateNode(org.apache.hadoop.yarn.api.records.NodeId nodeId)
public void updateNodeResource(org.apache.hadoop.yarn.api.records.NodeId node,
                               org.apache.hadoop.yarn.api.records.Resource newResource)
protected void handleStoreEvent(NodeAttributesStoreEvent event)
public void replaceNodeAttributes(String prefix, Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> nodeAttributeMapping) throws IOException
replaceNodeAttributes in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManagerIOExceptionpublic void addNodeAttributes(Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> nodeAttributeMapping) throws IOException
addNodeAttributes in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManagerIOExceptionpublic void removeNodeAttributes(Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> nodeAttributeMapping) throws IOException
removeNodeAttributes in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManagerIOExceptionprotected void stopDispatcher()
protected void serviceStop()
                    throws Exception
serviceStop in class org.apache.hadoop.service.AbstractServiceExceptionpublic void setRMContext(RMContext context)
public void refreshNodeAttributesToScheduler(org.apache.hadoop.yarn.api.records.NodeId nodeId)
refreshNodeAttributesToScheduler in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManagernodeId - Node IdCopyright © 2008–2023 Apache Software Foundation. All rights reserved.