Example usage for org.apache.thrift.protocol TProtocol writeDouble

List of usage examples for org.apache.thrift.protocol TProtocol writeDouble

Introduction

In this page you can find the example usage for org.apache.thrift.protocol TProtocol writeDouble.

Prototype

public void writeDouble(Double d) throws TException 

Source Link

Usage

From source file:backtype.storm.generated.BoltStats.java

License:Apache License

public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    validate();/*from  www .  j  av  a2  s. c  o  m*/

    oprot.writeStructBegin(STRUCT_DESC);
    if (this.acked != null) {
        oprot.writeFieldBegin(ACKED_FIELD_DESC);
        {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
                    org.apache.thrift.protocol.TType.MAP, this.acked.size()));
            for (Map.Entry<String, Map<GlobalStreamId, Long>> _iter85 : this.acked.entrySet()) {
                oprot.writeString(_iter85.getKey());
                {
                    oprot.writeMapBegin(
                            new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT,
                                    org.apache.thrift.protocol.TType.I64, _iter85.getValue().size()));
                    for (Map.Entry<GlobalStreamId, Long> _iter86 : _iter85.getValue().entrySet()) {
                        _iter86.getKey().write(oprot);
                        oprot.writeI64(_iter86.getValue());
                    }
                    oprot.writeMapEnd();
                }
            }
            oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
    }
    if (this.failed != null) {
        oprot.writeFieldBegin(FAILED_FIELD_DESC);
        {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
                    org.apache.thrift.protocol.TType.MAP, this.failed.size()));
            for (Map.Entry<String, Map<GlobalStreamId, Long>> _iter87 : this.failed.entrySet()) {
                oprot.writeString(_iter87.getKey());
                {
                    oprot.writeMapBegin(
                            new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT,
                                    org.apache.thrift.protocol.TType.I64, _iter87.getValue().size()));
                    for (Map.Entry<GlobalStreamId, Long> _iter88 : _iter87.getValue().entrySet()) {
                        _iter88.getKey().write(oprot);
                        oprot.writeI64(_iter88.getValue());
                    }
                    oprot.writeMapEnd();
                }
            }
            oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
    }
    if (this.process_ms_avg != null) {
        oprot.writeFieldBegin(PROCESS_MS_AVG_FIELD_DESC);
        {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
                    org.apache.thrift.protocol.TType.MAP, this.process_ms_avg.size()));
            for (Map.Entry<String, Map<GlobalStreamId, Double>> _iter89 : this.process_ms_avg.entrySet()) {
                oprot.writeString(_iter89.getKey());
                {
                    oprot.writeMapBegin(
                            new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT,
                                    org.apache.thrift.protocol.TType.DOUBLE, _iter89.getValue().size()));
                    for (Map.Entry<GlobalStreamId, Double> _iter90 : _iter89.getValue().entrySet()) {
                        _iter90.getKey().write(oprot);
                        oprot.writeDouble(_iter90.getValue());
                    }
                    oprot.writeMapEnd();
                }
            }
            oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
    }
    if (this.executed != null) {
        oprot.writeFieldBegin(EXECUTED_FIELD_DESC);
        {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
                    org.apache.thrift.protocol.TType.MAP, this.executed.size()));
            for (Map.Entry<String, Map<GlobalStreamId, Long>> _iter91 : this.executed.entrySet()) {
                oprot.writeString(_iter91.getKey());
                {
                    oprot.writeMapBegin(
                            new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT,
                                    org.apache.thrift.protocol.TType.I64, _iter91.getValue().size()));
                    for (Map.Entry<GlobalStreamId, Long> _iter92 : _iter91.getValue().entrySet()) {
                        _iter92.getKey().write(oprot);
                        oprot.writeI64(_iter92.getValue());
                    }
                    oprot.writeMapEnd();
                }
            }
            oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
    }
    if (this.execute_ms_avg != null) {
        oprot.writeFieldBegin(EXECUTE_MS_AVG_FIELD_DESC);
        {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
                    org.apache.thrift.protocol.TType.MAP, this.execute_ms_avg.size()));
            for (Map.Entry<String, Map<GlobalStreamId, Double>> _iter93 : this.execute_ms_avg.entrySet()) {
                oprot.writeString(_iter93.getKey());
                {
                    oprot.writeMapBegin(
                            new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRUCT,
                                    org.apache.thrift.protocol.TType.DOUBLE, _iter93.getValue().size()));
                    for (Map.Entry<GlobalStreamId, Double> _iter94 : _iter93.getValue().entrySet()) {
                        _iter94.getKey().write(oprot);
                        oprot.writeDouble(_iter94.getValue());
                    }
                    oprot.writeMapEnd();
                }
            }
            oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
}

