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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(struct.type.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.stream_sink != null) {
        if (struct.isSetStream_sink()) {
          oprot.writeFieldBegin(STREAM_SINK_FIELD_DESC);
          struct.stream_sink.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.table_sink != null) {
        if (struct.isSetTable_sink()) {
          oprot.writeFieldBegin(TABLE_SINK_FIELD_DESC);
          struct.table_sink.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Example #2
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, EchoRequestMessage 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: // HEADER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.header = new AsyncMessageHeader();
              struct.header.read(iprot);
              struct.setHeaderIsSet(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
      struct.validate();
    }
    public void read(org.apache.thrift.protocol.TProtocol iprot, CompleteFileTOptions 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: // UFS_LENGTH
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.ufsLength = iprot.readI64();
              struct.setUfsLengthIsSet(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
      struct.validate();
    }
Example #4
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, FrontendRequest struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.type != null) {
        if (struct.isSetType()) {
          oprot.writeFieldBegin(TYPE_FIELD_DESC);
          oprot.writeI32(struct.type.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.startBuild != null) {
        if (struct.isSetStartBuild()) {
          oprot.writeFieldBegin(START_BUILD_FIELD_DESC);
          struct.startBuild.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.buildStatus != null) {
        if (struct.isSetBuildStatus()) {
          oprot.writeFieldBegin(BUILD_STATUS_FIELD_DESC);
          struct.buildStatus.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
   org.apache.thrift.protocol.TField field;
   iprot.readStructBegin();
   while (true) {
     field = iprot.readFieldBegin();
     if (field.type == org.apache.thrift.protocol.TType.STOP) {
       break;
     }
     switch (field.id) {
       case 1: // WAIT_SECS
         if (field.type == org.apache.thrift.protocol.TType.I32) {
           this.wait_secs = iprot.readI32();
           set_wait_secs_isSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       default:
         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   validate();
 }
Example #6
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, ResUpdateUserProfile 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: // ERROR
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.error = new ErrorDesc();
              struct.error.read(iprot);
              struct.setErrorIsSet(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
      struct.validate();
    }
Example #7
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, TInPredicate 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: // IS_NOT_IN
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.is_not_in = iprot.readBool();
              struct.setIs_not_inIsSet(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.isSetIs_not_in()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'is_not_in' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }
    public void write(
        org.apache.thrift.protocol.TProtocol oprot, TGetAllCatalogObjectsResponse struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(MAX_CATALOG_VERSION_FIELD_DESC);
      oprot.writeI64(struct.max_catalog_version);
      oprot.writeFieldEnd();
      if (struct.objects != null) {
        oprot.writeFieldBegin(OBJECTS_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.objects.size()));
          for (com.cloudera.impala.thrift.TCatalogObject _iter3 : struct.objects) {
            _iter3.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Example #9
0
      public void write(org.apache.thrift.protocol.TProtocol oprot, tokenize_result struct)
          throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(
                    org.apache.thrift.protocol.TType.LIST, struct.success.size()));
            for (List<String> _iter6 : struct.success) {
              {
                oprot.writeListBegin(
                    new org.apache.thrift.protocol.TList(
                        org.apache.thrift.protocol.TType.STRING, _iter6.size()));
                for (String _iter7 : _iter6) {
                  oprot.writeString(_iter7);
                }
                oprot.writeListEnd();
              }
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }
    public void read(org.apache.thrift.protocol.TProtocol iprot)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true) {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (field.id) {
          case 1: // REQ
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.req = new ScheduleRequest();
              this.req.read(iprot);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      validate();
    }
  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true) {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) {
        break;
      }
      switch (field.id) {
        case 1: // WHY
          if (field.type == TType.STRING) {
            this.why = iprot.readString();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    validate();
  }
Example #12
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, MountTOptions 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: // READ_ONLY
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.readOnly = iprot.readBool();
              struct.setReadOnlyIsSet(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
      struct.validate();
    }
Example #13
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, LineageCommand struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.commandType != null) {
        oprot.writeFieldBegin(COMMAND_TYPE_FIELD_DESC);
        oprot.writeI32(struct.commandType.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.checkpointFiles != null) {
        oprot.writeFieldBegin(CHECKPOINT_FILES_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.checkpointFiles.size()));
          for (CheckpointFile _iter11 : struct.checkpointFiles) {
            _iter11.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    public void read(org.apache.thrift.protocol.TProtocol iprot)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField field;
      iprot.readStructBegin();
      while (true) {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (field.id) {
          case 0: // SUCCESS
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
              this.success = iprot.readString();
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          case 1: // E
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
              this.e = new EntitlementException();
              this.e.read(iprot);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      validate();
    }
Example #15
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, TTransmitDataResult 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: // STATUS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.status = new com.cloudera.impala.thrift.TStatus();
              struct.status.read(iprot);
              struct.setStatusIsSet(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
      struct.validate();
    }
Example #16
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, AbortTxnRequest 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: // TXNID
         if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
           struct.txnid = iprot.readI64();
           struct.setTxnidIsSet(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();
 }
Example #17
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, JobConfInfo 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: // OUTPUT_FILE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.outputFile = iprot.readString();
              struct.setOutputFileIsSet(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
      struct.validate();
    }
Example #18
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, LocationProperty 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: // PROPERTY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.property = new LocationPropertyValue();
              struct.property.read(iprot);
              struct.setPropertyIsSet(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
      struct.validate();
    }
Example #19
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleValue 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: // VALUE
         if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
           struct.value = iprot.readDouble();
           struct.setValueIsSet(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();
 }
Example #20
0
      public void read(org.apache.thrift.protocol.TProtocol iprot, getStruct_result 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 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new SharedStruct();
                struct.success.read(iprot);
                struct.setSuccessIsSet(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
        struct.validate();
      }
Example #21
0
 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
   org.apache.thrift.protocol.TField field;
   iprot.readStructBegin();
   while (true) {
     field = iprot.readFieldBegin();
     if (field.type == org.apache.thrift.protocol.TType.STOP) {
       break;
     }
     switch (field.id) {
       case 1: // KEY
         if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
           this.key = new Key();
           this.key.read(iprot);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 2: // DATA
         if (field.type == org.apache.thrift.protocol.TType.STRING) {
           this.data = iprot.readBinary();
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       default:
         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   validate();
 }
  public void write(TProtocol oprot) throws TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }
Example #23
0
      public void read(org.apache.thrift.protocol.TProtocol iprot, getStruct_args 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: // KEY
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.key = iprot.readI32();
                struct.setKeyIsSet(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
        struct.validate();
      }
  @Override
  public boolean process(TProtocol in, TProtocol out) throws TException {
    TMessage msg = in.readMessageBegin();
    String name = msg.name;
    int idx = name.indexOf('.');
    if (idx != -1) {
      name = name.substring(idx + 1);
    }
    TDynamicFunction f = descManager.getFunction(name);
    if (f == null) throw new TException("unknow function '" + name + "'");
    Reader reader = new Reader(f.getManager());
    Xdom param = reader.readStruct(f.getParamStruct(), in);
    in.readMessageEnd();

    if (!f.isOneway()) {

      XdomMap rep;
      TDynamicField retf = f.getReturnStruct().getField("success");
      if (retf.getTypeValue() != TType.VOID) {
        Xdom ret = handle(name, param);
        rep = new XdomMap();
        rep.put("success", ret);
      } else {
        rep = new XdomMap();
      }

      TMessage repmsg = new TMessage(name, TMessageType.REPLY, msg.seqid);
      out.writeMessageBegin(repmsg);
      Writer writer = new Writer(f.getManager());
      writer.writeStruct(f.getReturnStruct(), rep, out);
      out.writeMessageEnd();
      out.getTransport().flush();
    }
    return true;
  }
Example #25
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, SettableBlobMeta struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.acl != null) {
        oprot.writeFieldBegin(ACL_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.acl.size()));
          for (AccessControl _iter561 : struct.acl) {
            _iter561.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.is_set_replication_factor()) {
        oprot.writeFieldBegin(REPLICATION_FACTOR_FIELD_DESC);
        oprot.writeI32(struct.replication_factor);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    public void read(org.apache.thrift.protocol.TProtocol iprot, TUserDefinedTypeEntry 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: // TYPE_CLASS_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.typeClassName = iprot.readString();
              struct.setTypeClassNameIsSet(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
      struct.validate();
    }
    public void write(org.apache.thrift.protocol.TProtocol oprot, UnaryPredicate struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.predicateName != null) {
        oprot.writeFieldBegin(PREDICATE_NAME_FIELD_DESC);
        oprot.writeString(struct.predicateName);
        oprot.writeFieldEnd();
      }
      if (struct.values != null) {
        oprot.writeFieldBegin(VALUES_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.values.size()));
          for (PredicateValue _iter3 : struct.values) {
            _iter3.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true) {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) {
        break;
      }
      switch (field.id) {
        case 1: // INTERPRETATIONS
          if (field.type == TType.LIST) {
            {
              TList _list44 = iprot.readListBegin();
              this.interpretations = new ArrayList<GeocodeInterpretation>(_list44.size);
              for (int _i45 = 0; _i45 < _list44.size; ++_i45) {
                GeocodeInterpretation _elem46;
                _elem46 = new GeocodeInterpretation();
                _elem46.read(iprot);
                this.interpretations.add(_elem46);
              }
              iprot.readListEnd();
            }
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // DEBUG_LINES
          if (field.type == TType.LIST) {
            {
              TList _list47 = iprot.readListBegin();
              this.debugLines = new ArrayList<String>(_list47.size);
              for (int _i48 = 0; _i48 < _list47.size; ++_i48) {
                String _elem49;
                _elem49 = iprot.readString();
                this.debugLines.add(_elem49);
              }
              iprot.readListEnd();
            }
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // REQUEST_WKT_GEOMETRY
          if (field.type == TType.STRING) {
            this.requestWktGeometry = iprot.readString();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    validate();
  }
 public void read(org.apache.thrift.protocol.TProtocol iprot, TCreateSentryRoleRequest 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: // PROTOCOL_VERSION
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.protocol_version = iprot.readI32();
           struct.setProtocol_versionIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // REQUESTOR_USER_NAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.requestorUserName = iprot.readString();
           struct.setRequestorUserNameIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // REQUESTOR_GROUP_NAMES
         if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
           {
             org.apache.thrift.protocol.TSet _set0 = iprot.readSetBegin();
             struct.requestorGroupNames = new HashSet<String>(2 * _set0.size);
             for (int _i1 = 0; _i1 < _set0.size; ++_i1) {
               String _elem2; // required
               _elem2 = iprot.readString();
               struct.requestorGroupNames.add(_elem2);
             }
             iprot.readSetEnd();
           }
           struct.setRequestorGroupNamesIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // ROLE_NAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.roleName = iprot.readString();
           struct.setRoleNameIsSet(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();
 }
Example #30
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, DependencyInfo struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }