int errno = Proto.getErrno(rpcError.getMessage()); String sqlState = Proto.getSQLState(rpcError.getMessage()); throw new BatchUpdateException(rpcError.toString(), sqlState, errno, updateCounts);
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + LEGACY_CODE_FIELD_NUMBER; hash = (53 * hash) + legacyCode_; hash = (37 * hash) + MESSAGE_FIELD_NUMBER; hash = (53 * hash) + getMessage().hashCode(); hash = (37 * hash) + CODE_FIELD_NUMBER; hash = (53 * hash) + code_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (legacyCode_ != io.vitess.proto.Vtrpc.LegacyErrorCode.SUCCESS_LEGACY.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, legacyCode_); } if (!getMessageBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); } if (code_ != io.vitess.proto.Vtrpc.Code.OK.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(3, code_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
int errno = getErrno(error.getMessage()); String sqlState = getSQLState(error.getMessage()); switch (error.getCode()) { case OK: break; case INVALID_ARGUMENT: throw new SQLSyntaxErrorException(error.toString(), sqlState, errno); case DEADLINE_EXCEEDED: throw new SQLTimeoutException(error.toString(), sqlState, errno); case ALREADY_EXISTS: throw new SQLIntegrityConstraintViolationException(error.toString(), sqlState, errno); case UNAVAILABLE: throw new SQLTransientException(error.toString(), sqlState, errno); case UNAUTHENTICATED: throw new SQLInvalidAuthorizationSpecException(error.toString(), sqlState, errno); case ABORTED: throw new SQLRecoverableException(error.toString(), sqlState, errno); default: throw new SQLNonTransientException("Vitess RPC error: " + error.toString(), sqlState, errno); switch (error.getLegacyCode()) { case SUCCESS_LEGACY: break; case BAD_INPUT_LEGACY: throw new SQLSyntaxErrorException(error.toString(), sqlState, errno); case DEADLINE_EXCEEDED_LEGACY: throw new SQLTimeoutException(error.toString(), sqlState, errno);
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (legacyCode_ != io.vitess.proto.Vtrpc.LegacyErrorCode.SUCCESS_LEGACY.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, legacyCode_); } if (!getMessageBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); } if (code_ != io.vitess.proto.Vtrpc.Code.OK.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(3, code_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + LEGACY_CODE_FIELD_NUMBER; hash = (53 * hash) + legacyCode_; hash = (37 * hash) + MESSAGE_FIELD_NUMBER; hash = (53 * hash) + getMessage().hashCode(); hash = (37 * hash) + CODE_FIELD_NUMBER; hash = (53 * hash) + code_; 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 io.vitess.proto.Vtrpc.RPCError)) { return super.equals(obj); } io.vitess.proto.Vtrpc.RPCError other = (io.vitess.proto.Vtrpc.RPCError) obj; boolean result = true; result = result && legacyCode_ == other.legacyCode_; result = result && getMessage() .equals(other.getMessage()); result = result && code_ == other.code_; result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.vitess.proto.Vtrpc.RPCError)) { return super.equals(obj); } io.vitess.proto.Vtrpc.RPCError other = (io.vitess.proto.Vtrpc.RPCError) obj; boolean result = true; result = result && legacyCode_ == other.legacyCode_; result = result && getMessage() .equals(other.getMessage()); result = result && code_ == other.code_; result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(io.vitess.proto.Vtrpc.RPCError other) { if (other == io.vitess.proto.Vtrpc.RPCError.getDefaultInstance()) return this; if (other.legacyCode_ != 0) { setLegacyCodeValue(other.getLegacyCodeValue()); } if (!other.getMessage().isEmpty()) { message_ = other.message_; onChanged(); } if (other.code_ != 0) { setCodeValue(other.getCodeValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public Builder mergeFrom(io.vitess.proto.Vtrpc.RPCError other) { if (other == io.vitess.proto.Vtrpc.RPCError.getDefaultInstance()) return this; if (other.legacyCode_ != 0) { setLegacyCodeValue(other.getLegacyCodeValue()); } if (!other.getMessage().isEmpty()) { message_ = other.message_; onChanged(); } if (other.code_ != 0) { setCodeValue(other.getCodeValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
@java.lang.Override public io.vitess.proto.Vtrpc.RPCError getDefaultInstanceForType() { return io.vitess.proto.Vtrpc.RPCError.getDefaultInstance(); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (legacyCode_ != io.vitess.proto.Vtrpc.LegacyErrorCode.SUCCESS_LEGACY.getNumber()) { output.writeEnum(1, legacyCode_); } if (!getMessageBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); } if (code_ != io.vitess.proto.Vtrpc.Code.OK.getNumber()) { output.writeEnum(3, code_); } unknownFields.writeTo(output); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (legacyCode_ != io.vitess.proto.Vtrpc.LegacyErrorCode.SUCCESS_LEGACY.getNumber()) { output.writeEnum(1, legacyCode_); } if (!getMessageBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); } if (code_ != io.vitess.proto.Vtrpc.Code.OK.getNumber()) { output.writeEnum(3, code_); } unknownFields.writeTo(output); }
@java.lang.Override public io.vitess.proto.Vtrpc.RPCError getDefaultInstanceForType() { return io.vitess.proto.Vtrpc.RPCError.getDefaultInstance(); }
@java.lang.Override public io.vitess.proto.Vtrpc.RPCError build() { io.vitess.proto.Vtrpc.RPCError result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
/** * <code>string message = 2;</code> */ public Builder clearMessage() { message_ = getDefaultInstance().getMessage(); onChanged(); return this; } /**