Ejemplo n.º 1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   struct.status.write(oprot);
   BitSet optionals = new BitSet();
   if (struct.isSetOperationState()) {
     optionals.set(0);
   }
   if (struct.isSetSqlState()) {
     optionals.set(1);
   }
   if (struct.isSetErrorCode()) {
     optionals.set(2);
   }
   if (struct.isSetErrorMessage()) {
     optionals.set(3);
   }
   oprot.writeBitSet(optionals, 4);
   if (struct.isSetOperationState()) {
     oprot.writeI32(struct.operationState.getValue());
   }
   if (struct.isSetSqlState()) {
     oprot.writeString(struct.sqlState);
   }
   if (struct.isSetErrorCode()) {
     oprot.writeI32(struct.errorCode);
   }
   if (struct.isSetErrorMessage()) {
     oprot.writeString(struct.errorMessage);
   }
 }
Ejemplo n.º 2
0
  public boolean equals(TGetOperationStatusResp that) {
    if (that == null) return false;

    boolean this_present_status = true && this.isSetStatus();
    boolean that_present_status = true && that.isSetStatus();
    if (this_present_status || that_present_status) {
      if (!(this_present_status && that_present_status)) return false;
      if (!this.status.equals(that.status)) return false;
    }

    boolean this_present_operationState = true && this.isSetOperationState();
    boolean that_present_operationState = true && that.isSetOperationState();
    if (this_present_operationState || that_present_operationState) {
      if (!(this_present_operationState && that_present_operationState)) return false;
      if (!this.operationState.equals(that.operationState)) return false;
    }

    boolean this_present_sqlState = true && this.isSetSqlState();
    boolean that_present_sqlState = true && that.isSetSqlState();
    if (this_present_sqlState || that_present_sqlState) {
      if (!(this_present_sqlState && that_present_sqlState)) return false;
      if (!this.sqlState.equals(that.sqlState)) return false;
    }

    boolean this_present_errorCode = true && this.isSetErrorCode();
    boolean that_present_errorCode = true && that.isSetErrorCode();
    if (this_present_errorCode || that_present_errorCode) {
      if (!(this_present_errorCode && that_present_errorCode)) return false;
      if (this.errorCode != that.errorCode) return false;
    }

    boolean this_present_errorMessage = true && this.isSetErrorMessage();
    boolean that_present_errorMessage = true && that.isSetErrorMessage();
    if (this_present_errorMessage || that_present_errorMessage) {
      if (!(this_present_errorMessage && that_present_errorMessage)) return false;
      if (!this.errorMessage.equals(that.errorMessage)) return false;
    }

    return true;
  }
Ejemplo n.º 3
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, TGetOperationStatusResp struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        struct.status.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.operationState != null) {
        if (struct.isSetOperationState()) {
          oprot.writeFieldBegin(OPERATION_STATE_FIELD_DESC);
          oprot.writeI32(struct.operationState.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.sqlState != null) {
        if (struct.isSetSqlState()) {
          oprot.writeFieldBegin(SQL_STATE_FIELD_DESC);
          oprot.writeString(struct.sqlState);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetErrorCode()) {
        oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC);
        oprot.writeI32(struct.errorCode);
        oprot.writeFieldEnd();
      }
      if (struct.errorMessage != null) {
        if (struct.isSetErrorMessage()) {
          oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC);
          oprot.writeString(struct.errorMessage);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Ejemplo n.º 4
0
  @Override
  public int compareTo(TGetOperationStatusResp other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOperationState()).compareTo(other.isSetOperationState());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOperationState()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.operationState, other.operationState);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSqlState()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, other.sqlState);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetErrorCode()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetErrorMessage()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, other.errorMessage);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }