@Test public void putUnlessExistsDelegateDecidedByStartTimestamp() { delegatingTransactionService.putUnlessExists(3L, 12L); verify(delegate3).putUnlessExists(3L, 12L); }
@Override public void putUnlessExists(long startTimestamp, long commitTimestamp) throws KeyAlreadyExistsException { TransactionService service = getServiceForTimestamp(keyedServices, startTimestamp).orElseThrow( () -> new UnsupportedOperationException("putUnlessExists shouldn't be used with null services")); service.putUnlessExists(startTimestamp, commitTimestamp); }
SplitKeyDelegatingTransactionService implements TransactionService { @Override public void putUnlessExists(long startTimestamp, long commitTimestamp) throws KeyAlreadyExistsException { TransactionService service = getServiceForTimestamp(keyedServices, startTimestamp).orElseThrow( () -> new UnsupportedOperationException("putUnlessExists shouldn't be used with null services")); service.putUnlessExists(startTimestamp, commitTimestamp); } }
SplitKeyDelegatingTransactionService implements TransactionService { @Override public void putUnlessExists(long startTimestamp, long commitTimestamp) throws KeyAlreadyExistsException { TransactionService service = getServiceForTimestamp(keyedServices, startTimestamp).orElseThrow( () -> new UnsupportedOperationException("putUnlessExists shouldn't be used with null services")); service.putUnlessExists(startTimestamp, commitTimestamp); } SplitKeyDelegatingTransactionService(
            Function<Long, T> timestampToServiceKey,
            Map<T, TransactionService> keyedServices); }
SplitKeyDelegatingTransactionService implements TransactionService { @Override public void putUnlessExists(long startTimestamp, long commitTimestamp) throws KeyAlreadyExistsException { TransactionService service = getServiceForTimestamp(keyedServices, startTimestamp).orElseThrow( () -> new UnsupportedOperationException("putUnlessExists shouldn't be used with null services")); service.putUnlessExists(startTimestamp, commitTimestamp); } SplitKeyDelegatingTransactionService(
            Function<Long, T> timestampToServiceKey,
            Map<T, TransactionService> keyedServices); @CheckForNull @Override Long get(long startTimestamp); @Override Map<Long, Long> get(Iterable<Long> startTimestamps); @Override ListenableFuture<Long> getAsync(long startTimestamp); @Override ListenableFuture<Map<Long, Long>> getAsync(Iterable<Long> startTimestamps); @Override void putUnlessExists(long startTimestamp, long commitTimestamp); @Override void close(); }
SplitKeyDelegatingTransactionService implements TransactionService { @Override public void putUnlessExists(long startTimestamp, long commitTimestamp) throws KeyAlreadyExistsException { TransactionService service = getServiceForTimestamp(keyedServices, startTimestamp).orElseThrow( () -> new UnsupportedOperationException("putUnlessExists shouldn't be used with null services")); service.putUnlessExists(startTimestamp, commitTimestamp); } SplitKeyDelegatingTransactionService(
            Function<Long, T> timestampToServiceKey,
            Map<T, TransactionService> keyedServices); @CheckForNull @Override Long get(long startTimestamp); @Override Map<Long, Long> get(Iterable<Long> startTimestamps); @Override ListenableFuture<Long> getAsync(long startTimestamp); @Override ListenableFuture<Map<Long, Long>> getAsync(Iterable<Long> startTimestamps); @Override void putUnlessExists(long startTimestamp, long commitTimestamp); @Override void close();  }