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

The following examples show how to use org.apache.thrift.protocol.TTupleProtocol#readString() . 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: ClobChunk.java    From gemfirexd-oss with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ClobChunk struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.chunk = iprot.readString();
  struct.setChunkIsSet(true);
  struct.last = iprot.readBool();
  struct.setLastIsSet(true);
  BitSet incoming = iprot.readBitSet(3);
  if (incoming.get(0)) {
    struct.lobId = iprot.readI32();
    struct.setLobIdIsSet(true);
  }
  if (incoming.get(1)) {
    struct.offset = iprot.readI64();
    struct.setOffsetIsSet(true);
  }
  if (incoming.get(2)) {
    struct.totalLength = iprot.readI64();
    struct.setTotalLengthIsSet(true);
  }
}
 
Example 2
Source File: QidResponse.java    From DDMQ with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, QidResponse struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.topic = iprot.readString();
  struct.setTopicIsSet(true);
  struct.qid = iprot.readString();
  struct.setQidIsSet(true);
  {
    org.apache.thrift.protocol.TList _list59 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
    struct.messages = new ArrayList<Message>(_list59.size);
    Message _elem60;
    for (int _i61 = 0; _i61 < _list59.size; ++_i61)
    {
      _elem60 = new Message();
      _elem60.read(iprot);
      struct.messages.add(_elem60);
    }
  }
  struct.setMessagesIsSet(true);
  BitSet incoming = iprot.readBitSet(1);
  if (incoming.get(0)) {
    struct.nextRequestOffset = iprot.readI64();
    struct.setNextRequestOffsetIsSet(true);
  }
}
 
Example 3
Source File: Result.java    From DDMQ with Apache License 2.0 6 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Result struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(3);
  if (incoming.get(0)) {
    struct.code = iprot.readI32();
    struct.setCodeIsSet(true);
  }
  if (incoming.get(1)) {
    struct.msg = iprot.readString();
    struct.setMsgIsSet(true);
  }
  if (incoming.get(2)) {
    struct.key = iprot.readString();
    struct.setKeyIsSet(true);
  }
}
 
Example 4
Source File: BuildJobStateDaemonicParserState.java    From buck with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, BuildJobStateDaemonicParserState struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(1);
  if (incoming.get(0)) {
    {
      org.apache.thrift.protocol.TMap _map11 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.LIST, iprot.readI32());
      struct.cachedIncludes = new HashMap<String,List<String>>(2*_map11.size);
      String _key12;
      List<String> _val13;
      for (int _i14 = 0; _i14 < _map11.size; ++_i14)
      {
        _key12 = iprot.readString();
        {
          org.apache.thrift.protocol.TList _list15 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          _val13 = new ArrayList<String>(_list15.size);
          String _elem16;
          for (int _i17 = 0; _i17 < _list15.size; ++_i17)
          {
            _elem16 = iprot.readString();
            _val13.add(_elem16);
          }
        }
        struct.cachedIncludes.put(_key12, _val13);
      }
    }
    struct.setCachedIncludesIsSet(true);
  }
}
 
Example 5
Source File: JSONNode.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, JSONNode struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.refId = iprot.readI32();
  struct.setRefIdIsSet(true);
  BitSet incoming = iprot.readBitSet(2);
  if (incoming.get(0)) {
    {
      org.apache.thrift.protocol.TMap _map126 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
      struct.pairs = new HashMap<String,JSONField>(2*_map126.size);
      for (int _i127 = 0; _i127 < _map126.size; ++_i127)
      {
        String _key128;
        JSONField _val129;
        _key128 = iprot.readString();
        _val129 = new JSONField();
        _val129.read(iprot);
        struct.pairs.put(_key128, _val129);
      }
    }
    struct.setPairsIsSet(true);
  }
  if (incoming.get(1)) {
    struct.singleField = new JSONField();
    struct.singleField.read(iprot);
    struct.setSingleFieldIsSet(true);
  }
}
 
Example 6
Source File: ApiVersion1.java    From octo-rpc with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, send_args struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(2);
  if (incoming.get(0)) {
    struct.message = iprot.readString();
    struct.setMessageIsSet(true);
  }
  if (incoming.get(1)) {
    struct.param = iprot.readString();
    struct.setParamIsSet(true);
  }
}
 
