Package org.apache.storm.daemon
Class StormCommon
java.lang.Object
org.apache.storm.daemon.StormCommon
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Map<GlobalStreamId,
Grouping> ackerInputs
(StormTopology topology) static void
addAcker
(Map<String, Object> conf, StormTopology topology) static void
addEventLogger
(Map<String, Object> conf, StormTopology topology) static void
addMetricComponents
(Map<String, Object> conf, StormTopology topology) static void
addMetricStreams
(StormTopology topology) static void
addSystemComponents
(Map<String, Object> conf, StormTopology topology) static void
addSystemStreams
(StormTopology topology) allComponents
(StormTopology topology) componentConf
(Object component) static Map<GlobalStreamId,
Grouping> eventLoggerInputs
(StormTopology topology) executorIdToTasks
(List<Long> executorId) static ComponentCommon
getComponentCommon
(Object component) static boolean
static boolean
hasEventLoggers
(Map<String, Object> topoConf) static IBolt
static WorkerTopologyContext
makeWorkerContext
(Map<String, Object> workerData) metricsConsumerBoltSpecs
(Map<String, Object> conf, StormTopology topology) static IAuthorizer
mkAuthorizationHandler
(String klassName, Map<String, Object> conf) protected IAuthorizer
mkAuthorizationHandlerImpl
(String klassName, Map<String, Object> conf) static int
numStartExecutors
(Object component) static StormCommon
setInstance
(StormCommon common) Provide an instance of this class for delegates to use.stormTaskInfo
(StormTopology userTopology, Map<String, Object> topoConf) stormTaskInfoImpl
(StormTopology userTopology, Map<String, Object> topoConf) static StormTopology
systemTopology
(Map<String, Object> topoConf, StormTopology topology) Construct a new topology structure after adding system components and streams.protected StormTopology
systemTopologyImpl
(Map<String, Object> topoConf, StormTopology topology) taskToNodeport
(Map<List<Long>, NodeInfo> executorToNodePort) static void
validateBasic
(StormTopology topology) static void
validateDistributedMode
(Map<String, Object> conf) static void
validateStructure
(StormTopology topology)
-
Field Details
-
SYSTEM_STREAM_ID
- See Also:
-
EVENTLOGGER_COMPONENT_ID
- See Also:
-
EVENTLOGGER_STREAM_ID
- See Also:
-
TOPOLOGY_METRICS_CONSUMER_CLASS
- See Also:
-
TOPOLOGY_METRICS_CONSUMER_ARGUMENT
- See Also:
-
TOPOLOGY_METRICS_CONSUMER_MAX_RETAIN_METRIC_TUPLES
- See Also:
-
TOPOLOGY_METRICS_CONSUMER_PARALLELISM_HINT
- See Also:
-
TOPOLOGY_METRICS_CONSUMER_WHITELIST
- See Also:
-
TOPOLOGY_METRICS_CONSUMER_BLACKLIST
- See Also:
-
TOPOLOGY_METRICS_CONSUMER_EXPAND_MAP_TYPE
- See Also:
-
TOPOLOGY_METRICS_CONSUMER_METRIC_NAME_SEPARATOR
- See Also:
-
TOPOLOGY_EVENT_LOGGER_CLASS
- See Also:
-
TOPOLOGY_EVENT_LOGGER_ARGUMENTS
- See Also:
-
-
Constructor Details
-
StormCommon
public StormCommon()
-
-
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:
common
- a StormCommon instance- Returns:
- the previously set instance
-
validateDistributedMode
-
allComponents
-
componentConf
-
validateBasic
- Throws:
InvalidTopologyException
-
validateStructure
- Throws:
InvalidTopologyException
-
ackerInputs
-
makeAckerBolt
-
addAcker
-
getComponentCommon
-
addMetricStreams
-
addSystemStreams
-
eventLoggerBoltFields
-
eventLoggerInputs
-
addEventLogger
-
metricsConsumerBoltSpecs
-
addMetricComponents
-
addSystemComponents
-
systemTopology
public static StormTopology systemTopology(Map<String, Object> topoConf, StormTopology topology) throws InvalidTopologyExceptionConstruct a new topology structure after adding system components and streams. WARNING: while changing the existing code to add or remove streams for a component is allowed, please be aware that it might cause issues during cluster rolling upgrade becauseSerializationFactory.IdDictionary
depends on having a consistent map of component to streams to work properly (see STORM-3687 for an example). It will not impact a cluster running on a single version or running an older topology on a newer cluster. But a mixed cluster (with different versions of daemons running) is not guaranteed to work.- Parameters:
topoConf
- the topology configurationtopology
- the original topology structure- Returns:
- the newly constructed topology
- Throws:
InvalidTopologyException
- if the topology is invalid
-
hasAckers
-
hasEventLoggers
-
numStartExecutors
- Throws:
InvalidTopologyException
-
stormTaskInfo
public static Map<Integer,String> stormTaskInfo(StormTopology userTopology, Map<String, Object> topoConf) throws InvalidTopologyException- Throws:
InvalidTopologyException
-
executorIdToTasks
-
taskToNodeport
-
mkAuthorizationHandler
public static IAuthorizer mkAuthorizationHandler(String klassName, Map<String, Object> conf) throws IllegalAccessException, InstantiationException, ClassNotFoundException -
makeWorkerContext
-
makeAckerBoltImpl
-
systemTopologyImpl
protected StormTopology systemTopologyImpl(Map<String, Object> topoConf, StormTopology topology) throws InvalidTopologyException- Throws:
InvalidTopologyException
-
stormTaskInfoImpl
protected Map<Integer,String> stormTaskInfoImpl(StormTopology userTopology, Map<String, Object> topoConf) throws InvalidTopologyException- Throws:
InvalidTopologyException
-
mkAuthorizationHandlerImpl
protected IAuthorizer mkAuthorizationHandlerImpl(String klassName, Map<String, Object> conf) throws ClassNotFoundException, IllegalAccessException, InstantiationException
-