org.apache.thrift.protocol.TTupleProtocol Java Examples

The following examples show how to use org.apache.thrift.protocol.TTupleProtocol. 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: TopologySummary.java    From jstorm with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TopologySummary struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.id = iprot.readString();
  struct.set_id_isSet(true);
  struct.name = iprot.readString();
  struct.set_name_isSet(true);
  struct.status = iprot.readString();
  struct.set_status_isSet(true);
  struct.uptimeSecs = iprot.readI32();
  struct.set_uptimeSecs_isSet(true);
  struct.numTasks = iprot.readI32();
  struct.set_numTasks_isSet(true);
  struct.numWorkers = iprot.readI32();
  struct.set_numWorkers_isSet(true);
  BitSet incoming = iprot.readBitSet(1);
  if (incoming.get(0)) {
    struct.errorInfo = iprot.readString();
    struct.set_errorInfo_isSet(true);
  }
}
 
Example #2
Source File: ConsumerService.java    From DDMQ with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getConsumeStats_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 _list115 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
      struct.success = new ArrayList<ConsumeStats>(_list115.size);
      ConsumeStats _elem116;
      for (int _i117 = 0; _i117 < _list115.size; ++_i117)
      {
        _elem116 = new ConsumeStats();
        _elem116.read(iprot);
        struct.success.add(_elem116);
      }
    }
    struct.setSuccessIsSet(true);
  }
  if (incoming.get(1)) {
    struct.error = new PullException();
    struct.error.read(iprot);
    struct.setErrorIsSet(true);
  }
}
 
Example #3
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 #4
Source File: ClobChunk.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, ClobChunk struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(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 #5
Source File: Result.java    From suro with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Result struct) throws TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetResultCode()) {
    optionals.set(0);
  }
  if (struct.isSetMessage()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetResultCode()) {
    oprot.writeI32(struct.resultCode.getValue());
  }
  if (struct.isSetMessage()) {
    oprot.writeString(struct.message);
  }
}
 
Example #6
Source File: BinaryAnnotation.java    From incubator-retired-htrace with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, BinaryAnnotation struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(4);
  if (incoming.get(0)) {
    struct.key = iprot.readString();
    struct.setKeyIsSet(true);
  }
  if (incoming.get(1)) {
    struct.value = iprot.readBinary();
    struct.setValueIsSet(true);
  }
  if (incoming.get(2)) {
    struct.annotation_type = AnnotationType.findByValue(iprot.readI32());
    struct.setAnnotation_typeIsSet(true);
  }
  if (incoming.get(3)) {
    struct.host = new Endpoint();
    struct.host.read(iprot);
    struct.setHostIsSet(true);
  }
}
 
Example #7
Source File: EndpointDetails.java    From stratio-cassandra with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, EndpointDetails struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(3);
  if (incoming.get(0)) {
    struct.host = iprot.readString();
    struct.setHostIsSet(true);
  }
  if (incoming.get(1)) {
    struct.datacenter = iprot.readString();
    struct.setDatacenterIsSet(true);
  }
  if (incoming.get(2)) {
    struct.rack = iprot.readString();
    struct.setRackIsSet(true);
  }
}
 
Example #8
Source File: IndexClause.java    From stratio-cassandra with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, IndexClause struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  {
    org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
    struct.expressions = new ArrayList<IndexExpression>(_list29.size);
    for (int _i30 = 0; _i30 < _list29.size; ++_i30)
    {
      IndexExpression _elem31;
      _elem31 = new IndexExpression();
      _elem31.read(iprot);
      struct.expressions.add(_elem31);
    }
  }
  struct.setExpressionsIsSet(true);
  struct.start_key = iprot.readBinary();
  struct.setStart_keyIsSet(true);
  struct.count = iprot.readI32();
  struct.setCountIsSet(true);
}
 