Example 7
Source File: FieldDescriptor.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, FieldDescriptor struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.name = iprot.readString();
  struct.setNameIsSet(true);
  struct.type = FieldType.findByValue(iprot.readI32());
  struct.setTypeIsSet(true);
  BitSet incoming = iprot.readBitSet(1);
  if (incoming.get(0)) {
    struct.identity = iprot.readBool();
    struct.setIdentityIsSet(true);
  }
}
 
Example 8
Source File: DistributedRPC.java    From jstorm with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, execute_args struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(2);
  if (incoming.get(0)) {
    struct.functionName = iprot.readString();
    struct.set_functionName_isSet(true);
  }
  if (incoming.get(1)) {
    struct.funcArgs = iprot.readString();
    struct.set_funcArgs_isSet(true);
  }
}
 
Example 9
Source File: ConsumeStatsRequest.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ConsumeStatsRequest struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.group = iprot.readString();
  struct.setGroupIsSet(true);
  BitSet incoming = iprot.readBitSet(2);
  if (incoming.get(0)) {
    struct.topic = iprot.readString();
    struct.setTopicIsSet(true);
  }
  if (incoming.get(1)) {
    struct.version = iprot.readString();
    struct.setVersionIsSet(true);
  }
}
 
Example 10
Source File: PullRequest.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, PullRequest struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.groupId = iprot.readString();
  struct.setGroupIdIsSet(true);
  BitSet incoming = iprot.readBitSet(5);
  if (incoming.get(0)) {
    struct.topic = iprot.readString();
    struct.setTopicIsSet(true);
  }
  if (incoming.get(1)) {
    struct.maxBatchSize = iprot.readI32();
    struct.setMaxBatchSizeIsSet(true);
  }
  if (incoming.get(2)) {
    struct.maxLingerTime = iprot.readI32();
    struct.setMaxLingerTimeIsSet(true);
  }
  if (incoming.get(3)) {
    struct.result = new ConsumeResult();
    struct.result.read(iprot);
    struct.setResultIsSet(true);
  }
  if (incoming.get(4)) {
    struct.version = iprot.readString();
    struct.setVersionIsSet(true);
  }
}
 
Example 11
Source File: Message.java    From DDMQ with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Message struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(5);
  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.tag = iprot.readString();
    struct.setTagIsSet(true);
  }
  if (incoming.get(3)) {
    struct.offset = iprot.readI64();
    struct.setOffsetIsSet(true);
  }
  if (incoming.get(4)) {
    {
      org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
      struct.properties = new HashMap<String,String>(2*_map6.size);
      String _key7;
      String _val8;
      for (int _i9 = 0; _i9 < _map6.size; ++_i9)
      {
        _key7 = iprot.readString();
        _val8 = iprot.readString();
        struct.properties.put(_key7, _val8);
      }
    }
    struct.setPropertiesIsSet(true);
  }
}
 
Example 12
Source File: QueryResponse.java    From easy-mapper with Apache License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, QueryResponse struct) throws TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.queryId = iprot.readString();
  struct.setQueryIdIsSet(true);
  struct.state = com.baidu.unbiz.easymapper.thrift.QueryState.findByValue(iprot.readI32());
  struct.setStateIsSet(true);
  BitSet incoming = iprot.readBitSet(1);
  if (incoming.get(0)) {
    struct.message = iprot.readString();
    struct.setMessageIsSet(true);
  }
}
 
Example 13
Source File: TAlterSentryRoleRevokePrivilegeRequest.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, TAlterSentryRoleRevokePrivilegeRequest 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);
  BitSet incoming = iprot.readBitSet(2);
  if (incoming.get(0)) {
    struct.privilege = new TSentryPrivilege();
    struct.privilege.read(iprot);
    struct.setPrivilegeIsSet(true);
  }
  if (incoming.get(1)) {
    {
      org.apache.thrift.protocol.TSet _set37 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
      struct.privileges = new HashSet<TSentryPrivilege>(2*_set37.size);
      for (int _i38 = 0; _i38 < _set37.size; ++_i38)
      {
        TSentryPrivilege _elem39; // required
        _elem39 = new TSentryPrivilege();
        _elem39.read(iprot);
        struct.privileges.add(_elem39);
      }
    }
    struct.setPrivilegesIsSet(true);
  }
}
 
