diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceRequest.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceRequest.java
index 2d6f0f4..dfd5117 100644
--- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceRequest.java
+++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/ResourceRequest.java
@@ -35,9 +35,9 @@
*
* - {@link Priority} of the request.
* -
- * The name of the machine or rack on which the allocation is
+ * The name of the node or rack on which the allocation is
* desired. A special value of * signifies that
- * any host/rack is acceptable to the application.
+ * any node/rack is acceptable to the application.
*
* - {@link Resource} required for each request.
* -
@@ -61,36 +61,36 @@
@Public
@Stable
- public static ResourceRequest newInstance(Priority priority, String hostName,
+ public static ResourceRequest newInstance(Priority priority, String nodeName,
Resource capability, int numContainers) {
- return newInstance(priority, hostName, capability, numContainers, true);
+ return newInstance(priority, nodeName, capability, numContainers, true);
}
@Public
@Stable
- public static ResourceRequest newInstance(Priority priority, String hostName,
+ public static ResourceRequest newInstance(Priority priority, String nodeName,
Resource capability, int numContainers, boolean relaxLocality) {
- return newInstance(priority, hostName, capability, numContainers,
+ return newInstance(priority, nodeName, capability, numContainers,
relaxLocality, null);
}
@Public
@Stable
- public static ResourceRequest newInstance(Priority priority, String hostName,
+ public static ResourceRequest newInstance(Priority priority, String nodeName,
Resource capability, int numContainers, boolean relaxLocality,
String labelExpression) {
- return newInstance(priority, hostName, capability, numContainers,
+ return newInstance(priority, nodeName, capability, numContainers,
relaxLocality, labelExpression, ExecutionTypeRequest.newInstance());
}
@Public
@Evolving
- public static ResourceRequest newInstance(Priority priority, String hostName,
+ public static ResourceRequest newInstance(Priority priority, String nodeName,
Resource capability, int numContainers, boolean relaxLocality, String
labelExpression, ExecutionTypeRequest executionTypeRequest) {
ResourceRequest request = Records.newRecord(ResourceRequest.class);
request.setPriority(priority);
- request.setResourceName(hostName);
+ request.setResourceName(nodeName);
request.setCapability(capability);
request.setNumContainers(numContainers);
request.setRelaxLocality(relaxLocality);
@@ -109,7 +109,7 @@ public static ResourceRequest newInstance(Priority priority, String hostName,
@Override
public int compare(ResourceRequest r1, ResourceRequest r2) {
- // Compare priority, host and capability
+ // Compare priority, node and capability
int ret = r1.getPriority().compareTo(r2.getPriority());
if (ret == 0) {
ret = Long.compare(
@@ -133,23 +133,23 @@ public int compare(ResourceRequest r1, ResourceRequest r2) {
/**
* The constant string representing no locality.
- * It should be used by all references that want to pass an arbitrary host
+ * It should be used by all references that want to pass an arbitrary node
* name in.
*/
public static final String ANY = "*";
/**
- * Check whether the given host/rack string represents an arbitrary
- * host name.
+ * Check whether the given node/rack string represents an arbitrary
+ * node name.
*
- * @param hostName host/rack on which the allocation is desired
- * @return whether the given host/rack string represents an arbitrary
- * host name
+ * @param nodeName node/rack on which the allocation is desired
+ * @return whether the given node/rack string represents an arbitrary
+ * node name
*/
@Public
@Stable
- public static boolean isAnyLocation(String hostName) {
- return ANY.equals(hostName);
+ public static boolean isAnyLocation(String nodeName) {
+ return ANY.equals(nodeName);
}
/**
@@ -169,13 +169,13 @@ public static boolean isAnyLocation(String hostName) {
public abstract void setPriority(Priority priority);
/**
- * Get the resource (e.g. host/rack) on which the allocation
+ * Get the resource (e.g. node/rack) on which the allocation
* is desired.
*
* A special value of * signifies that any resource
- * (host/rack) is acceptable.
+ * (node/rack) is acceptable.
*
- * @return resource (e.g. host/rack) on which the allocation
+ * @return resource (e.g. node/rack) on which the allocation
* is desired
*/
@Public
@@ -183,13 +183,13 @@ public static boolean isAnyLocation(String hostName) {
public abstract String getResourceName();
/**
- * Set the resource name (e.g. host/rack) on which the allocation
+ * Set the resource name (e.g. node/rack) on which the allocation
* is desired.
*
* A special value of * signifies that any resource name
- * (e.g. host/rack) is acceptable.
+ * (e.g. node/rack) is acceptable.
*
- * @param resourceName (e.g. host/rack) on which the
+ * @param resourceName (e.g. node/rack) on which the
* allocation is desired
*/
@Public
@@ -378,11 +378,11 @@ public int hashCode() {
final int prime = 2153;
int result = 2459;
Resource capability = getCapability();
- String hostName = getResourceName();
+ String nodeName = getResourceName();
Priority priority = getPriority();
result =
prime * result + ((capability == null) ? 0 : capability.hashCode());
- result = prime * result + ((hostName == null) ? 0 : hostName.hashCode());
+ result = prime * result + ((nodeName == null) ? 0 : nodeName.hashCode());
result = prime * result + getNumContainers();
result = prime * result + ((priority == null) ? 0 : priority.hashCode());
result = prime * result + Long.valueOf(getAllocationRequestId()).hashCode();
@@ -404,11 +404,11 @@ public boolean equals(Object obj) {
return false;
} else if (!capability.equals(other.getCapability()))
return false;
- String hostName = getResourceName();
- if (hostName == null) {
+ String nodeName = getResourceName();
+ if (nodeName == null) {
if (other.getResourceName() != null)
return false;
- } else if (!hostName.equals(other.getResourceName()))
+ } else if (!nodeName.equals(other.getResourceName()))
return false;
if (getNumContainers() != other.getNumContainers())
return false;
@@ -453,9 +453,9 @@ public boolean equals(Object obj) {
public int compareTo(ResourceRequest other) {
int priorityComparison = this.getPriority().compareTo(other.getPriority());
if (priorityComparison == 0) {
- int hostNameComparison =
+ int nodeNameComparison =
this.getResourceName().compareTo(other.getResourceName());
- if (hostNameComparison == 0) {
+ if (nodeNameComparison == 0) {
int execTypeReqComparison = this.getExecutionTypeRequest()
.compareTo(other.getExecutionTypeRequest());
if (execTypeReqComparison == 0) {
@@ -477,7 +477,7 @@ public int compareTo(ResourceRequest other) {
return execTypeReqComparison;
}
} else {
- return hostNameComparison;
+ return nodeNameComparison;
}
} else {
return priorityComparison;