Skip to content

Commit

Permalink
CLEANUP: renaming hostPort in CacheManager
Browse files Browse the repository at this point in the history
  • Loading branch information
MinWooJin committed Oct 14, 2020
1 parent 7bbec43 commit 5aaae97
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/main/java/net/spy/memcached/CacheManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class CacheManager extends SpyThread implements Watcher,

private static final long ZK_CONNECT_TIMEOUT = ZK_SESSION_TIMEOUT;

private final String hostPort;
private final String zkConnectString;

private final String serviceCode;

Expand Down Expand Up @@ -93,7 +93,7 @@ public CacheManager(String hostPort, String serviceCode,
ConnectionFactoryBuilder cfb, CountDownLatch clientInitLatch, int poolSize,
int waitTimeForConnect) {

this.hostPort = hostPort;
this.zkConnectString = hostPort;
this.serviceCode = serviceCode;
this.cfb = cfb;
this.clientInitLatch = clientInitLatch;
Expand All @@ -112,10 +112,10 @@ public CacheManager(String hostPort, String serviceCode,

private void initZooKeeperClient() {
try {
getLogger().info("Trying to connect to Arcus admin(%s@%s)", serviceCode, hostPort);
getLogger().info("Trying to connect to Arcus admin(%s@%s)", serviceCode, zkConnectString);

zkInitLatch = new CountDownLatch(1);
zk = new ZooKeeper(hostPort, ZK_SESSION_TIMEOUT, this);
zk = new ZooKeeper(zkConnectString, ZK_SESSION_TIMEOUT, this);

try {
/* In the above ZooKeeper() internals, reverse DNS lookup occurs
Expand All @@ -126,8 +126,8 @@ private void initZooKeeperClient() {
*/
if (zkInitLatch.await(ZK_CONNECT_TIMEOUT, TimeUnit.MILLISECONDS) == false) {
getLogger().fatal("Connecting to Arcus admin(%s) timed out : %d miliseconds",
hostPort, ZK_CONNECT_TIMEOUT);
throw new AdminConnectTimeoutException(hostPort);
zkConnectString, ZK_CONNECT_TIMEOUT);
throw new AdminConnectTimeoutException(zkConnectString);
}

/* ENABLE_REPLICATION if */
Expand Down Expand Up @@ -172,7 +172,7 @@ private void initZooKeeperClient() {
throw e;
} catch (InterruptedException ie) {
getLogger().fatal("Can't connect to Arcus admin(%s@%s) %s",
serviceCode, hostPort, ie.getMessage());
serviceCode, zkConnectString, ie.getMessage());
shutdownZooKeeperClient();
return;
} catch (Exception e) {
Expand Down Expand Up @@ -253,7 +253,7 @@ public void process(WatchedEvent event) {
switch (event.getState()) {
case SyncConnected:
zkInitLatch.countDown();
getLogger().info("Connected to Arcus admin. (%s@%s)", serviceCode, hostPort);
getLogger().info("Connected to Arcus admin. (%s@%s)", serviceCode, zkConnectString);
if (cacheMonitor != null) {
getLogger().warn("Reconnected to the Arcus admin. " + getInfo());
} else {
Expand Down

0 comments on commit 5aaae97

Please sign in to comment.