Package com.linkedin.venice.helix
Class HelixInstanceConfigRepository
java.lang.Object
com.linkedin.venice.helix.HelixInstanceConfigRepository
- All Implemented Interfaces:
VeniceResource
,org.apache.helix.api.listeners.InstanceConfigChangeListener
public class HelixInstanceConfigRepository
extends 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 Summary
-
Constructor Summary
ConstructorDescriptionHelixInstanceConfigRepository
(SafeHelixManager manager, boolean useGroupFieldInDomain) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
int
int
getInstanceGroupId
(String instanceId) void
onInstanceConfigChange
(List<org.apache.helix.model.InstanceConfig> instanceConfigs, org.apache.helix.NotificationContext context) This function will assign a unique group id per group.void
refresh()
-
Field Details
-
DEFAULT_INSTANCE_GROUP_ID
public static final int DEFAULT_INSTANCE_GROUP_ID- See Also:
-
GROUP_FIELD_NAME_IN_DOMAIN
- See Also:
-
ZONE_FIELD_NAME_IN_DOMAIN
- See Also:
-
-
Constructor Details
-
HelixInstanceConfigRepository
-
-
Method Details
-
refresh
public void refresh()- Specified by:
refresh
in interfaceVeniceResource
-
clear
public void clear()- Specified by:
clear
in interfaceVeniceResource
-
getInstanceGroupId
-
getInstanceGroupIdMapping
-
getGroupCount
public int getGroupCount() -
onInstanceConfigChange
public void onInstanceConfigChange(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 interfaceorg.apache.helix.api.listeners.InstanceConfigChangeListener
-