Example 14
Source File: TestThriftService.java    From thrift-client-pool-java with Artistic License 2.0 5 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echo_result struct)
        throws org.apache.thrift.TException {
    TTupleProtocol iprot = (TTupleProtocol) prot;
    BitSet incoming = iprot.readBitSet(1);
    if (incoming.get(0)) {
        struct.success = iprot.readString();
        struct.setSuccessIsSet(true);
    }
}
 
Example 15
Source File: FetchRequest.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, FetchRequest struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.consumerId = iprot.readString();
  struct.setConsumerIdIsSet(true);
  struct.groupId = iprot.readString();
  struct.setGroupIdIsSet(true);
  struct.cluster = iprot.readString();
  struct.setClusterIsSet(true);
  BitSet incoming = iprot.readBitSet(4);
  if (incoming.get(0)) {
    {
      org.apache.thrift.protocol.TMap _map46 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.MAP, iprot.readI32());
      struct.fetchOffset = new HashMap<String,Map<String,Long>>(2*_map46.size);
      String _key47;
      Map<String,Long> _val48;
      for (int _i49 = 0; _i49 < _map46.size; ++_i49)
      {
        _key47 = iprot.readString();
        {
          org.apache.thrift.protocol.TMap _map50 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I64, iprot.readI32());
          _val48 = new HashMap<String,Long>(2*_map50.size);
          String _key51;
          long _val52;
          for (int _i53 = 0; _i53 < _map50.size; ++_i53)
          {
            _key51 = iprot.readString();
            _val52 = iprot.readI64();
            _val48.put(_key51, _val52);
          }
        }
        struct.fetchOffset.put(_key47, _val48);
      }
    }
    struct.setFetchOffsetIsSet(true);
  }
  if (incoming.get(1)) {
    struct.maxBatchSize = iprot.readI32();
    struct.setMaxBatchSizeIsSet(true);
  }
  if (incoming.get(2)) {
    struct.maxLingerTime = iprot.readI32();
    struct.setMaxLingerTimeIsSet(true);
  }
  if (incoming.get(3)) {
    struct.version = iprot.readString();
    struct.setVersionIsSet(true);
  }
}
 
Example 16
Source File: Response.java    From opencron with Apache License 2.0 4 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Response struct) throws org.apache.thrift.TException {
    TTupleProtocol iprot = (TTupleProtocol) prot;
    BitSet incoming = iprot.readBitSet(7);
    if (incoming.get(0)) {
        struct.action = org.opencron.common.job.Action.findByValue(iprot.readI32());
        struct.setActionIsSet(true);
    }
    if (incoming.get(1)) {
        {
            org.apache.thrift.protocol.TMap _map16 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
            struct.result = new HashMap<String,String>(2*_map16.size);
            String _key17;
            String _val18;
            for (int _i19 = 0; _i19 < _map16.size; ++_i19)
            {
                _key17 = iprot.readString();
                _val18 = iprot.readString();
                struct.result.put(_key17, _val18);
            }
        }
        struct.setResultIsSet(true);
    }
    if (incoming.get(2)) {
        struct.exitCode = iprot.readI32();
        struct.setExitCodeIsSet(true);
    }
    if (incoming.get(3)) {
        struct.success = iprot.readBool();
        struct.setSuccessIsSet(true);
    }
    if (incoming.get(4)) {
        struct.startTime = iprot.readI64();
        struct.setStartTimeIsSet(true);
    }
    if (incoming.get(5)) {
        struct.endTime = iprot.readI64();
        struct.setEndTimeIsSet(true);
    }
    if (incoming.get(6)) {
        struct.message = iprot.readString();
        struct.setMessageIsSet(true);
    }
}
 
