@Override public ByteBuffer getNext(ByteBuffer byteBuffer) { UUID uuid = fromByteBuffer(byteBuffer.duplicate()); return toByteBuffer(new java.util.UUID(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits() + 1)); }
private void cacheOldestSlabForChannel(String channel, UUID slabId) { // Functionally the same as ConcurrentMap.computeIfAbsent(...) try { // Subtract 1 minute from the slab ID to allow for a reasonable window of out-of-order writes while // constraining the number of tombstones read to 1 minute's worth of rows. _oldestSlab.get(channel, () -> TimeUUIDSerializer.get().toByteBuffer( TimeUUIDs.uuidForTimeMillis(TimeUUIDs.getTimeMillis(slabId) - TimeUnit.MINUTES.toMillis(1)))); } catch (ExecutionException e) { // Won't happen, the "execution" just returns a constant. } }
private void cacheOldestSlabForChannel(String channel, UUID slabId) { // Functionally the same as ConcurrentMap.computeIfAbsent(...) try { // Subtract 1 minute from the slab ID to allow for a reasonable window of out-of-order writes while // constraining the number of tombstones read to 1 minute's worth of rows. _oldestSlab.get(channel, () -> TimeUUIDSerializer.get().toByteBuffer( TimeUUIDs.uuidForTimeMillis(TimeUUIDs.getTimeMillis(slabId) - TimeUnit.MINUTES.toMillis(1)))); } catch (ExecutionException e) { // Won't happen, the "execution" just returns a constant. } }
private ByteBuffer generateSlabId() { return TimeUUIDSerializer.get().toByteBuffer(TimeUUIDs.newUUID()); } }
private ByteBuffer generateSlabId() { return TimeUUIDSerializer.get().toByteBuffer(TimeUUIDs.newUUID()); } }