|
@@ -57,7 +57,7 @@ public abstract class ResourceRequest implements Comparable<ResourceRequest> {
|
|
|
String hostName, Resource capability, int numContainers) {
|
|
|
ResourceRequest request = Records.newRecord(ResourceRequest.class);
|
|
|
request.setPriority(priority);
|
|
|
- request.setHostName(hostName);
|
|
|
+ request.setResourceName(hostName);
|
|
|
request.setCapability(capability);
|
|
|
request.setNumContainers(numContainers);
|
|
|
return request;
|
|
@@ -99,28 +99,32 @@ public abstract class ResourceRequest implements Comparable<ResourceRequest> {
|
|
|
public abstract void setPriority(Priority priority);
|
|
|
|
|
|
/**
|
|
|
- * Get the <em>host/rack</em> on which the allocation is desired.
|
|
|
+ * Get the resource (e.g. <em>host/rack</em>) on which the allocation
|
|
|
+ * is desired.
|
|
|
*
|
|
|
- * A special value of <em>*</em> signifies that <em>any</em> host/rack is
|
|
|
- * acceptable.
|
|
|
+ * A special value of <em>*</em> signifies that <em>any</em> resource
|
|
|
+ * (host/rack) is acceptable.
|
|
|
*
|
|
|
- * @return <em>host/rack</em> on which the allocation is desired
|
|
|
+ * @return resource (e.g. <em>host/rack</em>) on which the allocation
|
|
|
+ * is desired
|
|
|
*/
|
|
|
@Public
|
|
|
@Stable
|
|
|
- public abstract String getHostName();
|
|
|
+ public abstract String getResourceName();
|
|
|
|
|
|
/**
|
|
|
- * Set <em>host/rack</em> on which the allocation is desired.
|
|
|
+ * Set the resource (e.g. <em>host/rack</em>) on which the allocation
|
|
|
+ * is desired.
|
|
|
*
|
|
|
- * A special value of <em>*</em> signifies that <em>any</em> host/rack is
|
|
|
- * acceptable.
|
|
|
+ * A special value of <em>*</em> signifies that <em>any</em> resource
|
|
|
+ * (e.g. host/rack) is acceptable.
|
|
|
*
|
|
|
- * @param hostName <em>host/rack</em> on which the allocation is desired
|
|
|
+ * @param resourceName (e.g. <em>host/rack</em>) on which the
|
|
|
+ * allocation is desired
|
|
|
*/
|
|
|
@Public
|
|
|
@Stable
|
|
|
- public abstract void setHostName(String hostName);
|
|
|
+ public abstract void setResourceName(String resourceName);
|
|
|
|
|
|
/**
|
|
|
* Get the <code>Resource</code> capability of the request.
|
|
@@ -198,7 +202,7 @@ public abstract class ResourceRequest implements Comparable<ResourceRequest> {
|
|
|
final int prime = 2153;
|
|
|
int result = 2459;
|
|
|
Resource capability = getCapability();
|
|
|
- String hostName = getHostName();
|
|
|
+ String hostName = getResourceName();
|
|
|
Priority priority = getPriority();
|
|
|
result =
|
|
|
prime * result + ((capability == null) ? 0 : capability.hashCode());
|
|
@@ -223,11 +227,11 @@ public abstract class ResourceRequest implements Comparable<ResourceRequest> {
|
|
|
return false;
|
|
|
} else if (!capability.equals(other.getCapability()))
|
|
|
return false;
|
|
|
- String hostName = getHostName();
|
|
|
+ String hostName = getResourceName();
|
|
|
if (hostName == null) {
|
|
|
- if (other.getHostName() != null)
|
|
|
+ if (other.getResourceName() != null)
|
|
|
return false;
|
|
|
- } else if (!hostName.equals(other.getHostName()))
|
|
|
+ } else if (!hostName.equals(other.getResourceName()))
|
|
|
return false;
|
|
|
if (getNumContainers() != other.getNumContainers())
|
|
|
return false;
|
|
@@ -245,7 +249,7 @@ public abstract class ResourceRequest implements Comparable<ResourceRequest> {
|
|
|
int priorityComparison = this.getPriority().compareTo(other.getPriority());
|
|
|
if (priorityComparison == 0) {
|
|
|
int hostNameComparison =
|
|
|
- this.getHostName().compareTo(other.getHostName());
|
|
|
+ this.getResourceName().compareTo(other.getResourceName());
|
|
|
if (hostNameComparison == 0) {
|
|
|
int capabilityComparison =
|
|
|
this.getCapability().compareTo(other.getCapability());
|