Package org.apache.storm.daemon
Class StormCommon
java.lang.Object
org.apache.storm.daemon.StormCommon
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic Map<GlobalStreamId,Grouping> ackerInputs(StormTopology topology) static voidaddAcker(Map<String, Object> conf, StormTopology topology) static voidaddEventLogger(Map<String, Object> conf, StormTopology topology) static voidaddMetricComponents(Map<String, Object> conf, StormTopology topology) static voidaddMetricStreams(StormTopology topology) static voidaddSystemComponents(Map<String, Object> conf, StormTopology topology) static voidaddSystemStreams(StormTopology topology) allComponents(StormTopology topology) componentConf(Object component) static Map<GlobalStreamId,Grouping> eventLoggerInputs(StormTopology topology) executorIdToTasks(List<Long> executorId) static ComponentCommongetComponentCommon(Object component) static booleanstatic booleanhasEventLoggers(Map<String, Object> topoConf) static IBoltstatic WorkerTopologyContextmakeWorkerContext(Map<String, Object> workerData) metricsConsumerBoltSpecs(Map<String, Object> conf, StormTopology topology) static IAuthorizermkAuthorizationHandler(String klassName, Map<String, Object> conf) protected IAuthorizermkAuthorizationHandlerImpl(String klassName, Map<String, Object> conf) static intnumStartExecutors(Object component) static StormCommonsetInstance(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 StormTopologysystemTopology(Map<String, Object> topoConf, StormTopology topology) Construct a new topology structure after adding system components and streams.protected StormTopologysystemTopologyImpl(Map<String, Object> topoConf, StormTopology topology) taskToNodeport(Map<List<Long>, NodeInfo> executorToNodePort) static voidvalidateBasic(StormTopology topology) static voidvalidateDistributedMode(Map<String, Object> conf) static voidvalidateStructure(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- 
StormCommonpublic StormCommon()
 
- 
- 
Method Details- 
setInstanceProvide 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
- 
systemTopologypublic 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.IdDictionarydepends 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 configuration
- topology- the original topology structure
- Returns:
- the newly constructed topology
- Throws:
- InvalidTopologyException- if the topology is invalid
 
- 
hasAckers
- 
hasEventLoggers
- 
numStartExecutors- Throws:
- InvalidTopologyException
 
- 
stormTaskInfopublic static Map<Integer,String> stormTaskInfo(StormTopology userTopology, Map<String, Object> topoConf) throws InvalidTopologyException- Throws:
- InvalidTopologyException
 
- 
executorIdToTasks
- 
taskToNodeport
- 
mkAuthorizationHandlerpublic static IAuthorizer mkAuthorizationHandler(String klassName, Map<String, Object> conf) throws IllegalAccessException, InstantiationException, ClassNotFoundException
- 
makeWorkerContext
- 
makeAckerBoltImpl
- 
systemTopologyImplprotected StormTopology systemTopologyImpl(Map<String, Object> topoConf, StormTopology topology) throws InvalidTopologyException- Throws:
- InvalidTopologyException
 
- 
stormTaskInfoImplprotected Map<Integer,String> stormTaskInfoImpl(StormTopology userTopology, Map<String, Object> topoConf) throws InvalidTopologyException- Throws:
- InvalidTopologyException
 
- 
mkAuthorizationHandlerImplprotected IAuthorizer mkAuthorizationHandlerImpl(String klassName, Map<String, Object> conf) throws ClassNotFoundException, IllegalAccessException, InstantiationException
 
-