Package org.apache.storm.cluster
Class ClusterUtils
java.lang.Object
org.apache.storm.cluster.ClusterUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringassignmentPath(String id) static StringbackpressurePath(String stormId, String shortPath) Get the backpressure znode full path.static StringbackpressurePath(String stormId, String node, Long port) static StringbackpressureStormRoot(String stormId) static Stringstatic StringblobstorePath(String key) static Map<ExecutorInfo,ExecutorBeat> convertExecutorBeats(List<ExecutorInfo> executors, ClusterWorkerHeartbeat workerHeartbeat) Ensures that we only return heartbeats for executors assigned to this worker.static StringcredentialsPath(String stormId) static Stringstatic StringerrorStormRoot(String stormId) static StringlastErrorPath(String stormId, String componentId) static StringlogConfigPath(String stormId) Get the path to the log config for a topology.static <T> TmaybeDeserialize(byte[] serialized, Class<T> clazz) static IStateStoragemkStateStorage(Map<String, Object> config, Map<String, Object> authConf, ClusterStateContext context) mkStateStorageImpl(Map<String, Object> config, Map<String, Object> authConf, ClusterStateContext context) static IStormClusterStatemkStormClusterState(Object stateStorage, ILocalAssignmentsBackend backend, ClusterStateContext context) static IStormClusterStatemkStormClusterState(Object stateStorage, ClusterStateContext context) mkStormClusterStateImpl(Object stateStorage, ILocalAssignmentsBackend backend, ClusterStateContext context) static List<org.apache.storm.shade.org.apache.zookeeper.data.ACL>mkTopoReadOnlyAcls(Map<String, Object> topoConf) Get ZK ACLs for a topology to have read only access.static List<org.apache.storm.shade.org.apache.zookeeper.data.ACL>mkTopoReadWriteAcls(Map<String, Object> topoConf) Get ZK ACLs for a topology to have read/write access.static StringnimbusPath(String id) static StringprofilerConfigPath(String stormId) static StringprofilerConfigPath(String stormId, String host, Long port, ProfileAction requestType) static voidResets the singleton instance to the default.static StringGet the base path where secret keys are stored for a given service.static StringsecretKeysPath(WorkerTokenServiceType type, String topologyId) Get the path to secret keys for a specific topology.static StringsecretKeysPath(WorkerTokenServiceType type, String topologyId, long version) Get the path to a specific secret key.static voidProvide an instance of this class for delegates to use.static Stringstatic StringstringifyError(Throwable error) static StringsupervisorPath(String id) static StringworkerbeatPath(String stormId, String node, Long port) static StringworkerbeatStormRoot(String stormId)
-
Field Details
-
ZK_SEPERATOR
- See Also:
-
ASSIGNMENTS_ROOT
- See Also:
-
STORMS_ROOT
- See Also:
-
SUPERVISORS_ROOT
- See Also:
-
WORKERBEATS_ROOT
- See Also:
-
BACKPRESSURE_ROOT
- See Also:
-
LEADERINFO_ROOT
- See Also:
-
ERRORS_ROOT
- See Also:
-
BLOBSTORE_ROOT
- See Also:
-
BLOBSTORE_MAX_KEY_SEQUENCE_NUMBER_ROOT
- See Also:
-
NIMBUSES_ROOT
- See Also:
-
CREDENTIALS_ROOT
- See Also:
-
LOGCONFIG_ROOT
- See Also:
-
PROFILERCONFIG_ROOT
- See Also:
-
SECRET_KEYS_ROOT
- See Also:
-
ASSIGNMENTS_SUBTREE
- See Also:
-
STORMS_SUBTREE
- See Also:
-
SUPERVISORS_SUBTREE
- See Also:
-
WORKERBEATS_SUBTREE
- See Also:
-
BACKPRESSURE_SUBTREE
- See Also:
-
LEADERINFO_SUBTREE
- See Also:
-
ERRORS_SUBTREE
- See Also:
-
BLOBSTORE_SUBTREE
- See Also:
-
BLOBSTORE_MAX_KEY_SEQUENCE_NUMBER_SUBTREE
- See Also:
-
NIMBUSES_SUBTREE
- See Also:
-
CREDENTIALS_SUBTREE
- See Also:
-
LOGCONFIG_SUBTREE
- See Also:
-
PROFILERCONFIG_SUBTREE
- See Also:
-
SECRET_KEYS_SUBTREE
- See Also:
-
-
Constructor Details
-
ClusterUtils
public ClusterUtils()
-
-
Method Details
-
setInstance
Provide an instance of this class for delegates to use. To mock out delegated methods, provide an instance of a subclass that overrides the implementation of the delegated method.- Parameters:
u- a Cluster instance
-
resetInstance
public static void resetInstance()Resets the singleton instance to the default. This is helpful to reset the class to its original functionality when mocking is no longer desired. -
mkTopoReadWriteAcls
public static List<org.apache.storm.shade.org.apache.zookeeper.data.ACL> mkTopoReadWriteAcls(Map<String, Object> topoConf) Get ZK ACLs for a topology to have read/write access.- Parameters:
topoConf- the topology config.- Returns:
- the ACLs.
-
mkTopoReadOnlyAcls
public static List<org.apache.storm.shade.org.apache.zookeeper.data.ACL> mkTopoReadOnlyAcls(Map<String, Object> topoConf) Get ZK ACLs for a topology to have read only access.- Parameters:
topoConf- the topology config.- Returns:
- the ACLs.
-
supervisorPath
-
assignmentPath
-
blobstorePath
-
blobstoreMaxKeySequenceNumberPath
-
nimbusPath
-
stormPath
-
workerbeatStormRoot
-
workerbeatPath
-
backpressureStormRoot
-
backpressurePath
-
backpressurePath
Get the backpressure znode full path.- Parameters:
stormId- The topology idshortPath- A string in the form of "node-port"- Returns:
- The backpressure znode path
-
errorStormRoot
-
errorPath
-
lastErrorPath
-
credentialsPath
-
logConfigPath
Get the path to the log config for a topology.- Parameters:
stormId- the topology id.- Returns:
- the path to the config.
-
profilerConfigPath
-
profilerConfigPath
public static String profilerConfigPath(String stormId, String host, Long port, ProfileAction requestType) -
secretKeysPath
Get the base path where secret keys are stored for a given service.- Parameters:
type- the service we are interested in.- Returns:
- the path to that service root.
-
secretKeysPath
Get the path to secret keys for a specific topology.- Parameters:
type- the service the secret is for.topologyId- the topology the secret is for.- Returns:
- the path to the list of secret keys.
-
secretKeysPath
Get the path to a specific secret key.- Parameters:
type- the service the secret is for.topologyId- the topology the secret is for.version- the version the secret is for.- Returns:
- the path to the secret.
-
maybeDeserialize
-
convertExecutorBeats
public static Map<ExecutorInfo,ExecutorBeat> convertExecutorBeats(List<ExecutorInfo> executors, ClusterWorkerHeartbeat workerHeartbeat) Ensures that we only return heartbeats for executors assigned to this worker. -
mkStateStorage
public static IStateStorage mkStateStorage(Map<String, Object> config, Map<String, throws ExceptionObject> authConf, ClusterStateContext context) - Throws:
Exception
-
mkStormClusterState
public static IStormClusterState mkStormClusterState(Object stateStorage, ILocalAssignmentsBackend backend, ClusterStateContext context) throws Exception - Throws:
Exception
-
mkStormClusterState
public static IStormClusterState mkStormClusterState(Object stateStorage, ClusterStateContext context) throws Exception - Throws:
Exception
-
stringifyError
-
mkStormClusterStateImpl
public IStormClusterState mkStormClusterStateImpl(Object stateStorage, ILocalAssignmentsBackend backend, ClusterStateContext context) throws Exception - Throws:
Exception
-
mkStateStorageImpl
public IStateStorage mkStateStorageImpl(Map<String, Object> config, Map<String, throws ExceptionObject> authConf, ClusterStateContext context) - Throws:
Exception
-