From 546b28c4e37079c3df6eed2d6b77ea934c623065 Mon Sep 17 00:00:00 2001 From: olim7t Date: Fri, 13 Apr 2018 14:07:10 -0700 Subject: [PATCH] Remove unneeded variables in request handler --- .../driver/internal/core/cql/CqlRequestHandlerBase.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandlerBase.java b/core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandlerBase.java index 553008dcfd4..6f37178b210 100644 --- a/core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandlerBase.java +++ b/core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandlerBase.java @@ -39,7 +39,6 @@ import com.datastax.oss.driver.api.core.servererrors.ReadTimeoutException; import com.datastax.oss.driver.api.core.servererrors.UnavailableException; import com.datastax.oss.driver.api.core.servererrors.WriteTimeoutException; -import com.datastax.oss.driver.api.core.specex.SpeculativeExecutionPolicy; import com.datastax.oss.driver.internal.core.adminrequest.ThrottledAdminRequestHandler; import com.datastax.oss.driver.internal.core.adminrequest.UnexpectedResponseException; import com.datastax.oss.driver.internal.core.channel.DriverChannel; @@ -119,7 +118,6 @@ public abstract class CqlRequestHandlerBase implements Throttled { private final List> scheduledExecutions; private final List inFlightCallbacks; private final RetryPolicy retryPolicy; - private final SpeculativeExecutionPolicy speculativeExecutionPolicy; private final RequestThrottler throttler; // The errors on the nodes that were already tried (lazily initialized on the first error). @@ -175,7 +173,6 @@ protected CqlRequestHandlerBase( this.timeoutFuture = scheduleTimeout(timeout); this.retryPolicy = context.retryPolicy(); - this.speculativeExecutionPolicy = context.speculativeExecutionPolicy(); this.activeExecutionsCount = new AtomicInteger(1); this.startedSpeculativeExecutionsCount = new AtomicInteger(0); this.scheduledExecutions = isIdempotent ? new CopyOnWriteArrayList<>() : null; @@ -267,9 +264,8 @@ private void cancelScheduledTasks() { if (this.timeoutFuture != null) { this.timeoutFuture.cancel(false); } - List> pendingExecutionsSnapshot = this.scheduledExecutions; - if (pendingExecutionsSnapshot != null) { - for (ScheduledFuture future : pendingExecutionsSnapshot) { + if (scheduledExecutions != null) { + for (ScheduledFuture future : scheduledExecutions) { future.cancel(false); } }