From source file:backtype.storm.generated.JavaObjectArg.java

License:Apache License

@Override
protected void writeValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    switch (setField_) {
    case INT_ARG:
        Integer int_arg = (Integer) value_;
        oprot.writeI32(int_arg);
        return;//from   w w  w.  j av  a2 s  .c  om
    case LONG_ARG:
        Long long_arg = (Long) value_;
        oprot.writeI64(long_arg);
        return;
    case STRING_ARG:
        String string_arg = (String) value_;
        oprot.writeString(string_arg);
        return;
    case BOOL_ARG:
        Boolean bool_arg = (Boolean) value_;
        oprot.writeBool(bool_arg);
        return;
    case BINARY_ARG:
        ByteBuffer binary_arg = (ByteBuffer) value_;
        oprot.writeBinary(binary_arg);
        return;
    case DOUBLE_ARG:
        Double double_arg = (Double) value_;
        oprot.writeDouble(double_arg);
        return;
    default:
        throw new IllegalStateException("Cannot write union with unknown field " + setField_);
    }
}

From source file:backtype.storm.generated.SpoutStats.java

License:Apache License

public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    validate();/*from w  w  w.  j a v  a2 s .  com*/

    oprot.writeStructBegin(STRUCT_DESC);
    if (this.acked != null) {
        oprot.writeFieldBegin(ACKED_FIELD_DESC);
        {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
                    org.apache.thrift.protocol.TType.MAP, this.acked.size()));
            for (Map.Entry<String, Map<String, Long>> _iter119 : this.acked.entrySet()) {
                oprot.writeString(_iter119.getKey());
                {
                    oprot.writeMapBegin(
                            new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
                                    org.apache.thrift.protocol.TType.I64, _iter119.getValue().size()));
                    for (Map.Entry<String, Long> _iter120 : _iter119.getValue().entrySet()) {
                        oprot.writeString(_iter120.getKey());
                        oprot.writeI64(_iter120.getValue());
                    }
                    oprot.writeMapEnd();
                }
            }
            oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
    }
    if (this.failed != null) {
        oprot.writeFieldBegin(FAILED_FIELD_DESC);
        {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
                    org.apache.thrift.protocol.TType.MAP, this.failed.size()));
            for (Map.Entry<String, Map<String, Long>> _iter121 : this.failed.entrySet()) {
                oprot.writeString(_iter121.getKey());
                {
                    oprot.writeMapBegin(
                            new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
                                    org.apache.thrift.protocol.TType.I64, _iter121.getValue().size()));
                    for (Map.Entry<String, Long> _iter122 : _iter121.getValue().entrySet()) {
                        oprot.writeString(_iter122.getKey());
                        oprot.writeI64(_iter122.getValue());
                    }
                    oprot.writeMapEnd();
                }
            }
            oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
    }
    if (this.complete_ms_avg != null) {
        oprot.writeFieldBegin(COMPLETE_MS_AVG_FIELD_DESC);
        {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
                    org.apache.thrift.protocol.TType.MAP, this.complete_ms_avg.size()));
            for (Map.Entry<String, Map<String, Double>> _iter123 : this.complete_ms_avg.entrySet()) {
                oprot.writeString(_iter123.getKey());
                {
                    oprot.writeMapBegin(
                            new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING,
                                    org.apache.thrift.protocol.TType.DOUBLE, _iter123.getValue().size()));
                    for (Map.Entry<String, Double> _iter124 : _iter123.getValue().entrySet()) {
                        oprot.writeString(_iter124.getKey());
                        oprot.writeDouble(_iter124.getValue());
                    }
                    oprot.writeMapEnd();
                }
            }
            oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
}

From source file:com.ebay.nest.io.sede.dynamic_type.DynamicSerDeTypeDouble.java

License:Apache License

