final ByteBuffer bb = this.timestampInfo.isSaveAsLongType() ? LongType.instance.decompose(Long.parseLong(this.timestampInfo.getTimestamp().get())) : ByteBufferUtil.wrap(this.timestampInfo.getTimestamp().get()); insertStatement.value(SchemaUtil.DISPERSAL_TIMESTAMP, bb);
Assert.assertEquals(INT_FIELD, ByteBufferUtil.convertToString(field.getColumnKey())); Assert.assertEquals(Integer.MAX_VALUE, field.getValue().getInt()); break; Assert.assertEquals(ByteBufferUtil.convertToString(field.getColumnKey()), DOUBLE_FIELD); Assert.assertEquals(Double.MAX_VALUE, field.getValue().getDouble(), 0.0); break; Assert.assertEquals(ByteBufferUtil.convertToString(field.getColumnKey()), STRING_FIELD); Assert.assertEquals("foo", ByteBufferUtil.convertToString(field.getValue())); break; Assert.assertEquals(BOOLEAN_FIELD, ByteBufferUtil.convertToString(field.getColumnKey())); boolean value = field.getValue().get() > 0 ? true : false; Assert.assertTrue(value);
case STRING: final String strData = rawData.toString(); bb = ByteBufferUtil.wrap(strData); break; case FLOAT: row.addField(new CassandraDataField(ByteBufferUtil.wrap(field.name()), bb)); final ByteBuffer bb = this.timestampInfo.isSaveAsLongType() ? LongType.instance.decompose(Long.parseLong(this.timestampInfo.getTimestamp().get())) : ByteBufferUtil.wrap(this.timestampInfo.getTimestamp().get()); row.addField( new CassandraDataField(ByteBufferUtil.wrap(SchemaUtil.DISPERSAL_TIMESTAMP), bb));