diff --git a/src/main/java/net/spy/memcached/ArcusClient.java b/src/main/java/net/spy/memcached/ArcusClient.java index 36bf997db..fd28c31b2 100644 --- a/src/main/java/net/spy/memcached/ArcusClient.java +++ b/src/main/java/net/spy/memcached/ArcusClient.java @@ -33,7 +33,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; @@ -2002,7 +2001,7 @@ private SMGetFuture>> smget( final int count, final boolean reverse, final Transcoder tc) { final CountDownLatch blatch = new CountDownLatch(smGetList.size()); - final ConcurrentLinkedQueue ops = new ConcurrentLinkedQueue<>(); + final Collection ops = new ArrayList<>(smGetList.size()); final SMGetResultOldImpl result = new SMGetResultOldImpl<>(offset, count, reverse, smGetList.size() > 1); // if processedSMGetCount is 0, then all smget is done. @@ -2070,7 +2069,7 @@ private SMGetFuture>> smget( final boolean reverse, final Transcoder tc) { final CountDownLatch blatch = new CountDownLatch(smGetList.size()); - final ConcurrentLinkedQueue ops = new ConcurrentLinkedQueue<>(); + final Collection ops = new ArrayList<>(smGetList.size()); final SMGetResultImpl result = new SMGetResultImpl<>(count, unique, reverse); // if processedSMGetCount is 0, then all smget is done. @@ -3434,7 +3433,7 @@ private CollectionGetBulkFuture>> btreeG final boolean reverse, final Transcoder tc) { final CountDownLatch latch = new CountDownLatch(getBulkList.size()); - final ConcurrentLinkedQueue ops = new ConcurrentLinkedQueue<>(); + final Collection ops = new ArrayList<>(); final Map>> cachedDataMap = new HashMap<>(); final Map opStatusMap = @@ -3494,7 +3493,7 @@ public void gotElement(String key, int flags, Object bkey, byte[] eflag, byte[] final boolean reverse, final Transcoder tc) { final CountDownLatch latch = new CountDownLatch(getBulkList.size()); - final ConcurrentLinkedQueue ops = new ConcurrentLinkedQueue<>(); + final Collection ops = new ArrayList<>(getBulkList.size()); final Map>> cachedDataMap = new HashMap<>(); final Map opStatusMap = diff --git a/src/main/java/net/spy/memcached/internal/BroadcastFuture.java b/src/main/java/net/spy/memcached/internal/BroadcastFuture.java index 46e869b6f..c25de32ac 100644 --- a/src/main/java/net/spy/memcached/internal/BroadcastFuture.java +++ b/src/main/java/net/spy/memcached/internal/BroadcastFuture.java @@ -3,7 +3,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; -import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; @@ -14,7 +13,7 @@ import net.spy.memcached.ops.OperationState; public class BroadcastFuture extends OperationFuture { - private final List ops; + private final Collection ops; public BroadcastFuture(long timeout , T result, int latchSize) { super(new CountDownLatch(latchSize), timeout); diff --git a/src/main/java/net/spy/memcached/internal/BulkOperationFuture.java b/src/main/java/net/spy/memcached/internal/BulkOperationFuture.java index de45704cd..55f2c8cda 100644 --- a/src/main/java/net/spy/memcached/internal/BulkOperationFuture.java +++ b/src/main/java/net/spy/memcached/internal/BulkOperationFuture.java @@ -1,10 +1,10 @@ package net.spy.memcached.internal; +import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; -import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; @@ -18,7 +18,7 @@ public class BulkOperationFuture implements Future> { protected final Map failedResult = new HashMap<>(); - protected final ConcurrentLinkedQueue ops = new ConcurrentLinkedQueue<>(); + protected final Collection ops = new ArrayList<>(); protected final long timeout; protected final CountDownLatch latch; diff --git a/src/main/java/net/spy/memcached/internal/PipedCollectionFuture.java b/src/main/java/net/spy/memcached/internal/PipedCollectionFuture.java index 271f789d9..baae3a8d0 100644 --- a/src/main/java/net/spy/memcached/internal/PipedCollectionFuture.java +++ b/src/main/java/net/spy/memcached/internal/PipedCollectionFuture.java @@ -1,10 +1,10 @@ package net.spy.memcached.internal; +import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; @@ -18,7 +18,7 @@ public class PipedCollectionFuture extends CollectionFuture> { - private final ConcurrentLinkedQueue ops = new ConcurrentLinkedQueue<>(); + private final Collection ops = new ArrayList<>(); private final AtomicReference operationStatus = new AtomicReference<>(null);