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

The following examples show how to use org.apache.thrift.protocol.TTupleProtocol#writeI64() . 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: Annotation.java    From incubator-retired-htrace with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Annotation struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetTimestamp()) {
    optionals.set(0);
  }
  if (struct.isSetValue()) {
    optionals.set(1);
  }
  if (struct.isSetHost()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 4);
  if (struct.isSetTimestamp()) {
    oprot.writeI64(struct.timestamp);
  }
  if (struct.isSetValue()) {
    oprot.writeString(struct.value);
  }
  if (struct.isSetHost()) {
    struct.host.write(oprot);
  }
}
 
Example 2
Source File: TPathsUpdate.java    From incubator-sentry with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TPathsUpdate struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeBool(struct.hasFullImage);
  oprot.writeI64(struct.seqNum);
  {
    oprot.writeI32(struct.pathChanges.size());
    for (TPathChanges _iter62 : struct.pathChanges)
    {
      _iter62.write(oprot);
    }
  }
  BitSet optionals = new BitSet();
  if (struct.isSetPathsDump()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetPathsDump()) {
    struct.pathsDump.write(oprot);
  }
}
 
Example 3
Source File: AckResult.java    From DDMQ with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, AckResult struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.consumerId);
  oprot.writeString(struct.groupId);
  oprot.writeString(struct.cluster);
  {
    oprot.writeI32(struct.offsets.size());
    for (Map.Entry<String, Map<String,Long>> _iter80 : struct.offsets.entrySet())
    {
      oprot.writeString(_iter80.getKey());
      {
        oprot.writeI32(_iter80.getValue().size());
        for (Map.Entry<String, Long> _iter81 : _iter80.getValue().entrySet())
        {
          oprot.writeString(_iter81.getKey());
          oprot.writeI64(_iter81.getValue());
        }
      }
    }
  }
}
 
Example 4
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 5
Source File: ConsumeRequest.java    From luxun with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ConsumeRequest struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.topic);
  BitSet optionals = new BitSet();
  if (struct.isSetFanoutId()) {
    optionals.set(0);
  }
  if (struct.isSetStartIndex()) {
    optionals.set(1);
  }
  if (struct.isSetMaxFetchSize()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetFanoutId()) {
    oprot.writeString(struct.fanoutId);
  }
  if (struct.isSetStartIndex()) {
    oprot.writeI64(struct.startIndex);
  }
  if (struct.isSetMaxFetchSize()) {
    oprot.writeI32(struct.maxFetchSize);
  }
}
 
Example 6
Source File: BlobChunk.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, BlobChunk struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeBinary(struct.chunk);
  oprot.writeBool(struct.last);
  BitSet optionals = new BitSet();
  if (struct.isSetLobId()) {
    optionals.set(0);
  }
  if (struct.isSetOffset()) {
    optionals.set(1);
  }
  if (struct.isSetTotalLength()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetLobId()) {
    oprot.writeI32(struct.lobId);
  }
  if (struct.isSetOffset()) {
    oprot.writeI64(struct.offset);
  }
  if (struct.isSetTotalLength()) {
    oprot.writeI64(struct.totalLength);
  }
}
 
Example 7
Source File: Timestamp.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Timestamp struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeI64(struct.secsSinceEpoch);
  BitSet optionals = new BitSet();
  if (struct.isSetNanos()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetNanos()) {
    oprot.writeI32(struct.nanos);
  }
}
 
Example 8
Source File: SentryHDFSService.java    From incubator-sentry with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, check_hms_seq_num_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.writeI64(struct.success);
  }
}
 
Example 9
Source File: SentryHDFSService.java    From incubator-sentry with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, check_hms_seq_num_args struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetPathSeqNum()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetPathSeqNum()) {
    oprot.writeI64(struct.pathSeqNum);
  }
}
 
Example 10
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 11
Source File: FetchRequest.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, FetchRequest struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.consumerId);
  oprot.writeString(struct.groupId);
  oprot.writeString(struct.cluster);
  BitSet optionals = new BitSet();
  if (struct.isSetFetchOffset()) {
    optionals.set(0);
  }
  if (struct.isSetMaxBatchSize()) {
    optionals.set(1);
  }
  if (struct.isSetMaxLingerTime()) {
    optionals.set(2);
  }
  if (struct.isSetVersion()) {
    optionals.set(3);
  }
  oprot.writeBitSet(optionals, 4);
  if (struct.isSetFetchOffset()) {
    {
      oprot.writeI32(struct.fetchOffset.size());
      for (Map.Entry<String, Map<String,Long>> _iter44 : struct.fetchOffset.entrySet())
      {
        oprot.writeString(_iter44.getKey());
        {
          oprot.writeI32(_iter44.getValue().size());
          for (Map.Entry<String, Long> _iter45 : _iter44.getValue().entrySet())
          {
            oprot.writeString(_iter45.getKey());
            oprot.writeI64(_iter45.getValue());
          }
        }
      }
    }
  }
  if (struct.isSetMaxBatchSize()) {
    oprot.writeI32(struct.maxBatchSize);
  }
  if (struct.isSetMaxLingerTime()) {
    oprot.writeI32(struct.maxLingerTime);
  }
  if (struct.isSetVersion()) {
    oprot.writeString(struct.version);
  }
}
 
