Пример #1
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, TDataSink 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
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.type = TDataSinkType.findByValue(iprot.readI32());
              struct.setTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // STREAM_SINK
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.stream_sink = new TDataStreamSink();
              struct.stream_sink.read(iprot);
              struct.setStream_sinkIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // TABLE_SINK
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.table_sink = new TTableSink();
              struct.table_sink.read(iprot);
              struct.setTable_sinkIsSet(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();
    }
Пример #2
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TDataSink struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.type = TDataSinkType.findByValue(iprot.readI32());
   struct.setTypeIsSet(true);
   BitSet incoming = iprot.readBitSet(2);
   if (incoming.get(0)) {
     struct.stream_sink = new TDataStreamSink();
     struct.stream_sink.read(iprot);
     struct.setStream_sinkIsSet(true);
   }
   if (incoming.get(1)) {
     struct.table_sink = new TTableSink();
     struct.table_sink.read(iprot);
     struct.setTable_sinkIsSet(true);
   }
 }
Пример #3
0
  @Override
  public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder();

    boolean present_type = true && (isSetType());
    builder.append(present_type);
    if (present_type) builder.append(type.getValue());

    boolean present_stream_sink = true && (isSetStream_sink());
    builder.append(present_stream_sink);
    if (present_stream_sink) builder.append(stream_sink);

    boolean present_table_sink = true && (isSetTable_sink());
    builder.append(present_table_sink);
    if (present_table_sink) builder.append(table_sink);

    return builder.toHashCode();
  }