@Override
public void serialize(Object o, ObjectInspector oi, TProtocol oprot)
        throws TException, SerDeException, NoSuchFieldException, IllegalAccessException {
    DoubleObjectInspector poi = (DoubleObjectInspector) oi;
    oprot.writeDouble(poi.get(o));
}

From source file:com.facebook.swift.codec.internal.builtin.DoubleThriftCodec.java

License:Apache License

@Override
public void write(Double value, TProtocol protocol) throws Exception {
    Preconditions.checkNotNull(value, "value is null");
    Preconditions.checkNotNull(protocol, "protocol is null");
    protocol.writeDouble(value);
}

From source file:com.ning.metrics.serialization.thrift.ThriftFieldImpl.java

License:Apache License

@Override
public void write(TProtocol protocol) throws TException {
    protocol.writeFieldBegin(field);/*from w ww  .  ja v a 2  s  .c  om*/

    switch (field.type) {
    case TType.BOOL:
        protocol.writeBool(dataItem.getBoolean());
        break;
    case TType.BYTE:
        protocol.writeByte(dataItem.getByte());
        break;
    case TType.I16:
        protocol.writeI16(dataItem.getShort());
        break;
    case TType.I32:
        protocol.writeI32(dataItem.getInteger());
        break;
    case TType.I64:
        protocol.writeI64(dataItem.getLong());
        break;
    case TType.STRING:
        protocol.writeString(dataItem.getString());
        break;
    case TType.DOUBLE:
        protocol.writeDouble(dataItem.getDouble());
        break;
    default:
        throw new IllegalArgumentException(String.format("unsupported thrift type %s", field.type));
    }
    protocol.writeFieldEnd();
}

From source file:ezbake.data.elastic.thrift.ScriptValue.java

License:Apache License

@Override
protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot)
        throws org.apache.thrift.TException {
    switch (setField_) {
    case TEXT_VALUE:
        String textValue = (String) value_;
        oprot.writeString(textValue);//from   w  ww . ja  v  a  2 s.  co m
        return;
    case INT_VALUE:
        Integer intValue = (Integer) value_;
        oprot.writeI32(intValue);
        return;
    case DOUBLE_VALUE:
        Double doubleValue = (Double) value_;
        oprot.writeDouble(doubleValue);
        return;
    case LONG_VALUE:
        Long longValue = (Long) value_;
        oprot.writeI64(longValue);
        return;
    case BOOLEAN_VALUE:
        Boolean booleanValue = (Boolean) value_;
        oprot.writeBool(booleanValue);
        return;
    default:
        throw new IllegalStateException("Cannot write union with unknown field " + setField_);
    }
}

From source file:ezbake.data.elastic.thrift.ScriptValue.java

License:Apache License

@Override
protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot)
        throws org.apache.thrift.TException {
    switch (setField_) {
    case TEXT_VALUE:
        String textValue = (String) value_;
        oprot.writeString(textValue);/*from  ww w  .j a  va 2  s  . c  o  m*/
        return;
    case INT_VALUE:
        Integer intValue = (Integer) value_;
        oprot.writeI32(intValue);
        return;
    case DOUBLE_VALUE:
        Double doubleValue = (Double) value_;
        oprot.writeDouble(doubleValue);
        return;
    case LONG_VALUE:
        Long longValue = (Long) value_;
        oprot.writeI64(longValue);
        return;
    case BOOLEAN_VALUE:
        Boolean booleanValue = (Boolean) value_;
        oprot.writeBool(booleanValue);
        return;
    default:
        throw new IllegalStateException("Cannot write union with unknown field " + setField_);
    }
}

From source file:ezbake.query.basequeryableprocedure.ColumnDataValues.java

License:Apache License

