public static void main(String[] args) throws Exception{ StormExecutionEnvironment env = ExecutionEnvironments.getStorm(args); String spoutName = "msgConsumer"; int parallelism = env.getConfig().getInt("envContextConfig.parallelismConfig." + spoutName); env.fromSpout(new HiveJobRunningSourcedStormSpoutProvider().getSpout(env.getConfig(), parallelism)) .withOutputFields(4).nameAs(spoutName).groupBy(Arrays.asList(0)) .flatMap(new JobConfigurationAdaptorExecutor()).groupBy(Arrays.asList(0)) .flatMap(new HiveQueryParserExecutor()).groupBy(Arrays.asList(0)) .flatMap(new HiveResourceSensitivityDataJoinExecutor()) .alertWithConsumer("hiveAccessLogStream", "hiveAccessAlertByRunningJob"); env.execute(); } }
@Override public void submit(String topology, Config config) { StormExecutionEnvironment env = ExecutionEnvironments.getStorm(config); String spoutName = "msgConsumer"; int parallelism = env.getConfig().getInt("envContextConfig.parallelismConfig." + spoutName); env.fromSpout(new HiveJobRunningSourcedStormSpoutProvider().getSpout(env.getConfig(), parallelism)) .withOutputFields(4).nameAs(spoutName).groupBy(Arrays.asList(0)) .flatMap(new JobConfigurationAdaptorExecutor()).groupBy(Arrays.asList(0)) .flatMap(new HiveQueryParserExecutor()).groupBy(Arrays.asList(0)) .flatMap(new HiveResourceSensitivityDataJoinExecutor()) .alertWithConsumer("hiveAccessLogStream", "hiveAccessAlertByRunningJob"); env.execute(); } }
public static void main(String[] args) throws Exception{ StormExecutionEnvironment env = ExecutionEnvironments.getStorm(args); Config config = env.getConfig(); KafkaSourcedSpoutProvider provider = new KafkaSourcedSpoutProvider(); GCLogAnalysorExecutor logAnalysor = new GCLogAnalysorExecutor(); env.fromSpout(provider.getSpout(config)).withOutputFields(1).nameAs("kafkaMsgConsumer") .flatMap(logAnalysor) .flatMap(new GCMetricGeneratorExecutor()) .alertWithConsumer("NNGCLogStream", "NNGCAlert"); env.execute(); } }
public static void main(String[] args) throws Exception { StormExecutionEnvironment env = ExecutionEnvironments.getStorm(args); Config config = env.getConfig(); String deserClsName = config.getString("dataSourceConfig.deserializerClass"); final KafkaSourcedSpoutScheme scheme = new KafkaSourcedSpoutScheme(deserClsName, config) {