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

The following examples show how to use org.apache.thrift.protocol.TTupleProtocol#writeString() . 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: TGenericException.java    From phoenix-tephra with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TGenericException struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetMessage()) {
    optionals.set(0);
  }
  if (struct.isSetOriginalExceptionClass()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetMessage()) {
    oprot.writeString(struct.message);
  }
  if (struct.isSetOriginalExceptionClass()) {
    oprot.writeString(struct.originalExceptionClass);
  }
}
 
Example 2
Source File: TPermissionsUpdate.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, TPermissionsUpdate struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeBool(struct.hasfullImage);
  oprot.writeI64(struct.seqNum);
  {
    oprot.writeI32(struct.privilegeChanges.size());
    for (Map.Entry<String, TPrivilegeChanges> _iter112 : struct.privilegeChanges.entrySet())
    {
      oprot.writeString(_iter112.getKey());
      _iter112.getValue().write(oprot);
    }
  }
  {
    oprot.writeI32(struct.roleChanges.size());
    for (Map.Entry<String, TRoleChanges> _iter113 : struct.roleChanges.entrySet())
    {
      oprot.writeString(_iter113.getKey());
      _iter113.getValue().write(oprot);
    }
  }
}
 
Example 3
Source File: NamespaceDescriptor.java    From hbase with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, NamespaceDescriptor struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.name);
  BitSet optionals = new BitSet();
  if (struct.isSetConfiguration()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetConfiguration()) {
    {
      oprot.writeI32(struct.configuration.size());
      for (Map.Entry<String, String> _iter185 : struct.configuration.entrySet())
      {
        oprot.writeString(_iter185.getKey());
        oprot.writeString(_iter185.getValue());
      }
    }
  }
}
 
Example 4
Source File: TSentryPrivilegeMap.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, TSentryPrivilegeMap struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  {
    oprot.writeI32(struct.privilegeMap.size());
    for (Map.Entry<String, Set<TSentryPrivilege>> _iter97 : struct.privilegeMap.entrySet())
    {
      oprot.writeString(_iter97.getKey());
      {
        oprot.writeI32(_iter97.getValue().size());
        for (TSentryPrivilege _iter98 : _iter97.getValue())
        {
          _iter98.write(oprot);
        }
      }
    }
  }
}
 
Example 5
Source File: HostnameRuleset.java    From xio with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, HostnameRuleset struct)
    throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  {
    oprot.writeI32(struct.blacklistHosts.size());
    for (String _iter8 : struct.blacklistHosts) {
      oprot.writeString(_iter8);
    }
  }
  {
    oprot.writeI32(struct.whitelistHosts.size());
    for (String _iter9 : struct.whitelistHosts) {
      oprot.writeString(_iter9);
    }
  }
}
 
Example 6
Source File: SubMessage.java    From octo-rpc with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, SubMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetId()) {
    optionals.set(0);
  }
  if (struct.isSetValue()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetId()) {
    oprot.writeI64(struct.id);
  }
  if (struct.isSetValue()) {
    oprot.writeString(struct.value);
  }
}
 
Example 7
Source File: NimbusSummary.java    From jstorm with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, NimbusSummary struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  struct.nimbusMaster.write(oprot);
  {
    oprot.writeI32(struct.nimbusSlaves.size());
    for (NimbusStat _iter78 : struct.nimbusSlaves)
    {
      _iter78.write(oprot);
    }
  }
  oprot.writeI32(struct.supervisorNum);
  oprot.writeI32(struct.totalPortNum);
  oprot.writeI32(struct.usedPortNum);
  oprot.writeI32(struct.freePortNum);
  oprot.writeString(struct.version);
}
 
Example 8
Source File: Store.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, Store struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.storeName);
  BitSet optionals = new BitSet();
  if (struct.isSetScope()) {
    optionals.set(0);
  }
  if (struct.isSetPersist()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetScope()) {
    oprot.writeI32(struct.scope.getValue());
  }
  if (struct.isSetPersist()) {
    oprot.writeBool(struct.persist);
  }
}
 
Example 9
Source File: TSentryConfigValueResponse.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, TSentryConfigValueResponse struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  struct.status.write(oprot);
  BitSet optionals = new BitSet();
  if (struct.isSetValue()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetValue()) {
    oprot.writeString(struct.value);
  }
}
 
Example 10
Source File: TAlterSentryRoleAddGroupsRequest.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, TAlterSentryRoleAddGroupsRequest struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeI32(struct.protocol_version);
  oprot.writeString(struct.requestorUserName);
  oprot.writeString(struct.roleName);
  oprot.writeString(struct.component);
  {
    oprot.writeI32(struct.groups.size());
    for (String _iter12 : struct.groups)
    {
      oprot.writeString(_iter12);
    }
  }
}
 
Example 11
Source File: TSentryPrivilege.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, TSentryPrivilege struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.component);
  oprot.writeString(struct.serviceName);
  {
    oprot.writeI32(struct.authorizables.size());
    for (TAuthorizable _iter4 : struct.authorizables)
    {
      _iter4.write(oprot);
    }
  }
  oprot.writeString(struct.action);
  BitSet optionals = new BitSet();
  if (struct.isSetCreateTime()) {
    optionals.set(0);
  }
  if (struct.isSetGrantorPrincipal()) {
    optionals.set(1);
  }
  if (struct.isSetGrantOption()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetCreateTime()) {
    oprot.writeI64(struct.createTime);
  }
  if (struct.isSetGrantorPrincipal()) {
    oprot.writeString(struct.grantorPrincipal);
  }
  if (struct.isSetGrantOption()) {
    oprot.writeI32(struct.grantOption.getValue());
  }
}
 
