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

The following examples show how to use org.apache.thrift.protocol.TTupleProtocol#writeDouble() . 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: Word2VecModelThrift.java    From Word2VecJava with MIT License 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Word2VecModelThrift struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetVocab()) {
    optionals.set(0);
  }
  if (struct.isSetLayerSize()) {
    optionals.set(1);
  }
  if (struct.isSetVectors()) {
    optionals.set(2);
  }
  oprot.writeBitSet(optionals, 3);
  if (struct.isSetVocab()) {
    {
      oprot.writeI32(struct.vocab.size());
      for (String _iter8 : struct.vocab)
      {
        oprot.writeString(_iter8);
      }
    }
  }
  if (struct.isSetLayerSize()) {
    oprot.writeI32(struct.layerSize);
  }
  if (struct.isSetVectors()) {
    {
      oprot.writeI32(struct.vectors.size());
      for (double _iter9 : struct.vectors)
      {
        oprot.writeDouble(_iter9);
      }
    }
  }
}
 
Example 2
Source File: MetricWindow.java    From jstorm with Apache License 2.0 5 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, MetricWindow struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  {
    oprot.writeI32(struct.metricWindow.size());
    for (Map.Entry<Integer, Double> _iter111 : struct.metricWindow.entrySet())
    {
      oprot.writeI32(_iter111.getKey());
      oprot.writeDouble(_iter111.getValue());
    }
  }
}
 
Example 3
Source File: Location.java    From octo-rpc with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Location struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeDouble(struct.latitude);
  oprot.writeDouble(struct.longitude);
}
 
Example 4
Source File: Location.java    From octo-rpc with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, Location struct) throws TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  oprot.writeDouble(struct.latitude);
  oprot.writeDouble(struct.longitude);
}
 
Example 5
Source File: LoadInfo.java    From octo-rpc with Apache License 2.0 4 votes vote down vote up
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, LoadInfo struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetAverageLoad()) {
    optionals.set(0);
  }
  if (struct.isSetOldGC()) {
    optionals.set(1);
  }
  if (struct.isSetThreadNum()) {
    optionals.set(2);
  }
  if (struct.isSetQueueSize()) {
    optionals.set(3);
  }
  if (struct.isSetMethodQpsMap()) {
    optionals.set(4);
  }
  oprot.writeBitSet(optionals, 5);
  if (struct.isSetAverageLoad()) {
    oprot.writeDouble(struct.averageLoad);
  }
  if (struct.isSetOldGC()) {
    oprot.writeI32(struct.oldGC);
  }
  if (struct.isSetThreadNum()) {
    oprot.writeI32(struct.threadNum);
  }
  if (struct.isSetQueueSize()) {
    oprot.writeI32(struct.queueSize);
  }
  if (struct.isSetMethodQpsMap()) {
    {
      oprot.writeI32(struct.methodQpsMap.size());
      for (Map.Entry<String, Double> _iter5 : struct.methodQpsMap.entrySet())
      {
        oprot.writeString(_iter5.getKey());
        oprot.writeDouble(_iter5.getValue());
      }
    }
  }
}
 
Example 6
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 7
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);
      }
    }
  }
}