@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasJobId()) { hash = (37 * hash) + JOBID_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getJobId()); } if (hasTaskId()) { hash = (37 * hash) + TASKID_FIELD_NUMBER; hash = (53 * hash) + getTaskId(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof alluxio.grpc.CancelTaskCommand)) { return super.equals(obj); } alluxio.grpc.CancelTaskCommand other = (alluxio.grpc.CancelTaskCommand) obj; boolean result = true; result = result && (hasJobId() == other.hasJobId()); if (hasJobId()) { result = result && (getJobId() == other.getJobId()); } result = result && (hasTaskId() == other.hasTaskId()); if (hasTaskId()) { result = result && (getTaskId() == other.getTaskId()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(alluxio.grpc.CancelTaskCommand other) { if (other == alluxio.grpc.CancelTaskCommand.getDefaultInstance()) return this; if (other.hasJobId()) { setJobId(other.getJobId()); } if (other.hasTaskId()) { setTaskId(other.getTaskId()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
CancelTaskCommand command = mCommand.getCancelTaskCommand(); long jobId = command.getJobId(); int taskId = command.getTaskId(); mTaskExecutorManager.cancelTask(jobId, taskId); } else if (mCommand.hasRegisterCommand()) {
@Test public void submitCancelTaskCommand() { long jobId = 0L; int taskId = 1; long workerId = 2L; mManager.submitCancelTaskCommand(jobId, taskId, workerId); List<JobCommand> commands = mManager.pollAllPendingCommands(workerId); Assert.assertEquals(1, commands.size()); JobCommand command = commands.get(0); Assert.assertEquals(jobId, command.getCancelTaskCommand().getJobId()); Assert.assertEquals(taskId, command.getCancelTaskCommand().getTaskId()); } }