From 9d9ffde5e01475ac232e6cb9a49c7a6123c78e26 Mon Sep 17 00:00:00 2001 From: brido4125 Date: Thu, 12 Dec 2024 09:37:57 +0900 Subject: [PATCH] REFACTOR: remove unused getMaxPipeCount. --- src/main/java/net/spy/memcached/ArcusClient.java | 5 ----- src/main/java/net/spy/memcached/ArcusClientIF.java | 7 ------- src/main/java/net/spy/memcached/ArcusClientPool.java | 6 ------ src/test/java/net/spy/memcached/ArcusTimeoutTest.java | 7 ++++--- .../bulkoperation/SopInsertBulkMultipleValueTest.java | 3 ++- .../net/spy/memcached/collection/list/LopBulkAPITest.java | 3 ++- .../net/spy/memcached/collection/map/MopBulkAPITest.java | 3 ++- .../net/spy/memcached/collection/set/SopBulkAPITest.java | 3 ++- .../spy/memcached/collection/set/SopPipedExistTest.java | 5 +++-- 9 files changed, 15 insertions(+), 27 deletions(-) diff --git a/src/main/java/net/spy/memcached/ArcusClient.java b/src/main/java/net/spy/memcached/ArcusClient.java index 522f43f09..76454699f 100644 --- a/src/main/java/net/spy/memcached/ArcusClient.java +++ b/src/main/java/net/spy/memcached/ArcusClient.java @@ -1162,11 +1162,6 @@ public Future> asyncDeleteBulk(String... key) { return asyncDeleteBulk(Arrays.asList(key)); } - @Override - public int getMaxPipedItemCount() { - return CollectionPipedInsert.MAX_PIPED_ITEM_COUNT; - } - @Override public CollectionFuture asyncBopCreate(String key, ElementValueType valueType, diff --git a/src/main/java/net/spy/memcached/ArcusClientIF.java b/src/main/java/net/spy/memcached/ArcusClientIF.java index 690737a1f..ce7199161 100644 --- a/src/main/java/net/spy/memcached/ArcusClientIF.java +++ b/src/main/java/net/spy/memcached/ArcusClientIF.java @@ -440,13 +440,6 @@ Future> asyncSopInsertBulk( Future> asyncSopInsertBulk( List keyList, Object value, CollectionAttributes attributesForCreate); - /** - * Get maximum possible piped bulk insert item count. - * - * @return Get maximum possible piped bulk insert item count. - */ - int getMaxPipedItemCount(); - /** * Create an empty b+ tree * diff --git a/src/main/java/net/spy/memcached/ArcusClientPool.java b/src/main/java/net/spy/memcached/ArcusClientPool.java index ad0911595..4ff4cceb4 100644 --- a/src/main/java/net/spy/memcached/ArcusClientPool.java +++ b/src/main/java/net/spy/memcached/ArcusClientPool.java @@ -32,7 +32,6 @@ import net.spy.memcached.collection.BTreeOrder; import net.spy.memcached.collection.ByteArrayBKey; import net.spy.memcached.collection.CollectionAttributes; -import net.spy.memcached.collection.CollectionPipedInsert; import net.spy.memcached.collection.Element; import net.spy.memcached.collection.ElementFlagFilter; import net.spy.memcached.collection.ElementFlagUpdate; @@ -627,11 +626,6 @@ public Future> asyncSopInsertBulk( attributesForCreate); } - @Override - public int getMaxPipedItemCount() { - return CollectionPipedInsert.MAX_PIPED_ITEM_COUNT; - } - @Override public CollectionFuture asyncBopCreate(String key, ElementValueType valueType, diff --git a/src/test/java/net/spy/memcached/ArcusTimeoutTest.java b/src/test/java/net/spy/memcached/ArcusTimeoutTest.java index 1a272d863..deedc0af9 100644 --- a/src/test/java/net/spy/memcached/ArcusTimeoutTest.java +++ b/src/test/java/net/spy/memcached/ArcusTimeoutTest.java @@ -27,6 +27,7 @@ import java.util.concurrent.TimeoutException; import net.spy.memcached.collection.CollectionAttributes; +import net.spy.memcached.collection.CollectionPipedInsert; import net.spy.memcached.collection.ElementFlagFilter; import net.spy.memcached.collection.SMGetElement; import net.spy.memcached.collection.SMGetMode; @@ -141,7 +142,7 @@ void testBulkDeleteTimeoutUsingSingleThread() { @Test void testSopPipedInsertBulkTimeout() { String key = "testTimeout"; - int valueCount = mc.getMaxPipedItemCount(); + int valueCount = CollectionPipedInsert.MAX_PIPED_ITEM_COUNT; Object[] valueList = new Object[valueCount]; for (int i = 0; i < valueList.length; i++) { valueList[i] = "MyValue" + i; @@ -198,7 +199,7 @@ void testBopPipedInsertBulkTimeout() { String key = "MyBopKey"; String value = "MyValue"; - int bkeySize = mc.getMaxPipedItemCount(); + int bkeySize = CollectionPipedInsert.MAX_PIPED_ITEM_COUNT; Map bkeys = new TreeMap<>(); for (int i = 0; i < bkeySize; i++) { bkeys.put((long) i, value); @@ -296,7 +297,7 @@ void testMopInsertBulkMultipleTimeout() { String key = "MyMopKey"; String value = "MyValue"; - int elementSize = mc.getMaxPipedItemCount(); + int elementSize = CollectionPipedInsert.MAX_PIPED_ITEM_COUNT; Map elements = new TreeMap<>(); for (int i = 0; i < elementSize; i++) { elements.put(String.valueOf(i), value); diff --git a/src/test/manual/net/spy/memcached/bulkoperation/SopInsertBulkMultipleValueTest.java b/src/test/manual/net/spy/memcached/bulkoperation/SopInsertBulkMultipleValueTest.java index 9c51894bd..28439ccc9 100644 --- a/src/test/manual/net/spy/memcached/bulkoperation/SopInsertBulkMultipleValueTest.java +++ b/src/test/manual/net/spy/memcached/bulkoperation/SopInsertBulkMultipleValueTest.java @@ -25,6 +25,7 @@ import net.spy.memcached.collection.BaseIntegrationTest; import net.spy.memcached.collection.CollectionAttributes; +import net.spy.memcached.collection.CollectionPipedInsert; import net.spy.memcached.ops.CollectionOperationStatus; import org.junit.jupiter.api.Test; @@ -41,7 +42,7 @@ void testInsertAndGet() { String key = "testInsertAndGet"; String prefix = "MyValue"; - int valueCount = mc.getMaxPipedItemCount(); + int valueCount = CollectionPipedInsert.MAX_PIPED_ITEM_COUNT; Object[] valueList = new Object[valueCount]; for (int i = 0; i < valueList.length; i++) { valueList[i] = String.format("%s%d", prefix, i); diff --git a/src/test/manual/net/spy/memcached/collection/list/LopBulkAPITest.java b/src/test/manual/net/spy/memcached/collection/list/LopBulkAPITest.java index 38eddba08..92a56edc3 100644 --- a/src/test/manual/net/spy/memcached/collection/list/LopBulkAPITest.java +++ b/src/test/manual/net/spy/memcached/collection/list/LopBulkAPITest.java @@ -25,6 +25,7 @@ import net.spy.memcached.collection.BaseIntegrationTest; import net.spy.memcached.collection.CollectionAttributes; import net.spy.memcached.collection.CollectionOverflowAction; +import net.spy.memcached.collection.CollectionPipedInsert; import net.spy.memcached.internal.CollectionFuture; import net.spy.memcached.ops.CollectionOperationStatus; @@ -42,7 +43,7 @@ class LopBulkAPITest extends BaseIntegrationTest { private final List valueList = new ArrayList<>(); private int getValueCount() { - return mc.getMaxPipedItemCount(); + return CollectionPipedInsert.MAX_PIPED_ITEM_COUNT; } @BeforeEach diff --git a/src/test/manual/net/spy/memcached/collection/map/MopBulkAPITest.java b/src/test/manual/net/spy/memcached/collection/map/MopBulkAPITest.java index 1d2fec09e..169ddb0ee 100644 --- a/src/test/manual/net/spy/memcached/collection/map/MopBulkAPITest.java +++ b/src/test/manual/net/spy/memcached/collection/map/MopBulkAPITest.java @@ -24,6 +24,7 @@ import net.spy.memcached.collection.BaseIntegrationTest; import net.spy.memcached.collection.CollectionAttributes; import net.spy.memcached.collection.CollectionOverflowAction; +import net.spy.memcached.collection.CollectionPipedInsert; import net.spy.memcached.internal.CollectionFuture; import net.spy.memcached.ops.CollectionOperationStatus; @@ -41,7 +42,7 @@ class MopBulkAPITest extends BaseIntegrationTest { private final Map updateMap = new HashMap<>(); private int getValueCount() { - return mc.getMaxPipedItemCount(); + return CollectionPipedInsert.MAX_PIPED_ITEM_COUNT; } @BeforeEach diff --git a/src/test/manual/net/spy/memcached/collection/set/SopBulkAPITest.java b/src/test/manual/net/spy/memcached/collection/set/SopBulkAPITest.java index 526f7505e..ac38a08f6 100644 --- a/src/test/manual/net/spy/memcached/collection/set/SopBulkAPITest.java +++ b/src/test/manual/net/spy/memcached/collection/set/SopBulkAPITest.java @@ -26,6 +26,7 @@ import net.spy.memcached.collection.BaseIntegrationTest; import net.spy.memcached.collection.CollectionAttributes; +import net.spy.memcached.collection.CollectionPipedInsert; import net.spy.memcached.internal.CollectionFuture; import net.spy.memcached.ops.CollectionOperationStatus; @@ -42,7 +43,7 @@ class SopBulkAPITest extends BaseIntegrationTest { private final List valueList = new ArrayList<>(); private int getValueCount() { - return mc.getMaxPipedItemCount(); + return CollectionPipedInsert.MAX_PIPED_ITEM_COUNT; } @BeforeEach diff --git a/src/test/manual/net/spy/memcached/collection/set/SopPipedExistTest.java b/src/test/manual/net/spy/memcached/collection/set/SopPipedExistTest.java index 3a3272760..cbfdeab5f 100644 --- a/src/test/manual/net/spy/memcached/collection/set/SopPipedExistTest.java +++ b/src/test/manual/net/spy/memcached/collection/set/SopPipedExistTest.java @@ -24,6 +24,7 @@ import net.spy.memcached.collection.CollectionAttributes; import net.spy.memcached.collection.CollectionResponse; import net.spy.memcached.collection.ElementValueType; +import net.spy.memcached.collection.SetPipedExist; import net.spy.memcached.internal.CollectionFuture; import org.junit.jupiter.api.AfterEach; @@ -145,7 +146,7 @@ void testMaxPipedExist() { List findValues = new ArrayList<>(); // insert items - for (int i = 0; i < mc.getMaxPipedItemCount(); i++) { + for (int i = 0; i < SetPipedExist.MAX_PIPED_ITEM_COUNT; i++) { findValues.add("VALUE" + i); if (i / 2 == 0) { @@ -163,7 +164,7 @@ void testMaxPipedExist() { assertTrue(future.getOperationStatus().isSuccess()); - for (int i = 0; i < mc.getMaxPipedItemCount(); i++) { + for (int i = 0; i < SetPipedExist.MAX_PIPED_ITEM_COUNT; i++) { if (i / 2 == 0) { assertFalse(map.get("VALUE" + i)); } else {