Java Code Examples for org.apache.thrift.protocol.TTupleProtocol#writeBinary()

The following examples show how to use org.apache.thrift.protocol.TTupleProtocol#writeBinary() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TMessageList.java    From luxun with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TMessageList struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetMessages()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetMessages()) {
    {
      oprot.writeI32(struct.messages.size());
      for (ByteBuffer _iter4 : struct.messages)
      {
        oprot.writeBinary(_iter4);
      }
    }
  }
}
 
Example 2
Source File: ConsumeResponse.java    From luxun with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ConsumeResponse struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  struct.result.write(oprot);
  BitSet optionals = new BitSet();
  if (struct.isSetItemList()) {
    optionals.set(0);
  }
  if (struct.isSetLastConsumedIndex()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetItemList()) {
    {
      oprot.writeI32(struct.itemList.size());
      for (ByteBuffer _iter4 : struct.itemList)
      {
        oprot.writeBinary(_iter4);
      }
    }
  }
  if (struct.isSetLastConsumedIndex()) {
    oprot.writeI64(struct.lastConsumedIndex);
  }
}
 
Example 3
Source File: Deletion.java    From stratio-cassandra with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Deletion struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetTimestamp()) {
    optionals.set(0);
  }
  if (struct.isSetSuper_column()) {
    optionals.set(1);
  }
  if (struct.isSetPredicate()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetTimestamp()) {
    oprot.writeI64(struct.timestamp);
  }
  if (struct.isSetSuper_column()) {
    oprot.writeBinary(struct.super_column);
  }
  if (struct.isSetPredicate()) {
    struct.predicate.write(oprot);
  }
}
 
Example 4
Source File: Response.java    From disruptor_thrift_server with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Response struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetId()) {
    optionals.set(0);
  }
  if (struct.isSetResult()) {
    optionals.set(1);
  }
  if (struct.isSetResType()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetId()) {
    oprot.writeI32(struct.id);
  }
  if (struct.isSetResult()) {
    oprot.writeBinary(struct.result);
  }
  if (struct.isSetResType()) {
    oprot.writeI32(struct.resType.getValue());
  }
}
 
Example 5
Source File: TMessagePack.java    From luxun with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TMessagePack struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeBinary(struct.messageList);
  BitSet optionals = new BitSet();
  if (struct.isSetMagic()) {
    optionals.set(0);
  }
  if (struct.isSetAttribute()) {
    optionals.set(1);
  }
  if (struct.isSetCrc32()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetMagic()) {
    oprot.writeByte(struct.magic);
  }
  if (struct.isSetAttribute()) {
    oprot.writeByte(struct.attribute);
  }
  if (struct.isSetCrc32()) {
    oprot.writeI32(struct.crc32);
  }
}
 
Example 6
Source File: SlicePredicate.java    From stratio-cassandra with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, SlicePredicate struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetColumn_names()) {
    optionals.set(0);
  }
  if (struct.isSetSlice_range()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetColumn_names()) {
    {
      oprot.writeI32(struct.column_names.size());
      for (ByteBuffer _iter20 : struct.column_names)
      {
        oprot.writeBinary(_iter20);
      }
    }
  }
  if (struct.isSetSlice_range()) {
    struct.slice_range.write(oprot);
  }
}
 
Example 7
Source File: PacketStreamer.java    From floodlight_with_topoguard with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getPackets_result struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetSuccess()) {
    {
      oprot.writeI32(struct.success.size());
      for (ByteBuffer _iter12 : struct.success)
      {
        oprot.writeBinary(_iter12);
      }
    }
  }
}
 
Example 8
Source File: ConnectionProperties.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ConnectionProperties struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeI32(struct.connId);
  oprot.writeString(struct.clientHostName);
  oprot.writeString(struct.clientID);
  BitSet optionals = new BitSet();
  if (struct.isSetUserName()) {
    optionals.set(0);
  }
  if (struct.isSetToken()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetUserName()) {
    oprot.writeString(struct.userName);
  }
  if (struct.isSetToken()) {
    oprot.writeBinary(struct.token);
  }
}
 
Example 9
Source File: BinaryAnnotation.java    From incubator-retired-htrace with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, BinaryAnnotation struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetKey()) {
    optionals.set(0);
  }
  if (struct.isSetValue()) {
    optionals.set(1);
  }
  if (struct.isSetAnnotation_type()) {
    optionals.set(2);
  }
  if (struct.isSetHost()) {
    optionals.set(3);
  }
  oprot.writeBitSet(optionals, 4);
  if (struct.isSetKey()) {
    oprot.writeString(struct.key);
  }
  if (struct.isSetValue()) {
    oprot.writeBinary(struct.value);
  }
  if (struct.isSetAnnotation_type()) {
    oprot.writeI32(struct.annotation_type.getValue());
  }
  if (struct.isSetHost()) {
    struct.host.write(oprot);
  }
}
 
Example 10
Source File: KeyedValues.java    From floodlight_with_topoguard with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, KeyedValues struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeBinary(struct.key);
  {
    oprot.writeI32(struct.values.size());
    for (VersionedValue _iter12 : struct.values)
    {
      _iter12.write(oprot);
    }
  }
}
 
Example 11
Source File: GetRequestMessage.java    From floodlight_with_topoguard with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, GetRequestMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  struct.header.write(oprot);
  oprot.writeString(struct.storeName);
  oprot.writeBinary(struct.key);
}
 
Example 12
Source File: IndexClause.java    From stratio-cassandra with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, IndexClause struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  {
    oprot.writeI32(struct.expressions.size());
    for (IndexExpression _iter28 : struct.expressions)
    {
      _iter28.write(oprot);
    }
  }
  oprot.writeBinary(struct.start_key);
  oprot.writeI32(struct.count);
}
 
Example 13
Source File: ProduceRequest.java    From luxun with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ProduceRequest struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeBinary(struct.item);
  oprot.writeString(struct.topic);
}
 
Example 14
Source File: CounterColumn.java    From stratio-cassandra with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, CounterColumn struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeBinary(struct.name);
  oprot.writeI64(struct.value);
}
 
Example 15
Source File: RowSet.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, RowSet struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  {
    oprot.writeI32(struct.rows.size());
    for (Row _iter304 : struct.rows)
    {
      _iter304.write(oprot);
    }
  }
  oprot.writeByte(struct.flags);
  oprot.writeI32(struct.cursorId);
  oprot.writeI32(struct.statementId);
  oprot.writeI32(struct.connId);
  BitSet optionals = new BitSet();
  if (struct.isSetToken()) {
    optionals.set(0);
  }
  if (struct.isSetSource()) {
    optionals.set(1);
  }
  if (struct.isSetOffset()) {
    optionals.set(2);
  }
  if (struct.isSetMetadata()) {
    optionals.set(3);
  }
  if (struct.isSetCursorName()) {
    optionals.set(4);
  }
  if (struct.isSetWarnings()) {
    optionals.set(5);
  }
  if (struct.isSetRowIdsForUpdateOrDelete()) {
    optionals.set(6);
  }
  oprot.writeBitSet(optionals, 7);
  if (struct.isSetToken()) {
    oprot.writeBinary(struct.token);
  }
  if (struct.isSetSource()) {
    struct.source.write(oprot);
  }
  if (struct.isSetOffset()) {
    oprot.writeI32(struct.offset);
  }
  if (struct.isSetMetadata()) {
    {
      oprot.writeI32(struct.metadata.size());
      for (ColumnDescriptor _iter305 : struct.metadata)
      {
        _iter305.write(oprot);
      }
    }
  }
  if (struct.isSetCursorName()) {
    oprot.writeString(struct.cursorName);
  }
  if (struct.isSetWarnings()) {
    struct.warnings.write(oprot);
  }
  if (struct.isSetRowIdsForUpdateOrDelete()) {
    {
      oprot.writeI32(struct.rowIdsForUpdateOrDelete.size());
      for (long _iter306 : struct.rowIdsForUpdateOrDelete)
      {
        oprot.writeI64(_iter306);
      }
    }
  }
}
 
Example 16
Source File: Message.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Message struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetTopic()) {
    optionals.set(0);
  }
  if (struct.isSetKey()) {
    optionals.set(1);
  }
  if (struct.isSetValue()) {
    optionals.set(2);
  }
  if (struct.isSetHashId()) {
    optionals.set(3);
  }
  if (struct.isSetTags()) {
    optionals.set(4);
  }
  if (struct.isSetPartitionId()) {
    optionals.set(5);
  }
  if (struct.isSetBody()) {
    optionals.set(6);
  }
  if (struct.isSetVersion()) {
    optionals.set(7);
  }
  if (struct.isSetProperties()) {
    optionals.set(8);
  }
  oprot.writeBitSet(optionals, 9);
  if (struct.isSetTopic()) {
    oprot.writeString(struct.topic);
  }
  if (struct.isSetKey()) {
    oprot.writeString(struct.key);
  }
  if (struct.isSetValue()) {
    oprot.writeString(struct.value);
  }
  if (struct.isSetHashId()) {
    oprot.writeI64(struct.hashId);
  }
  if (struct.isSetTags()) {
    oprot.writeString(struct.tags);
  }
  if (struct.isSetPartitionId()) {
    oprot.writeI32(struct.partitionId);
  }
  if (struct.isSetBody()) {
    oprot.writeBinary(struct.body);
  }
  if (struct.isSetVersion()) {
    oprot.writeString(struct.version);
  }
  if (struct.isSetProperties()) {
    {
      oprot.writeI32(struct.properties.size());
      for (Map.Entry<String, String> _iter25 : struct.properties.entrySet())
      {
        oprot.writeString(_iter25.getKey());
        oprot.writeString(_iter25.getValue());
      }
    }
  }
}
 
Example 17
Source File: DelayMessage.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, DelayMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetTopic()) {
    optionals.set(0);
  }
  if (struct.isSetUniqDelayMsgId()) {
    optionals.set(1);
  }
  if (struct.isSetBody()) {
    optionals.set(2);
  }
  if (struct.isSetTags()) {
    optionals.set(3);
  }
  if (struct.isSetAction()) {
    optionals.set(4);
  }
  if (struct.isSetTimestamp()) {
    optionals.set(5);
  }
  if (struct.isSetDmsgtype()) {
    optionals.set(6);
  }
  if (struct.isSetInterval()) {
    optionals.set(7);
  }
  if (struct.isSetExpire()) {
    optionals.set(8);
  }
  if (struct.isSetTimes()) {
    optionals.set(9);
  }
  if (struct.isSetUuid()) {
    optionals.set(10);
  }
  if (struct.isSetVersion()) {
    optionals.set(11);
  }
  if (struct.isSetProperties()) {
    optionals.set(12);
  }
  oprot.writeBitSet(optionals, 13);
  if (struct.isSetTopic()) {
    oprot.writeString(struct.topic);
  }
  if (struct.isSetUniqDelayMsgId()) {
    oprot.writeString(struct.uniqDelayMsgId);
  }
  if (struct.isSetBody()) {
    oprot.writeBinary(struct.body);
  }
  if (struct.isSetTags()) {
    oprot.writeString(struct.tags);
  }
  if (struct.isSetAction()) {
    oprot.writeI32(struct.action);
  }
  if (struct.isSetTimestamp()) {
    oprot.writeI64(struct.timestamp);
  }
  if (struct.isSetDmsgtype()) {
    oprot.writeI32(struct.dmsgtype);
  }
  if (struct.isSetInterval()) {
    oprot.writeI64(struct.interval);
  }
  if (struct.isSetExpire()) {
    oprot.writeI64(struct.expire);
  }
  if (struct.isSetTimes()) {
    oprot.writeI64(struct.times);
  }
  if (struct.isSetUuid()) {
    oprot.writeString(struct.uuid);
  }
  if (struct.isSetVersion()) {
    oprot.writeString(struct.version);
  }
  if (struct.isSetProperties()) {
    {
      oprot.writeI32(struct.properties.size());
      for (Map.Entry<String, String> _iter35 : struct.properties.entrySet())
      {
        oprot.writeString(_iter35.getKey());
        oprot.writeString(_iter35.getValue());
      }
    }
  }
}
 