Example #9
Source File: TimedOutException.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, TimedOutException struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetAcknowledged_by()) {
    optionals.set(0);
  }
  if (struct.isSetAcknowledged_by_batchlog()) {
    optionals.set(1);
  }
  if (struct.isSetPaxos_in_progress()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetAcknowledged_by()) {
    oprot.writeI32(struct.acknowledged_by);
  }
  if (struct.isSetAcknowledged_by_batchlog()) {
    oprot.writeBool(struct.acknowledged_by_batchlog);
  }
  if (struct.isSetPaxos_in_progress()) {
    oprot.writeBool(struct.paxos_in_progress);
  }
}
 
Example #10
Source File: Context.java    From DDMQ with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Context struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(3);
  if (incoming.get(0)) {
    struct.groupId = iprot.readString();
    struct.setGroupIdIsSet(true);
  }
  if (incoming.get(1)) {
    struct.topic = iprot.readString();
    struct.setTopicIsSet(true);
  }
  if (incoming.get(2)) {
    struct.qid = iprot.readString();
    struct.setQidIsSet(true);
  }
}
 
Example #11
Source File: Pistachios.java    From Pistachio with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, processEvent_args struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetEvent()) {
    optionals.set(0);
  }
  if (struct.isSetJar_url()) {
    optionals.set(1);
  }
  if (struct.isSetClass_full_name()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetEvent()) {
    oprot.writeBinary(struct.event);
  }
  if (struct.isSetJar_url()) {
    oprot.writeString(struct.jar_url);
  }
  if (struct.isSetClass_full_name()) {
    oprot.writeString(struct.class_full_name);
  }
}
 
Example #12
Source File: FetchResponse.java    From DDMQ with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, FetchResponse struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  {
    oprot.writeI32(struct.results.size());
    for (QidResponse _iter66 : struct.results)
    {
      _iter66.write(oprot);
    }
  }
  BitSet optionals = new BitSet();
  if (struct.isSetCode()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetCode()) {
    oprot.writeI32(struct.code);
  }
}
 
Example #13
Source File: ConsumeResponse.java    From luxun with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ConsumeResponse struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.result = new Result();
  struct.result.read(iprot);
  struct.setResultIsSet(true);
  BitSet incoming = iprot.readBitSet(2);
  if (incoming.get(0)) {
    {
      org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
      struct.itemList = new ArrayList<ByteBuffer>(_list5.size);
      ByteBuffer _elem6;
      for (int _i7 = 0; _i7 < _list5.size; ++_i7)
      {
        _elem6 = iprot.readBinary();
        struct.itemList.add(_elem6);
      }
    }
    struct.setItemListIsSet(true);
  }
  if (incoming.get(1)) {
    struct.lastConsumedIndex = iprot.readI64();
    struct.setLastConsumedIndexIsSet(true);
  }
}
 
Example #14
Source File: ErrorMessage.java    From floodlight_with_topoguard with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ErrorMessage 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.error = new SyncError();
    struct.error.read(iprot);
    struct.setErrorIsSet(true);
  }
  if (incoming.get(1)) {
    struct.type = MessageType.findByValue(iprot.readI32());
    struct.setTypeIsSet(true);
  }
}
 
Example #15
Source File: TweetSearchResult.java    From octo-rpc with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TweetSearchResult 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.tweets = new ArrayList<Tweet>(_list5.size);
      Tweet _elem6;
      for (int _i7 = 0; _i7 < _list5.size; ++_i7)
      {
        _elem6 = new Tweet();
        _elem6.read(iprot);
        struct.tweets.add(_elem6);
      }
    }
    struct.setTweetsIsSet(true);
  }
}
 
Example #16
Source File: Pistachios.java    From Pistachio with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, processEvent_args struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(3);
  if (incoming.get(0)) {
    struct.event = iprot.readBinary();
    struct.setEventIsSet(true);
  }
  if (incoming.get(1)) {
    struct.jar_url = iprot.readString();
    struct.setJar_urlIsSet(true);
  }
  if (incoming.get(2)) {
    struct.class_full_name = iprot.readString();
    struct.setClass_full_nameIsSet(true);
  }
}
 
