Skip to content

Commit

Permalink
REACTOR: ArucsClientPool constructor parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
brido4125 committed Jun 5, 2024
1 parent d50edf1 commit 2ec8a20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/main/java/net/spy/memcached/ArcusClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,7 @@ private static ArcusClientPool createArcusClient(String hostPorts, String servic
if (serviceCode.isEmpty()) {
throw new IllegalArgumentException("Service code is empty.");
}

CacheManager exe = new CacheManager(hostPorts, serviceCode, cfb, poolSize, waitTimeForConnect);
return new ArcusClientPool(poolSize, exe.getAC());
return new ArcusClientPool(new CacheManager(hostPorts, serviceCode, cfb, poolSize, waitTimeForConnect));
}

/**
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/net/spy/memcached/ArcusClientPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ public class ArcusClientPool implements MemcachedClientIF, ArcusClientIF {
private final ArcusClient[] client;
private final Random rand;

public ArcusClientPool(int poolSize, ArcusClient[] client) {

this.poolSize = poolSize;
this.client = client;
rand = new Random();
public ArcusClientPool(CacheManager cacheManager) {
this.poolSize = cacheManager.getAC().length;
this.client = cacheManager.getAC();
this.rand = new Random();
}

/**
Expand Down

0 comments on commit 2ec8a20

Please sign in to comment.