[4/5] incubator-eagle git commit: EAGLE-271 Topology management in remote/local mode including start/stop operations

2016-04-24 Thread qingwzhao
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ecf75b28/eagle-core/eagle-application-management/eagle-stream-application-manager/src/main/java/org/apache/eagle/stream/application/TopologyFactory.java
--
diff --git 
a/eagle-core/eagle-application-management/eagle-stream-application-manager/src/main/java/org/apache/eagle/stream/application/TopologyFactory.java
 
b/eagle-core/eagle-application-management/eagle-stream-application-manager/src/main/java/org/apache/eagle/stream/application/TopologyFactory.java
new file mode 100644
index 000..e32f48e
--- /dev/null
+++ 
b/eagle-core/eagle-application-management/eagle-stream-application-manager/src/main/java/org/apache/eagle/stream/application/TopologyFactory.java
@@ -0,0 +1,55 @@
+/*
+ * 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.stream.application;
+
+
+import com.typesafe.config.Config;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+
+public final class TopologyFactory {
+public static Logger LOG = LoggerFactory.getLogger(TopologyFactory.class);
+private final static Map topologyCache = 
Collections.synchronizedMap(new HashMap());
+public static TopologyExecutable getTopologyInstance(String topologyClass) 
throws TopologyException {
+TopologyExecutable instance;
+if(topologyCache.containsKey(topologyClass)){
+instance = topologyCache.get(topologyClass);
+} else {
+try {
+LOG.info("load class " + topologyClass + "with classLoader " + 
TopologyFactory.class.getClassLoader().toString());
+instance = (TopologyExecutable) 
Class.forName(topologyClass).newInstance();
+topologyCache.put(topologyClass, instance);
+} catch (ClassNotFoundException e) {
+throw new TopologyException("Topology in type of " + 
topologyClass + " is not found",e);
+} catch (InstantiationException | IllegalAccessException e) {
+throw new TopologyException(e);
+}
+}
+return instance;
+}
+
+public static void submit(String topologyClass, Config config) throws 
TopologyException {
+TopologyExecutable topology = getTopologyInstance(topologyClass);
+topology.submit(topologyClass, config);
+}
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ecf75b28/eagle-core/eagle-application-management/eagle-stream-application-manager/src/main/scala/org/apache/eagle/stream/application/AbstractDynamicApplication.scala
--
diff --git 
a/eagle-core/eagle-application-management/eagle-stream-application-manager/src/main/scala/org/apache/eagle/stream/application/AbstractDynamicApplication.scala
 
b/eagle-core/eagle-application-management/eagle-stream-application-manager/src/main/scala/org/apache/eagle/stream/application/AbstractDynamicApplication.scala
new file mode 100644
index 000..3e918cc
--- /dev/null
+++ 
b/eagle-core/eagle-application-management/eagle-stream-application-manager/src/main/scala/org/apache/eagle/stream/application/AbstractDynamicApplication.scala
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ *
+ */
+

[1/2] incubator-eagle git commit: change dataSource to application in ALERT_DEFAULT.vm

2016-04-24 Thread qingwzhao
Repository: incubator-eagle
Updated Branches:
  refs/heads/master ed270c9e3 -> 99b25759c


change dataSource to application in ALERT_DEFAULT.vm


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/5d82c610
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/5d82c610
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/5d82c610

Branch: refs/heads/master
Commit: 5d82c61099416c99e3a3f011d0851c0589ddf383
Parents: ed270c9
Author: Zhao, Qingwen 
Authored: Fri Apr 22 11:08:57 2016 +0800
Committer: Zhao, Qingwen 
Committed: Fri Apr 22 11:08:57 2016 +0800

--
 .../src/main/resources/ALERT_DEFAULT.vm| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/5d82c610/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/resources/ALERT_DEFAULT.vm
--
diff --git 
a/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/resources/ALERT_DEFAULT.vm
 
b/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/resources/ALERT_DEFAULT.vm
index 887d759..0a044f6 100644
--- 
a/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/resources/ALERT_DEFAULT.vm
+++ 
b/eagle-core/eagle-alert/eagle-alert-notification-plugin/src/main/resources/ALERT_DEFAULT.vm
@@ -209,7 +209,7 @@

$elem["site"]




-   
$elem["dataSource"]
+   
$elem["application"]