result2 = keyspace
.prepareQuery(CF_TIME_UUID)
.getKey(rowKey)
.withColumnRange(
new RangeBuilder()
.setLimit(10)
.setStart(TimeUUIDUtils.getTimeUUID(0))
.setEnd(TimeUUIDUtils
.getTimeUUID(Long.MAX_VALUE >> 8))
.build()).execute();
Assert.assertEquals(10, result2.getResult().size());
} catch (ConnectionException e) {
LOG.error(e.getMessage(), e);
Assert.fail();
}
UUID currentUUID = TimeUUIDUtils.getUniqueTimeUUIDinMicros();
SerializerPackage pkg = null;
try {
pkg = keyspace.getSerializerPackage(CF_TIME_UUID.getName(), false);
} catch (ConnectionException e) {
Assert.fail();
e.printStackTrace();
} catch (UnknownComparatorException e) {
Assert.fail();
e.printStackTrace();
}
Serializer<UUID> serializer = (Serializer<UUID>) pkg
.getColumnNameSerializer();
ByteBuffer buffer = serializer.toByteBuffer(currentUUID);
String value = serializer.getString(buffer);
LOG.info("UUID Time = " + value);
// Test timeUUID pagination
RowQuery<String, UUID> query = keyspace
.prepareQuery(CF_TIME_UUID)
.getKey(rowKey)
.withColumnRange(
new RangeBuilder()
.setLimit(10)
.setStart(
TimeUUIDUtils.getTimeUUID(columnTime
+ startTime))
.setEnd(TimeUUIDUtils.getTimeUUID(columnTime