@Test public void testUpperBoundWithLargeTimestamps() throws Exception { Bytes upper = windowKeySchema.upperRange(Bytes.wrap(new byte[]{0xA, 0xB, 0xC}), Long.MAX_VALUE); assertThat( "shorter key with max timestamp should be in range", upper.compareTo( WindowStoreUtils.toBinaryKey( new byte[]{0xA}, Long.MAX_VALUE, Integer.MAX_VALUE ) ) >= 0 ); assertThat( "shorter key with max timestamp should be in range", upper.compareTo( WindowStoreUtils.toBinaryKey( new byte[]{0xA, 0xB}, Long.MAX_VALUE, Integer.MAX_VALUE ) ) >= 0 ); assertThat(upper, equalTo(WindowStoreUtils.toBinaryKey(new byte[]{0xA}, Long.MAX_VALUE, Integer.MAX_VALUE))); }
@Override public Bytes upperRange(final Bytes key, final long to) { final byte[] maxSuffix = ByteBuffer.allocate(SUFFIX_SIZE) .putLong(to) .putInt(Integer.MAX_VALUE) .array(); return OrderedBytes.upperRange(key, maxSuffix); }
WindowKeySchema implements RocksDBSegmentedBytesStore.KeySchema { @Override public Bytes upperRange(final Bytes key, final long to) { final byte[] maxSuffix = ByteBuffer.allocate(SUFFIX_SIZE) .putLong(to) .putInt(Integer.MAX_VALUE) .array(); return OrderedBytes.upperRange(key, maxSuffix); } }
WindowKeySchema implements RocksDBSegmentedBytesStore.KeySchema { @Override public Bytes upperRange(final Bytes key, final long to) { final byte[] maxSuffix = ByteBuffer.allocate(SUFFIX_SIZE) .putLong(to) .putInt(Integer.MAX_VALUE) .array(); return OrderedBytes.upperRange(key, maxSuffix); }  }
WindowKeySchema implements RocksDBSegmentedBytesStore.KeySchema { @Override public Bytes upperRange(final Bytes key, final long to) { final byte[] maxSuffix = ByteBuffer.allocate(SUFFIX_SIZE) .putLong(to) .putInt(Integer.MAX_VALUE) .array(); return OrderedBytes.upperRange(key, maxSuffix); }  @Override void init(final String topic); @Override Bytes upperRange(final Bytes key, final long to); @Override Bytes lowerRange(final Bytes key, final long from); @Override Bytes lowerRangeFixedSize(final Bytes key, final long from); @Override Bytes upperRangeFixedSize(final Bytes key, final long to); @Override long segmentTimestamp(final Bytes key); @Override HasNextCondition hasNextCondition(final Bytes binaryKeyFrom, final Bytes binaryKeyTo, final long from, final long to); @Override List<Segment> segmentsToSearch(final Segments segments, final long from, final long to); }
WindowKeySchema implements RocksDBSegmentedBytesStore.KeySchema { @Override public Bytes upperRange(final Bytes key, final long to) { final byte[] maxSuffix = ByteBuffer.allocate(SUFFIX_SIZE) .putLong(to) .putInt(Integer.MAX_VALUE) .array(); return OrderedBytes.upperRange(key, maxSuffix); }  @Override void init(final String topic); @Override Bytes upperRange(final Bytes key, final long to); @Override Bytes lowerRange(final Bytes key, final long from); @Override Bytes lowerRangeFixedSize(final Bytes key, final long from); @Override Bytes upperRangeFixedSize(final Bytes key, final long to); @Override long segmentTimestamp(final Bytes key); @Override HasNextCondition hasNextCondition(final Bytes binaryKeyFrom, final Bytes binaryKeyTo, final long from, final long to); @Override List<Segment> segmentsToSearch(final Segments segments, final long from, final long to);  }