http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestMetadataSpecSerDeser.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestMetadataSpecSerDeser.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestMetadataSpecSerDeser.java deleted file mode 100644 index 03db0c3..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestMetadataSpecSerDeser.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * - * * Licensed to the Apache Software Foundation (ASF) under one or more - * * contributor license agreements. See the NOTICE file distributed with - * * this work for additional information regarding copyright ownership. - * * The ASF licenses this file to You under the Apache License, Version 2.0 - * * (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package org.apache.eagle.alert.engine.topology; - -import org.apache.eagle.alert.coordination.model.*; -import org.apache.eagle.alert.engine.coordinator.*; -import org.apache.eagle.alert.engine.evaluator.PolicyStreamHandlers; -import org.apache.eagle.alert.engine.utils.MetadataSerDeser; -import com.fasterxml.jackson.core.type.TypeReference; -import org.joda.time.Period; -import org.junit.Assert; -import org.junit.Test; - -import java.util.*; - -/** - * Since 5/6/16. - */ -public class TestMetadataSpecSerDeser { - private String getStreamNameByTopic(String topic) { - return topic + "Stream"; - } - - @Test - public void testStreamDefinitions() { - Map<String, StreamDefinition> sds = new HashMap<>(); - List<String> topics = Arrays.asList("testTopic3", "testTopic4", "testTopic5"); - for (String topic : topics) { - String streamId = getStreamNameByTopic(topic); - if (topic.equals("testTopic3") || topic.equals("testTopic4")) { - StreamDefinition schema = new StreamDefinition(); - schema.setStreamId(streamId); - StreamColumn column = new StreamColumn(); - column.setName("value"); - column.setType(StreamColumn.Type.STRING); - schema.setColumns(Collections.singletonList(column)); - sds.put(schema.getStreamId(), schema); - } else if (topic.equals("testTopic5")) { - StreamDefinition schema = new StreamDefinition(); - schema.setStreamId(streamId); - StreamColumn column = new StreamColumn(); - column.setName("value"); - column.setType(StreamColumn.Type.STRING); - schema.setColumns(Collections.singletonList(column)); - sds.put(schema.getStreamId(), schema); - } - } - - String json = MetadataSerDeser.serialize(sds); - System.out.println(json); - - Map<String, StreamDefinition> deserializedSpec = MetadataSerDeser.deserialize(json, new TypeReference<Map<String, StreamDefinition>>() { - }); - Assert.assertEquals(3, deserializedSpec.size()); - } - - @SuppressWarnings("unused") - @Test - public void testSpoutSpec() { - String topologyName = "testTopology"; - String spoutId = "alertEngineSpout"; - List<String> plainStringTopics = Arrays.asList("testTopic3", "testTopic4"); - List<String> jsonStringTopics = Arrays.asList("testTopic5"); - Map<String, Kafka2TupleMetadata> kafka2TupleMetadataMap = new HashMap<>(); - for (String topic : plainStringTopics) { - Kafka2TupleMetadata kafka2TupleMetadata = new Kafka2TupleMetadata(); - kafka2TupleMetadata.setName(topic); - kafka2TupleMetadata.setTopic(topic); - kafka2TupleMetadata.setSchemeCls("org.apache.eagle.alert.engine.scheme.PlainStringScheme"); - kafka2TupleMetadataMap.put(topic, kafka2TupleMetadata); - } - for (String topic : jsonStringTopics) { - Kafka2TupleMetadata kafka2TupleMetadata = new Kafka2TupleMetadata(); - kafka2TupleMetadata.setName(topic); - kafka2TupleMetadata.setTopic(topic); - kafka2TupleMetadata.setSchemeCls("org.apache.eagle.alert.engine.scheme.JsonScheme"); - kafka2TupleMetadataMap.put(topic, kafka2TupleMetadata); - } - - // construct Tuple2StreamMetadata - Map<String, Tuple2StreamMetadata> tuple2StreamMetadataMap = new HashMap<>(); - for (String topic : plainStringTopics) { - String streamId = getStreamNameByTopic(topic); - Tuple2StreamMetadata tuple2StreamMetadata = new Tuple2StreamMetadata(); - Set<String> activeStreamNames = new HashSet<>(); - activeStreamNames.add(streamId); - tuple2StreamMetadata.setStreamNameSelectorCls("org.apache.eagle.alert.engine.scheme.PlainStringStreamNameSelector"); - tuple2StreamMetadata.setStreamNameSelectorProp(new Properties()); - tuple2StreamMetadata.getStreamNameSelectorProp().put("userProvidedStreamName", streamId); - tuple2StreamMetadata.setActiveStreamNames(activeStreamNames); - tuple2StreamMetadata.setTimestampColumn("timestamp"); - tuple2StreamMetadataMap.put(topic, tuple2StreamMetadata); - } - - for (String topic : jsonStringTopics) { - String streamId = getStreamNameByTopic(topic); - Tuple2StreamMetadata tuple2StreamMetadata = new Tuple2StreamMetadata(); - Set<String> activeStreamNames = new HashSet<>(); - activeStreamNames.add(streamId); - tuple2StreamMetadata.setStreamNameSelectorCls("org.apache.eagle.alert.engine.scheme.JsonStringStreamNameSelector"); - tuple2StreamMetadata.setStreamNameSelectorProp(new Properties()); - tuple2StreamMetadata.getStreamNameSelectorProp().put("userProvidedStreamName", streamId); - tuple2StreamMetadata.setActiveStreamNames(activeStreamNames); - tuple2StreamMetadata.setTimestampColumn("timestamp"); - tuple2StreamMetadataMap.put(topic, tuple2StreamMetadata); - } - - // construct StreamRepartitionMetadata - Map<String, List<StreamRepartitionMetadata>> streamRepartitionMetadataMap = new HashMap<>(); - for (String topic : plainStringTopics) { - String streamId = getStreamNameByTopic(topic); - StreamRepartitionMetadata streamRepartitionMetadata = new StreamRepartitionMetadata(topic, "defaultStringStream"); - StreamRepartitionStrategy gs = new StreamRepartitionStrategy(); - // StreamPartition, groupby col1 for stream cpuUsageStream - StreamPartition sp = new StreamPartition(); - sp.setStreamId(streamId); - sp.setColumns(Arrays.asList("value")); - sp.setType(StreamPartition.Type.GROUPBY); - StreamSortSpec sortSpec = new StreamSortSpec(); - sortSpec.setWindowMargin(1000); - sortSpec.setWindowPeriod2(Period.seconds(10)); - sp.setSortSpec(sortSpec); - - gs.partition = sp; - gs.numTotalParticipatingRouterBolts = 1; - gs.startSequence = 0; - streamRepartitionMetadata.addGroupStrategy(gs); - streamRepartitionMetadataMap.put(topic, Arrays.asList(streamRepartitionMetadata)); - } - - for (String topic : jsonStringTopics) { - String streamId = getStreamNameByTopic(topic); - StreamRepartitionMetadata streamRepartitionMetadata = new StreamRepartitionMetadata(topic, "defaultStringStream"); - StreamRepartitionStrategy gs = new StreamRepartitionStrategy(); - // StreamPartition, groupby col1 for stream cpuUsageStream - StreamPartition sp = new StreamPartition(); - sp.setStreamId(streamId); - sp.setColumns(Arrays.asList("value")); - sp.setType(StreamPartition.Type.GROUPBY); - StreamSortSpec sortSpec = new StreamSortSpec(); - sortSpec.setWindowMargin(1000); - sortSpec.setWindowPeriod2(Period.seconds(10)); - sp.setSortSpec(sortSpec); - - gs.partition = sp; - gs.numTotalParticipatingRouterBolts = 1; - gs.startSequence = 0; - streamRepartitionMetadata.addGroupStrategy(gs); - streamRepartitionMetadataMap.put(topic, Arrays.asList(streamRepartitionMetadata)); - } - - SpoutSpec newSpec = new SpoutSpec(topologyName, streamRepartitionMetadataMap, tuple2StreamMetadataMap, kafka2TupleMetadataMap); - String json = MetadataSerDeser.serialize(newSpec); - System.out.println(json); - - SpoutSpec deserializedSpec = MetadataSerDeser.deserialize(json, SpoutSpec.class); - Assert.assertNotNull(deserializedSpec); -// Assert.assertEquals(spoutId, deserializedSpec.getSpoutId()); - } - - @Test - public void testRouterBoltSpec() { - List<String> topics = Arrays.asList("testTopic3", "testTopic4", "testTopic5"); - RouterSpec boltSpec = new RouterSpec(); - for (String topic : topics) { - String streamId = getStreamNameByTopic(topic); - // StreamPartition, groupby col1 for stream cpuUsageStream - StreamPartition sp = new StreamPartition(); - sp.setStreamId(streamId); - sp.setColumns(Arrays.asList("value")); - sp.setType(StreamPartition.Type.GROUPBY); - - StreamSortSpec sortSpec = new StreamSortSpec(); - sortSpec.setWindowMargin(1000); - sortSpec.setWindowPeriod2(Period.seconds(10)); - sp.setSortSpec(sortSpec); - - // set StreamRouterSpec to have 2 WorkSlot - StreamRouterSpec routerSpec = new StreamRouterSpec(); - routerSpec.setPartition(sp); - routerSpec.setStreamId(streamId); - PolicyWorkerQueue queue = new PolicyWorkerQueue(); - queue.setPartition(sp); - queue.setWorkers(Arrays.asList(new WorkSlot("testTopology", "alertBolt0"), new WorkSlot("testTopology", "alertBolt1"))); - routerSpec.setTargetQueue(Arrays.asList(queue)); - boltSpec.addRouterSpec(routerSpec); - } - - String json = MetadataSerDeser.serialize(boltSpec); - System.out.println(json); - RouterSpec deserializedSpec = MetadataSerDeser.deserialize(json, RouterSpec.class); - Assert.assertEquals(3, deserializedSpec.getRouterSpecs().size()); - } - - @Test - public void testAlertBoltSpec() { - String topologyName = "testTopology"; - AlertBoltSpec spec = new AlertBoltSpec(); - List<String> topics = Arrays.asList("testTopic3", "testTopic4", "testTopic5"); - for (String topic : topics) { - String streamId = getStreamNameByTopic(topic); - - // construct StreamPartition - StreamPartition sp = new StreamPartition(); - sp.setColumns(Collections.singletonList("value")); - sp.setStreamId(streamId); - sp.setType(StreamPartition.Type.GROUPBY); - StreamSortSpec sortSpec = new StreamSortSpec(); - sortSpec.setWindowMargin(1000); - sortSpec.setWindowPeriod2(Period.seconds(10)); - sp.setSortSpec(sortSpec); - - spec.setVersion("version1"); - spec.setTopologyName(topologyName); - PolicyDefinition pd = new PolicyDefinition(); - pd.setName("policy1"); - pd.setPartitionSpec(Collections.singletonList(sp)); - pd.setOutputStreams(Collections.singletonList("testAlertStream")); - pd.setInputStreams(Collections.singletonList(streamId)); - pd.setDefinition(new PolicyDefinition.Definition()); - pd.getDefinition().type = PolicyStreamHandlers.SIDDHI_ENGINE; - pd.getDefinition().value = String.format("from %s[value=='xyz'] select value insert into testAlertStream;", streamId); - spec.addBoltPolicy("alertBolt0", pd.getName()); - } - String json = MetadataSerDeser.serialize(spec); - System.out.println(json); - AlertBoltSpec deserializedSpec = MetadataSerDeser.deserialize(json, AlertBoltSpec.class); - Assert.assertEquals(topologyName, deserializedSpec.getTopologyName()); - } -}
http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestStormCustomGroupingRouting.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestStormCustomGroupingRouting.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestStormCustomGroupingRouting.java deleted file mode 100644 index c612d28..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestStormCustomGroupingRouting.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * - * * Licensed to the Apache Software Foundation (ASF) under one or more - * * contributor license agreements. See the NOTICE file distributed with - * * this work for additional information regarding copyright ownership. - * * The ASF licenses this file to You under the Apache License, Version 2.0 - * * (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package org.apache.eagle.alert.engine.topology; - -import backtype.storm.Config; -import backtype.storm.LocalCluster; -import backtype.storm.generated.GlobalStreamId; -import backtype.storm.grouping.CustomStreamGrouping; -import backtype.storm.spout.SpoutOutputCollector; -import backtype.storm.task.OutputCollector; -import backtype.storm.task.TopologyContext; -import backtype.storm.task.WorkerTopologyContext; -import backtype.storm.topology.OutputFieldsDeclarer; -import backtype.storm.topology.TopologyBuilder; -import backtype.storm.topology.base.BaseRichBolt; -import backtype.storm.topology.base.BaseRichSpout; -import backtype.storm.tuple.Fields; -import backtype.storm.tuple.Tuple; -import org.junit.Ignore; -import org.junit.Test; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Since 4/29/16. - */ -@SuppressWarnings( {"rawtypes", "serial"}) -public class TestStormCustomGroupingRouting implements Serializable { - @Ignore - @Test - public void testRoutingByCustomGrouping() throws Exception { - Config conf = new Config(); - conf.setNumWorkers(2); // use two worker processes - TopologyBuilder topologyBuilder = new TopologyBuilder(); - topologyBuilder.setSpout("blue-spout", new BlueSpout()); // parallelism hint - - topologyBuilder.setBolt("green-bolt-1", new GreenBolt(0)).setNumTasks(2) - .customGrouping("blue-spout", new CustomStreamGrouping() { - int count = 0; - List<Integer> targetTask; - - @Override - public void prepare(WorkerTopologyContext context, GlobalStreamId stream, List<Integer> targetTasks) { - this.targetTask = targetTasks; - } - - @Override - public List<Integer> chooseTasks(int taskId, List<Object> values) { - if (count % 2 == 0) { - count++; - return Arrays.asList(targetTask.get(0)); - } else { - count++; - return Arrays.asList(targetTask.get(1)); - } - } - }); - - LocalCluster cluster = new LocalCluster(); - cluster.submitTopology("mytopology", new HashMap(), topologyBuilder.createTopology()); - - while (true) { - try { - Thread.sleep(1000); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - private static class BlueSpout extends BaseRichSpout { - int count = 0; - private SpoutOutputCollector collector; - - public BlueSpout() { - } - - @Override - public void declareOutputFields(OutputFieldsDeclarer declarer) { - declarer.declare(new Fields("a")); - } - - @Override - public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { - this.collector = collector; - } - - @Override - public void nextTuple() { - if (count % 2 == 0) { - this.collector.emit(Arrays.asList("testdata" + count)); - count++; - } else { - this.collector.emit(Arrays.asList("testdata" + count)); - count++; - } - try { - Thread.sleep(10000); - } catch (Exception ex) { - - } - } - } - - private static class GreenBolt extends BaseRichBolt { - private int id; - - public GreenBolt(int id) { - this.id = id; - } - - @Override - public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { - } - - @Override - public void execute(Tuple input) { - System.out.println("bolt " + id + " received data " + input.getString(0)); - System.out.flush(); - } - - @Override - public void declareOutputFields(OutputFieldsDeclarer declarer) { - declarer.declare(new Fields("a")); - } - } -} http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestStormParallelism.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestStormParallelism.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestStormParallelism.java deleted file mode 100644 index c235e73..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestStormParallelism.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * - * * Licensed to the Apache Software Foundation (ASF) under one or more - * * contributor license agreements. See the NOTICE file distributed with - * * this work for additional information regarding copyright ownership. - * * The ASF licenses this file to You under the Apache License, Version 2.0 - * * (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package org.apache.eagle.alert.engine.topology; - -import backtype.storm.Config; -import backtype.storm.LocalCluster; -import backtype.storm.spout.SpoutOutputCollector; -import backtype.storm.task.OutputCollector; -import backtype.storm.task.TopologyContext; -import backtype.storm.topology.OutputFieldsDeclarer; -import backtype.storm.topology.TopologyBuilder; -import backtype.storm.topology.base.BaseRichBolt; -import backtype.storm.topology.base.BaseRichSpout; -import backtype.storm.tuple.Fields; -import backtype.storm.tuple.Tuple; -import org.junit.Ignore; -import org.junit.Test; - -import java.util.HashMap; -import java.util.Map; - -/** - * Since 4/29/16. - */ -@SuppressWarnings( {"serial", "rawtypes"}) -public class TestStormParallelism { - /** - * When run this test, please check the following through jstack and log - * 1) for blue-spout, num of executors is 2, # of tasks is 2 - * <p> - * Expected: - * <p> - * a. 2 threads uniquely named Thread-*-blue-spout-executor[*,*] - * b. each thread will have single task - * <p> - * 2) for green-bolt, num of executors is 2, # of tasks is 4 - * <p> - * Expected: - * <p> - * a. 2 threads uniquely named Thread-*-green-bolt-executor[*,*] - * b. each thread will have 2 tasks - * <p> - * 3) for yellow-bolt, num of executors is 6, # of tasks is 6 - * <p> - * Expected: - * <p> - * a. 6 threads uniquely named Thread-*-yellow-bolt-executor[*,*] - * b. each thread will have 1 tasks - * <p> - * <p> - * Continue to think: - * <p> - * For alter engine, if we use multiple tasks per component instead of one task per component, - * what will the parallelism mechanism affect? - * - * @throws Exception - */ - @Ignore - @Test - public void testParallelism() throws Exception { - Config conf = new Config(); - conf.setNumWorkers(2); // use two worker processes - TopologyBuilder topologyBuilder = new TopologyBuilder(); - topologyBuilder.setSpout("blue-spout", new BlueSpout(), 2); // parallelism hint - - topologyBuilder.setBolt("green-bolt", new GreenBolt(), 2) - .setNumTasks(4) - .shuffleGrouping("blue-spout"); - - topologyBuilder.setBolt("yellow-bolt", new YellowBolt(), 6) - .shuffleGrouping("green-bolt"); - - LocalCluster cluster = new LocalCluster(); - cluster.submitTopology("mytopology", new HashMap(), topologyBuilder.createTopology()); - - while (true) { - try { - Thread.sleep(1000); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - private static class BlueSpout extends BaseRichSpout { - static int count = 0; - - public BlueSpout() { - } - - @Override - public void declareOutputFields(OutputFieldsDeclarer declarer) { - declarer.declare(new Fields("a")); - } - - @Override - public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { - count++; - System.out.println("# of spout objects " + count + ", current spout " + this); - } - - @Override - public void nextTuple() { - - } - } - - private static class GreenBolt extends BaseRichBolt { - static int count; - - @Override - public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { - count++; - System.out.println("# of green bolt objects " + count + ", current green bolt " + this); - } - - @Override - public void execute(Tuple input) { - - } - - @Override - public void declareOutputFields(OutputFieldsDeclarer declarer) { - declarer.declare(new Fields("a")); - } - } - - private static class YellowBolt extends BaseRichBolt { - static int count; - - @Override - public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { - count++; - System.out.println("# of yellow bolt objects " + count + ", current yellow bolt " + this); - } - - @Override - public void execute(Tuple input) { - - } - - @Override - public void declareOutputFields(OutputFieldsDeclarer declarer) { - declarer.declare(new Fields("a")); - } - } -} http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestStormStreamIdRouting.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestStormStreamIdRouting.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestStormStreamIdRouting.java deleted file mode 100644 index c27edf4..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestStormStreamIdRouting.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * - * * Licensed to the Apache Software Foundation (ASF) under one or more - * * contributor license agreements. See the NOTICE file distributed with - * * this work for additional information regarding copyright ownership. - * * The ASF licenses this file to You under the Apache License, Version 2.0 - * * (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package org.apache.eagle.alert.engine.topology; - -import backtype.storm.Config; -import backtype.storm.LocalCluster; -import backtype.storm.spout.SpoutOutputCollector; -import backtype.storm.task.OutputCollector; -import backtype.storm.task.TopologyContext; -import backtype.storm.topology.OutputFieldsDeclarer; -import backtype.storm.topology.TopologyBuilder; -import backtype.storm.topology.base.BaseRichBolt; -import backtype.storm.topology.base.BaseRichSpout; -import backtype.storm.tuple.Fields; -import backtype.storm.tuple.Tuple; -import org.junit.Ignore; -import org.junit.Test; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - - -/** - * Since 4/29/16. - */ -@SuppressWarnings( {"serial", "rawtypes", "unused"}) -public class TestStormStreamIdRouting { - @Ignore - @Test - public void testRoutingByStreamId() throws Exception { - Config conf = new Config(); - conf.setNumWorkers(2); // use two worker processes - TopologyBuilder topologyBuilder = new TopologyBuilder(); - topologyBuilder.setSpout("blue-spout", new BlueSpout()); // parallelism hint - - topologyBuilder.setBolt("green-bolt-1", new GreenBolt(1)) - .shuffleGrouping("blue-spout", "green-bolt-stream-1"); - topologyBuilder.setBolt("green-bolt-2", new GreenBolt(2)) - .shuffleGrouping("blue-spout", "green-bolt-stream-2"); - - LocalCluster cluster = new LocalCluster(); - cluster.submitTopology("mytopology", new HashMap(), topologyBuilder.createTopology()); - - while (true) { - try { - Thread.sleep(1000); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - private static class BlueSpout extends BaseRichSpout { - int count = 0; - private SpoutOutputCollector collector; - - public BlueSpout() { - } - - @Override - public void declareOutputFields(OutputFieldsDeclarer declarer) { - declarer.declareStream("green-bolt-stream-1", new Fields("a")); - declarer.declareStream("green-bolt-stream-2", new Fields("a")); - } - - @Override - public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { - this.collector = collector; - } - - @Override - public void nextTuple() { - if (count % 2 == 0) { - this.collector.emit("green-bolt-stream-1", Arrays.asList("testdata" + count)); - count++; - } else { - this.collector.emit("green-bolt-stream-2", Arrays.asList("testdata" + count)); - count++; - } - try { - Thread.sleep(10000); - } catch (Exception ex) { - - } - } - } - - private static class GreenBolt extends BaseRichBolt { - private int id; - - public GreenBolt(int id) { - this.id = id; - } - - @Override - public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { - } - - @Override - public void execute(Tuple input) { - System.out.println("bolt " + id + " received data " + input.getString(0)); - } - - @Override - public void declareOutputFields(OutputFieldsDeclarer declarer) { - declarer.declare(new Fields("a")); - } - } - - private static class YellowBolt extends BaseRichBolt { - @Override - public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) { - } - - @Override - public void execute(Tuple input) { - - } - - @Override - public void declareOutputFields(OutputFieldsDeclarer declarer) { - declarer.declare(new Fields("a")); - } - } -} http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestTuple2StreamConverter.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestTuple2StreamConverter.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestTuple2StreamConverter.java deleted file mode 100644 index 19ab1da..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestTuple2StreamConverter.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * * Licensed to the Apache Software Foundation (ASF) under one or more - * * contributor license agreements. See the NOTICE file distributed with - * * this work for additional information regarding copyright ownership. - * * The ASF licenses this file to You under the Apache License, Version 2.0 - * * (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package org.apache.eagle.alert.engine.topology; - -import org.apache.eagle.alert.coordination.model.Tuple2StreamConverter; -import org.apache.eagle.alert.coordination.model.Tuple2StreamMetadata; -import org.junit.Assert; -import org.junit.Test; - -import java.util.*; - -/** - * Since 5/3/16. - */ -public class TestTuple2StreamConverter { - @SuppressWarnings( {"unchecked", "rawtypes"}) - @Test - public void test() { - Tuple2StreamMetadata metadata = new Tuple2StreamMetadata(); - Set activeStreamNames = new HashSet<>(); - activeStreamNames.add("defaultStringStream"); - metadata.setStreamNameSelectorCls("org.apache.eagle.alert.engine.scheme.PlainStringStreamNameSelector"); - metadata.setStreamNameSelectorProp(new Properties()); - metadata.getStreamNameSelectorProp().put("userProvidedStreamName", "defaultStringStream"); - metadata.setActiveStreamNames(activeStreamNames); - metadata.setTimestampColumn("timestamp"); - Tuple2StreamConverter convert = new Tuple2StreamConverter(metadata); - String topic = "testTopic"; - Map m = new HashMap<>(); - m.put("value", "IAmPlainString"); - long t = System.currentTimeMillis(); - m.put("timestamp", t); - List<Object> ret = convert.convert(Arrays.asList(topic, m)); - Assert.assertEquals(topic, ret.get(0)); - Assert.assertEquals("defaultStringStream", ret.get(1)); - Assert.assertEquals(t, ret.get(2)); - Assert.assertEquals(m, ret.get(3)); - } -} http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestUnitTopologyMain.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestUnitTopologyMain.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestUnitTopologyMain.java deleted file mode 100644 index 9647830..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/topology/TestUnitTopologyMain.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * - * * Licensed to the Apache Software Foundation (ASF) under one or more - * * contributor license agreements. See the NOTICE file distributed with - * * this work for additional information regarding copyright ownership. - * * The ASF licenses this file to You under the Apache License, Version 2.0 - * * (the "License"); you may not use this file except in compliance with - * * the License. You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package org.apache.eagle.alert.engine.topology; - -import com.typesafe.config.Config; -import com.typesafe.config.ConfigFactory; -import org.apache.eagle.alert.engine.runner.UnitTopologyRunner; -import org.junit.Ignore; -import org.junit.Test; - -/** - * Since 5/4/16. - */ -public class TestUnitTopologyMain { - @Ignore - @Test - public void testTopologyRun() { - testTopologyRun("/application-test.conf"); - } - - public void testTopologyRun(String configResourceName) { - ConfigFactory.invalidateCaches(); - System.setProperty("config.resource", configResourceName); - System.out.print("Set config.resource = " + configResourceName); - Config config = ConfigFactory.load(); - String topologyId = config.getString("topology.name"); - MockMetadataChangeNotifyService changeNotifyService = - new MockMetadataChangeNotifyService(topologyId, "alertEngineSpout"); - new UnitTopologyRunner(changeNotifyService).run(topologyId, config); - } - - public static void main(String[] args) { - if (args.length > 0) { - new TestUnitTopologyMain().testTopologyRun(args[0]); - } else { - new TestUnitTopologyMain().testTopologyRun(); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/utils/CompressionUtilsTest.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/utils/CompressionUtilsTest.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/utils/CompressionUtilsTest.java deleted file mode 100644 index 3bfb1ab..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/java/org/apache/eagle/alert/engine/utils/CompressionUtilsTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * <p/> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p/> - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.eagle.alert.engine.utils; - -import org.junit.Assert; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -public class CompressionUtilsTest { - private final static Logger LOG = LoggerFactory.getLogger(CompressionUtilsTest.class); - - @Test - public void testCompressAndDecompress() throws IOException { - String value = "http://www.apache.org/licenses/LICENSE-2.0"; - byte[] original = value.getBytes(); - byte[] compressed = CompressionUtils.compress(original); - byte[] decompressed = CompressionUtils.decompress(compressed); - - LOG.info("original size: {}", original.length); - LOG.info("compressed size: {}", compressed.length); - LOG.info("decompressed size: {}", decompressed.length); - - String decompressedValue = new String(decompressed); - Assert.assertEquals(value, decompressedValue); - } -} http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/application-absence.conf ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/application-absence.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/application-absence.conf deleted file mode 100644 index 11df895..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/application-absence.conf +++ /dev/null @@ -1,60 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -{ - "topology": { - "name": "alertUnitTopology_1", - "numOfTotalWorkers": 20, - "numOfSpoutTasks": 1, - "numOfRouterBolts": 4, - "numOfAlertBolts": 10, - "numOfPublishTasks": 1, - "localMode": "true" - }, - "spout": { - "kafkaBrokerZkQuorum": "sandbox.hortonworks.com:2181", - "kafkaBrokerZkBasePath": "/brokers", - "stormKafkaUseSameZkQuorumWithKafkaBroker": true, - "stormKafkaTransactionZkQuorum": "", - "stormKafkaTransactionZkPath": "/consumers", - "stormKafkaEagleConsumer": "eagle_consumer", - "stormKafkaStateUpdateIntervalMs": 2000, - "stormKafkaFetchSizeBytes": 1048586, - }, - "zkConfig": { - "zkQuorum": "sandbox.hortonworks.com:2181", - "zkRoot": "/alert", - "zkSessionTimeoutMs": 10000, - "connectionTimeoutMs": 10000, - "zkRetryTimes": 3, - "zkRetryInterval": 3000 - }, - "dynamicConfigSource": { - "initDelayMillis": 3000, - "delayMillis": 10000 - }, - "metadataService": { - "context": "/rest", - "host": "localhost", - "port": 8080 - }, - "coordinatorService": { - "host": "localhost", - "port": "8080", - "context": "/rest" - }, - "kafkaProducer": { - "bootstrapServers": "sandbox.hortonworks.com:6667" - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/datasources.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/datasources.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/datasources.json deleted file mode 100644 index ed4d638..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/datasources.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "name": "absenceAlertDataSource", - "type": "KAFKA", - "properties": {}, - "topic": "absenceAlertTopic", - "schemeCls": "org.apache.eagle.alert.engine.scheme.JsonScheme", - "codec": { - "streamNameSelectorProp": { - "userProvidedStreamName": "noDataAlertStream" - }, - "streamNameSelectorCls": "org.apache.eagle.alert.engine.scheme.JsonStringStreamNameSelector", - "timestampColumn": "timestamp", - "timestampFormat": "" - } - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/policies.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/policies.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/policies.json deleted file mode 100644 index d03c86e..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/policies.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "name": "absenceAlertPolicy", - "description": "absenceAlertPolicy", - "inputStreams": [ - "absenceAlertStream" - ], - "outputStreams": [ - "absenceAlertStream_out" - ], - "definition": { - "type": "absencealert", - "value": "1,jobID,job1,daily_rule,14:00:00,15:00:00" - }, - "partitionSpec": [ - { - "streamId": "absenceAlertStream", - "type": "GROUPBY", - "columns": [ - "jobID" - ] - } - ], - "parallelismHint": 2 - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/publishments.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/publishments.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/publishments.json deleted file mode 100644 index fca49e2..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/publishments.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "name": "test-stream-output", - "type": "org.apache.eagle.alert.engine.publisher.impl.AlertEmailPublisher", - "policyIds": [ - "absenceAlertPolicy" - ], - "properties": { - "subject": "Eagle Test Alert", - "template": "", - "sender": "[email protected]", - "recipients": "[email protected]", - "smtp.server": "smtp.mailhost.com", - "connection": "plaintext", - "smtp.port": "25" - }, - "dedupIntervalMin": "PT5M", - "serializer": "org.apache.eagle.alert.engine.publisher.impl.StringEventSerializer" - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/streamdefinitions.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/streamdefinitions.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/streamdefinitions.json deleted file mode 100644 index 4bd7319..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/streamdefinitions.json +++ /dev/null @@ -1,29 +0,0 @@ -[ - { - "streamId": "absenceAlertStream", - "dataSource": "absenceAlertDataSource", - "description": "the data stream for testing absence alert", - "validate": false, - "timeseries": false, - "columns": [ - { - "name": "jobID", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "timestamp", - "type": "LONG", - "defaultValue": 0, - "required": true - }, - { - "name": "status", - "type": "STRING", - "defaultValue": "running", - "required": true - } - ] - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/topologies.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/topologies.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/topologies.json deleted file mode 100644 index 8278b2d..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/absence/topologies.json +++ /dev/null @@ -1,31 +0,0 @@ -[ - { - "name": "alertUnitTopology_1", - "numOfSpout": 1, - "numOfAlertBolt": 10, - "numOfGroupBolt": 4, - "spoutId": "alertEngineSpout", - "groupNodeIds": [ - "streamRouterBolt0", - "streamRouterBolt1", - "streamRouterBolt2", - "streamRouterBolt3" - ], - "alertBoltIds": [ - "alertBolt0", - "alertBolt1", - "alertBolt2", - "alertBolt3", - "alertBolt4", - "alertBolt5", - "alertBolt6", - "alertBolt7", - "alertBolt8", - "alertBolt9" - ], - "pubBoltId": "alertPublishBolt", - "spoutParallelism": 1, - "groupParallelism": 1, - "alertParallelism": 1 - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/application-mongo-statestore.conf ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/application-mongo-statestore.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/application-mongo-statestore.conf deleted file mode 100644 index 8504b35..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/application-mongo-statestore.conf +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -{ - "connection": "mongodb://localhost:27017" -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/application-test-backup.conf ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/application-test-backup.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/application-test-backup.conf deleted file mode 100755 index 5b4ff04..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/application-test-backup.conf +++ /dev/null @@ -1,71 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -{ - "topology": { - "name": "alertUnitTopology_bug", - "numOfSpoutTasks": 3, - "numOfRouterBolts": 6, - "numOfAlertBolts": 6, - "numOfPublishTasks": 1, - "numOfTotalWorkers": 1, - "messageTimeoutSecs": 30, // topology.message.timeout.secs: 30 by default - "localMode": true - }, - "spout": { - "kafkaBrokerZkQuorum": "localhost:2181", - "kafkaBrokerZkBasePath": "/brokers", - "stormKafkaUseSameZkQuorumWithKafkaBroker": true, - "stormKafkaTransactionZkQuorum": "", - "stormKafkaTransactionZkPath": "/consumers", - "stormKafkaEagleConsumer": "eagle_consumer", - "stormKafkaStateUpdateIntervalMs": 2000, - "stormKafkaFetchSizeBytes": 1048586, - }, - "zkConfig": { - "zkQuorum": "localhost:2181", - "zkRoot": "/alert", - "zkSessionTimeoutMs": 10000, - "connectionTimeoutMs": 10000, - "zkRetryTimes": 3, - "zkRetryInterval": 3000 - }, - "dynamicConfigSource": { - "initDelayMillis": 3000, - "delayMillis": 10000 - }, - "metadataService": { - "context": "/api", - "host": "localhost", - "port": 8080 - }, - "metric": { - "tags": { - "topologyName": "alertUnitTopology_1" - } - "sink": { - // "kafka": { - // "topic": "alert_metric_test" - // "bootstrap.servers": "localhost:9092" - // } - "logger": { - "level": "DEBUG" - } - "elasticsearch": { - "hosts": ["localhost:9200"] - "index": "alert_metric_test" - } - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/application-test.conf ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/application-test.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/application-test.conf deleted file mode 100755 index 99bbee6..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/application-test.conf +++ /dev/null @@ -1,78 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -{ - "topology": { - "name": "alertUnitTopology_1_test", - "numOfSpoutTasks": 3, - "numOfRouterBolts": 6, - "numOfAlertBolts": 6, - "numOfPublishTasks": 1, - "numOfTotalWorkers": 1, - "messageTimeoutSecs": 30, // topology.message.timeout.secs: 30 by default - "localMode": true - }, - "spout": { - "kafkaBrokerZkQuorum": "localhost:2181", - "kafkaBrokerZkBasePath": "/brokers", - "stormKafkaUseSameZkQuorumWithKafkaBroker": true, - "stormKafkaTransactionZkQuorum": "", - "stormKafkaTransactionZkPath": "/consumers", - "stormKafkaEagleConsumer": "eagle_consumer", - "stormKafkaStateUpdateIntervalMs": 2000, - "stormKafkaFetchSizeBytes": 1048586, - }, - "zkConfig": { - "zkQuorum": "localhost:2181", - "zkRoot": "/alert", - "zkSessionTimeoutMs": 10000, - "connectionTimeoutMs": 10000, - "zkRetryTimes": 3, - "zkRetryInterval": 3000 - }, - "dynamicConfigSource": { - "initDelayMillis": 3000, - "delayMillis": 10000 - }, - "metadataService": { - "context": "/api", - "host": "localhost", - "port": 8080 - }, - "metric": { - "sink": { -// "kafka": { -// "topic": "alert_metric_test" -// "bootstrap.servers": "localhost:9092" -// } -// "logger": { -// "level": "INFO" -// } -// "elasticsearch": { -// "hosts": ["localhost:9200"] -// "index": "alert_metric_test" -// } - } - }, - "connection": "mongodb://localhost:27017" - application.mailService { - mailSmtpServer = "localhost", - mailSmtpPort = 5025, - mailSmtpAuth = "false" - //mailSmtpConn = "plaintext", - //mailSmtpUsername = "" - //mailSmtpPassword = "" - //mailSmtpDebug = false - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/application-integration-2.conf ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/application-integration-2.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/application-integration-2.conf deleted file mode 100644 index 5a626d7..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/application-integration-2.conf +++ /dev/null @@ -1,60 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -{ - "topology": { - "name": "alertUnitTopology_2", - "numOfSpoutTasks": 1, - "numOfRouterBolts": 4, - "numOfAlertBolts": 10, - "numOfPublishTasks": 1, - "numOfTotalWorkers": 20, - "localMode": "true" - }, - "spout": { - "kafkaBrokerZkQuorum": "localhost:2181", - "kafkaBrokerZkBasePath": "/brokers", - "stormKafkaUseSameZkQuorumWithKafkaBroker": true, - "stormKafkaTransactionZkQuorum": "", - "stormKafkaTransactionZkPath": "/consumers", - "stormKafkaEagleConsumer": "eagle_consumer", - "stormKafkaStateUpdateIntervalMs": 2000, - "stormKafkaFetchSizeBytes": 1048586, - }, - "zkConfig": { - "zkQuorum": "localhost:2181", - "zkRoot": "/alert", - "zkSessionTimeoutMs": 10000, - "connectionTimeoutMs": 10000, - "zkRetryTimes": 3, - "zkRetryInterval": 3000 - }, - "dynamicConfigSource": { - "initDelayMillis": 3000, - "delayMillis": 10000 - }, - "metadataService": { - "context": "/rest", - "host": "localhost", - "port": 8080 - }, - "coordinatorService": { - "host": "localhost", - "port": "8080", - "context": "/rest" - }, - "kafkaProducer": { - "bootstrapServers": "localhost:9092" - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/datasources.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/datasources.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/datasources.json deleted file mode 100644 index d16cea3..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/datasources.json +++ /dev/null @@ -1,36 +0,0 @@ -[ - { - "name": "eslog_datasource", - "type": "KAFKA", - "properties": { - }, - "topic": "eslogs", - "schemeCls": "org.apache.eagle.alert.engine.scheme.JsonScheme", - "codec": { - "streamNameSelectorProp": { - "userProvidedStreamName": "esStream", - "streamNameFormat": "%s" - }, - "streamNameSelectorCls": "org.apache.eagle.alert.engine.scheme.JsonStringStreamNameSelector", - "timestampColumn": "timestamp", - "timestampFormat": "" - } - }, - { - "name": "bootfailure_datasource", - "type": "KAFKA", - "properties": { - }, - "topic": "bootfailures", - "schemeCls": "org.apache.eagle.alert.engine.scheme.JsonScheme", - "codec": { - "streamNameSelectorProp": { - "userProvidedStreamName": "ifStream", - "streamNameFormat": "%s" - }, - "streamNameSelectorCls": "org.apache.eagle.alert.engine.scheme.JsonStringStreamNameSelector", - "timestampColumn": "timestamp", - "timestampFormat": "" - } - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/policies.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/policies.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/policies.json deleted file mode 100644 index 31463cd..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/policies.json +++ /dev/null @@ -1,39 +0,0 @@ -[ - { - "name": "logStreamJoinBootFailure", - "description": "policy to check host perfmon_cpu", - "inputStreams": [ - "esStream", - "ifStream" - ], - "outputStreams": [ - "log_stream_join_output" - ], - "definition": { - "type": "siddhi", - "value": " from esStream#window.externalTime(timestamp, 20 min) as a join ifStream#window.externalTime(timestamp, 5 min) as b on a.instanceUuid == b.instanceUuid select logLevel, a.host as aHost, a.component, a.message as logMessage, b.message as failMessage, a.timestamp as t1, b.timestamp as t2, b.host as bHost, count(1) as errorCount insert into log_stream_join_output; " - }, - "partitionSpec": [ - { - "streamId": "esStream", - "type": "GROUPBY", - "columns": [ - "instanceUuid" - ], - "sortSpec": { - "windowPeriod": "PT1M" - } - }, - { - "streamId": "ifStream", - "type": "GROUPBY", - "columns": [ - "instanceUuid" - ], - "sortSpec": { - "windowPeriod": "PT1M" - } - } - ] - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/publishments.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/publishments.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/publishments.json deleted file mode 100644 index 06d7b82..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/publishments.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "name": "log-stream-join-output", - "type": "org.apache.eagle.alert.engine.publisher.impl.AlertEmailPublisher", - "policyIds": [ - "log_stream_join_output" - ], - "properties": { - "subject": "Eagle Test Alert", - "template": "", - "sender": "[email protected]", - "recipients": "[email protected]", - "smtp.server": "mailhost.com" - }, - "dedupIntervalMin": "PT1M", - "serializer": "org.apache.eagle.alert.engine.publisher.impl.StringEventSerializer" - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/streamdefinitions.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/streamdefinitions.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/streamdefinitions.json deleted file mode 100644 index d6603ac..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/streamdefinitions.json +++ /dev/null @@ -1,92 +0,0 @@ -[ - { - "streamId": "esStream", - "dataSource": "eslog_datasource", - "description": "the data stream for es log of different modules", - "validate": false, - "timeseries": false, - "columns": [ - { - "name": "instanceUuid", - "type": "string", - "defaultValue": "", - "required": true - }, - { - "name": "timestamp", - "type": "long", - "defaultValue": 0, - "required": true - }, - { - "name": "logLevel", - "type": "string", - "defaultValue": "ERROR", - "required": true - }, - { - "name": "message", - "type": "string", - "defaultValue": "", - "required": true - }, - { - "name": "reqId", - "type": "string", - "defaultValue": "", - "required": true - }, - { - "name": "host", - "type": "string", - "defaultValue": "", - "required": true - }, - { - "name": "component", - "type": "string", - "defaultValue": "nova", - "required": true - } - ] - }, - { - "streamId": "ifStream", - "dataSource": "bootfailure_datasource", - "description": "the data stream for boot failure(instance fault)", - "validate": false, - "timeseries": false, - "columns": [ - { - "name": "instanceUuid", - "type": "string", - "defaultValue": "", - "required": true - }, - { - "name": "timestamp", - "type": "long", - "defaultValue": 0, - "required": true - }, - { - "name": "reqId", - "type": "string", - "defaultValue": "", - "required": true - }, - { - "name": "message", - "type": "string", - "defaultValue": "", - "required": true - }, - { - "name": "host", - "type": "string", - "defaultValue": "", - "required": true - } - ] - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/topologies.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/topologies.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/topologies.json deleted file mode 100644 index c865746..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation/topologies.json +++ /dev/null @@ -1,31 +0,0 @@ -[ - { - "name": "alertUnitTopology_2", - "numOfSpout": 1, - "numOfGroupBolt": 4, - "numOfAlertBolt": 10, - "spoutId": "alertEngineSpout", - "groupNodeIds": [ - "streamRouterBolt0", - "streamRouterBolt1", - "streamRouterBolt2", - "streamRouterBolt3" - ], - "alertBoltIds": [ - "alertBolt0", - "alertBolt1", - "alertBolt2", - "alertBolt3", - "alertBolt4", - "alertBolt5", - "alertBolt6", - "alertBolt7", - "alertBolt8", - "alertBolt9" - ], - "pubBoltId": "alertPublishBolt", - "spoutParallelism": 1, - "groupParallelism": 1, - "alertParallelism": 1 - } -] http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation_spouttest.conf ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation_spouttest.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation_spouttest.conf deleted file mode 100644 index c607702..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/correlation_spouttest.conf +++ /dev/null @@ -1,53 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -{ - "topology": { - "name": "alertUnitTopology_1_test", - "numOfSpoutTasks": 3, - "numOfRouterBolts": 6, - "numOfAlertBolts": 6, - "numOfPublishTasks": 1, - "numOfTotalWorkers": 1, - "messageTimeoutSecs": 30, // topology.message.timeout.secs: 30 by default - "localMode": true - }, - "spout": { - "kafkaBrokerZkQuorum": "localhost:2181", - "kafkaBrokerZkBasePath": "/brokers", - "stormKafkaUseSameZkQuorumWithKafkaBroker": true, - "stormKafkaTransactionZkQuorum": "", - "stormKafkaTransactionZkPath": "/consumers", - "stormKafkaEagleConsumer": "eagle_consumer", - "stormKafkaStateUpdateIntervalMs": 2000, - "stormKafkaFetchSizeBytes": 1048586, - }, - "zkConfig": { - "zkQuorum": "localhost:2181", - "zkRoot": "/alert", - "zkSessionTimeoutMs": 10000, - "connectionTimeoutMs": 10000, - "zkRetryTimes": 3, - "zkRetryInterval": 3000 - }, - "dynamicConfigSource": { - "initDelayMillis": 3000, - "delayMillis": 10000 - }, - "metadataService": { - "context": "/rest", - "host": "localhost", - "port": 8080 - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/application-e2e.conf ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/application-e2e.conf b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/application-e2e.conf deleted file mode 100644 index 5a626d7..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/application-e2e.conf +++ /dev/null @@ -1,60 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -{ - "topology": { - "name": "alertUnitTopology_2", - "numOfSpoutTasks": 1, - "numOfRouterBolts": 4, - "numOfAlertBolts": 10, - "numOfPublishTasks": 1, - "numOfTotalWorkers": 20, - "localMode": "true" - }, - "spout": { - "kafkaBrokerZkQuorum": "localhost:2181", - "kafkaBrokerZkBasePath": "/brokers", - "stormKafkaUseSameZkQuorumWithKafkaBroker": true, - "stormKafkaTransactionZkQuorum": "", - "stormKafkaTransactionZkPath": "/consumers", - "stormKafkaEagleConsumer": "eagle_consumer", - "stormKafkaStateUpdateIntervalMs": 2000, - "stormKafkaFetchSizeBytes": 1048586, - }, - "zkConfig": { - "zkQuorum": "localhost:2181", - "zkRoot": "/alert", - "zkSessionTimeoutMs": 10000, - "connectionTimeoutMs": 10000, - "zkRetryTimes": 3, - "zkRetryInterval": 3000 - }, - "dynamicConfigSource": { - "initDelayMillis": 3000, - "delayMillis": 10000 - }, - "metadataService": { - "context": "/rest", - "host": "localhost", - "port": 8080 - }, - "coordinatorService": { - "host": "localhost", - "port": "8080", - "context": "/rest" - }, - "kafkaProducer": { - "bootstrapServers": "localhost:9092" - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/datasources.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/datasources.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/datasources.json deleted file mode 100644 index 09d1b97..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/datasources.json +++ /dev/null @@ -1,19 +0,0 @@ -[ - { - "name": "network_syslog_datasource", - "type": "KAFKA", - "properties": { - }, - "topic": "syslog_events", - "schemeCls": "org.apache.eagle.alert.engine.extension.SherlockEventScheme", - "codec": { - "streamNameSelectorProp": { - "userProvidedStreamName": "syslog_stream", - "streamNameFormat": "%s" - }, - "streamNameSelectorCls": "org.apache.eagle.alert.engine.scheme.JsonStringStreamNameSelector", - "timestampColumn": "timestamp", - "timestampFormat": "" - } - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/policies.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/policies.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/policies.json deleted file mode 100644 index 0848585..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/policies.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "name": "syslog_severity_check", - "description": "syslog.severity > 3 then error", - "inputStreams": [ - "syslog_stream" - ], - "outputStreams": [ - "syslog_severity_check_output" - ], - "definition": { - "type": "siddhi", - "value": "from syslog_stream[dims_severity == \"NOTICE\"] select * insert into syslog_severity_check_output;" - }, - "partitionSpec": [ - { - "streamId": "syslog_stream", - "type": "GROUPBY", - "columns": [ - "dims_hostname" - ] - } - ], - "parallelismHint": 10 - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/publishments.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/publishments.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/publishments.json deleted file mode 100644 index 0d56012..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/publishments.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "type": "org.apache.eagle.alert.engine.publisher.impl.AlertKafkaPublisher", - "name": "network-syslog-publish", - "policyIds": [ - "syslog_severity_check" - ], - "dedupIntervalMin": "PT0M", - "properties": { - "kafka_broker": "localhost:9092", - "topic": "syslog_alerts", - "value_deserializer": "org.apache.kafka.common.serialization.ByteArrayDeserializer", - "value_serializer": "org.apache.kafka.common.serialization.ByteArraySerializer" - }, - "serializer": "org.apache.eagle.alert.engine.extension.SherlockAlertSerializer" - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/sherlock.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/sherlock.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/sherlock.json deleted file mode 100644 index ec5a13b..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/sherlock.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "SchemaCompModel": { - "syslog": { - "demo": { - "tsdType": "SherlockLog", - "dimTagsSchema": { - "mandatoryDimensions": [ - "facility", - "severity", - "hostname", - "msgid" - ] - }, - "valueSchema": { - "type": "Primitive", - "primitiveType": "StringValue" - } - }, - "parsed": { - "tsdType": "SherlockEvent", - "dimTagsSchema": { - "mandatoryDimensions": [ - "facility", - "severity", - "hostname", - "msgid" - ] - }, - "valueSchema": { - "type": "Mapdata", - "typeName": "MapdataValue", - "subValueSchema": { - "timestamp": { - "primitiveType": "StringValue" - }, - "conn": { - "primitiveType": "StringValue" - }, - "op": { - "primitiveType": "StringValue" - }, - "msgId": { - "primitiveType": "StringValue" - }, - "command": { - "primitiveType": "StringValue" - } - } - } - } - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/streamdefinitions.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/streamdefinitions.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/streamdefinitions.json deleted file mode 100644 index 082e068..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/streamdefinitions.json +++ /dev/null @@ -1,83 +0,0 @@ -[ - { - "streamId": "syslog_stream", - "dataSource": "network_syslog_datasource", - "description": "the data stream for syslog events", - "validate": false, - "timeseries": false, - "columns": [ - { - "name": "dims_facility", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "dims_severity", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "dims_hostname", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "dims_msgid", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "timestamp", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "conn", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "op", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "msgId", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "command", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "name", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "namespace", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "epochMillis", - "type": "LONG", - "defaultValue": 0, - "required": true - } - ] - } -] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/topologies.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/topologies.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/topologies.json deleted file mode 100644 index c865746..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/topologies.json +++ /dev/null @@ -1,31 +0,0 @@ -[ - { - "name": "alertUnitTopology_2", - "numOfSpout": 1, - "numOfGroupBolt": 4, - "numOfAlertBolt": 10, - "spoutId": "alertEngineSpout", - "groupNodeIds": [ - "streamRouterBolt0", - "streamRouterBolt1", - "streamRouterBolt2", - "streamRouterBolt3" - ], - "alertBoltIds": [ - "alertBolt0", - "alertBolt1", - "alertBolt2", - "alertBolt3", - "alertBolt4", - "alertBolt5", - "alertBolt6", - "alertBolt7", - "alertBolt8", - "alertBolt9" - ], - "pubBoltId": "alertPublishBolt", - "spoutParallelism": 1, - "groupParallelism": 1, - "alertParallelism": 1 - } -] http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/ump_demo_schema.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/ump_demo_schema.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/ump_demo_schema.json deleted file mode 100644 index a833819..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/e2e/ump_demo_schema.json +++ /dev/null @@ -1,181 +0,0 @@ -{ - "clusters": [], - "schemas": [ - { - "streamId": "syslog_stream", - "dataSource": "network_syslog_datasource", - "description": "the data stream for syslog events", - "validate": false, - "timeseries": false, - "columns": [ - { - "name": "dims_facility", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "dims_severity", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "dims_hostname", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "dims_msgid", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "timestamp", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "conn", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "op", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "msgId", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "command", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "name", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "namespace", - "type": "STRING", - "defaultValue": "", - "required": true - }, - { - "name": "epochMillis", - "type": "LONG", - "defaultValue": 0, - "required": true - } - ] - } - ], - "datasources": [ - { - "name": "network_syslog_datasource", - "type": "KAFKA", - "properties": { - }, - "topic": "logoutput", - "schemeCls": "org.apache.eagle.alert.engine.extension.SherlockEventScheme", - "codec": { - "streamNameSelectorProp": { - "userProvidedStreamName": "syslog_stream", - "streamNameFormat": "%s" - }, - "streamNameSelectorCls": "org.apache.eagle.alert.engine.scheme.JsonStringStreamNameSelector", - "timestampColumn": "timestamp", - "timestampFormat": "" - } - } - ], - "policies": [ - { - "name": "syslog_severity_check", - "description": "syslog.severity > 3 then error", - "inputStreams": [ - "syslog_stream" - ], - "outputStreams": [ - "syslog_severity_check_output" - ], - "definition": { - "type": "siddhi", - "value": "from syslog_stream[dims_severity == \"NOTICE\"] select * insert into syslog_severity_check_output;" - }, - "partitionSpec": [ - { - "streamId": "syslog_stream", - "type": "GROUPBY", - "columns": [ - "dims_hostname" - ] - } - ], - "parallelismHint": 10 - } - ], - "publishments": [ - { - "type": "org.apache.eagle.alert.engine.publisher.impl.AlertKafkaPublisher", - "name": "network-syslog-publish", - "policyIds": [ - "syslog_severity_check" - ], - "dedupIntervalMin": "PT0M", - "properties": { - "kafka_broker": "localhost:9092", - "topic": "syslog_alerts", - "value.deserializer": "org.apache.kafka.common.serialization.ByteArrayDeserializer", - "value.serializer": "org.apache.kafka.common.serialization.ByteArraySerializer" - }, - "serializer": "org.apache.eagle.alert.engine.extension.SherlockAlertSerializer" - } - ], - "scheduleStates": {}, - "assignments": [], - "topologies": [ - { - "name": "alertUnitTopology_1", - "numOfSpout": 1, - "numOfGroupBolt": 4, - "numOfAlertBolt": 10, - "spoutId": "alertEngineSpout", - "groupNodeIds": [ - "streamRouterBolt0", - "streamRouterBolt1", - "streamRouterBolt2", - "streamRouterBolt3" - ], - "alertBoltIds": [ - "alertBolt0", - "alertBolt1", - "alertBolt2", - "alertBolt3", - "alertBolt4", - "alertBolt5", - "alertBolt6", - "alertBolt7", - "alertBolt8", - "alertBolt9" - ], - "pubBoltId": "alertPublishBolt", - "spoutParallelism": 1, - "groupParallelism": 1, - "alertParallelism": 1 - } - ] -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/eagle.siddhiext ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/eagle.siddhiext b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/eagle.siddhiext deleted file mode 100644 index 4ce9805..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/eagle.siddhiext +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -collect=org.apache.eagle.alert.engine.siddhi.extension.AttributeCollectAggregator http://git-wip-us.apache.org/repos/asf/eagle/blob/6fd95d5c/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/extend_policy.json ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/extend_policy.json b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/extend_policy.json deleted file mode 100644 index 3a5bd86..0000000 --- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/test/resources/extend_policy.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "name": "extend-policy", - "definition": { - "type": "Custom", - "handlerClass": "i.o.x.Handler", - "value": "", - "properties": { - "parentKey": { - "syslogStream": { - "pattern": "%s-%s", - "columns": [ - "a", - "b", - "d" - ] - } - } - } - } - } -]
