public class NodeInventory extends Object
Constructor and Description |
---|
NodeInventory(AMYarnFacade yarn) |
Modifier and Type | Method and Description |
---|---|
void |
blacklist(String hostName) |
List<String> |
getBlacklist()
Return a copy of the blacklist (list of failed nodes) for use in display
to the user or similar purpose.
|
int |
getFreeNodeCount()
Determine the number of free nodes in the YARN cluster.
|
boolean |
isFailed() |
boolean |
isInUse(String hostName)
Report if the given host name is in use.
|
void |
release(org.apache.hadoop.yarn.api.records.Container container) |
void |
release(String hostName) |
void |
reserve(org.apache.hadoop.yarn.api.records.Container container) |
void |
reserve(String hostName) |
public NodeInventory(AMYarnFacade yarn) throws YarnFacadeException
YarnFacadeException
public boolean isFailed()
public void reserve(org.apache.hadoop.yarn.api.records.Container container)
public void reserve(String hostName)
public void release(org.apache.hadoop.yarn.api.records.Container container)
public void release(String hostName)
public void blacklist(String hostName)
public int getFreeNodeCount()
This number is an approximation: the set of nodes managed by YARN can change any time, and in-flight container requests will consume a node, but since the request is not yet completed, we don't know which node will be assigned, so the node does not yet appear in the in-use list.
public List<String> getBlacklist()
public boolean isInUse(String hostName)
hostName
- Copyright © 1970 The Apache Software Foundation. All rights reserved.