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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]