Package org.apache.storm.daemon
Class StormCommon
- java.lang.Object
-
- org.apache.storm.daemon.StormCommon
-
public class StormCommon extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
EVENTLOGGER_COMPONENT_ID
static String
EVENTLOGGER_STREAM_ID
static String
SYSTEM_STREAM_ID
static String
TOPOLOGY_EVENT_LOGGER_ARGUMENTS
static String
TOPOLOGY_EVENT_LOGGER_CLASS
static String
TOPOLOGY_METRICS_CONSUMER_ARGUMENT
static String
TOPOLOGY_METRICS_CONSUMER_BLACKLIST
static String
TOPOLOGY_METRICS_CONSUMER_CLASS
static String
TOPOLOGY_METRICS_CONSUMER_EXPAND_MAP_TYPE
static String
TOPOLOGY_METRICS_CONSUMER_MAX_RETAIN_METRIC_TUPLES
static String
TOPOLOGY_METRICS_CONSUMER_METRIC_NAME_SEPARATOR
static String
TOPOLOGY_METRICS_CONSUMER_PARALLELISM_HINT
static String
TOPOLOGY_METRICS_CONSUMER_WHITELIST
-
Constructor Summary
Constructors Constructor Description StormCommon()
-
Method Summary
-
-
-
Field Detail
-
SYSTEM_STREAM_ID
public static final String SYSTEM_STREAM_ID
- See Also:
- Constant Field Values
-
EVENTLOGGER_COMPONENT_ID
public static final String EVENTLOGGER_COMPONENT_ID
- See Also:
- Constant Field Values
-
EVENTLOGGER_STREAM_ID
public static final String EVENTLOGGER_STREAM_ID
- See Also:
- Constant Field Values
-
TOPOLOGY_METRICS_CONSUMER_CLASS
public static final String TOPOLOGY_METRICS_CONSUMER_CLASS
- See Also:
- Constant Field Values
-
TOPOLOGY_METRICS_CONSUMER_ARGUMENT
public static final String TOPOLOGY_METRICS_CONSUMER_ARGUMENT
- See Also:
- Constant Field Values
-
TOPOLOGY_METRICS_CONSUMER_MAX_RETAIN_METRIC_TUPLES
public static final String TOPOLOGY_METRICS_CONSUMER_MAX_RETAIN_METRIC_TUPLES
- See Also:
- Constant Field Values
-
TOPOLOGY_METRICS_CONSUMER_PARALLELISM_HINT
public static final String TOPOLOGY_METRICS_CONSUMER_PARALLELISM_HINT
- See Also:
- Constant Field Values
-
TOPOLOGY_METRICS_CONSUMER_WHITELIST
public static final String TOPOLOGY_METRICS_CONSUMER_WHITELIST
- See Also:
- Constant Field Values
-
TOPOLOGY_METRICS_CONSUMER_BLACKLIST
public static final String TOPOLOGY_METRICS_CONSUMER_BLACKLIST
- See Also:
- Constant Field Values
-
TOPOLOGY_METRICS_CONSUMER_EXPAND_MAP_TYPE
public static final String TOPOLOGY_METRICS_CONSUMER_EXPAND_MAP_TYPE
- See Also:
- Constant Field Values
-
TOPOLOGY_METRICS_CONSUMER_METRIC_NAME_SEPARATOR
public static final String TOPOLOGY_METRICS_CONSUMER_METRIC_NAME_SEPARATOR
- See Also:
- Constant Field Values
-
TOPOLOGY_EVENT_LOGGER_CLASS
public static final String TOPOLOGY_EVENT_LOGGER_CLASS
- See Also:
- Constant Field Values
-
TOPOLOGY_EVENT_LOGGER_ARGUMENTS
public static final String TOPOLOGY_EVENT_LOGGER_ARGUMENTS
- See Also:
- Constant Field Values
-
-
Method Detail
-
setInstance
public static StormCommon setInstance(StormCommon common)
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
-
allComponents
public static Map<String,Object> allComponents(StormTopology topology)
-
validateBasic
public static void validateBasic(StormTopology topology) throws InvalidTopologyException
- Throws:
InvalidTopologyException
-
validateStructure
public static void validateStructure(StormTopology topology) throws InvalidTopologyException
- Throws:
InvalidTopologyException
-
ackerInputs
public static Map<GlobalStreamId,Grouping> ackerInputs(StormTopology topology)
-
makeAckerBolt
public static IBolt makeAckerBolt()
-
addAcker
public static void addAcker(Map<String,Object> conf, StormTopology topology)
-
getComponentCommon
public static ComponentCommon getComponentCommon(Object component)
-
addMetricStreams
public static void addMetricStreams(StormTopology topology)
-
addSystemStreams
public static void addSystemStreams(StormTopology topology)
-
eventLoggerInputs
public static Map<GlobalStreamId,Grouping> eventLoggerInputs(StormTopology topology)
-
addEventLogger
public static void addEventLogger(Map<String,Object> conf, StormTopology topology)
-
metricsConsumerBoltSpecs
public static Map<String,Bolt> metricsConsumerBoltSpecs(Map<String,Object> conf, StormTopology topology)
-
addMetricComponents
public static void addMetricComponents(Map<String,Object> conf, StormTopology topology)
-
addSystemComponents
public static void addSystemComponents(Map<String,Object> conf, StormTopology topology)
-
systemTopology
public static StormTopology systemTopology(Map<String,Object> topoConf, StormTopology topology) throws InvalidTopologyException
Construct 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
-
numStartExecutors
public static int numStartExecutors(Object component) throws InvalidTopologyException
- Throws:
InvalidTopologyException
-
stormTaskInfo
public static Map<Integer,String> stormTaskInfo(StormTopology userTopology, Map<String,Object> topoConf) throws InvalidTopologyException
- Throws:
InvalidTopologyException
-
taskToNodeport
public static Map<Integer,NodeInfo> taskToNodeport(Map<List<Long>,NodeInfo> executorToNodePort)
-
mkAuthorizationHandler
public static IAuthorizer mkAuthorizationHandler(String klassName, Map<String,Object> conf) throws IllegalAccessException, InstantiationException, ClassNotFoundException
-
makeWorkerContext
public static WorkerTopologyContext makeWorkerContext(Map<String,Object> workerData)
-
makeAckerBoltImpl
public IBolt 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
-
-