qqu0127 commented on a change in pull request #1935: URL: https://github.com/apache/helix/pull/1935#discussion_r787290107
########## File path: helix-core/src/main/java/org/apache/helix/controller/VirtualTopologyGroupStrategy.java ########## @@ -0,0 +1,80 @@ +package org.apache.helix.controller; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import com.google.common.collect.ImmutableMap; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.helix.util.HelixUtil; + +public enum VirtualTopologyGroupStrategy { Review comment: The Enum `VirtualTopologyGroupStrategy` may have other enum values, e.g. `STRATEGY1`, `STRATEGY2` (in parallel to `DEFAULT` , they can have their own method implementation. And it can be configurable which one to use by parsing string. To clarify, the reason I created this class is to have a way to "implement" static method as in interface. So each enu value defines a strategy, while each strategy comes with an assignment algorithm (abstract method). Indeed, a util class fits here, but I chose to use Enum for better encapsulation. FYI, https://blogs.oracle.com/javamagazine/post/how-to-make-the-most-of-java-enums. That said, I'm afraid this is creating more confusion than I expected, I'll change it to a util class if you don't have objection. We can revisit this when we want to add other implementations. Thanks. -- 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]
