Skip to content

Commit 2ec8a20

Browse files
committed
REACTOR: ArucsClientPool constructor parameters.
1 parent d50edf1 commit 2ec8a20

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

src/main/java/net/spy/memcached/ArcusClient.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,7 @@ private static ArcusClientPool createArcusClient(String hostPorts, String servic
288288
if (serviceCode.isEmpty()) {
289289
throw new IllegalArgumentException("Service code is empty.");
290290
}
291-
292-
CacheManager exe = new CacheManager(hostPorts, serviceCode, cfb, poolSize, waitTimeForConnect);
293-
return new ArcusClientPool(poolSize, exe.getAC());
291+
return new ArcusClientPool(new CacheManager(hostPorts, serviceCode, cfb, poolSize, waitTimeForConnect));
294292
}
295293

296294
/**

src/main/java/net/spy/memcached/ArcusClientPool.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ public class ArcusClientPool implements MemcachedClientIF, ArcusClientIF {
6060
private final ArcusClient[] client;
6161
private final Random rand;
6262

63-
public ArcusClientPool(int poolSize, ArcusClient[] client) {
64-
65-
this.poolSize = poolSize;
66-
this.client = client;
67-
rand = new Random();
63+
public ArcusClientPool(CacheManager cacheManager) {
64+
this.poolSize = cacheManager.getAC().length;
65+
this.client = cacheManager.getAC();
66+
this.rand = new Random();
6867
}
6968

7069
/**

0 commit comments

Comments
 (0)