Package com.linkedin.venice.controller
Interface HelixAdminClient
- All Known Implementing Classes:
ZkHelixAdminClient
public interface HelixAdminClient
Interface and wrapper for Helix related admin operations needed by Venice when running Helix as a service.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddClusterToGrandCluster(String clusterName) Add the specified cluster as a resource to the grand cluster to be managed by HaaS controllers.voidaddVeniceStorageClusterToControllerCluster(String clusterName) Add the given Venice storage cluster's cluster resource to the controller cluster.voidclose()Release resources.booleancontainsResource(String clusterName, String resourceName) Check if a resource exists in a cluster by checking its ideal state.voidCreate and configure the Venice controller cluster.voidcreateVeniceStorageCluster(String clusterName, org.apache.helix.model.ClusterConfig clusterConfig, org.apache.helix.model.RESTConfig restConfig) Create and configure the Venice storage cluster.voidcreateVeniceStorageClusterResources(String clusterName, String kafkaTopic, int numberOfPartition, int replicationFactor) Create resources for a given storage node cluster.voiddropResource(String clusterName, String resourceName) Drop a resource from a cluster.voiddropStorageInstance(String clusterName, String instanceName) Drop a storage node instance from the given cluster.voidenablePartition(boolean enabled, String clusterName, String instanceName, String resourceName, List<String> partitionNames) Disable or enable a list of partitions on an instance.getDisabledPartitionsMap(String clusterName, String instanceName) Returns a list of disabled partitions in an instance.getInstancesInCluster(String clusterName) Get a list of instances under a cluster.org.apache.helix.model.IdealStategetResourceIdealState(String clusterName, String resourceName) booleanisClusterInGrandCluster(String clusterName) Check if the grand cluster managed by HaaS controllers is aware of the given cluster.booleanCheck if the Venice controller cluster is created and configured.booleanisVeniceStorageClusterCreated(String clusterName) Check if the given Venice storage cluster is created and configured.booleanisVeniceStorageClusterInControllerCluster(String clusterName) Check if the given Venice storage cluster's cluster resource is in the Venice controller cluster.voidmanuallyEnableMaintenanceMode(String clusterName, boolean enabled, String reason, Map<String, String> customFields) Manually enable maintenance mode.voidresetPartition(String clusterName, String instanceName, String resourceName, List<String> partitionNames) Reset a list of partitions in error state for an instance.voidsetInstanceOperation(String clusterName, String instanceName, org.apache.helix.constants.InstanceConstants.InstanceOperation instanceOperation, String reason) Set the instanceOperation of and instance withInstanceConstants.InstanceOperation.voidupdateClusterConfigs(String clusterName, org.apache.helix.model.ClusterConfig clusterConfig) Update some Helix cluster properties for the given cluster.voidupdateIdealState(String clusterName, String resourceName, org.apache.helix.model.IdealState idealState) voidupdateRESTConfigs(String clusterName, org.apache.helix.model.RESTConfig restConfig) Update some Helix cluster properties for the given cluster.
-
Method Details
-
isVeniceControllerClusterCreated
boolean isVeniceControllerClusterCreated()Check if the Venice controller cluster is created and configured.- Returns:
- true or false.
-
isVeniceStorageClusterCreated
Check if the given Venice storage cluster is created and configured.- Parameters:
clusterName- of the Venice cluster.- Returns:
- true or false.
-
createVeniceControllerCluster
void createVeniceControllerCluster()Create and configure the Venice controller cluster. -
createVeniceStorageCluster
void createVeniceStorageCluster(String clusterName, org.apache.helix.model.ClusterConfig clusterConfig, org.apache.helix.model.RESTConfig restConfig) Create and configure the Venice storage cluster.- Parameters:
clusterName- of the Venice storage cluster.clusterConfig-ClusterConfigfor the new cluster.restConfig-RESTConfigfor the new cluster.
-
isVeniceStorageClusterInControllerCluster
Check if the given Venice storage cluster's cluster resource is in the Venice controller cluster.- Parameters:
clusterName- of the Venice storage cluster.- Returns:
- true or false.
-
addVeniceStorageClusterToControllerCluster
Add the given Venice storage cluster's cluster resource to the controller cluster.- Parameters:
clusterName- of the Venice storage cluster.
-
isClusterInGrandCluster
Check if the grand cluster managed by HaaS controllers is aware of the given cluster.- Parameters:
clusterName- of the cluster.- Returns:
- true or false.
-
addClusterToGrandCluster
Add the specified cluster as a resource to the grand cluster to be managed by HaaS controllers.- Parameters:
clusterName- of the cluster to be added as a resource to the grand cluster.
-
updateClusterConfigs
Update some Helix cluster properties for the given cluster.- Parameters:
clusterName- of the cluster to be updated.clusterConfig-ClusterConfigfor the new cluster.
-
updateRESTConfigs
Update some Helix cluster properties for the given cluster.- Parameters:
clusterName- of the cluster to be updated.restConfig-RESTConfigfor the new cluster.
-
enablePartition
void enablePartition(boolean enabled, String clusterName, String instanceName, String resourceName, List<String> partitionNames) Disable or enable a list of partitions on an instance. -
getInstancesInCluster
Get a list of instances under a cluster.- Returns:
- a list of instance names.
-
createVeniceStorageClusterResources
void createVeniceStorageClusterResources(String clusterName, String kafkaTopic, int numberOfPartition, int replicationFactor) Create resources for a given storage node cluster. -
containsResource
Check if a resource exists in a cluster by checking its ideal state. -
dropResource
Drop a resource from a cluster. -
dropStorageInstance
Drop a storage node instance from the given cluster. -
getDisabledPartitionsMap
Returns a list of disabled partitions in an instance. -
resetPartition
void resetPartition(String clusterName, String instanceName, String resourceName, List<String> partitionNames) Reset a list of partitions in error state for an instance.The partitions are assumed to be in error state and reset will bring them from error to initial state. An error to initial state transition is required for reset.
-
close
void close()Release resources. -
manuallyEnableMaintenanceMode
void manuallyEnableMaintenanceMode(String clusterName, boolean enabled, String reason, Map<String, String> customFields) Manually enable maintenance mode. To be called by the REST client that accepts KV mappings as the payload. -
setInstanceOperation
void setInstanceOperation(String clusterName, String instanceName, org.apache.helix.constants.InstanceConstants.InstanceOperation instanceOperation, String reason) Set the instanceOperation of and instance withInstanceConstants.InstanceOperation.- Parameters:
clusterName- The cluster nameinstanceName- The instance nameinstanceOperation- The instance operation typereason- The reason for the operation
-
getResourceIdealState
-
updateIdealState
-