예제 #1
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, BatchQueue struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.queueName != null) {
        oprot.writeFieldBegin(QUEUE_NAME_FIELD_DESC);
        oprot.writeString(struct.queueName);
        oprot.writeFieldEnd();
      }
      if (struct.queueDescription != null) {
        if (struct.isSetQueueDescription()) {
          oprot.writeFieldBegin(QUEUE_DESCRIPTION_FIELD_DESC);
          oprot.writeString(struct.queueDescription);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetMaxRunTime()) {
        oprot.writeFieldBegin(MAX_RUN_TIME_FIELD_DESC);
        oprot.writeI32(struct.maxRunTime);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMaxNodes()) {
        oprot.writeFieldBegin(MAX_NODES_FIELD_DESC);
        oprot.writeI32(struct.maxNodes);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMaxProcessors()) {
        oprot.writeFieldBegin(MAX_PROCESSORS_FIELD_DESC);
        oprot.writeI32(struct.maxProcessors);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMaxJobsInQueue()) {
        oprot.writeFieldBegin(MAX_JOBS_IN_QUEUE_FIELD_DESC);
        oprot.writeI32(struct.maxJobsInQueue);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMaxMemory()) {
        oprot.writeFieldBegin(MAX_MEMORY_FIELD_DESC);
        oprot.writeI32(struct.maxMemory);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
예제 #2
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, BatchQueue 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: // QUEUE_NAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.queueName = iprot.readString();
           struct.setQueueNameIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // QUEUE_DESCRIPTION
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.queueDescription = iprot.readString();
           struct.setQueueDescriptionIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // MAX_RUN_TIME
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.maxRunTime = iprot.readI32();
           struct.setMaxRunTimeIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // MAX_NODES
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.maxNodes = iprot.readI32();
           struct.setMaxNodesIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5: // MAX_PROCESSORS
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.maxProcessors = iprot.readI32();
           struct.setMaxProcessorsIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 6: // MAX_JOBS_IN_QUEUE
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.maxJobsInQueue = iprot.readI32();
           struct.setMaxJobsInQueueIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 7: // MAX_MEMORY
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.maxMemory = iprot.readI32();
           struct.setMaxMemoryIsSet(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();
 }