Example #17
Source File: ConsumerService.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, fetch_args struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetRequest()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetRequest()) {
    struct.request.write(oprot);
  }
}
 
Example #18
Source File: TDropSentryRoleRequest.java    From incubator-sentry with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TDropSentryRoleRequest struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.protocol_version = iprot.readI32();
  struct.setProtocol_versionIsSet(true);
  struct.requestorUserName = iprot.readString();
  struct.setRequestorUserNameIsSet(true);
  struct.roleName = iprot.readString();
  struct.setRoleNameIsSet(true);
}
 
Example #19
Source File: TSentryConfigValueRequest.java    From incubator-sentry with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TSentryConfigValueRequest struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.protocol_version = iprot.readI32();
  struct.setProtocol_versionIsSet(true);
  struct.propertyName = iprot.readString();
  struct.setPropertyNameIsSet(true);
  BitSet incoming = iprot.readBitSet(1);
  if (incoming.get(0)) {
    struct.defaultValue = iprot.readString();
    struct.setDefaultValueIsSet(true);
  }
}
 
Example #20
Source File: ApiVersion2.java    From octo-rpc with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, send_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()) {
    struct.success.write(oprot);
  }
}
 
Example #21
Source File: ProduceResponse.java    From luxun with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ProduceResponse struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  struct.result.write(oprot);
  BitSet optionals = new BitSet();
  if (struct.isSetIndex()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetIndex()) {
    oprot.writeI64(struct.index);
  }
}
 
Example #22
Source File: RequestInfo.java    From octo-rpc with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, RequestInfo struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.serviceName);
  oprot.writeI64(struct.sequenceId);
  oprot.writeByte(struct.callType);
  oprot.writeI32(struct.timeout);
}
 
Example #23
Source File: HelloService.java    From octo-rpc with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, sayBye_result struct) throws TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetSuccess()) {
    oprot.writeString(struct.success);
  }
}
 
Example #24
Source File: FieldDescriptor.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, FieldDescriptor struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.name);
  oprot.writeI32(struct.type.getValue());
  BitSet optionals = new BitSet();
  if (struct.isSetIdentity()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetIdentity()) {
    oprot.writeBool(struct.identity);
  }
}
 
Example #25
Source File: ConsumerService.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getConsumeStats_args struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(1);
  if (incoming.get(0)) {
    struct.request = new ConsumeStatsRequest();
    struct.request.read(iprot);
    struct.setRequestIsSet(true);
  }
}
 
Example #26
Source File: TSentryImportMappingDataResponse.java    From incubator-sentry with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TSentryImportMappingDataResponse struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.status = new org.apache.sentry.service.thrift.TSentryResponseStatus();
  struct.status.read(iprot);
  struct.setStatusIsSet(true);
}
 
Example #27
Source File: PDXNode.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, PDXNode struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSingleField()) {
    optionals.set(0);
  }
  if (struct.isSetFields()) {
    optionals.set(1);
  }
  if (struct.isSetRefId()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetSingleField()) {
    struct.singleField.write(oprot);
  }
  if (struct.isSetFields()) {
    {
      oprot.writeI32(struct.fields.size());
      for (FieldValue _iter76 : struct.fields)
      {
        _iter76.write(oprot);
      }
    }
  }
  if (struct.isSetRefId()) {
    oprot.writeI32(struct.refId);
  }
}
 
Example #28
Source File: HelloService.java    From octo-rpc with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, sayBye_args struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetUsername()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetUsername()) {
    oprot.writeString(struct.username);
  }
}
 
Example #29
Source File: Scribe.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, Log_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.getValue());
  }
}
 
Example #30
Source File: ApiVersion1.java    From octo-rpc with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, send_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()) {
    struct.success.write(oprot);
  }
}