Search in sources :

Example 1 with SystemBolt

use of org.apache.storm.metric.SystemBolt in project storm by apache.

the class StormCommon method addSystemComponents.

@SuppressWarnings("unused")
public static void addSystemComponents(Map conf, StormTopology topology) {
    Map<String, StreamInfo> outputStreams = new HashMap<>();
    outputStreams.put(Constants.SYSTEM_TICK_STREAM_ID, Thrift.outputFields(Arrays.asList("rate_secs")));
    outputStreams.put(Constants.METRICS_TICK_STREAM_ID, Thrift.outputFields(Arrays.asList("interval")));
    outputStreams.put(Constants.CREDENTIALS_CHANGED_STREAM_ID, Thrift.outputFields(Arrays.asList("creds")));
    Map<String, Object> boltConf = new HashMap<>();
    boltConf.put(Config.TOPOLOGY_TASKS, 0);
    Bolt systemBoltSpec = Thrift.prepareSerializedBoltDetails(null, new SystemBolt(), outputStreams, 0, boltConf);
    topology.put_to_bolts(Constants.SYSTEM_COMPONENT_ID, systemBoltSpec);
}
Also used : HashMap(java.util.HashMap) StreamInfo(org.apache.storm.generated.StreamInfo) Bolt(org.apache.storm.generated.Bolt) MetricsConsumerBolt(org.apache.storm.metric.MetricsConsumerBolt) IBolt(org.apache.storm.task.IBolt) EventLoggerBolt(org.apache.storm.metric.EventLoggerBolt) SystemBolt(org.apache.storm.metric.SystemBolt) SystemBolt(org.apache.storm.metric.SystemBolt)

Aggregations

HashMap (java.util.HashMap)1 Bolt (org.apache.storm.generated.Bolt)1 StreamInfo (org.apache.storm.generated.StreamInfo)1 EventLoggerBolt (org.apache.storm.metric.EventLoggerBolt)1 MetricsConsumerBolt (org.apache.storm.metric.MetricsConsumerBolt)1 SystemBolt (org.apache.storm.metric.SystemBolt)1 IBolt (org.apache.storm.task.IBolt)1