public interface

HelixAdmin

org.apache.helix.HelixAdmin
Known Indirect Subclasses

Summary

Public Methods
abstract boolean addCluster(String clusterName, boolean recreateIfExists)
Add a cluster
abstract boolean addCluster(String clusterName)
Add a cluster
abstract void addClusterToGrandCluster(String clusterName, String grandCluster)
Add a cluster and also add this cluster as a resource group in the super cluster
abstract void addIdealState(String clusterName, String resourceName, String idealStateFile)
Add ideal state using a json format file
abstract void addInstance(String clusterName, InstanceConfig instanceConfig)
Add an instance to a cluster
abstract void addInstanceTag(String clusterName, String instanceName, String tag)
abstract void addResource(String clusterName, String resourceName, int numPartitions, String stateModelRef, String rebalancerMode)
Add a resource to a cluster
abstract void addResource(String clusterName, String resourceName, IdealState idealstate)
abstract void addResource(String clusterName, String resourceName, int numPartitions, String stateModelRef, String rebalancerMode, int bucketSize)
Add a resource to a cluster, using a bucket size > 1
abstract void addResource(String clusterName, String resourceName, int numPartitions, String stateModelRef)
Add a resource to a cluster, using the default ideal state mode AUTO
abstract void addResource(String clusterName, String resourceName, int numPartitions, String stateModelRef, String rebalancerMode, int bucketSize, int maxPartitionsPerInstance)
Add a resource to a cluster, using a bucket size > 1
abstract void addStateModelDef(String clusterName, String stateModelDef, StateModelDefinition record)
Add a state model definition
abstract void addStateModelDef(String clusterName, String stateModelDefName, String stateModelDefFile)
Add state model definition using a json format file
abstract void close()
Release resources
abstract void dropCluster(String clusterName)
Drop a cluster
abstract void dropInstance(String clusterName, InstanceConfig instanceConfig)
Drop an instance from a cluster
abstract void dropResource(String clusterName, String resourceName)
Drop a resource from a cluster
abstract void enableCluster(String clusterName, boolean enabled)
Disable or enable a cluster
abstract void enableInstance(String clusterName, String instanceName, boolean enabled)
Disable or enable an instance
abstract void enablePartition(boolean enabled, String clusterName, String instanceName, String resourceName, List<String> partitionNames)
Disable or enable a list of partitions on an instance
abstract void enableResource(String clusterName, String resourceName, boolean enabled)
Disable or enable a resource
abstract List<String> getClusters()
Get a list of clusters under "/"
abstract Map<StringString> getConfig(HelixConfigScope scope, List<String> keys)
Get configuration values
abstract List<String> getConfigKeys(HelixConfigScope scope)
Get configuration keys
abstract ClusterConstraints getConstraints(String clusterName, ClusterConstraints.ConstraintType constraintType)
Get all constraints for a type
abstract InstanceConfig getInstanceConfig(String clusterName, String instanceName)
Get an instance config
abstract List<String> getInstancesInCluster(String clusterName)
Get a list of instances under a cluster
abstract List<String> getInstancesInClusterWithTag(String clusterName, String tag)
abstract ExternalView getResourceExternalView(String clusterName, String resourceName)
Get external view for a resource
abstract IdealState getResourceIdealState(String clusterName, String resourceName)
Get ideal state for a resource
abstract List<String> getResourcesInCluster(String clusterName)
Get a list of resources in a cluster
abstract StateModelDefinition getStateModelDef(String clusterName, String stateModelName)
Get a state model definition in a cluster
abstract List<String> getStateModelDefs(String clusterName)
Get a list of state model definitions in a cluster
abstract void rebalance(String clusterName, String resourceName, int replica, List<String> instances)
abstract void rebalance(String clusterName, IdealState currentIdealState, List<String> instanceNames)
abstract void rebalance(String clusterName, String resourceName, int replica)
Rebalance a resource in cluster
abstract void rebalance(String clusterName, String resourceName, int replica, String keyPrefix, String group)
abstract void removeConfig(HelixConfigScope scope, List<String> keys)
Remove configuration values
abstract void removeConstraint(String clusterName, ClusterConstraints.ConstraintType constraintType, String constraintId)
Remove a constraint item
abstract void removeInstanceTag(String clusterName, String instanceName, String tag)
abstract void resetInstance(String clusterName, List<String> instanceNames)
Reset all the partitions in error state for a list of instances
abstract 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 assume to be in error state and reset will bring them from error to initial state.
abstract void resetResource(String clusterName, List<String> resourceNames)
Reset all partitions in error state for a list of resources
abstract void setConfig(HelixConfigScope scope, Map<StringString> properties)
Set configuration values
abstract void setConstraint(String clusterName, ClusterConstraints.ConstraintType constraintType, String constraintId, ConstraintItem constraintItem)
Add a constraint item; create if not exist
abstract void setResourceIdealState(String clusterName, String resourceName, IdealState idealState)
Set ideal state for a resource

Public Methods

public abstract boolean addCluster (String clusterName, boolean recreateIfExists)

Add a cluster

Parameters
recreateIfExists If the cluster already exists, it will delete it and recreate
Returns
  • true if successfully created, or if cluster already exists

public abstract boolean addCluster (String clusterName)

Add a cluster

Returns
  • true if successfully created, or if cluster already exists