Example 12
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 13
Source File: Response.java    From opencron with Apache License 2.0 4 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.isSetAction()) {
        optionals.set(0);
    }
    if (struct.isSetResult()) {
        optionals.set(1);
    }
    if (struct.isSetExitCode()) {
        optionals.set(2);
    }
    if (struct.isSetSuccess()) {
        optionals.set(3);
    }
    if (struct.isSetStartTime()) {
        optionals.set(4);
    }
    if (struct.isSetEndTime()) {
        optionals.set(5);
    }
    if (struct.isSetMessage()) {
        optionals.set(6);
    }
    oprot.writeBitSet(optionals, 7);
    if (struct.isSetAction()) {
        oprot.writeI32(struct.action.getValue());
    }
    if (struct.isSetResult()) {
        {
            oprot.writeI32(struct.result.size());
            for (Map.Entry<String, String> _iter15 : struct.result.entrySet())
            {
                oprot.writeString(_iter15.getKey());
                oprot.writeString(_iter15.getValue());
            }
        }
    }
    if (struct.isSetExitCode()) {
        oprot.writeI32(struct.exitCode);
    }
    if (struct.isSetSuccess()) {
        oprot.writeBool(struct.success);
    }
    if (struct.isSetStartTime()) {
        oprot.writeI64(struct.startTime);
    }
    if (struct.isSetEndTime()) {
        oprot.writeI64(struct.endTime);
    }
    if (struct.isSetMessage()) {
        oprot.writeString(struct.message);
    }
}
 
Example 14
Source File: FetchRequest.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, FetchRequest struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.consumerId);
  oprot.writeString(struct.groupId);
  oprot.writeString(struct.cluster);
  BitSet optionals = new BitSet();
  if (struct.isSetFetchOffset()) {
    optionals.set(0);
  }
  if (struct.isSetMaxBatchSize()) {
    optionals.set(1);
  }
  if (struct.isSetMaxLingerTime()) {
    optionals.set(2);
  }
  if (struct.isSetVersion()) {
    optionals.set(3);
  }
  oprot.writeBitSet(optionals, 4);
  if (struct.isSetFetchOffset()) {
    {
      oprot.writeI32(struct.fetchOffset.size());
      for (Map.Entry<String, Map<String,Long>> _iter44 : struct.fetchOffset.entrySet())
      {
        oprot.writeString(_iter44.getKey());
        {
          oprot.writeI32(_iter44.getValue().size());
          for (Map.Entry<String, Long> _iter45 : _iter44.getValue().entrySet())
          {
            oprot.writeString(_iter45.getKey());
            oprot.writeI64(_iter45.getValue());
          }
        }
      }
    }
  }
  if (struct.isSetMaxBatchSize()) {
    oprot.writeI32(struct.maxBatchSize);
  }
  if (struct.isSetMaxLingerTime()) {
    oprot.writeI32(struct.maxLingerTime);
  }
  if (struct.isSetVersion()) {
    oprot.writeString(struct.version);
  }
}
 
Example 15
Source File: RDF_Decimal.java    From rdf-delta with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, RDF_Decimal struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeI64(struct.value);
  oprot.writeI32(struct.scale);
}
 
Example 16
Source File: DelayMeta.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, DelayMeta struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetTimestamp()) {
    optionals.set(0);
  }
  if (struct.isSetDmsgtype()) {
    optionals.set(1);
  }
  if (struct.isSetInterval()) {
    optionals.set(2);
  }
  if (struct.isSetExpire()) {
    optionals.set(3);
  }
  if (struct.isSetTimes()) {
    optionals.set(4);
  }
  if (struct.isSetProperties()) {
    optionals.set(5);
  }
  oprot.writeBitSet(optionals, 6);
  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.isSetProperties()) {
    {
      oprot.writeI32(struct.properties.size());
      for (Map.Entry<String, String> _iter45 : struct.properties.entrySet())
      {
        oprot.writeString(_iter45.getKey());
        oprot.writeString(_iter45.getValue());
      }
    }
  }
}
 
