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

The following examples show how to use org.apache.thrift.protocol.TTupleProtocol#writeBool() . 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: ConsumerService.java    From DDMQ with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, submit_result struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  if (struct.isSetError()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetSuccess()) {
    oprot.writeBool(struct.success);
  }
  if (struct.isSetError()) {
    struct.error.write(oprot);
  }
}
 
Example 2
Source File: SentryHDFSService.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, get_all_related_paths_args struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetPath()) {
    optionals.set(0);
  }
  if (struct.isSetExactMatch()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetPath()) {
    oprot.writeString(struct.path);
  }
  if (struct.isSetExactMatch()) {
    oprot.writeBool(struct.exactMatch);
  }
}
 
Example 3
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 4
Source File: CursorRequestMessage.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, 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);
  }
}
 
Example 5
Source File: ConsumerService.java    From DDMQ with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, submit_result struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  if (struct.isSetError()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetSuccess()) {
    oprot.writeBool(struct.success);
  }
  if (struct.isSetError()) {
    struct.error.write(oprot);
  }
}
 
Example 6
Source File: Result.java    From xio with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Result struct)
    throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  if (struct.isSetErrorReason()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetSuccess()) {
    oprot.writeBool(struct.success);
  }
  if (struct.isSetErrorReason()) {
    oprot.writeString(struct.errorReason);
  }
}
 
Example 7
Source File: Result.java    From xio with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Result struct)
    throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  if (struct.isSetErrorReason()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetSuccess()) {
    oprot.writeBool(struct.success);
  }
  if (struct.isSetErrorReason()) {
    oprot.writeString(struct.errorReason);
  }
}
 
Example 8
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 9
Source File: QueryRequest.java    From easy-mapper with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, QueryRequest struct) throws TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeI64(struct.id);
  oprot.writeString(struct.name);
  BitSet optionals = new BitSet();
  if (struct.isSetOptList()) {
    optionals.set(0);
  }
  if (struct.isSetQuiet()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetOptList()) {
    {
      oprot.writeI32(struct.optList.size());
      for (String _iter4 : struct.optList)
      {
        oprot.writeString(_iter4);
      }
    }
  }
  if (struct.isSetQuiet()) {
    oprot.writeBool(struct.quiet);
  }
}
 
Example 10
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 11
Source File: TSentryActiveRoleSet.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, TSentryActiveRoleSet struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeBool(struct.all);
  {
    oprot.writeI32(struct.roles.size());
    for (String _iter76 : struct.roles)
    {
      oprot.writeString(_iter76);
    }
  }
}
 
Example 12
Source File: AccessControlEntry.java    From distributedlog with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, AccessControlEntry struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetDenyWrite()) {
    optionals.set(0);
  }
  if (struct.isSetDenyTruncate()) {
    optionals.set(1);
  }
  if (struct.isSetDenyDelete()) {
    optionals.set(2);
  }
  if (struct.isSetDenyAcquire()) {
    optionals.set(3);
  }
  if (struct.isSetDenyRelease()) {
    optionals.set(4);
  }
  oprot.writeBitSet(optionals, 5);
  if (struct.isSetDenyWrite()) {
    oprot.writeBool(struct.denyWrite);
  }
  if (struct.isSetDenyTruncate()) {
    oprot.writeBool(struct.denyTruncate);
  }
  if (struct.isSetDenyDelete()) {
    oprot.writeBool(struct.denyDelete);
  }
  if (struct.isSetDenyAcquire()) {
    oprot.writeBool(struct.denyAcquire);
  }
  if (struct.isSetDenyRelease()) {
    oprot.writeBool(struct.denyRelease);
  }
}
 
Example 13
Source File: StreamInfo.java    From jstorm with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, StreamInfo struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  {
    oprot.writeI32(struct.output_fields.size());
    for (String _iter20 : struct.output_fields)
    {
      oprot.writeString(_iter20);
    }
  }
  oprot.writeBool(struct.direct);
}
 
Example 14
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, ack_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.writeBool(struct.success);
  }
}
 
Example 15
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, ack_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.writeBool(struct.success);
  }
}
 
Example 16
Source File: Pistachios.java    From Pistachio with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, processEvent_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.writeBool(struct.success);
  }
}
 
