/** * Submits a cancel-task command to a specified worker. * * @param jobId the job id * @param taskId the task id * @param workerId the worker id */ public synchronized void submitCancelTaskCommand(long jobId, int taskId, long workerId) { CancelTaskCommand.Builder cancelTaskCommand = CancelTaskCommand.newBuilder(); cancelTaskCommand.setJobId(jobId); cancelTaskCommand.setTaskId(taskId); JobCommand.Builder command = JobCommand.newBuilder(); command.setCancelTaskCommand(cancelTaskCommand); if (!mWorkerIdToPendingCommands.containsKey(workerId)) { mWorkerIdToPendingCommands.put(workerId, Lists.<JobCommand>newArrayList()); } mWorkerIdToPendingCommands.get(workerId).add(command.build()); }
/** * <code>optional .alluxio.grpc.job.CancelTaskCommand cancelTaskCommand = 2;</code> */ public Builder setCancelTaskCommand( alluxio.grpc.CancelTaskCommand.Builder builderForValue) { if (cancelTaskCommandBuilder_ == null) { cancelTaskCommand_ = builderForValue.build(); onChanged(); } else { cancelTaskCommandBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000002; return this; } /**
subBuilder.mergeFrom(cancelTaskCommand_); cancelTaskCommand_ = subBuilder.buildPartial();
/** * <code>optional .alluxio.grpc.job.CancelTaskCommand cancelTaskCommand = 2;</code> */ public Builder mergeCancelTaskCommand(alluxio.grpc.CancelTaskCommand value) { if (cancelTaskCommandBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && cancelTaskCommand_ != null && cancelTaskCommand_ != alluxio.grpc.CancelTaskCommand.getDefaultInstance()) { cancelTaskCommand_ = alluxio.grpc.CancelTaskCommand.newBuilder(cancelTaskCommand_).mergeFrom(value).buildPartial(); } else { cancelTaskCommand_ = value; } onChanged(); } else { cancelTaskCommandBuilder_.mergeFrom(value); } bitField0_ |= 0x00000002; return this; } /**
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { alluxio.grpc.CancelTaskCommand parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (alluxio.grpc.CancelTaskCommand) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
public alluxio.grpc.CancelTaskCommand buildPartial() { alluxio.grpc.CancelTaskCommand result = new alluxio.grpc.CancelTaskCommand(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.jobId_ = jobId_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.taskId_ = taskId_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
private Builder() { maybeForceBuilderInitialization(); }
public static Builder newBuilder(alluxio.grpc.CancelTaskCommand prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() {
private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() {
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof alluxio.grpc.CancelTaskCommand) { return mergeFrom((alluxio.grpc.CancelTaskCommand)other); } else { super.mergeFrom(other); return this; } }
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; }
public alluxio.grpc.CancelTaskCommand build() { alluxio.grpc.CancelTaskCommand result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }