本文整理匯總了Java中org.apache.thrift.protocol.TTupleProtocol類的典型用法代碼示例。如果您正苦於以下問題:Java TTupleProtocol類的具體用法?Java TTupleProtocol怎麽用?Java TTupleProtocol使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TTupleProtocol類屬於org.apache.thrift.protocol包,在下文中一共展示了TTupleProtocol類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: read
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Log_args struct)
throws TException
{
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.messages = new ArrayList<>(_list5.size);
for (int _i6 = 0; _i6 < _list5.size; ++_i6) {
LogEntry _elem7; // required
_elem7 = new LogEntry();
_elem7.read(iprot);
struct.messages.add(_elem7);
}
}
struct.setMessagesIsSet(true);
}
}
示例2: write
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getRowWithColumnsTs_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetIo()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
for (TRowResult _iter222 : struct.success)
{
_iter222.write(oprot);
}
}
}
if (struct.isSetIo()) {
struct.io.write(oprot);
}
}
示例3: read
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getMultiple_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list145 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.success = new ArrayList<TResult>(_list145.size);
TResult _elem146;
for (int _i147 = 0; _i147 < _list145.size; ++_i147)
{
_elem146 = new TResult();
_elem146.read(iprot);
struct.success.add(_elem146);
}
}
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.io = new TIOError();
struct.io.read(iprot);
struct.setIoIsSet(true);
}
}
示例4: read
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ThriftTestObject struct) throws TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(5);
if (incoming.get(0)) {
struct.field1 = iprot.readString();
struct.setField1IsSet(true);
}
if (incoming.get(1)) {
struct.field2 = iprot.readString();
struct.setField2IsSet(true);
}
if (incoming.get(2)) {
struct.field3 = iprot.readString();
struct.setField3IsSet(true);
}
if (incoming.get(3)) {
struct.field4 = iprot.readString();
struct.setField4IsSet(true);
}
if (incoming.get(4)) {
struct.field5 = iprot.readString();
struct.setField5IsSet(true);
}
}
示例5: read
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, instructionInvokeAsync_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.success = new ArrayList<Reinstruct>(_list13.size);
Reinstruct _elem14;
for (int _i15 = 0; _i15 < _list13.size; ++_i15)
{
_elem14 = new Reinstruct();
_elem14.read(iprot);
struct.success.add(_elem14);
}
}
struct.setSuccessIsSet(true);
}
}
示例6: write
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, giveUpTask_args struct) throws TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetTaskId()) {
optionals.set(0);
}
if (struct.isSetReason()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetTaskId()) {
oprot.writeString(struct.taskId);
}
if (struct.isSetReason()) {
oprot.writeString(struct.reason);
}
}
示例7: read
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ClusterJoinResponseMessage struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.header = new AsyncMessageHeader();
struct.header.read(iprot);
struct.setHeaderIsSet(true);
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.newNodeId = iprot.readI16();
struct.setNewNodeIdIsSet(true);
}
if (incoming.get(1)) {
{
org.apache.thrift.protocol.TList _list69 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.nodeStore = new ArrayList<KeyedValues>(_list69.size);
for (int _i70 = 0; _i70 < _list69.size; ++_i70)
{
KeyedValues _elem71; // required
_elem71 = new KeyedValues();
_elem71.read(iprot);
struct.nodeStore.add(_elem71);
}
}
struct.setNodeStoreIsSet(true);
}
}
示例8: write
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, VectorClock struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetVersions()) {
optionals.set(0);
}
if (struct.isSetTimestamp()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetVersions()) {
{
oprot.writeI32(struct.versions.size());
for (ClockEntry _iter4 : struct.versions)
{
_iter4.write(oprot);
}
}
}
if (struct.isSetTimestamp()) {
oprot.writeI64(struct.timestamp);
}
}
示例9: read
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, incrementRows_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list453 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.increments = new ArrayList<TIncrement>(_list453.size);
TIncrement _elem454;
for (int _i455 = 0; _i455 < _list453.size; ++_i455)
{
_elem454 = new TIncrement();
_elem454.read(iprot);
struct.increments.add(_elem454);
}
}
struct.setIncrementsIsSet(true);
}
}
示例10: write
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, CursorRequestMessage struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
struct.header.write(oprot);
BitSet optionals = new BitSet();
if (struct.isSetStoreName()) {
optionals.set(0);
}
if (struct.isSetCursorId()) {
optionals.set(1);
}
if (struct.isSetClose()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetStoreName()) {
oprot.writeString(struct.storeName);
}
if (struct.isSetCursorId()) {
oprot.writeI32(struct.cursorId);
}
if (struct.isSetClose()) {
oprot.writeBool(struct.close);
}
}
示例11: write
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, AuthChallengeResponse struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetChallenge()) {
optionals.set(0);
}
if (struct.isSetResponse()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetChallenge()) {
oprot.writeString(struct.challenge);
}
if (struct.isSetResponse()) {
oprot.writeString(struct.response);
}
}
示例12: write
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ClusterJoinResponseMessage struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
struct.header.write(oprot);
BitSet optionals = new BitSet();
if (struct.isSetNewNodeId()) {
optionals.set(0);
}
if (struct.isSetNodeStore()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetNewNodeId()) {
oprot.writeI16(struct.newNodeId);
}
if (struct.isSetNodeStore()) {
{
oprot.writeI32(struct.nodeStore.size());
for (KeyedValues _iter68 : struct.nodeStore)
{
_iter68.write(oprot);
}
}
}
}
示例13: write
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, SyncError struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetErrorCode()) {
optionals.set(0);
}
if (struct.isSetMessage()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetErrorCode()) {
oprot.writeI32(struct.errorCode);
}
if (struct.isSetMessage()) {
oprot.writeString(struct.message);
}
}
示例14: read
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, CursorResponseMessage struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.header = new AsyncMessageHeader();
struct.header.read(iprot);
struct.setHeaderIsSet(true);
struct.cursorId = iprot.readI32();
struct.setCursorIdIsSet(true);
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list61 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.values = new ArrayList<KeyedValues>(_list61.size);
for (int _i62 = 0; _i62 < _list61.size; ++_i62)
{
KeyedValues _elem63; // required
_elem63 = new KeyedValues();
_elem63.read(iprot);
struct.values.add(_elem63);
}
}
struct.setValuesIsSet(true);
}
}
示例15: write
import org.apache.thrift.protocol.TTupleProtocol; //導入依賴的package包/類
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, HelloMessage struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
struct.header.write(oprot);
BitSet optionals = new BitSet();
if (struct.isSetNodeId()) {
optionals.set(0);
}
if (struct.isSetAuthScheme()) {
optionals.set(1);
}
if (struct.isSetAuthChallengeResponse()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetNodeId()) {
oprot.writeI16(struct.nodeId);
}
if (struct.isSetAuthScheme()) {
oprot.writeI32(struct.authScheme.getValue());
}
if (struct.isSetAuthChallengeResponse()) {
struct.authChallengeResponse.write(oprot);
}
}