RangeSet { @Nonnull public CompletableFuture<Boolean> insertRange(@Nonnull TransactionContext tc, @Nonnull Range r) { return insertRange(tc, r.begin, r.end); } RangeSet(@Nonnull Subspace subspace); @Nonnull CompletableFuture<Boolean> contains(@Nonnull TransactionContext tc, @Nonnull byte[] key); @Nonnull CompletableFuture<Boolean> insertRange(@Nonnull TransactionContext tc, @Nonnull Range r); @Nonnull CompletableFuture<Boolean> insertRange(@Nonnull TransactionContext tc, @Nonnull Range r, boolean requireEmpty); @Nonnull CompletableFuture<Boolean> insertRange(@Nonnull TransactionContext tc, @Nullable byte[] begin, @Nullable byte[] end); @Nonnull CompletableFuture<Boolean> insertRange(@Nonnull TransactionContext tc, @Nullable byte[] begin, @Nullable byte[] end, boolean requireEmpty); @Nonnull CompletableFuture<List<Range>> missingRanges(@Nonnull ReadTransactionContext tc); @Nonnull AsyncIterable<Range> missingRanges(@Nonnull ReadTransaction tr); @Nonnull CompletableFuture<List<Range>> missingRanges(@Nonnull ReadTransactionContext tc, @Nonnull Range superRange); @Nonnull AsyncIterable<Range> missingRanges(@Nonnull ReadTransaction tr, @Nonnull Range superRange); @Nonnull CompletableFuture<List<Range>> missingRanges(@Nonnull ReadTransactionContext tc, @Nullable byte[] begin, @Nullable byte[] end); @Nonnull AsyncIterable<Range> missingRanges(@Nonnull ReadTransaction tr, @Nullable byte[] begin, @Nullable byte[] end); @Nonnull CompletableFuture<List<Range>> missingRanges(@Nonnull ReadTransactionContext tc, @Nullable byte[] begin, @Nullable byte[] end, int limit); @Nonnull AsyncIterable<Range> missingRanges(@Nonnull ReadTransaction tr, @Nullable byte[] begin, @Nullable byte[] end, int limit); @Nonnull CompletableFuture<Void> clear(@Nonnull TransactionContext tc); @Nonnull CompletableFuture<String> rep(@Nonnull ReadTransactionContext tc); static final int UNLIMITED; }
@Test public void insertEmpty() { assertThrows(IllegalArgumentException.class, () -> rs.insertRange(db, new byte[0], new byte[]{0x00})); }
@Test public void insertInverted() { assertThrows(IllegalArgumentException.class, () -> rs.insertRange(db, new byte[]{0x15}, new byte[]{0x05})); }
@Test public void insertPastEnd() { assertThrows(IllegalArgumentException.class, () -> rs.insertRange(db, new byte[]{(byte)0xff, (byte)0x10}, new byte[]{(byte)0xff, (byte)0x15})); }