This is an automated email from the ASF dual-hosted git repository.
nwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git
The following commit(s) were added to refs/heads/master by this push:
new 6154c12 Nwang/improve curator connection error message (#3327)
6154c12 is described below
commit 6154c12d21557a5c92ccdf42357b2a728b67fefa
Author: Ning Wang <[email protected]>
AuthorDate: Thu Aug 15 17:43:48 2019 -0700
Nwang/improve curator connection error message (#3327)
* Improve the error messages for blockUntilConnected(). The current
messages sound like client construction issue
* update two more error messages
---
.../heron/statemgr/zookeeper/curator/CuratorStateManager.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git
a/heron/statemgrs/src/java/org/apache/heron/statemgr/zookeeper/curator/CuratorStateManager.java
b/heron/statemgrs/src/java/org/apache/heron/statemgr/zookeeper/curator/CuratorStateManager.java
index 78129cc..3e0e63f 100644
---
a/heron/statemgrs/src/java/org/apache/heron/statemgr/zookeeper/curator/CuratorStateManager.java
+++
b/heron/statemgrs/src/java/org/apache/heron/statemgr/zookeeper/curator/CuratorStateManager.java
@@ -118,10 +118,10 @@ public class CuratorStateManager extends
FileSystemStateManager {
try {
if (!client.blockUntilConnected(ZkContext.connectionTimeoutMs(newConfig),
TimeUnit.MILLISECONDS)) {
- throw new RuntimeException("Failed to initialize CuratorClient");
+ throw new RuntimeException("Failed to connect to " + connectionString);
}
} catch (InterruptedException e) {
- throw new RuntimeException("Failed to initialize CuratorClient", e);
+ throw new RuntimeException("Interrupted from blockUntilConnected(): " +
connectionString, e);
}
if (ZkContext.isInitializeTree(newConfig)) {
@@ -335,7 +335,8 @@ public class CuratorStateManager extends
FileSystemStateManager {
// Suppress it since forPath() throws Exception
// SUPPRESS CHECKSTYLE IllegalCatch
} catch (Exception e) {
- safeSetException(future, new RuntimeException("Could not getNodeData",
e));
+ safeSetException(future, new RuntimeException(
+ "Could not getNodeData using watcher for path: " + path, e));
}
return future;
@@ -448,7 +449,7 @@ public class CuratorStateManager extends
FileSystemStateManager {
public static void main(String[] args) throws ExecutionException,
InterruptedException,
IllegalAccessException, ClassNotFoundException, InstantiationException {
if (args.length < 2) {
- throw new RuntimeException("Expects arguments: <topology_name>
<zookeeper_hostname>");
+ throw new RuntimeException("Expects 2 arguments: <topology_name>
<zookeeper_hostname>");
}
String zookeeperHostname = args[1];