Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
Remove commented out block, add javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
alechenninger committed Jul 19, 2016
1 parent 3af5637 commit 1a7b865
Showing 1 changed file with 5 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ private LightblueBulkDataResponse tryBulkRequest(DataBulkRequest bulkRequest)
}
}

// TODO comment a bit why there is this hierarchy
/**
* We have two response maps: one with guaranteed successful responses (
* {@link BulkDataResponses} and one with no guarantees ({@link BulkResponses}). They are both
* backed by simple maps, just with different generic types, hence the base class.
*/
static abstract class ResponseMap<T> implements Responses<AbstractLightblueDataRequest, T> {
private final Map<AbstractLightblueDataRequest, T> responseMap;

Expand Down Expand Up @@ -494,87 +498,6 @@ public T get(long timeout, TimeUnit unit) throws InterruptedException,
}
}

//
// /**
// * TODO update this comment
// * Wraps a {@link LazyTransformableFuture} and some {@link AbstractLightblueDataRequest
// * lightblue requests} which are used to complete this in
// * {@link #doQueuedRequestsAndCompleteFutures()}. Naturally, then, that function is used as the
// * lazy future's completer function. That function and this implementation are tightly coupled.
// */
// class LazyTryRequestTransformableFuture implements TransformableFuture<LightblueResponses> {
// private final LazyTransformableFuture<LightblueResponses> backingFuture =
// new LazyTransformableFuture<>(() -> doQueuedRequestsAndCompleteFutures());
//
// final AbstractLightblueDataRequest[] requests;
//
// LazyTryRequestTransformableFuture(AbstractLightblueDataRequest[] requests) {
// this.requests = requests;
// }
//
// void complete(LightblueResponses responses) {
// backingFuture.complete(responses);
// }
//
// void completeExceptionally(Exception exception) {
// backingFuture.completeExceptionally(exception);
// }
//
// @Override
// public <U> TransformableFuture<U> transformSync(
// FutureTransform<LightblueResponses, U> futureTransform) {
// return backingFuture.transformSync(futureTransform);
// }
//
// @Override
// public <U> TransformableFuture<U> transformAsync(
// FutureTransform<LightblueResponses, TransformableFuture<U>> futureTransform) {
// return backingFuture.transformAsync(futureTransform);
// }
//
// @Override
// public TransformableFuture<Void> transformAsyncIgnoringReturn(
// FutureTransform<LightblueResponses, TransformableFuture<?>> futureTransform) {
// return backingFuture.transformAsyncIgnoringReturn(futureTransform);
// }
//
// @Override
// public TransformableFuture<LightblueResponses> whenDoneOrCancelled(FutureDoneCallback callback) {
// backingFuture.whenDoneOrCancelled(callback);
// return this;
// }
//
// @Override
// public boolean cancel(boolean mayInterruptIfRunning) {
// if (!backingFuture.isDone()) {
// queuedRequests.remove(this);
// }
//
// return backingFuture.cancel(mayInterruptIfRunning);
// }
//
// @Override
// public boolean isCancelled() {
// return backingFuture.isCancelled();
// }
//
// @Override
// public boolean isDone() {
// return backingFuture.isDone();
// }
//
// @Override
// public LightblueResponses get() throws InterruptedException, ExecutionException {
// return backingFuture.get();
// }
//
// @Override
// public LightblueResponses get(long timeout, TimeUnit unit) throws InterruptedException,
// ExecutionException, TimeoutException {
// return backingFuture.get(timeout, unit);
// }
// }

/**
* A simple lazy future implementation which applies some transformation function to the value
* it is completed with.
Expand Down

0 comments on commit 1a7b865

Please sign in to comment.