cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cassandra] jasonstack commented on a change in pull request #446: CASSANDRA-15564 Refactor repair coordinator to centralize stage change logic and improved the public facing errors
Date Tue, 10 Mar 2020 07:24:04 GMT
jasonstack commented on a change in pull request #446: CASSANDRA-15564 Refactor repair coordinator
to centralize stage change logic and improved the public facing errors
URL: https://github.com/apache/cassandra/pull/446#discussion_r390130474
 
 

 ##########
 File path: test/distributed/org/apache/cassandra/distributed/impl/Instance.java
 ##########
 @@ -552,9 +568,66 @@ public int liveMemberCount()
         }).call();
     }
 
-    public int nodetool(String... commandAndArgs)
+    public NodeToolResult nodetoolResult(boolean withNotifications, String... commandAndArgs)
     {
-        return sync(() -> new NodeTool(new InternalNodeProbeFactory()).execute(commandAndArgs)).call();
+        return sync(() -> {
+            DTestNodeTool nodetool = new DTestNodeTool(withNotifications);
+            int rc =  nodetool.execute(commandAndArgs);
+            return new NodeToolResult(commandAndArgs, rc, new ArrayList<>(nodetool.notifications.notifications),
nodetool.latestError);
+        }).call();
+    }
+
+    private static class DTestNodeTool extends NodeTool {
+        private final StorageServiceMBean storageProxy;
+        private final CollectingNotificationListener notifications = new CollectingNotificationListener();
+
+        private Throwable latestError;
+
+        DTestNodeTool(boolean withNotifications) {
+            super(new InternalNodeProbeFactory(withNotifications));
 
 Review comment:
   since we are creating `InternalNodeProbe` instance to get `storageProxy ` in the next line.
It looks like we don't need `withNotifications` for `InternalNodeProbeFactory`..

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message