public class NodeAttributesManagerImpl
extends org.apache.hadoop.yarn.nodelabels.NodeAttributesManager
Modifier and Type | Class and Description |
---|---|
static class |
NodeAttributesManagerImpl.Host
A
Host can have multiple Node s. |
Modifier and Type | Field and Description |
---|---|
static String |
EMPTY_ATTRIBUTE_VALUE
If 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)
Validate for attributes.
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
protected 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.AbstractService
Exception
protected void initNodeAttributeStore(org.apache.hadoop.conf.Configuration conf) throws Exception
Exception
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 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
- NodeAttribute MappingnewAttributesToBeAdded
- new Attributes ToBeAddedisRemoveOperation
- : to indicate whether it's 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.NodeAttributesManager
public 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.NodeAttributesManager
public 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.NodeAttributesManager
public List<org.apache.hadoop.yarn.server.api.protocolrecords.NodeToAttributes> getNodeToAttributes(Set<String> prefix)
getNodeToAttributes
in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManager
public Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> getNodesToAttributes(Set<String> hostNames)
getNodesToAttributes
in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManager
public 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.NodeAttributesManager
IOException
public void addNodeAttributes(Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> nodeAttributeMapping) throws IOException
addNodeAttributes
in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManager
IOException
public void removeNodeAttributes(Map<String,Set<org.apache.hadoop.yarn.api.records.NodeAttribute>> nodeAttributeMapping) throws IOException
removeNodeAttributes
in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManager
IOException
protected void stopDispatcher()
protected void serviceStop() throws Exception
serviceStop
in class org.apache.hadoop.service.AbstractService
Exception
public void setRMContext(RMContext context)
public void refreshNodeAttributesToScheduler(org.apache.hadoop.yarn.api.records.NodeId nodeId)
refreshNodeAttributesToScheduler
in class org.apache.hadoop.yarn.nodelabels.NodeAttributesManager
nodeId
- Node IdCopyright © 2008–2023 Apache Software Foundation. All rights reserved.