public void write(org.apache.thrift.protocol.TProtocol oprot, TOperationHandle struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.operationId != null) {
        oprot.writeFieldBegin(OPERATION_ID_FIELD_DESC);
        struct.operationId.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.operationType != null) {
        oprot.writeFieldBegin(OPERATION_TYPE_FIELD_DESC);
        oprot.writeI32(struct.operationType.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC);
      oprot.writeBool(struct.hasResultSet);
      oprot.writeFieldEnd();
      if (struct.isSetModifiedRowCount()) {
        oprot.writeFieldBegin(MODIFIED_ROW_COUNT_FIELD_DESC);
        oprot.writeDouble(struct.modifiedRowCount);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
 public void read(org.apache.thrift.protocol.TProtocol iprot, TOperationHandle struct)
     throws org.apache.thrift.TException {
   org.apache.thrift.protocol.TField schemeField;
   iprot.readStructBegin();
   while (true) {
     schemeField = iprot.readFieldBegin();
     if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
       break;
     }
     switch (schemeField.id) {
       case 1: // OPERATION_ID
         if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
           struct.operationId = new THandleIdentifier();
           struct.operationId.read(iprot);
           struct.setOperationIdIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // OPERATION_TYPE
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.operationType = TOperationType.findByValue(iprot.readI32());
           struct.setOperationTypeIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // HAS_RESULT_SET
         if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
           struct.hasResultSet = iprot.readBool();
           struct.setHasResultSetIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // MODIFIED_ROW_COUNT
         if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
           struct.modifiedRowCount = iprot.readDouble();
           struct.setModifiedRowCountIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       default:
         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   struct.validate();
 }
Exemple #3
0
  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (!isSetStatus()) {
      throw new org.apache.thrift.protocol.TProtocolException(
          "Required field 'status' is unset! Struct:" + toString());
    }

    // check for sub-struct validity
    if (status != null) {
      status.validate();
    }
    if (operationHandle != null) {
      operationHandle.validate();
    }
  }
 public void validate() throws org.apache.thrift.TException {
   // check for required fields
   if (operationHandle == null) {
     throw new org.apache.thrift.protocol.TProtocolException(
         "Required field 'operationHandle' was not present! Struct: " + toString());
   }
   if (orientation == null) {
     throw new org.apache.thrift.protocol.TProtocolException(
         "Required field 'orientation' was not present! Struct: " + toString());
   }
   // alas, we cannot check 'maxRows' because it's a primitive and you chose the non-beans
   // generator.
   // check for sub-struct validity
   if (operationHandle != null) {
     operationHandle.validate();
   }
 }