Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log in ZkclientZookeeperClient.java #3109

Merged
merged 1 commit into from
Jan 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import org.apache.dubbo.common.Constants;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.remoting.zookeeper.ChildListener;
import org.apache.dubbo.remoting.zookeeper.StateListener;
import org.apache.dubbo.remoting.zookeeper.support.AbstractZookeeperClient;
Expand All @@ -32,6 +34,8 @@

public class ZkclientZookeeperClient extends AbstractZookeeperClient<IZkChildListener> {

private Logger logger = LoggerFactory.getLogger(ZkclientZookeeperClient.class);

private final ZkClientWrapper client;

private volatile KeeperState state = KeeperState.SyncConnected;
Expand Down Expand Up @@ -65,6 +69,7 @@ public void createPersistent(String path) {
try {
client.createPersistent(path);
} catch (ZkNodeExistsException e) {
logger.error("zookeeper failed to create persistent node with " + path + ": ", e);
}
}

Expand All @@ -73,6 +78,7 @@ public void createEphemeral(String path) {
try {
client.createEphemeral(path);
} catch (ZkNodeExistsException e) {
logger.error("zookeeper failed to create ephemeral node with " + path + ": ", e);
}
}

Expand All @@ -81,6 +87,8 @@ protected void createPersistent(String path, String data) {
try {
client.createPersistent(path, data);
} catch (ZkNodeExistsException e) {
logger.error("zookeeper failed to create persistent node with " +
path + " and " + data + " : ", e);
}
}

Expand All @@ -89,6 +97,8 @@ protected void createEphemeral(String path, String data) {
try {
client.createEphemeral(path, data);
} catch (ZkNodeExistsException e) {
logger.error("zookeeper failed to create ephemeral node with " +
path + " and " + data + " : ", e);
}
}

Expand All @@ -97,6 +107,7 @@ public void delete(String path) {
try {
client.delete(path);
} catch (ZkNoNodeException e) {
logger.error("zookeeper failed to delete node with " + path + ": ", e);
}
}

Expand All @@ -105,6 +116,7 @@ public List<String> getChildren(String path) {
try {
return client.getChildren(path);
} catch (ZkNoNodeException e) {
logger.error("zookeeper failed to get children node with " + path + ": ", e);
return null;
}
}
Expand All @@ -114,6 +126,7 @@ public boolean checkExists(String path) {
try {
return client.exists(path);
} catch (Throwable t) {
logger.error("zookeeper failed to check node existing with " + path + ": ", t);
}
return false;
}
Expand All @@ -128,6 +141,7 @@ public String doGetContent(String path) {
try {
return client.getData(path);
} catch (ZkNoNodeException e) {
logger.error("zookeeper failed to get data with " + path + ": ", e);
return null;
}
}
Expand Down