public List<ListenableFuture<?>> mutate(List<? extends Mutation> mutations) { closedReadLock.lock(); try { List<ListenableFuture<?>> futures = new ArrayList<>(mutations.size()); for (Mutation mutation : mutations) { futures.add(offer(mutation)); } return futures; } finally { closedReadLock.unlock(); } }
public List<ListenableFuture<?>> mutate(List<? extends Mutation> mutations) { closedReadLock.lock(); try { List<ListenableFuture<?>> futures = new ArrayList<>(mutations.size()); for (Mutation mutation : mutations) { futures.add(offer(mutation)); } return futures; } finally { closedReadLock.unlock(); } }
/** * Being a Mutation. This method will block if either of the following are true: * 1) There are more than {@code maxInflightRpcs} RPCs in flight * 2) There are more than {@link #getWriteBufferSize()} bytes pending * @return */ public ListenableFuture<?> mutate(final Mutation mutation) { closedReadLock.lock(); try { if (closed) { throw new IllegalStateException("Cannot mutate when the BufferedMutator is closed."); } return offer(mutation); } finally { closedReadLock.unlock(); } }
/** * Being a Mutation. This method will block if either of the following are true: * 1) There are more than {@code maxInflightRpcs} RPCs in flight * 2) There are more than {@link #getWriteBufferSize()} bytes pending * @return */ public ListenableFuture<?> mutate(final Mutation mutation) { closedReadLock.lock(); try { if (closed) { throw new IllegalStateException("Cannot mutate when the BufferedMutator is closed."); } return offer(mutation); } finally { closedReadLock.unlock(); } }