Example 18
Source File: Message.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Message struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetKey()) {
    optionals.set(0);
  }
  if (struct.isSetValue()) {
    optionals.set(1);
  }
  if (struct.isSetTag()) {
    optionals.set(2);
  }
  if (struct.isSetOffset()) {
    optionals.set(3);
  }
  if (struct.isSetProperties()) {
    optionals.set(4);
  }
  oprot.writeBitSet(optionals, 5);
  if (struct.isSetKey()) {
    oprot.writeString(struct.key);
  }
  if (struct.isSetValue()) {
    oprot.writeBinary(struct.value);
  }
  if (struct.isSetTag()) {
    oprot.writeString(struct.tag);
  }
  if (struct.isSetOffset()) {
    oprot.writeI64(struct.offset);
  }
  if (struct.isSetProperties()) {
    {
      oprot.writeI32(struct.properties.size());
      for (Map.Entry<String, String> _iter5 : struct.properties.entrySet())
      {
        oprot.writeString(_iter5.getKey());
        oprot.writeString(_iter5.getValue());
      }
    }
  }
}
 
Example 19
Source File: Message.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Message struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetKey()) {
    optionals.set(0);
  }
  if (struct.isSetValue()) {
    optionals.set(1);
  }
  if (struct.isSetTag()) {
    optionals.set(2);
  }
  if (struct.isSetOffset()) {
    optionals.set(3);
  }
  if (struct.isSetProperties()) {
    optionals.set(4);
  }
  oprot.writeBitSet(optionals, 5);
  if (struct.isSetKey()) {
    oprot.writeString(struct.key);
  }
  if (struct.isSetValue()) {
    oprot.writeBinary(struct.value);
  }
  if (struct.isSetTag()) {
    oprot.writeString(struct.tag);
  }
  if (struct.isSetOffset()) {
    oprot.writeI64(struct.offset);
  }
  if (struct.isSetProperties()) {
    {
      oprot.writeI32(struct.properties.size());
      for (Map.Entry<String, String> _iter5 : struct.properties.entrySet())
      {
        oprot.writeString(_iter5.getKey());
        oprot.writeString(_iter5.getValue());
      }
    }
  }
}
 
Example 20
Source File: DelayMessage.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, DelayMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetTopic()) {
    optionals.set(0);
  }
  if (struct.isSetUniqDelayMsgId()) {
    optionals.set(1);
  }
  if (struct.isSetBody()) {
    optionals.set(2);
  }
  if (struct.isSetTags()) {
    optionals.set(3);
  }
  if (struct.isSetAction()) {
    optionals.set(4);
  }
  if (struct.isSetTimestamp()) {
    optionals.set(5);
  }
  if (struct.isSetDmsgtype()) {
    optionals.set(6);
  }
  if (struct.isSetInterval()) {
    optionals.set(7);
  }
  if (struct.isSetExpire()) {
    optionals.set(8);
  }
  if (struct.isSetTimes()) {
    optionals.set(9);
  }
  if (struct.isSetUuid()) {
    optionals.set(10);
  }
  if (struct.isSetVersion()) {
    optionals.set(11);
  }
  if (struct.isSetProperties()) {
    optionals.set(12);
  }
  oprot.writeBitSet(optionals, 13);
  if (struct.isSetTopic()) {
    oprot.writeString(struct.topic);
  }
  if (struct.isSetUniqDelayMsgId()) {
    oprot.writeString(struct.uniqDelayMsgId);
  }
  if (struct.isSetBody()) {
    oprot.writeBinary(struct.body);
  }
  if (struct.isSetTags()) {
    oprot.writeString(struct.tags);
  }
  if (struct.isSetAction()) {
    oprot.writeI32(struct.action);
  }
  if (struct.isSetTimestamp()) {
    oprot.writeI64(struct.timestamp);
  }
  if (struct.isSetDmsgtype()) {
    oprot.writeI32(struct.dmsgtype);
  }
  if (struct.isSetInterval()) {
    oprot.writeI64(struct.interval);
  }
  if (struct.isSetExpire()) {
    oprot.writeI64(struct.expire);
  }
  if (struct.isSetTimes()) {
    oprot.writeI64(struct.times);
  }
  if (struct.isSetUuid()) {
    oprot.writeString(struct.uuid);
  }
  if (struct.isSetVersion()) {
    oprot.writeString(struct.version);
  }
  if (struct.isSetProperties()) {
    {
      oprot.writeI32(struct.properties.size());
      for (Map.Entry<String, String> _iter35 : struct.properties.entrySet())
      {
        oprot.writeString(_iter35.getKey());
        oprot.writeString(_iter35.getValue());
      }
    }
  }
}