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 Details

    • isVeniceControllerClusterCreated

      boolean isVeniceControllerClusterCreated()
      Check if the Venice controller cluster is created and configured.
      Returns:
      true or false.
    • isVeniceStorageClusterCreated

      boolean isVeniceStorageClusterCreated(String clusterName)
      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 - ClusterConfig for the new cluster.
      restConfig - RESTConfig for the new cluster.
    • isVeniceStorageClusterInControllerCluster

      boolean isVeniceStorageClusterInControllerCluster(String clusterName)
      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

      void addVeniceStorageClusterToControllerCluster(String clusterName)
      Add the given Venice storage cluster's cluster resource to the controller cluster.
      Parameters:
      clusterName - of the Venice storage cluster.
    • isClusterInGrandCluster

      boolean isClusterInGrandCluster(String clusterName)
      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

      void addClusterToGrandCluster(String clusterName)
      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

      void updateClusterConfigs(String clusterName, org.apache.helix.model.ClusterConfig clusterConfig)
      Update some Helix cluster properties for the given cluster.
      Parameters:
      clusterName - of the cluster to be updated.
      clusterConfig - ClusterConfig for the new cluster.
    • updateRESTConfigs

      void updateRESTConfigs(String clusterName, org.apache.helix.model.RESTConfig restConfig)
      Update some Helix cluster properties for the given cluster.
      Parameters:
      clusterName - of the cluster to be updated.
      restConfig - RESTConfig for 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

      List<String> getInstancesInCluster(String clusterName)
      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

      boolean containsResource(String clusterName, String resourceName)
      Check if a resource exists in a cluster by checking its ideal state.
    • dropResource

      void dropResource(String clusterName, String resourceName)
      Drop a resource from a cluster.
    • dropStorageInstance

      void dropStorageInstance(String clusterName, String instanceName)
      Drop a storage node instance from the given cluster.
    • getDisabledPartitionsMap

      Map<String,List<String>> getDisabledPartitionsMap(String clusterName, String instanceName)
      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 with InstanceConstants.InstanceOperation.
      Parameters:
      clusterName - The cluster name
      instanceName - The instance name
      instanceOperation - The instance operation type
      reason - The reason for the operation