public final class RoleStatus extends Object implements Cloneable, com.codahale.metrics.MetricSet
AppState and RoleHistory structures,
and must be designed for synchronous access. Atomic counters are preferred to anything which
requires synchronization. Where synchronized access is good is that it allows for
the whole instance to be locked, for updating multiple entries.| Modifier and Type | Class and Description |
|---|---|
static class |
RoleStatus.CompareByKey
Compare two role status entries by key
|
static class |
RoleStatus.CompareByName
Compare two role status entries by name
|
| Constructor and Description |
|---|
RoleStatus(ProviderRole providerRole) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Integer> |
buildStatistics()
Build the statistics map from the current data
|
void |
cancel(long count) |
void |
cancelOutstandingAARequest()
Cancel any outstanding AA request.
|
Object |
clone() |
void |
completeOutstandingAARequest()
Complete the outstanding AA request (there's no check for one in progress, caller
expected to have done that).
|
org.apache.hadoop.yarn.api.records.Resource |
copyResourceRequirements(org.apache.hadoop.yarn.api.records.Resource resource)
Given a resource, set its requirements to those this role needs
|
long |
decActual() |
long |
decPendingAntiAffineRequests() |
long |
decReleasing() |
void |
decRequested() |
long |
getActual() |
long |
getActualAndRequested()
Get count of actual and requested containers.
|
long |
getCompleted() |
long |
getDelta()
Get the number of roles we are short of.
|
long |
getDesired() |
long |
getFailed() |
long |
getFailedRecently() |
String |
getFailureMessage() |
int |
getKey() |
String |
getLabelExpression()
Get the (possibly null) label expression for this role
|
long |
getLimitsExceeded() |
Map<String,com.codahale.metrics.Metric> |
getMetrics() |
String |
getName() |
long |
getNodeFailed() |
int |
getNodeFailureThreshold()
The number of failures on a specific node that can be tolerated
before selecting a different node for placement
|
OutstandingRequest |
getOutstandingAArequest() |
int |
getOutstandingAARequestCount()
expose the predicate
isAARequestOutstanding() as an integer,
which is very convenient in tests |
long |
getPendingAntiAffineRequests() |
int |
getPlacementPolicy()
Get the placement policy enum, from the values in
PlacementPolicy |
long |
getPlacementTimeoutSeconds() |
long |
getPreempted() |
int |
getPriority() |
ProviderRole |
getProviderRole()
Get the provider role
|
long |
getReleasing() |
long |
getRequested()
Get the request count.
|
org.apache.hadoop.yarn.api.records.Resource |
getResourceRequirements() |
long |
getStarted() |
long |
getStartFailed() |
RoleStatistics |
getStatistics() |
long |
getTotalRequested() |
boolean |
hasPlacementPolicy(int policy) |
long |
incActual() |
long |
incCompleted() |
long |
incPendingAntiAffineRequests(long v) |
long |
incReleasing() |
long |
incRequested() |
void |
incStarted() |
void |
incStartFailed() |
boolean |
isAARequestOutstanding()
Probe for an outstanding AA request being true
|
boolean |
isAntiAffinePlacement() |
boolean |
isExcludeFromFlexing() |
boolean |
isPlacementDesired() |
boolean |
isStrictPlacement() |
void |
noteFailed(boolean startupFailure,
String text,
ContainerOutcome outcome)
Note that a role failed, text will
be used in any diagnostics if an exception
is later raised.
|
long |
resetFailedRecently()
Reset the recent failure
|
ComponentInformation |
serialize()
Produced a serialized form which can be served up as JSON
|
void |
setCompleted(int completed) |
void |
setDesired(long desired) |
void |
setOutstandingAArequest(OutstandingRequest outstandingAArequest) |
void |
setPendingAntiAffineRequests(long pendingAntiAffineRequests) |
void |
setResourceRequirements(org.apache.hadoop.yarn.api.records.Resource resourceRequirements) |
String |
toString() |
public RoleStatus(ProviderRole providerRole)
public Map<String,com.codahale.metrics.Metric> getMetrics()
getMetrics in interface com.codahale.metrics.MetricSetpublic String getName()
public int getKey()
public int getPriority()
public int getPlacementPolicy()
PlacementPolicypublic long getPlacementTimeoutSeconds()
public int getNodeFailureThreshold()
public boolean isExcludeFromFlexing()
public boolean isStrictPlacement()
public boolean isAntiAffinePlacement()
public boolean hasPlacementPolicy(int policy)
public boolean isPlacementDesired()
public long getDesired()
public void setDesired(long desired)
public long getActual()
public long incActual()
public long decActual()
public long getRequested()
public long incRequested()
public void cancel(long count)
public void decRequested()
public long getReleasing()
public long incReleasing()
public long decReleasing()
public long getFailed()
public long getFailedRecently()
public long resetFailedRecently()
public long getLimitsExceeded()
public long incPendingAntiAffineRequests(long v)
public boolean isAARequestOutstanding()
public int getOutstandingAARequestCount()
isAARequestOutstanding() as an integer,
which is very convenient in testspublic void noteFailed(boolean startupFailure,
String text,
ContainerOutcome outcome)
startupFailure - flag to indicate this was a startup eventtext - text about the failureoutcome - outcome of the containerpublic long getStartFailed()
public void incStartFailed()
public String getFailureMessage()
public long getCompleted()
public void setCompleted(int completed)
public long incCompleted()
public long getStarted()
public void incStarted()
public long getTotalRequested()
public long getPreempted()
public long getNodeFailed()
public long getPendingAntiAffineRequests()
public void setPendingAntiAffineRequests(long pendingAntiAffineRequests)
public long decPendingAntiAffineRequests()
public OutstandingRequest getOutstandingAArequest()
public void setOutstandingAArequest(OutstandingRequest outstandingAArequest)
public void completeOutstandingAARequest()
public void cancelOutstandingAARequest()
public long getDelta()
public long getActualAndRequested()
public Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic ProviderRole getProviderRole()
public Map<String,Integer> buildStatistics()
public ComponentInformation serialize()
public String getLabelExpression()
public org.apache.hadoop.yarn.api.records.Resource getResourceRequirements()
public void setResourceRequirements(org.apache.hadoop.yarn.api.records.Resource resourceRequirements)
public org.apache.hadoop.yarn.api.records.Resource copyResourceRequirements(org.apache.hadoop.yarn.api.records.Resource resource)
resource - resource to configurepublic RoleStatistics getStatistics()
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.