@Override public void serialize(ByteArrayDataOutput out, Object value) { ParseException exceptionToThrow = null; Double ret = null; try { ret = DimensionHandlerUtils.convertObjectToDouble(value, true); } catch (ParseException pe) { exceptionToThrow = pe; } if (ret == null) { // remove null -> zero conversion when https://github.com/apache/incubator-druid/pull/5278 series of patches is merged // we'll also need to change the serialized encoding so that it can represent numeric nulls ret = DimensionHandlerUtils.ZERO_DOUBLE; } out.writeDouble(ret); if (exceptionToThrow != null) { throw exceptionToThrow; } }
public void testNewDataOutput_writeDouble() { ByteArrayDataOutput out = ByteStreams.newDataOutput(); out.writeDouble(Double.longBitsToDouble(0x1234567876543210L)); assertEquals(bytes, out.toByteArray()); }
WritableUtils.writeVLong(out, agg.getLong()); } else if ("double".equals(t)) { out.writeDouble(agg.getDouble()); } else {
@Override public void serialize(ByteArrayDataOutput out, Object value, boolean reportParseExceptions) { Double ret = DimensionHandlerUtils.convertObjectToDouble(value, reportParseExceptions); if (ret == null) { // remove null -> zero conversion when https://github.com/druid-io/druid/pull/5278 series of patches is merged // we'll also need to change the serialized encoding so that it can represent numeric nulls ret = DimensionHandlerUtils.ZERO_DOUBLE; } out.writeDouble(ret); }
@Override public void serialize(ByteArrayDataOutput out, Object value) { ParseException exceptionToThrow = null; Double ret = null; try { ret = DimensionHandlerUtils.convertObjectToDouble(value, true); } catch (ParseException pe) { exceptionToThrow = pe; } if (ret == null) { // remove null -> zero conversion when https://github.com/apache/incubator-druid/pull/5278 series of patches is merged // we'll also need to change the serialized encoding so that it can represent numeric nulls ret = DimensionHandlerUtils.ZERO_DOUBLE; } out.writeDouble(ret); if (exceptionToThrow != null) { throw exceptionToThrow; } }
public void move(double x, double y, double z) { ByteArrayDataOutput buf = ByteStreams.newDataOutput(); try{ Packet.writeVarInt(buf, 14); buf.writeDouble(x); buf.writeDouble(y); buf.writeDouble(z); buf.writeFloat(c.yaw); buf.writeFloat(c.pitch); buf.writeBoolean(c.onground); c.net.sendPacket(buf, c.out); }catch(IOException e){ e.printStackTrace(); } }
public void testNewDataOutput_writeDouble() { ByteArrayDataOutput out = ByteStreams.newDataOutput(); out.writeDouble(Double.longBitsToDouble(0x1234567876543210L)); assertEquals(bytes, out.toByteArray()); }
WritableUtils.writeVLong(out, agg.getLong()); } else if ("double".equals(t)) { out.writeDouble(agg.getDouble()); } else {
WritableUtils.writeVLong(out, agg.getLong()); } else if (t.equals("double")) { out.writeDouble(agg.getDouble()); } else {
} else if (value instanceof Double) { buffer.write(DATA_TYPE_DOUBLE); buffer.writeDouble((Double) value); } else if (value instanceof Boolean) { buffer.write(DATA_TYPE_BOOLEAN);