public final class

HelixUtil

extends Object
java.lang.Object
   ↳ org.apache.helix.util.HelixUtil

Summary

Public Methods
static String getControllerPath(String clusterName)
static String getControllerPropertyPath(String clusterName, PropertyType type)
static String getCurrentStateBasePath(String clusterName, String instanceName)
static String getCurrentStatePath(String clusterName, String instanceName, String sessionId, String stateUnitKey)
Even though this is simple we want to have the mechanism of bucketing the partitions.
static String getErrorsPath(String clusterName, String instanceName)
static String getExternalViewPath(String clusterName)
static String getExternalViewPath(String clusterName, String resourceName)
static String getIdealStatePath(String clusterName)
static String getIdealStatePath(String clusterName, String resourceName)
static String getInstanceNameFromPath(String path)
static String getInstancePath(String clusterName, String instanceName)
static String getInstancePropertyPath(String clusterName, String instanceName, PropertyType type)
static String getLiveInstancePath(String clusterName, String instanceName)
static String getLiveInstancesPath(String clusterName)
static String getMemberInstancesPath(String clusterName)
static String getMessagePath(String clusterName, String instanceName)
static String getPropertyPath(String clusterName, PropertyType type)
static List<String> getRequiredPathsForCluster(String clusterName)
Get the required paths for a valid cluster
static List<String> getRequiredPathsForInstance(String clusterName, String instanceName)
Get the required paths for a valid instance
static String getStateModelDefinitionPath(String clusterName)
static String getStatusUpdatesPath(String clusterName, String instanceName)
static String getZkName(String path)
get the last part of the zk-path
static String getZkParentPath(String path)
get the parent-path of given path return "/" string if path = "/xxx", null if path = "/"
static <T> Class<?> loadClass(Class<T> clazz, String className)
Attempts to load the class and delegates to TCCL if class is not found.
static Map<StringString> parseCsvFormatedKeyValuePairs(String keyValuePairs)
parse a csv-formated key-value pairs
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static String getControllerPath (String clusterName)

public static String getControllerPropertyPath (String clusterName, PropertyType type)

public static String getCurrentStateBasePath (String clusterName, String instanceName)

public static String getCurrentStatePath (String clusterName, String instanceName, String sessionId, String stateUnitKey)

Even though this is simple we want to have the mechanism of bucketing the partitions. If we have P partitions and N nodes with K replication factor and D databases. Then on each node we will have (P/N)*K*D partitions. And cluster manager neeeds to maintain watch on each of these nodes for every node. So over all cluster manager will have P*K*D watches which can be quite large given that we over partition. The other extreme is having one znode per storage per database. This will result in N*D watches which is good. But data in every node might become really big since it has to save partition Ideally we want to balance between the two models

public static String getErrorsPath (String clusterName, String instanceName)

public static String getExternalViewPath (String clusterName)

public static String getExternalViewPath (String clusterName, String resourceName)

public static String getIdealStatePath (String clusterName)

public static String getIdealStatePath (String clusterName, String resourceName)

public static String getInstanceNameFromPath (String path)

public static String getInstancePath (String clusterName, String instanceName)

public static String getInstancePropertyPath (String clusterName, String instanceName, PropertyType type)

public static String getLiveInstancePath (String clusterName, String instanceName)

public static String getLiveInstancesPath (String clusterName)

public static String getMemberInstancesPath (String clusterName)

public static String getMessagePath (String clusterName, String instanceName)

public static String getPropertyPath (String clusterName, PropertyType type)

public static List<String> getRequiredPathsForCluster (String clusterName)

Get the required paths for a valid cluster

Parameters
clusterName the cluster to check
Returns
  • List of paths as strings

public static List<String> getRequiredPathsForInstance (String clusterName, String instanceName)

Get the required paths for a valid instance

Parameters
clusterName the cluster that owns the instance
instanceName the instance to check
Returns
  • List of paths as strings

public static String getStateModelDefinitionPath (String clusterName)

public static String getStatusUpdatesPath (String clusterName, String instanceName)

public static String getZkName (String path)

get the last part of the zk-path

public static String getZkParentPath (String path)

get the parent-path of given path return "/" string if path = "/xxx", null if path = "/"

public static Class<?> loadClass (Class<T> clazz, String className)

Attempts to load the class and delegates to TCCL if class is not found. Note: The approach is used as a last resort for environments like OSGi.@return

public static Map<StringString> parseCsvFormatedKeyValuePairs (String keyValuePairs)

parse a csv-formated key-value pairs

Parameters
keyValuePairs : csv-formatted key-value pairs. e.g. k1=v1,k2=v2,...