public class NodeEntry extends Object implements Cloneable
The two fields `releasing` and `requested` are used to track the ongoing state of YARN requests; they do not need to be persisted across stop/start cycles. They may be relevant across AM restart, but without other data structures in the AM, not enough to track what the AM was up to before it was restarted. The strategy will be to ignore unexpected allocation responses (which may come from pre-restart) requests, while treating unexpected container release responses as failures.
The `active` counter is only decremented after a container release response has been received.
| Modifier and Type | Field and Description |
|---|---|
int |
rolePriority |
| Constructor and Description |
|---|
NodeEntry(int rolePriority) |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
boolean |
containerCompleted(boolean wasReleased,
ContainerOutcome outcome)
completion event, which can be a planned or unplanned
planned: dec our release count
unplanned: dec our live count
|
int |
getActive()
return no of active instances -those that could be released as they
are live and not already being released
|
int |
getFailed() |
int |
getFailedRecently() |
long |
getLastUsed()
Time last used.
|
int |
getLive() |
int |
getPreempted() |
int |
getReleasing()
No of instances in release state
|
int |
getRequested()
no of requests made of this role of this node.
|
int |
getStartFailed() |
int |
getStarting() |
boolean |
isAntiAffinityConstraintHeld()
Are the anti-affinity constraints held.
|
boolean |
isAvailable()
Is the node available for assignments? That is, it is
not running any instances of this type, nor are there
any requests oustanding for it.
|
boolean |
notUsedSince(long absoluteTime)
Return true if the node is not busy, and it
has not been used since the absolute time
|
void |
onStartCompleted() |
boolean |
onStartFailed()
start failed -decrement the starting flag.
|
void |
onStarting() |
void |
release()
Release an instance -which is no longer marked as active
|
void |
request()
request a node:
|
void |
requestCompleted()
A request made explicitly to this node has completed
|
void |
resetFailedRecently()
Reset the failed recently count.
|
NodeEntryInformation |
serialize()
Produced a serialized form which can be served up as JSON
|
void |
setFailedRecently(int failedRecently) |
void |
setLastUsed(long lastUsed) |
void |
setLive(int v)
Set the live value directly -used on AM restart
|
String |
toString() |
public boolean isAvailable()
public boolean isAntiAffinityConstraintHeld()
public int getActive()
public boolean notUsedSince(long absoluteTime)
absoluteTime - timepublic int getLive()
public int getStarting()
public void setLive(int v)
v - valuepublic void onStarting()
public void onStartCompleted()
public boolean onStartFailed()
public int getRequested()
public void request()
public void requestCompleted()
public int getReleasing()
public void release()
public boolean containerCompleted(boolean wasReleased,
ContainerOutcome outcome)
wasReleased - true if this was plannedoutcome - public long getLastUsed()
public void setLastUsed(long lastUsed)
public int getStartFailed()
public int getFailed()
public int getFailedRecently()
public void setFailedRecently(int failedRecently)
public int getPreempted()
public void resetFailedRecently()
public NodeEntryInformation serialize()
public Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.