コード例 #1
0
ファイル: SubmitOptions.java プロジェクト: matif84/storm
    public void write(org.apache.thrift.protocol.TProtocol oprot, SubmitOptions struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.initial_status != null) {
        oprot.writeFieldBegin(INITIAL_STATUS_FIELD_DESC);
        oprot.writeI32(struct.initial_status.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.creds != null) {
        if (struct.is_set_creds()) {
          oprot.writeFieldBegin(CREDS_FIELD_DESC);
          struct.creds.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
コード例 #2
0
ファイル: SubmitOptions.java プロジェクト: matif84/storm
 public void read(org.apache.thrift.protocol.TProtocol iprot, SubmitOptions 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: // INITIAL_STATUS
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.initial_status =
               backtype.storm.generated.TopologyInitialStatus.findByValue(iprot.readI32());
           struct.set_initial_status_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // CREDS
         if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
           struct.creds = new Credentials();
           struct.creds.read(iprot);
           struct.set_creds_isSet(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();
 }