public final class OutstandingRequest extends RoleHostnamePair
The node identifier may be null -which indicates that a request was made without a specific target node
Equality and the hash code are based only on the role and hostname,
which are fixed in the constructor. This means that a simple
instance constructed with (role, hostname) can be used to look up
a complete request instance in the OutstandingRequestTracker map
| Modifier and Type | Field and Description |
|---|---|
String |
label
Optional label.
|
protected static org.slf4j.Logger |
log |
NodeInstance |
node
Node the request is for -may be null
|
List<NodeInstance> |
nodes
A list of all possible nodes to list in an AA request.
|
hostname, roleId| Constructor and Description |
|---|
OutstandingRequest(int roleId,
List<NodeInstance> nodes)
Create an Anti-affine reques, including all listed nodes (there must be one)
as targets.
|
OutstandingRequest(int roleId,
NodeInstance node)
Create a request
|
OutstandingRequest(int roleId,
String hostname)
Create an outstanding request with the given role and hostname
Important: this is useful only for map lookups -the other constructor
with the NodeInstance parameter is needed to generate node-specific
container requests
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest |
buildContainerRequest(org.apache.hadoop.yarn.api.records.Resource resource,
RoleStatus role,
long time)
Build a container request.
|
void |
completed()
Mark the request as completed (or canceled).
|
CancelSingleRequest |
createCancelOperation()
Create a cancel operation
|
org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest |
escalate()
Build an escalated container request, updating
issuedRequest with
the new value. |
long |
getEscalationTimeoutMillis() |
RoleHostnamePair |
getIndex()
Create a new role/hostname pair for indexing.
|
org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest |
getIssuedRequest() |
int |
getPriority() |
long |
getRequestedTimeMillis() |
boolean |
isAntiAffine() |
boolean |
isEscalated() |
boolean |
isLocated()
Is the request located in the cluster, that is: does it have a node.
|
boolean |
mayEscalate() |
boolean |
resourceRequirementsMatch(org.apache.hadoop.yarn.api.records.Resource resource)
Query for the resource requirements matching; always false before a request is issued
|
void |
setAntiAffine(boolean antiAffine) |
boolean |
shouldEscalate(long time)
Query to see if the request is available and ready to be escalated
|
String |
toString() |
void |
validate()
Valid if a node label expression specified on container request is valid or
not.
|
equals, getHostname, getRoleId, hashCodeprotected static final org.slf4j.Logger log
public final NodeInstance node
public final List<NodeInstance> nodes
node is set, element 0 of the list is the same
value.public String label
public OutstandingRequest(int roleId,
NodeInstance node)
roleId - rolenode - node -can be nullpublic OutstandingRequest(int roleId,
String hostname)
roleId - rolehostname - hostnamepublic OutstandingRequest(int roleId,
List<NodeInstance> nodes)
roleId - rolenodes - list of nodespublic boolean isLocated()
public long getRequestedTimeMillis()
public long getEscalationTimeoutMillis()
public boolean isEscalated()
public boolean mayEscalate()
public org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest getIssuedRequest()
public int getPriority()
public boolean isAntiAffine()
public void setAntiAffine(boolean antiAffine)
public org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest buildContainerRequest(org.apache.hadoop.yarn.api.records.Resource resource,
RoleStatus role,
long time)
The value of node is used to direct a lot of policy. If null,
placement is relaxed.
If not null, the choice of whether to use the suggested node
is based on the placement policy and failure history.
If the request has an address, it is set in the container request (with a flag to enable relaxed priorities).
This operation sets the requested time flag, used for tracking timeouts on outstanding requests
resource - resourcerole - roletime - time in millis to record as request timepublic org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest escalate()
issuedRequest with
the new value.public void completed()
Current action: if a node is defined, its request count is decremented
public boolean shouldEscalate(long time)
time - time to check againstpublic boolean resourceRequirementsMatch(org.apache.hadoop.yarn.api.records.Resource resource)
resource - public String toString()
toString in class RoleHostnamePairpublic CancelSingleRequest createCancelOperation()
public void validate()
throws org.apache.hadoop.yarn.client.api.InvalidContainerRequestException
org.apache.hadoop.yarn.client.api.InvalidContainerRequestExceptionpublic RoleHostnamePair getIndex()
Copyright © 2014–2015 The Apache Software Foundation. All rights reserved.