Esempio n. 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();
    }
Esempio n. 2
0
  public boolean equals(TDataSink that) {
    if (that == null) return false;

    boolean this_present_type = true && this.isSetType();
    boolean that_present_type = true && that.isSetType();
    if (this_present_type || that_present_type) {
      if (!(this_present_type && that_present_type)) return false;
      if (!this.type.equals(that.type)) return false;
    }

    boolean this_present_stream_sink = true && this.isSetStream_sink();
    boolean that_present_stream_sink = true && that.isSetStream_sink();
    if (this_present_stream_sink || that_present_stream_sink) {
      if (!(this_present_stream_sink && that_present_stream_sink)) return false;
      if (!this.stream_sink.equals(that.stream_sink)) return false;
    }

    boolean this_present_table_sink = true && this.isSetTable_sink();
    boolean that_present_table_sink = true && that.isSetTable_sink();
    if (this_present_table_sink || that_present_table_sink) {
      if (!(this_present_table_sink && that_present_table_sink)) return false;
      if (!this.table_sink.equals(that.table_sink)) return false;
    }

    return true;
  }
Esempio n. 3
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, TDataSink struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   oprot.writeI32(struct.type.getValue());
   BitSet optionals = new BitSet();
   if (struct.isSetStream_sink()) {
     optionals.set(0);
   }
   if (struct.isSetTable_sink()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetStream_sink()) {
     struct.stream_sink.write(oprot);
   }
   if (struct.isSetTable_sink()) {
     struct.table_sink.write(oprot);
   }
 }
Esempio n. 4
0
 /** Performs a deep copy on <i>other</i>. */
 public TDataSink(TDataSink other) {
   if (other.isSetType()) {
     this.type = other.type;
   }
   if (other.isSetStream_sink()) {
     this.stream_sink = new TDataStreamSink(other.stream_sink);
   }
   if (other.isSetTable_sink()) {
     this.table_sink = new TTableSink(other.table_sink);
   }
 }
Esempio n. 5
0
  public int compareTo(TDataSink other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    TDataSink typedOther = (TDataSink) other;

    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStream_sink()).compareTo(typedOther.isSetStream_sink());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStream_sink()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.stream_sink, typedOther.stream_sink);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTable_sink()).compareTo(typedOther.isSetTable_sink());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTable_sink()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.table_sink, typedOther.table_sink);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }