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

The following examples show how to use org.apache.thrift.protocol.TTupleProtocol#writeI16() . 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: Endpoint.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, Endpoint struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetIpv4()) {
    optionals.set(0);
  }
  if (struct.isSetPort()) {
    optionals.set(1);
  }
  if (struct.isSetService_name()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetIpv4()) {
    oprot.writeI32(struct.ipv4);
  }
  if (struct.isSetPort()) {
    oprot.writeI16(struct.port);
  }
  if (struct.isSetService_name()) {
    oprot.writeString(struct.service_name);
  }
}
 
Example 2
Source File: TestService.java    From Firefly with Apache License 2.0 6 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getList_args struct) throws TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetIds()) {
    optionals.set(0);
  }
  oprot.writeBitSet(optionals, 1);
  if (struct.isSetIds()) {
    {
      oprot.writeI32(struct.ids.size());
      for (short _iter56 : struct.ids)
      {
        oprot.writeI16(_iter56);
      }
    }
  }
}
 
Example 3
Source File: HelloMessage.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, HelloMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  struct.header.write(oprot);
  BitSet optionals = new BitSet();
  if (struct.isSetNodeId()) {
    optionals.set(0);
  }
  if (struct.isSetAuthScheme()) {
    optionals.set(1);
  }
  if (struct.isSetAuthChallengeResponse()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetNodeId()) {
    oprot.writeI16(struct.nodeId);
  }
  if (struct.isSetAuthScheme()) {
    oprot.writeI32(struct.authScheme.getValue());
  }
  if (struct.isSetAuthChallengeResponse()) {
    struct.authChallengeResponse.write(oprot);
  }
}
 
Example 4
Source File: ClusterJoinResponseMessage.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, ClusterJoinResponseMessage struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  struct.header.write(oprot);
  BitSet optionals = new BitSet();
  if (struct.isSetNewNodeId()) {
    optionals.set(0);
  }
  if (struct.isSetNodeStore()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetNewNodeId()) {
    oprot.writeI16(struct.newNodeId);
  }
  if (struct.isSetNodeStore()) {
    {
      oprot.writeI32(struct.nodeStore.size());
      for (KeyedValues _iter68 : struct.nodeStore)
      {
        _iter68.write(oprot);
      }
    }
  }
}
 
Example 5
Source File: SwitchPortTuple.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, SwitchPortTuple struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetDpid()) {
    optionals.set(0);
  }
  if (struct.isSetPort()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetDpid()) {
    oprot.writeI64(struct.dpid);
  }
  if (struct.isSetPort()) {
    oprot.writeI16(struct.port);
  }
}
 
Example 6
Source File: ColumnDescriptor.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, ColumnDescriptor struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeI32(struct.type.getValue());
  oprot.writeI16(struct.descFlags);
  oprot.writeI16(struct.precision);
  BitSet optionals = new BitSet();
  if (struct.isSetScale()) {
    optionals.set(0);
  }
  if (struct.isSetName()) {
    optionals.set(1);
  }
  if (struct.isSetFullTableName()) {
    optionals.set(2);
  }
  if (struct.isSetUdtTypeAndClassName()) {
    optionals.set(3);
  }
  oprot.writeBitSet(optionals, 4);
  if (struct.isSetScale()) {
    oprot.writeI16(struct.scale);
  }
  if (struct.isSetName()) {
    oprot.writeString(struct.name);
  }
  if (struct.isSetFullTableName()) {
    oprot.writeString(struct.fullTableName);
  }
  if (struct.isSetUdtTypeAndClassName()) {
    oprot.writeString(struct.udtTypeAndClassName);
  }
}
 
Example 7
Source File: ColumnDescriptor.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, ColumnDescriptor struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeI32(struct.type.getValue());
  oprot.writeI16(struct.descFlags);
  oprot.writeI16(struct.precision);
  BitSet optionals = new BitSet();
  if (struct.isSetScale()) {
    optionals.set(0);
  }
  if (struct.isSetName()) {
    optionals.set(1);
  }
  if (struct.isSetFullTableName()) {
    optionals.set(2);
  }
  if (struct.isSetUdtTypeAndClassName()) {
    optionals.set(3);
  }
  oprot.writeBitSet(optionals, 4);
  if (struct.isSetScale()) {
    oprot.writeI16(struct.scale);
  }
  if (struct.isSetName()) {
    oprot.writeString(struct.name);
  }
  if (struct.isSetFullTableName()) {
    oprot.writeString(struct.fullTableName);
  }
  if (struct.isSetUdtTypeAndClassName()) {
    oprot.writeString(struct.udtTypeAndClassName);
  }
}
 
Example 8
Source File: Node.java    From floodlight_with_topoguard with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Node struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetNodeId()) {
    optionals.set(0);
  }
  if (struct.isSetDomainId()) {
    optionals.set(1);
  }
  if (struct.isSetHostname()) {
    optionals.set(2);
  }
  if (struct.isSetPort()) {
    optionals.set(3);
  }
  oprot.writeBitSet(optionals, 4);
  if (struct.isSetNodeId()) {
    oprot.writeI16(struct.nodeId);
  }
  if (struct.isSetDomainId()) {
    oprot.writeI16(struct.domainId);
  }
  if (struct.isSetHostname()) {
    oprot.writeString(struct.hostname);
  }
  if (struct.isSetPort()) {
    oprot.writeI32(struct.port);
  }
}
 
Example 9
Source File: ClockEntry.java    From floodlight_with_topoguard with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ClockEntry struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeI16(struct.nodeId);
  oprot.writeI64(struct.version);
}
 
Example 10
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);
    }
  }
}