本文整理匯總了Java中org.apache.thrift.protocol.TTupleProtocol.writeI16方法的典型用法代碼示例。如果您正苦於以下問題:Java TTupleProtocol.writeI16方法的具體用法?Java TTupleProtocol.writeI16怎麽用?Java TTupleProtocol.writeI16使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.thrift.protocol.TTupleProtocol
的用法示例。
在下文中一共展示了TTupleProtocol.writeI16方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: write
import org.apache.thrift.protocol.TTupleProtocol; //導入方法依賴的package包/類
@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);
}
}
示例2: write
import org.apache.thrift.protocol.TTupleProtocol; //導入方法依賴的package包/類
@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);
}
}
}
}
示例3: write
import org.apache.thrift.protocol.TTupleProtocol; //導入方法依賴的package包/類
@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);
}
}
示例4: write
import org.apache.thrift.protocol.TTupleProtocol; //導入方法依賴的package包/類
@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);
}
}
示例5: write
import org.apache.thrift.protocol.TTupleProtocol; //導入方法依賴的package包/類
@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);
}