Example 12
Source File: KsDef.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, KsDef struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.name);
  oprot.writeString(struct.strategy_class);
  {
    oprot.writeI32(struct.cf_defs.size());
    for (CfDef _iter155 : struct.cf_defs)
    {
      _iter155.write(oprot);
    }
  }
  BitSet optionals = new BitSet();
  if (struct.isSetStrategy_options()) {
    optionals.set(0);
  }
  if (struct.isSetReplication_factor()) {
    optionals.set(1);
  }
  if (struct.isSetDurable_writes()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetStrategy_options()) {
    {
      oprot.writeI32(struct.strategy_options.size());
      for (Map.Entry<String, String> _iter156 : struct.strategy_options.entrySet())
      {
        oprot.writeString(_iter156.getKey());
        oprot.writeString(_iter156.getValue());
      }
    }
  }
  if (struct.isSetReplication_factor()) {
    oprot.writeI32(struct.replication_factor);
  }
  if (struct.isSetDurable_writes()) {
    oprot.writeBool(struct.durable_writes);
  }
}
 
Example 13
Source File: SupervisorSummary.java    From jstorm with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, SupervisorSummary struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.host);
  oprot.writeString(struct.supervisorId);
  oprot.writeI32(struct.uptimeSecs);
  oprot.writeI32(struct.numWorkers);
  oprot.writeI32(struct.numUsedWorkers);
  BitSet optionals = new BitSet();
  if (struct.is_set_version()) {
    optionals.set(0);
  }
  if (struct.is_set_buildTs()) {
    optionals.set(1);
  }
  if (struct.is_set_port()) {
    optionals.set(2);
  }
  if (struct.is_set_errorMessage()) {
    optionals.set(3);
  }
  oprot.writeBitSet(optionals, 4);
  if (struct.is_set_version()) {
    oprot.writeString(struct.version);
  }
  if (struct.is_set_buildTs()) {
    oprot.writeString(struct.buildTs);
  }
  if (struct.is_set_port()) {
    oprot.writeI32(struct.port);
  }
  if (struct.is_set_errorMessage()) {
    oprot.writeString(struct.errorMessage);
  }
}
 
Example 14
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 15
Source File: Result1.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, Result1 struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.result);
  oprot.writeI32(struct.id);
  oprot.writeString(struct.message);
}
 
Example 16
Source File: ProcessingException.java    From incubator-pinot with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ProcessingException struct)
    throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeI32(struct.errorCode);
  BitSet optionals = new BitSet();
  if (struct.isSetMessage()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetMessage()) {
    oprot.writeString(struct.message);
  }
}
 
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: ConsumeStats.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ConsumeStats struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetGroup()) {
    optionals.set(0);
  }
  if (struct.isSetTopic()) {
    optionals.set(1);
  }
  if (struct.isSetConsumeOffsets()) {
    optionals.set(2);
  }
  if (struct.isSetProduceOffsets()) {
    optionals.set(3);
  }
  oprot.writeBitSet(optionals, 4);
  if (struct.isSetGroup()) {
    oprot.writeString(struct.group);
  }
  if (struct.isSetTopic()) {
    oprot.writeString(struct.topic);
  }
  if (struct.isSetConsumeOffsets()) {
    {
      oprot.writeI32(struct.consumeOffsets.size());
      for (Map.Entry<String, Long> _iter100 : struct.consumeOffsets.entrySet())
      {
        oprot.writeString(_iter100.getKey());
        oprot.writeI64(_iter100.getValue());
      }
    }
  }
  if (struct.isSetProduceOffsets()) {
    {
      oprot.writeI32(struct.produceOffsets.size());
      for (Map.Entry<String, Long> _iter101 : struct.produceOffsets.entrySet())
      {
        oprot.writeString(_iter101.getKey());
        oprot.writeI64(_iter101.getValue());
      }
    }
  }
}
 
Example 19
Source File: OpenConnectionArgs.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, OpenConnectionArgs struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeString(struct.clientHostName);
  oprot.writeString(struct.clientID);
  oprot.writeI32(struct.security.getValue());
  BitSet optionals = new BitSet();
  if (struct.isSetUserName()) {
    optionals.set(0);
  }
  if (struct.isSetPassword()) {
    optionals.set(1);
  }
  if (struct.isSetTokenSize()) {
    optionals.set(2);
  }
  if (struct.isSetUseStringForDecimal()) {
    optionals.set(3);
  }
  if (struct.isSetProperties()) {
    optionals.set(4);
  }
  oprot.writeBitSet(optionals, 5);
  if (struct.isSetUserName()) {
    oprot.writeString(struct.userName);
  }
  if (struct.isSetPassword()) {
    oprot.writeString(struct.password);
  }
  if (struct.isSetTokenSize()) {
    oprot.writeI32(struct.tokenSize);
  }
  if (struct.isSetUseStringForDecimal()) {
    oprot.writeBool(struct.useStringForDecimal);
  }
  if (struct.isSetProperties()) {
    {
      oprot.writeI32(struct.properties.size());
      for (Map.Entry<String, String> _iter245 : struct.properties.entrySet())
      {
        oprot.writeString(_iter245.getKey());
        oprot.writeString(_iter245.getValue());
      }
    }
  }
}
 
Example 20
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);
    }
}