Class HelixInstanceConfigRepository

  • All Implemented Interfaces:
    VeniceResource, org.apache.helix.api.listeners.InstanceConfigChangeListener

    public class HelixInstanceConfigRepository
    extends java.lang.Object
    implements VeniceResource, org.apache.helix.api.listeners.InstanceConfigChangeListener
    This repository is used to store the instance config per instance. So far it only stores group/zone info, and we could add more if necessary in the future.
    • Field Detail


        public static final int DEFAULT_INSTANCE_GROUP_ID
        See Also:
        Constant Field Values

        public static final java.lang.String GROUP_FIELD_NAME_IN_DOMAIN
        See Also:
        Constant Field Values

        public static final java.lang.String ZONE_FIELD_NAME_IN_DOMAIN
        See Also:
        Constant Field Values
    • Constructor Detail

      • HelixInstanceConfigRepository

        public HelixInstanceConfigRepository​(SafeHelixManager manager,
                                             boolean useGroupFieldInDomain)
    • Method Detail

      • getInstanceGroupId

        public int getInstanceGroupId​(java.lang.String instanceId)
      • getInstanceGroupIdMapping

        public java.util.Map<java.lang.String,​java.lang.Integer> getInstanceGroupIdMapping()
      • getGroupCount

        public int getGroupCount()
      • onInstanceConfigChange

        public void onInstanceConfigChange​(java.util.List<org.apache.helix.model.InstanceConfig> instanceConfigs,
                                           org.apache.helix.NotificationContext context)
        This function will assign a unique group id per group. If there is no group defined for some instances, this function will use empty string as the default.
        Specified by:
        onInstanceConfigChange in interface org.apache.helix.api.listeners.InstanceConfigChangeListener