slfan1989 commented on code in PR #6990:
URL: https://github.com/apache/hadoop/pull/6990#discussion_r1752954371
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AbstractYarnScheduler.java:
##########
@@ -1678,4 +1794,78 @@ private List<ApplicationAttemptId>
getAppsFromQueue(String queueName)
}
return apps;
}
+
+ /**
+ * ContainerObjectType is a container object with the following properties.
+ * Namely allocationId, priority, executionType and resourceType.
+ */
+ protected class ContainerObjectType extends Object {
+ private final long allocationId;
+ private final Priority priority;
+ private final ExecutionType executionType;
+ private final Resource resource;
+
+ public ContainerObjectType(long allocationId, Priority priority,
+ ExecutionType executionType, Resource resource) {
+ this.allocationId = allocationId;
+ this.priority = priority;
+ this.executionType = executionType;
+ this.resource = resource;
+ }
+
+ public long getAllocationId() {
+ return allocationId;
+ }
+
+ public Priority getPriority() {
+ return priority;
+ }
+
+ public ExecutionType getExecutionType() {
+ return executionType;
+ }
+
+ public Resource getResource() {
+ return resource;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
Review Comment:
We typically use `HashCodeBuilder`.
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/AbstractYarnScheduler.java:
##########
@@ -1678,4 +1794,78 @@ private List<ApplicationAttemptId>
getAppsFromQueue(String queueName)
}
return apps;
}
+
+ /**
+ * ContainerObjectType is a container object with the following properties.
+ * Namely allocationId, priority, executionType and resourceType.
+ */
+ protected class ContainerObjectType extends Object {
+ private final long allocationId;
+ private final Priority priority;
+ private final ExecutionType executionType;
+ private final Resource resource;
+
+ public ContainerObjectType(long allocationId, Priority priority,
+ ExecutionType executionType, Resource resource) {
+ this.allocationId = allocationId;
+ this.priority = priority;
+ this.executionType = executionType;
+ this.resource = resource;
+ }
+
+ public long getAllocationId() {
+ return allocationId;
+ }
+
+ public Priority getPriority() {
+ return priority;
+ }
+
+ public ExecutionType getExecutionType() {
+ return executionType;
+ }
+
+ public Resource getResource() {
+ return resource;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = (int) (prime * result + allocationId);
+ result = prime * result + (priority == null ? 0 : priority.hashCode());
+ result = prime * result + (executionType == null ? 0 :
executionType.hashCode());
+ result = prime * result + (resource == null ? 0 : resource.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
Review Comment:
EqualsBuilder
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]