Ejemplo n.º 1
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsReq 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_HANDLE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.operationHandle = new TOperationHandle();
              struct.operationHandle.read(iprot);
              struct.setOperationHandleIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // ORIENTATION
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.orientation = TFetchOrientation.findByValue(iprot.readI32());
              struct.setOrientationIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // MAX_ROWS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.maxRows = iprot.readI64();
              struct.setMaxRowsIsSet(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();

      // check for required fields of primitive type, which can't be checked in the validate method
      if (!struct.isSetMaxRows()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'maxRows' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }
Ejemplo n.º 2
0
  @Override
  public int compareTo(TFetchResultsReq other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison =
        Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOperationHandle()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOrientation()).compareTo(other.isSetOrientation());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOrientation()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orientation, other.orientation);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMaxRows()).compareTo(other.isSetMaxRows());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMaxRows()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxRows, other.maxRows);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }