You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/12/03 20:25:33 UTC

[GitHub] [cassandra] smiklosovic commented on a change in pull request #1353: 10023

smiklosovic commented on a change in pull request #1353:
URL: https://github.com/apache/cassandra/pull/1353#discussion_r762221874



##########
File path: src/java/org/apache/cassandra/service/StorageProxy.java
##########
@@ -795,6 +805,20 @@ protected Verb verb()
         });
     }
 
+    public static boolean hasLocalMutation(IMutation mutation)
+    {
+        String keyspace = mutation.getKeyspaceName();
+        List<String> endpoints = StorageService.instance.getNaturalEndpointsWithPort(keyspace, mutation.key().getKey());
+        return canDoLocalRequest(endpoints);
+    }
+
+    public static boolean canDoLocalRequest(List<String> endpoints)
+    {
+        String[] split = FBUtilities.getBroadcastAddressAndPort().toString().split("/");

Review comment:
       This is here because getBroadcastAddressAndPort returns something like "/127.0.0.1:1234" (with / at the start), there does not seem to be any other method which would return port as well without that slash. I would create a helper method where this would be precomputed and just reused.




-- 
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.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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