RestForwarderScheduler: remove unused code
Change-Id: I7510cd64d486638f6ea3c89490f13122eb8da2cd
diff --git a/src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/rest/RestForwarderScheduler.java b/src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/rest/RestForwarderScheduler.java
index da3d09f..640c5b7 100644
--- a/src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/rest/RestForwarderScheduler.java
+++ b/src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/rest/RestForwarderScheduler.java
@@ -25,8 +25,6 @@
import java.time.Duration;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
@@ -38,35 +36,6 @@
private final ScheduledExecutorService executor;
private final Duration retryInterval;
- public class CompletablePromise<V> extends CompletableFuture<V> {
- private Future<V> future;
-
- public CompletablePromise(Future<V> future) {
- this.future = future;
- executor.execute(this::tryToComplete);
- }
-
- private void tryToComplete() {
- if (future.isDone()) {
- try {
- complete(future.get());
- } catch (InterruptedException e) {
- completeExceptionally(e);
- } catch (ExecutionException e) {
- completeExceptionally(e.getCause());
- }
- return;
- }
-
- if (future.isCancelled()) {
- cancel(true);
- return;
- }
-
- executor.execute(this::tryToComplete);
- }
- }
-
@Inject
public RestForwarderScheduler(
WorkQueue workQueue, Configuration cfg, Provider<Set<PeerInfo>> peerInfoProvider) {