Ejemplo n.º 1
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, ResourceJobManager struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.resourceJobManagerId != null) {
        oprot.writeFieldBegin(RESOURCE_JOB_MANAGER_ID_FIELD_DESC);
        oprot.writeString(struct.resourceJobManagerId);
        oprot.writeFieldEnd();
      }
      if (struct.resourceJobManagerType != null) {
        oprot.writeFieldBegin(RESOURCE_JOB_MANAGER_TYPE_FIELD_DESC);
        oprot.writeI32(struct.resourceJobManagerType.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.pushMonitoringEndpoint != null) {
        if (struct.isSetPushMonitoringEndpoint()) {
          oprot.writeFieldBegin(PUSH_MONITORING_ENDPOINT_FIELD_DESC);
          oprot.writeString(struct.pushMonitoringEndpoint);
          oprot.writeFieldEnd();
        }
      }
      if (struct.jobManagerBinPath != null) {
        if (struct.isSetJobManagerBinPath()) {
          oprot.writeFieldBegin(JOB_MANAGER_BIN_PATH_FIELD_DESC);
          oprot.writeString(struct.jobManagerBinPath);
          oprot.writeFieldEnd();
        }
      }
      if (struct.jobManagerCommands != null) {
        if (struct.isSetJobManagerCommands()) {
          oprot.writeFieldBegin(JOB_MANAGER_COMMANDS_FIELD_DESC);
          {
            oprot.writeMapBegin(
                new org.apache.thrift.protocol.TMap(
                    org.apache.thrift.protocol.TType.I32,
                    org.apache.thrift.protocol.TType.STRING,
                    struct.jobManagerCommands.size()));
            for (Map.Entry<JobManagerCommand, String> _iter4 :
                struct.jobManagerCommands.entrySet()) {
              oprot.writeI32(_iter4.getKey().getValue());
              oprot.writeString(_iter4.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Ejemplo n.º 2
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, ResourceJobManager 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: // RESOURCE_JOB_MANAGER_ID
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.resourceJobManagerId = iprot.readString();
           struct.setResourceJobManagerIdIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // RESOURCE_JOB_MANAGER_TYPE
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.resourceJobManagerType =
               org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType
                   .findByValue(iprot.readI32());
           struct.setResourceJobManagerTypeIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // PUSH_MONITORING_ENDPOINT
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.pushMonitoringEndpoint = iprot.readString();
           struct.setPushMonitoringEndpointIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // JOB_MANAGER_BIN_PATH
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.jobManagerBinPath = iprot.readString();
           struct.setJobManagerBinPathIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5: // JOB_MANAGER_COMMANDS
         if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
           {
             org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
             struct.jobManagerCommands = new HashMap<JobManagerCommand, String>(2 * _map0.size);
             JobManagerCommand _key1;
             String _val2;
             for (int _i3 = 0; _i3 < _map0.size; ++_i3) {
               _key1 =
                   org.apache.airavata.model.appcatalog.computeresource.JobManagerCommand
                       .findByValue(iprot.readI32());
               _val2 = iprot.readString();
               struct.jobManagerCommands.put(_key1, _val2);
             }
             iprot.readMapEnd();
           }
           struct.setJobManagerCommandsIsSet(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();
 }