Example 17
Source File: DelayMeta.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, DelayMeta struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetTimestamp()) {
    optionals.set(0);
  }
  if (struct.isSetDmsgtype()) {
    optionals.set(1);
  }
  if (struct.isSetInterval()) {
    optionals.set(2);
  }
  if (struct.isSetExpire()) {
    optionals.set(3);
  }
  if (struct.isSetTimes()) {
    optionals.set(4);
  }
  if (struct.isSetProperties()) {
    optionals.set(5);
  }
  oprot.writeBitSet(optionals, 6);
  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.isSetProperties()) {
    {
      oprot.writeI32(struct.properties.size());
      for (Map.Entry<String, String> _iter45 : struct.properties.entrySet())
      {
        oprot.writeString(_iter45.getKey());
        oprot.writeString(_iter45.getValue());
      }
    }
  }
}
 
Example 18
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 19
Source File: RestMessage.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, RestMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetType()) {
    optionals.set(0);
  }
  if (struct.isSetMode()) {
    optionals.set(1);
  }
  if (struct.isSetUrl()) {
    optionals.set(2);
  }
  if (struct.isSetParams()) {
    optionals.set(3);
  }
  if (struct.isSetHeaders()) {
    optionals.set(4);
  }
  if (struct.isSetTimestamp()) {
    optionals.set(5);
  }
  if (struct.isSetExpire()) {
    optionals.set(6);
  }
  if (struct.isSetTimeout()) {
    optionals.set(7);
  }
  if (struct.isSetRetryCnt()) {
    optionals.set(8);
  }
  oprot.writeBitSet(optionals, 9);
  if (struct.isSetType()) {
    oprot.writeByte(struct.type);
  }
  if (struct.isSetMode()) {
    oprot.writeByte(struct.mode);
  }
  if (struct.isSetUrl()) {
    oprot.writeString(struct.url);
  }
  if (struct.isSetParams()) {
    {
      oprot.writeI32(struct.params.size());
      for (Map.Entry<String, String> _iter10 : struct.params.entrySet())
      {
        oprot.writeString(_iter10.getKey());
        oprot.writeString(_iter10.getValue());
      }
    }
  }
  if (struct.isSetHeaders()) {
    {
      oprot.writeI32(struct.headers.size());
      for (Map.Entry<String, String> _iter11 : struct.headers.entrySet())
      {
        oprot.writeString(_iter11.getKey());
        oprot.writeString(_iter11.getValue());
      }
    }
  }
  if (struct.isSetTimestamp()) {
    oprot.writeI64(struct.timestamp);
  }
  if (struct.isSetExpire()) {
    oprot.writeI64(struct.expire);
  }
  if (struct.isSetTimeout()) {
    oprot.writeI64(struct.timeout);
  }
  if (struct.isSetRetryCnt()) {
    oprot.writeI32(struct.retryCnt);
  }
}
 
Example 20
Source File: RestMessage.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, RestMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetType()) {
    optionals.set(0);
  }
  if (struct.isSetMode()) {
    optionals.set(1);
  }
  if (struct.isSetUrl()) {
    optionals.set(2);
  }
  if (struct.isSetParams()) {
    optionals.set(3);
  }
  if (struct.isSetHeaders()) {
    optionals.set(4);
  }
  if (struct.isSetTimestamp()) {
    optionals.set(5);
  }
  if (struct.isSetExpire()) {
    optionals.set(6);
  }
  if (struct.isSetTimeout()) {
    optionals.set(7);
  }
  if (struct.isSetRetryCnt()) {
    optionals.set(8);
  }
  oprot.writeBitSet(optionals, 9);
  if (struct.isSetType()) {
    oprot.writeByte(struct.type);
  }
  if (struct.isSetMode()) {
    oprot.writeByte(struct.mode);
  }
  if (struct.isSetUrl()) {
    oprot.writeString(struct.url);
  }
  if (struct.isSetParams()) {
    {
      oprot.writeI32(struct.params.size());
      for (Map.Entry<String, String> _iter10 : struct.params.entrySet())
      {
        oprot.writeString(_iter10.getKey());
        oprot.writeString(_iter10.getValue());
      }
    }
  }
  if (struct.isSetHeaders()) {
    {
      oprot.writeI32(struct.headers.size());
      for (Map.Entry<String, String> _iter11 : struct.headers.entrySet())
      {
        oprot.writeString(_iter11.getKey());
        oprot.writeString(_iter11.getValue());
      }
    }
  }
  if (struct.isSetTimestamp()) {
    oprot.writeI64(struct.timestamp);
  }
  if (struct.isSetExpire()) {
    oprot.writeI64(struct.expire);
  }
  if (struct.isSetTimeout()) {
    oprot.writeI64(struct.timeout);
  }
  if (struct.isSetRetryCnt()) {
    oprot.writeI32(struct.retryCnt);
  }
}