zpinto commented on code in PR #2772:
URL: https://github.com/apache/helix/pull/2772#discussion_r1526814136
##########
helix-common/src/main/java/org/apache/helix/constants/InstanceConstants.java:
##########
@@ -1,17 +1,43 @@
package org.apache.helix.constants;
+import java.util.Set;
+
public class InstanceConstants {
public static final String INSTANCE_NOT_DISABLED = "INSTANCE_NOT_DISABLED";
+ // This means that the instance can have replicas assigned to it by the
rebalancer.
+ // It does not necessarily mean that the replicas will be in ONLINE state.
+ public static final Set<InstanceOperation> ASSIGNABLE_INSTANCE_OPERATIONS =
+ Set.of(InstanceOperation.ENABLE, InstanceOperation.DISABLE);
+
+ // This means that the instance can host partitions that are not OFFLINE. It
does not necessarily
+ // mean that the instance can take new assignment.
+ public static final Set<InstanceOperation>
INSTANCE_OPERATIONS_HOSTING_ONLINE_REPLICAS =
+ Set.of(InstanceOperation.ENABLE, InstanceOperation.EVACUATE);
+
+ // For backwards compatibility with HELIX_ENABLED, we consider the following
InstanceOperations
+ // as DISABLED when HELIX_ENABLED is set to false.
+ public static final Set<InstanceOperation>
INSTANCE_DISABLED_OVERRIDABLE_OPERATIONS =
+ Set.of(InstanceOperation.ENABLE, InstanceOperation.DISABLE,
InstanceOperation.EVACUATE);
+
+ // This means that the instance will not be populated in the routing table
provider and should
+ // be considered as a ghost instance in the cluster.
+ public static final Set<InstanceOperation> UNSERVABLE_INSTANCE_OPERATIONS =
+ Set.of(InstanceOperation.SWAP_IN, InstanceOperation.UNKNOWN);
+
public enum InstanceDisabledType {
CLOUD_EVENT,
USER_OPERATION,
DEFAULT_INSTANCE_DISABLE_TYPE
}
public enum InstanceOperation {
- EVACUATE, // Node will be removed after a period of time
- SWAP_IN, // New node joining for swap operation
- SWAP_OUT // Existing Node to be removed for swap operation
+ ENABLE, // ENABLE: Node can host online replicas and is assignable
Review Comment:
Update the description of each state
--
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]