public abstract void addClusterToGrandCluster (String clusterName, String grandCluster)

Add a cluster and also add this cluster as a resource group in the super cluster

public abstract void addIdealState (String clusterName, String resourceName, String idealStateFile)

Add ideal state using a json format file

Throws
IOException

public abstract void addInstance (String clusterName, InstanceConfig instanceConfig)

Add an instance to a cluster

public abstract void addInstanceTag (String clusterName, String instanceName, String tag)

public abstract void addResource (String clusterName, String resourceName, int numPartitions, String stateModelRef, String rebalancerMode)

Add a resource to a cluster

public abstract void addResource (String clusterName, String resourceName, IdealState idealstate)

public abstract void addResource (String clusterName, String resourceName, int numPartitions, String stateModelRef, String rebalancerMode, int bucketSize)

Add a resource to a cluster, using a bucket size > 1

public abstract void addResource (String clusterName, String resourceName, int numPartitions, String stateModelRef)

Add a resource to a cluster, using the default ideal state mode AUTO

public abstract void addResource (String clusterName, String resourceName, int numPartitions, String stateModelRef, String rebalancerMode, int bucketSize, int maxPartitionsPerInstance)

Add a resource to a cluster, using a bucket size > 1

public abstract void addStateModelDef (String clusterName, String stateModelDef, StateModelDefinition record)

Add a state model definition

public abstract void addStateModelDef (String clusterName, String stateModelDefName, String stateModelDefFile)

Add state model definition using a json format file

Throws
IOException error reading the state model definition file

public abstract void close ()

Release resources

public abstract void dropCluster (String clusterName)

Drop a cluster

public abstract void dropInstance (String clusterName, InstanceConfig instanceConfig)

Drop an instance from a cluster

public abstract void dropResource (String clusterName, String resourceName)

Drop a resource from a cluster

public abstract void enableCluster (String clusterName, boolean enabled)

Disable or enable a cluster

public abstract void enableInstance (String clusterName, String instanceName, boolean enabled)

Disable or enable an instance

public abstract void enablePartition (boolean enabled, String clusterName, String instanceName, String resourceName, List<String> partitionNames)

Disable or enable a list of partitions on an instance

public abstract void enableResource (String clusterName, String resourceName, boolean enabled)

Disable or enable a resource

public abstract List<String> getClusters ()

Get a list of clusters under "/"

Returns
  • a list of cluster names

public abstract Map<StringString> getConfig (HelixConfigScope scope, List<String> keys)

Get configuration values

Returns
  • configuration values ordered by the provided keys

public abstract List<String> getConfigKeys (HelixConfigScope scope)

Get configuration keys

Returns
  • keys mapping to valid configuration values

public abstract ClusterConstraints getConstraints (String clusterName, ClusterConstraints.ConstraintType constraintType)

Get all constraints for a type

Returns
  • constraints of constraintType

public abstract InstanceConfig getInstanceConfig (String clusterName, String instanceName)

Get an instance config

Returns
  • InstanceConfig corresponding to the specified instance

public abstract List<String> getInstancesInCluster (String clusterName)

Get a list of instances under a cluster

Returns
  • a list of instance names

public abstract List<String> getInstancesInClusterWithTag (String clusterName, String tag)

public abstract ExternalView getResourceExternalView (String clusterName, String resourceName)

Get external view for a resource

Returns
  • ExternalView for the resource

public abstract IdealState getResourceIdealState (String clusterName, String resourceName)

Get ideal state for a resource

public abstract List<String> getResourcesInCluster (String clusterName)

Get a list of resources in a cluster

Returns
  • a list of resource names in the cluster

public abstract StateModelDefinition getStateModelDef (String clusterName, String stateModelName)

Get a state model definition in a cluster

Returns
  • StateModelDefinition identified by stateModelName

public abstract List<String> getStateModelDefs (String clusterName)

Get a list of state model definitions in a cluster

public abstract void rebalance (String clusterName, String resourceName, int replica, List<String> instances)

public abstract void rebalance (String clusterName, IdealState currentIdealState, List<String> instanceNames)

public abstract void rebalance (String clusterName, String resourceName, int replica)

Rebalance a resource in cluster

public abstract void rebalance (String clusterName, String resourceName, int replica, String keyPrefix, String group)

Parameters
group the group identifier of instances to rebalance

public abstract void removeConfig (HelixConfigScope scope, List<String> keys)

Remove configuration values

public abstract void removeConstraint (String clusterName, ClusterConstraints.ConstraintType constraintType, String constraintId)

Remove a constraint item

public abstract void removeInstanceTag (String clusterName, String instanceName, String tag)

public abstract void resetInstance (String clusterName, List<String> instanceNames)

Reset all the partitions in error state for a list of instances

public abstract 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 assume 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.

public abstract void resetResource (String clusterName, List<String> resourceNames)

Reset all partitions in error state for a list of resources

public abstract void setConfig (HelixConfigScope scope, Map<StringString> properties)

Set configuration values

public abstract void setConstraint (String clusterName, ClusterConstraints.ConstraintType constraintType, String constraintId, ConstraintItem constraintItem)

Add a constraint item; create if not exist

public abstract void setResourceIdealState (String clusterName, String resourceName, IdealState idealState)

Set ideal state for a resource