@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasExternalId()) { hash = (37 * hash) + EXTERNAL_ID_FIELD_NUMBER; hash = (53 * hash) + getExternalId().hashCode(); } if (hasCancelReason()) { hash = (37 * hash) + CANCEL_REASON_FIELD_NUMBER; hash = (53 * hash) + getCancelReason().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
public CancelQuery(ExternalId queryId, String reason) { super(); this.jobCancelRequest = CoordRPC.JobCancelRequest.newBuilder() .setExternalId(queryId) .setCancelReason(Optional.ofNullable(reason).orElse("")).build(); }
public com.dremio.exec.proto.CoordRPC.JobCancelRequest buildPartial() { com.dremio.exec.proto.CoordRPC.JobCancelRequest result = new com.dremio.exec.proto.CoordRPC.JobCancelRequest(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (externalIdBuilder_ == null) { result.externalId_ = externalId_; } else { result.externalId_ = externalIdBuilder_.build(); } if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.cancelReason_ = cancelReason_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
final ExternalId id = jobCancelRequest.getExternalId(); final String cancelreason = jobCancelRequest.getCancelReason(); boolean canceled = tool.cancel(id, cancelreason); final Response outcome = canceled ? OK : FAIL;
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.dremio.exec.proto.CoordRPC.JobCancelRequest)) { return super.equals(obj); } com.dremio.exec.proto.CoordRPC.JobCancelRequest other = (com.dremio.exec.proto.CoordRPC.JobCancelRequest) obj; boolean result = true; result = result && (hasExternalId() == other.hasExternalId()); if (hasExternalId()) { result = result && getExternalId() .equals(other.getExternalId()); } result = result && (hasCancelReason() == other.hasCancelReason()); if (hasCancelReason()) { result = result && getCancelReason() .equals(other.getCancelReason()); } result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, externalId_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, getCancelReasonBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public Builder toBuilder() { return newBuilder(this); }
public com.dremio.exec.proto.CoordRPC.JobCancelRequest getDefaultInstanceForType() { return com.dremio.exec.proto.CoordRPC.JobCancelRequest.getDefaultInstance(); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(com.dremio.exec.proto.CoordRPC.JobCancelRequest prototype) {
public static Builder newBuilder(com.dremio.exec.proto.CoordRPC.JobCancelRequest prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public Builder mergeFrom(com.dremio.exec.proto.CoordRPC.JobCancelRequest other) { if (other == com.dremio.exec.proto.CoordRPC.JobCancelRequest.getDefaultInstance()) return this; if (other.hasExternalId()) { mergeExternalId(other.getExternalId()); } if (other.hasCancelReason()) { bitField0_ |= 0x00000002; cancelReason_ = other.cancelReason_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public void writeTo(io.protostuff.Output output, com.dremio.exec.proto.CoordRPC.JobCancelRequest message) throws java.io.IOException { if(message.hasExternalId()) output.writeObject(1, message.getExternalId(), com.dremio.exec.proto.SchemaUserBitShared.ExternalId.WRITE, false); if(message.hasCancelReason()) output.writeString(2, message.getCancelReason(), false); } public boolean isInitialized(com.dremio.exec.proto.CoordRPC.JobCancelRequest message)
public com.dremio.exec.proto.CoordRPC.JobCancelRequest.Builder newMessage() { return com.dremio.exec.proto.CoordRPC.JobCancelRequest.newBuilder(); } public java.lang.String getFieldName(int number)
/** * <code>optional string cancel_reason = 2;</code> */ public Builder clearCancelReason() { bitField0_ = (bitField0_ & ~0x00000002); cancelReason_ = getDefaultInstance().getCancelReason(); onChanged(); return this; } /**
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeMessage(1, externalId_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, getCancelReasonBytes()); } getUnknownFields().writeTo(output); }