Skip to content

Commit

Permalink
FIX: getElement logic in BTreeStoreAndGetFuture.
Browse files Browse the repository at this point in the history
  • Loading branch information
brido4125 committed Sep 4, 2023
1 parent 4318361 commit 04ffb09
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
package net.spy.memcached.internal;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicReference;

import net.spy.memcached.collection.Element;
Expand All @@ -42,6 +45,15 @@ public BTreeStoreAndGetFuture(CountDownLatch l, AtomicReference<T> oref, long op

public Element<E> getElement() {
CollectionGetOpCallback callback = (CollectionGetOpCallback) op.getCallback();
try {
super.get(super.timeout, TimeUnit.MILLISECONDS);
} catch (ExecutionException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
} catch (TimeoutException e) {
throw new RuntimeException(e);
}
callback.addResult();
return element;
}
Expand Down

0 comments on commit 04ffb09

Please sign in to comment.