Skip to content

Commit

Permalink
REFACTOR: remove unused getMaxPipeCount.
Browse files Browse the repository at this point in the history
  • Loading branch information
brido4125 authored and jhpark816 committed Dec 12, 2024
1 parent 7b301af commit 9d9ffde
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 27 deletions.
5 changes: 0 additions & 5 deletions src/main/java/net/spy/memcached/ArcusClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1162,11 +1162,6 @@ public Future<Map<String, OperationStatus>> asyncDeleteBulk(String... key) {
return asyncDeleteBulk(Arrays.asList(key));
}

@Override
public int getMaxPipedItemCount() {
return CollectionPipedInsert.MAX_PIPED_ITEM_COUNT;
}

@Override
public CollectionFuture<Boolean> asyncBopCreate(String key,
ElementValueType valueType,
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/net/spy/memcached/ArcusClientIF.java
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,6 @@ <T> Future<Map<String, CollectionOperationStatus>> asyncSopInsertBulk(
Future<Map<String, CollectionOperationStatus>> asyncSopInsertBulk(
List<String> 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
*
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/net/spy/memcached/ArcusClientPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -627,11 +626,6 @@ public Future<Map<String, CollectionOperationStatus>> asyncSopInsertBulk(
attributesForCreate);
}

@Override
public int getMaxPipedItemCount() {
return CollectionPipedInsert.MAX_PIPED_ITEM_COUNT;
}

@Override
public CollectionFuture<Boolean> asyncBopCreate(String key,
ElementValueType valueType,
Expand Down
7 changes: 4 additions & 3 deletions src/test/java/net/spy/memcached/ArcusTimeoutTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -198,7 +199,7 @@ void testBopPipedInsertBulkTimeout() {
String key = "MyBopKey";
String value = "MyValue";

int bkeySize = mc.getMaxPipedItemCount();
int bkeySize = CollectionPipedInsert.MAX_PIPED_ITEM_COUNT;
Map<Long, Object> bkeys = new TreeMap<>();
for (int i = 0; i < bkeySize; i++) {
bkeys.put((long) i, value);
Expand Down Expand Up @@ -296,7 +297,7 @@ void testMopInsertBulkMultipleTimeout() {
String key = "MyMopKey";
String value = "MyValue";

int elementSize = mc.getMaxPipedItemCount();
int elementSize = CollectionPipedInsert.MAX_PIPED_ITEM_COUNT;
Map<String, Object> elements = new TreeMap<>();
for (int i = 0; i < elementSize; i++) {
elements.put(String.valueOf(i), value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -42,7 +43,7 @@ class LopBulkAPITest extends BaseIntegrationTest {
private final List<Object> valueList = new ArrayList<>();

private int getValueCount() {
return mc.getMaxPipedItemCount();
return CollectionPipedInsert.MAX_PIPED_ITEM_COUNT;
}

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -41,7 +42,7 @@ class MopBulkAPITest extends BaseIntegrationTest {
private final Map<String, Object> updateMap = new HashMap<>();

private int getValueCount() {
return mc.getMaxPipedItemCount();
return CollectionPipedInsert.MAX_PIPED_ITEM_COUNT;
}

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -42,7 +43,7 @@ class SopBulkAPITest extends BaseIntegrationTest {
private final List<Object> valueList = new ArrayList<>();

private int getValueCount() {
return mc.getMaxPipedItemCount();
return CollectionPipedInsert.MAX_PIPED_ITEM_COUNT;
}

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -145,7 +146,7 @@ void testMaxPipedExist() {
List<Object> 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) {
Expand All @@ -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 {
Expand Down

0 comments on commit 9d9ffde

Please sign in to comment.