You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "junkaixue (via GitHub)" <gi...@apache.org> on 2023/02/28 19:45:26 UTC

[GitHub] [helix] junkaixue commented on a diff in pull request #2380: Refactor updating and searching for threadpool for state transition messages

junkaixue commented on code in PR #2380:
URL: https://github.com/apache/helix/pull/2380#discussion_r1120687500


##########
helix-core/src/main/java/org/apache/helix/model/Message.java:
##########
@@ -966,4 +966,46 @@ public boolean isValid() {
     }
     return true;
   }
+
+  /**
+   * This class is for categorizing state transition messages based on certain properties, and generating
+   */
+  public static class MessageInfo {
+    public String _msgType;
+    public String _resourceName;
+    public String _fromState;
+    public String _toState;
+
+    public enum MessageIdentifierBase {
+      PER_RESOURCE, PER_STATE_TRANSITION_TYPE

Review Comment:
   NIT: formatter problem?



##########
helix-core/src/main/java/org/apache/helix/model/Message.java:
##########
@@ -966,4 +966,46 @@ public boolean isValid() {
     }
     return true;
   }
+
+  /**
+   * This class is for categorizing state transition messages based on certain properties, and generating
+   */
+  public static class MessageInfo {
+    public String _msgType;
+    public String _resourceName;
+    public String _fromState;
+    public String _toState;
+
+    public enum MessageIdentifierBase {
+      PER_RESOURCE, PER_STATE_TRANSITION_TYPE
+    }
+
+    public MessageInfo(Message message) {
+      _msgType = message.getMsgType();
+      _resourceName = message.getResourceName();
+      _fromState = message.getFromState();
+      _toState = message.getToState();
+    }
+
+    public String getMessageIdentifier(MessageIdentifierBase basis) {
+      String delimiter = ".";
+      if (_msgType == null) {
+        return null;
+      }
+      String identifier = _msgType;
+      if (basis.ordinal() >= MessageIdentifierBase.PER_RESOURCE.ordinal()) {

Review Comment:
   How was the ordinal work? The number larger means the position higher? What if this non-existing type?



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org