Example 17
Source File: JSONField.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, JSONField struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetString_val()) {
    optionals.set(0);
  }
  if (struct.isSetBool_val()) {
    optionals.set(1);
  }
  if (struct.isSetI32_val()) {
    optionals.set(2);
  }
  if (struct.isSetI64_val()) {
    optionals.set(3);
  }
  if (struct.isSetDouble_val()) {
    optionals.set(4);
  }
  if (struct.isSetNull_val()) {
    optionals.set(5);
  }
  if (struct.isSetRef_val()) {
    optionals.set(6);
  }
  if (struct.isSetArray_val()) {
    optionals.set(7);
  }
  oprot.writeBitSet(optionals, 8);
  if (struct.isSetString_val()) {
    oprot.writeString(struct.string_val);
  }
  if (struct.isSetBool_val()) {
    oprot.writeBool(struct.bool_val);
  }
  if (struct.isSetI32_val()) {
    oprot.writeI32(struct.i32_val);
  }
  if (struct.isSetI64_val()) {
    oprot.writeI64(struct.i64_val);
  }
  if (struct.isSetDouble_val()) {
    oprot.writeDouble(struct.double_val);
  }
  if (struct.isSetNull_val()) {
    oprot.writeBool(struct.null_val);
  }
  if (struct.isSetRef_val()) {
    oprot.writeI32(struct.ref_val);
  }
  if (struct.isSetArray_val()) {
    {
      oprot.writeI32(struct.array_val.size());
      for (int _iter116 : struct.array_val)
      {
        oprot.writeI32(_iter116);
      }
    }
  }
}
 
Example 18
Source File: MultiSliceRequest.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, MultiSliceRequest struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetKey()) {
    optionals.set(0);
  }
  if (struct.isSetColumn_parent()) {
    optionals.set(1);
  }
  if (struct.isSetColumn_slices()) {
    optionals.set(2);
  }
  if (struct.isSetReversed()) {
    optionals.set(3);
  }
  if (struct.isSetCount()) {
    optionals.set(4);
  }
  if (struct.isSetConsistency_level()) {
    optionals.set(5);
  }
  oprot.writeBitSet(optionals, 6);
  if (struct.isSetKey()) {
    oprot.writeBinary(struct.key);
  }
  if (struct.isSetColumn_parent()) {
    struct.column_parent.write(oprot);
  }
  if (struct.isSetColumn_slices()) {
    {
      oprot.writeI32(struct.column_slices.size());
      for (ColumnSlice _iter220 : struct.column_slices)
      {
        _iter220.write(oprot);
      }
    }
  }
  if (struct.isSetReversed()) {
    oprot.writeBool(struct.reversed);
  }
  if (struct.isSetCount()) {
    oprot.writeI32(struct.count);
  }
  if (struct.isSetConsistency_level()) {
    oprot.writeI32(struct.consistency_level.getValue());
  }
}
 
Example 19
Source File: ThriftSampleData.java    From incubator-pinot with Apache License 2.0 4 votes vote down vote up
public void write(TProtocol prot, ThriftSampleData struct)
    throws TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetId()) {
    optionals.set(0);
  }

  if (struct.isSetName()) {
    optionals.set(1);
  }

  if (struct.isSetCreated_at()) {
    optionals.set(2);
  }

  if (struct.isSetActive()) {
    optionals.set(3);
  }

  if (struct.isSetGroups()) {
    optionals.set(4);
  }

  if (struct.isSetMap_values()) {
    optionals.set(5);
  }

  if (struct.isSetSet_values()) {
    optionals.set(6);
  }

  oprot.writeBitSet(optionals, 7);
  if (struct.isSetId()) {
    oprot.writeI32(struct.id);
  }

  if (struct.isSetName()) {
    oprot.writeString(struct.name);
  }

  if (struct.isSetCreated_at()) {
    oprot.writeI64(struct.created_at);
  }

  if (struct.isSetActive()) {
    oprot.writeBool(struct.active);
  }

  Iterator var5;
  if (struct.isSetGroups()) {
    oprot.writeI32(struct.groups.size());
    var5 = struct.groups.iterator();

    while (var5.hasNext()) {
      short _iter13 = ((Short) var5.next()).shortValue();
      oprot.writeI16(_iter13);
    }
  }

  if (struct.isSetMap_values()) {
    oprot.writeI32(struct.map_values.size());
    var5 = struct.map_values.entrySet().iterator();

    while (var5.hasNext()) {
      Entry<String, Long> _iter14 = (Entry) var5.next();
      oprot.writeString((String) _iter14.getKey());
      oprot.writeI64(((Long) _iter14.getValue()).longValue());
    }
  }

  if (struct.isSetSet_values()) {
    oprot.writeI32(struct.set_values.size());
    var5 = struct.set_values.iterator();

    while (var5.hasNext()) {
      String _iter15 = (String) var5.next();
      oprot.writeString(_iter15);
    }
  }
}
 
Example 20
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());
      }
    }
  }
}