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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addClusterToGrandCluster​(java.lang.String clusterName)
      Add the specified cluster as a resource to the grand cluster to be managed by HaaS controllers.
      void addVeniceStorageClusterToControllerCluster​(java.lang.String clusterName)
      Add the given Venice storage cluster's cluster resource to the controller cluster.
      void close()
      Release resources.
      boolean containsResource​(java.lang.String clusterName, java.lang.String resourceName)
      Check if a resource exists in a cluster by checking its ideal state.
      void createVeniceControllerCluster​(boolean isControllerInAzureFabric)
      Create and configure the Venice controller cluster.
      void createVeniceStorageCluster​(java.lang.String clusterName, java.util.Map<java.lang.String,​java.lang.String> helixClusterProperties, boolean isControllerInAzureFabric)
      Create and configure the Venice storage cluster.
      void createVeniceStorageClusterResources​(java.lang.String clusterName, java.lang.String kafkaTopic, int numberOfPartition, int replicationFactor)
      Create resources for a given storage node cluster.
      void dropResource​(java.lang.String clusterName, java.lang.String resourceName)
      Drop a resource from a cluster.
      void dropStorageInstance​(java.lang.String clusterName, java.lang.String instanceName)
      Drop a storage node instance from the given cluster.
      void enablePartition​(boolean enabled, java.lang.String clusterName, java.lang.String instanceName, java.lang.String resourceName, java.util.List<java.lang.String> partitionNames)
      Disable or enable a list of partitions on an instance.
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getDisabledPartitionsMap​(java.lang.String clusterName, java.lang.String instanceName)
      Returns a list of disabled partitions in an instance.
      java.util.List<java.lang.String> getInstancesInCluster​(java.lang.String clusterName)
      Get a list of instances under a cluster.
      boolean isClusterInGrandCluster​(java.lang.String clusterName)
      Check if the grand cluster managed by HaaS controllers is aware of the given cluster.
      boolean isVeniceControllerClusterCreated()
      Check if the Venice controller cluster is created and configured.
      boolean isVeniceStorageClusterCreated​(java.lang.String clusterName)
      Check if the given Venice storage cluster is created and configured.
      boolean isVeniceStorageClusterInControllerCluster​(java.lang.String clusterName)
      Check if the given Venice storage cluster's cluster resource is in the Venice controller cluster.
      void resetPartition​(java.lang.String clusterName, java.lang.String instanceName, java.lang.String resourceName, java.util.List<java.lang.String> partitionNames)
      Reset a list of partitions in error state for an instance.
      void updateClusterConfigs​(java.lang.String clusterName, java.util.Map<java.lang.String,​java.lang.String> helixClusterProperties)
      Update some Helix cluster properties for the given cluster.
    • Method Detail

      • isVeniceControllerClusterCreated

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

        boolean isVeniceStorageClusterCreated​(java.lang.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​(boolean isControllerInAzureFabric)
        Create and configure the Venice controller cluster.
        Parameters:
        isControllerInAzureFabric - whether the controller is in Azure fabric.
      • createVeniceStorageCluster

        void createVeniceStorageCluster​(java.lang.String clusterName,
                                        java.util.Map<java.lang.String,​java.lang.String> helixClusterProperties,
                                        boolean isControllerInAzureFabric)
        Create and configure the Venice storage cluster.
        Parameters:
        clusterName - of the Venice storage cluster.
        helixClusterProperties - to be applied to the new cluster.
        isControllerInAzureFabric - whether the controller is in Azure fabric.
      • isVeniceStorageClusterInControllerCluster

        boolean isVeniceStorageClusterInControllerCluster​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String clusterName,
                                  java.util.Map<java.lang.String,​java.lang.String> helixClusterProperties)
        Update some Helix cluster properties for the given cluster.
        Parameters:
        clusterName - of the cluster to be updated.
        helixClusterProperties - to be applied to the given cluster.
      • enablePartition

        void enablePartition​(boolean enabled,
                             java.lang.String clusterName,
                             java.lang.String instanceName,
                             java.lang.String resourceName,
                             java.util.List<java.lang.String> partitionNames)
        Disable or enable a list of partitions on an instance.
      • getInstancesInCluster

        java.util.List<java.lang.String> getInstancesInCluster​(java.lang.String clusterName)
        Get a list of instances under a cluster.
        Returns:
        a list of instance names.
      • createVeniceStorageClusterResources

        void createVeniceStorageClusterResources​(java.lang.String clusterName,
                                                 java.lang.String kafkaTopic,
                                                 int numberOfPartition,
                                                 int replicationFactor)
        Create resources for a given storage node cluster.
      • containsResource

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

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

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

        java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getDisabledPartitionsMap​(java.lang.String clusterName,
                                                                                                        java.lang.String instanceName)
        Returns a list of disabled partitions in an instance.
      • resetPartition

        void resetPartition​(java.lang.String clusterName,
                            java.lang.String instanceName,
                            java.lang.String resourceName,
                            java.util.List<java.lang.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.