@Override
protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot)
        throws org.apache.thrift.TException {
    switch (setField_) {
    case BOOL_VALS:
        List<Boolean> bool_vals = (List<Boolean>) value_; {
        oprot.writeListBegin(/* w  ww  . j  a va  2 s . c  o  m*/
                new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, bool_vals.size()));
        for (boolean _iter32 : bool_vals) {
            oprot.writeBool(_iter32);
        }
        oprot.writeListEnd();
    }
        return;
    case BYTE_VALS:
        List<Byte> byte_vals = (List<Byte>) value_; {
        oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, byte_vals.size()));
        for (byte _iter33 : byte_vals) {
            oprot.writeByte(_iter33);
        }
        oprot.writeListEnd();
    }
        return;
    case SHORT_VALS:
        List<Short> short_vals = (List<Short>) value_; {
        oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, short_vals.size()));
        for (short _iter34 : short_vals) {
            oprot.writeI16(_iter34);
        }
        oprot.writeListEnd();
    }
        return;
    case INT_VALS:
        List<Integer> int_vals = (List<Integer>) value_; {
        oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, int_vals.size()));
        for (int _iter35 : int_vals) {
            oprot.writeI32(_iter35);
        }
        oprot.writeListEnd();
    }
        return;
    case LONG_VALS:
        List<Long> long_vals = (List<Long>) value_; {
        oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, long_vals.size()));
        for (long _iter36 : long_vals) {
            oprot.writeI64(_iter36);
        }
        oprot.writeListEnd();
    }
        return;
    case DOUBLE_VALS:
        List<Double> double_vals = (List<Double>) value_; {
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE,
                double_vals.size()));
        for (double _iter37 : double_vals) {
            oprot.writeDouble(_iter37);
        }
        oprot.writeListEnd();
    }
        return;
    case STRING_VALS:
        List<String> string_vals = (List<String>) value_; {
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING,
                string_vals.size()));
        for (String _iter38 : string_vals) {
            oprot.writeString(_iter38);
        }
        oprot.writeListEnd();
    }
        return;
    case BINARY_VALS:
        List<ByteBuffer> binary_vals = (List<ByteBuffer>) value_; {
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING,
                binary_vals.size()));
        for (ByteBuffer _iter39 : binary_vals) {
            oprot.writeBinary(_iter39);
        }
        oprot.writeListEnd();
    }
        return;
    default:
        throw new IllegalStateException("Cannot write union with unknown field " + setField_);
    }
}

From source file:ezbake.query.basequeryableprocedure.ColumnDataValues.java

License:Apache License

@Override
protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot)
        throws org.apache.thrift.TException {
    switch (setField_) {
    case BOOL_VALS:
        List<Boolean> bool_vals = (List<Boolean>) value_; {
        oprot.writeListBegin(/*from  ww w.ja  v a2 s  .c o m*/
                new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, bool_vals.size()));
        for (boolean _iter64 : bool_vals) {
            oprot.writeBool(_iter64);
        }
        oprot.writeListEnd();
    }
        return;
    case BYTE_VALS:
        List<Byte> byte_vals = (List<Byte>) value_; {
        oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, byte_vals.size()));
        for (byte _iter65 : byte_vals) {
            oprot.writeByte(_iter65);
        }
        oprot.writeListEnd();
    }
        return;
    case SHORT_VALS:
        List<Short> short_vals = (List<Short>) value_; {
        oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, short_vals.size()));
        for (short _iter66 : short_vals) {
            oprot.writeI16(_iter66);
        }
        oprot.writeListEnd();
    }
        return;
    case INT_VALS:
        List<Integer> int_vals = (List<Integer>) value_; {
        oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, int_vals.size()));
        for (int _iter67 : int_vals) {
            oprot.writeI32(_iter67);
        }
        oprot.writeListEnd();
    }
        return;
    case LONG_VALS:
        List<Long> long_vals = (List<Long>) value_; {
        oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, long_vals.size()));
        for (long _iter68 : long_vals) {
            oprot.writeI64(_iter68);
        }
        oprot.writeListEnd();
    }
        return;
    case DOUBLE_VALS:
        List<Double> double_vals = (List<Double>) value_; {
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE,
                double_vals.size()));
        for (double _iter69 : double_vals) {
            oprot.writeDouble(_iter69);
        }
        oprot.writeListEnd();
    }
        return;
    case STRING_VALS:
        List<String> string_vals = (List<String>) value_; {
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING,
                string_vals.size()));
        for (String _iter70 : string_vals) {
            oprot.writeString(_iter70);
        }
        oprot.writeListEnd();
    }
        return;
    case BINARY_VALS:
        List<ByteBuffer> binary_vals = (List<ByteBuffer>) value_; {
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING,
                binary_vals.size()));
        for (ByteBuffer _iter71 : binary_vals) {
            oprot.writeBinary(_iter71);
        }
        oprot.writeListEnd();
    }
        return;
    default:
        throw new IllegalStateException("Cannot write union with unknown field " + setField_);
    }
}