Example 17
Source File: LocatorService.java    From gemfirexd-oss with Apache License 2.0 4 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getAllServersWithPreferredServer_args struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(3);
  if (incoming.get(0)) {
    {
      org.apache.thrift.protocol.TSet _set387 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32());
      struct.serverTypes = new HashSet<ServerType>(2*_set387.size);
      for (int _i388 = 0; _i388 < _set387.size; ++_i388)
      {
        ServerType _elem389;
        _elem389 = ServerType.findByValue(iprot.readI32());
        struct.serverTypes.add(_elem389);
      }
    }
    struct.setServerTypesIsSet(true);
  }
  if (incoming.get(1)) {
    {
      org.apache.thrift.protocol.TSet _set390 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
      struct.serverGroups = new HashSet<String>(2*_set390.size);
      for (int _i391 = 0; _i391 < _set390.size; ++_i391)
      {
        String _elem392;
        _elem392 = iprot.readString();
        struct.serverGroups.add(_elem392);
      }
    }
    struct.setServerGroupsIsSet(true);
  }
  if (incoming.get(2)) {
    {
      org.apache.thrift.protocol.TSet _set393 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
      struct.failedServers = new HashSet<HostAddress>(2*_set393.size);
      for (int _i394 = 0; _i394 < _set393.size; ++_i394)
      {
        HostAddress _elem395;
        _elem395 = new HostAddress();
        _elem395.read(iprot);
        struct.failedServers.add(_elem395);
      }
    }
    struct.setFailedServersIsSet(true);
  }
}
 
Example 18
Source File: TListSentryPrivilegesByAuthRequest.java    From incubator-sentry with Apache License 2.0 4 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TListSentryPrivilegesByAuthRequest 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.component = iprot.readString();
  struct.setComponentIsSet(true);
  struct.serviceName = iprot.readString();
  struct.setServiceNameIsSet(true);
  {
    org.apache.thrift.protocol.TSet _set132 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
    struct.authorizablesSet = new HashSet<String>(2*_set132.size);
    for (int _i133 = 0; _i133 < _set132.size; ++_i133)
    {
      String _elem134; // required
      _elem134 = iprot.readString();
      struct.authorizablesSet.add(_elem134);
    }
  }
  struct.setAuthorizablesSetIsSet(true);
  BitSet incoming = iprot.readBitSet(2);
  if (incoming.get(0)) {
    {
      org.apache.thrift.protocol.TSet _set135 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
      struct.groups = new HashSet<String>(2*_set135.size);
      for (int _i136 = 0; _i136 < _set135.size; ++_i136)
      {
        String _elem137; // required
        _elem137 = iprot.readString();
        struct.groups.add(_elem137);
      }
    }
    struct.setGroupsIsSet(true);
  }
  if (incoming.get(1)) {
    struct.roleSet = new TSentryActiveRoleSet();
    struct.roleSet.read(iprot);
    struct.setRoleSetIsSet(true);
  }
}
 
Example 19
Source File: InvalidRequestException.java    From stratio-cassandra with Apache License 2.0 4 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, InvalidRequestException struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.why = iprot.readString();
  struct.setWhyIsSet(true);
}
 
Example 20
Source File: Span.java    From incubator-retired-htrace with Apache License 2.0 4 votes vote down vote up
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, Span struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(7);
  if (incoming.get(0)) {
    struct.trace_id = iprot.readI64();
    struct.setTrace_idIsSet(true);
  }
  if (incoming.get(1)) {
    struct.name = iprot.readString();
    struct.setNameIsSet(true);
  }
  if (incoming.get(2)) {
    struct.id = iprot.readI64();
    struct.setIdIsSet(true);
  }
  if (incoming.get(3)) {
    struct.parent_id = iprot.readI64();
    struct.setParent_idIsSet(true);
  }
  if (incoming.get(4)) {
    {
      org.apache.thrift.protocol.TList _list10 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
      struct.annotations = new ArrayList<Annotation>(_list10.size);
      for (int _i11 = 0; _i11 < _list10.size; ++_i11)
      {
        Annotation _elem12; // required
        _elem12 = new Annotation();
        _elem12.read(iprot);
        struct.annotations.add(_elem12);
      }
    }
    struct.setAnnotationsIsSet(true);
  }
  if (incoming.get(5)) {
    {
      org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
      struct.binary_annotations = new ArrayList<BinaryAnnotation>(_list13.size);
      for (int _i14 = 0; _i14 < _list13.size; ++_i14)
      {
        BinaryAnnotation _elem15; // required
        _elem15 = new BinaryAnnotation();
        _elem15.read(iprot);
        struct.binary_annotations.add(_elem15);
      }
    }
    struct.setBinary_annotationsIsSet(true);
  }
  if (incoming.get(6)) {
    struct.debug = iprot.readBool();
    struct.setDebugIsSet(true);
  }
}