eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject incubator-eagle git commit: [EAGLE-325] Combine multiple web resource into centralized service and remove useless codec interface
Date Sat, 04 Jun 2016 07:15:03 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/develop 1d51f826c -> 985080112


[EAGLE-325] Combine multiple web resource into centralized service and remove useless codec
interface

Author: Hao Chen <hao@apache.org>

Closes #219 from haoch/refactor-war.


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

Branch: refs/heads/develop
Commit: 9850801123d408194ffbd84cd215344c15fd3240
Parents: 1d51f82
Author: Hao Chen <hao@apache.org>
Authored: Sat Jun 4 15:14:49 2016 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Sat Jun 4 15:14:49 2016 +0800

----------------------------------------------------------------------
 .github/PULL_REQUEST_TEMPLATE.md                | 13 +++++
 .../eagle/alert/engine/codec/IStreamCodec.java  | 30 ------------
 .../alert/engine/codec/SherlockEventCodec.java  | 41 ----------------
 .../alert/engine/codec/SherlockMetricCodec.java | 39 ---------------
 .../eagle-alert/alert-coordinator/pom.xml       |  2 +-
 .../src/main/webapp/WEB-INF/web.xml             |  4 +-
 .../alert-metadata-service/pom.xml              |  2 +-
 .../src/main/webapp/WEB-INF/web.xml             |  4 +-
 eagle-webservice/pom.xml                        | 12 ++++-
 .../src/main/resources/application.conf         | 50 ++++++++++++++++----
 .../src/main/webapp/WEB-INF/web.xml             |  2 +-
 pom.xml                                         |  1 +
 12 files changed, 73 insertions(+), 127 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/98508011/.github/PULL_REQUEST_TEMPLATE.md
----------------------------------------------------------------------
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..b17f620
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,13 @@
+Be sure to do all of the following to help us incorporate your contribution
+quickly and easily:
+
+ - [ ] Make sure the PR title is formatted like:
+   `[BEAM-<Jira issue #>] Description of pull request`
+ - [ ] Make sure tests pass via `mvn clean verify`. (Even better, enable
+       Travis-CI on your fork and ensure the whole test matrix passes).
+ - [ ] Replace `<Jira issue #>` in the title with the actual Jira issue
+       number, if there is one.
+ - [ ] If this contribution is large, please file an Apache
+       [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.txt).
+
+---

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/98508011/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/IStreamCodec.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/IStreamCodec.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/IStreamCodec.java
deleted file mode 100644
index 3272d28..0000000
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/IStreamCodec.java
+++ /dev/null
@@ -1,30 +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.codec;
-
-import org.apache.eagle.alert.engine.model.StreamEvent;
-
-/**
- * @since Apr 5, 2016
- *
- */
-public interface IStreamCodec {
-
-    StreamEvent decode(byte[] contents);
-
-    byte[] encode(StreamEvent tuple);
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/98508011/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/SherlockEventCodec.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/SherlockEventCodec.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/SherlockEventCodec.java
deleted file mode 100644
index 49726e9..0000000
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/SherlockEventCodec.java
+++ /dev/null
@@ -1,41 +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.codec;
-
-import org.apache.eagle.alert.engine.model.StreamEvent;
-
-/**
- * This is used for event codec.
- * 
- * @since Apr 5, 2016
- *
- */
-public class SherlockEventCodec implements IStreamCodec {
-
-    @Override
-    public StreamEvent decode(byte[] contents) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public byte[] encode(StreamEvent tuple) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/98508011/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/SherlockMetricCodec.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/SherlockMetricCodec.java
b/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/SherlockMetricCodec.java
deleted file mode 100644
index 0e875d8..0000000
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/engine/codec/SherlockMetricCodec.java
+++ /dev/null
@@ -1,39 +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.codec;
-
-import org.apache.eagle.alert.engine.model.StreamEvent;
-
-/**
- * @since Apr 5, 2016
- *
- */
-public class SherlockMetricCodec implements IStreamCodec {
-
-    @Override
-    public StreamEvent decode(byte[] contents) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public byte[] encode(StreamEvent tuple) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/98508011/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/pom.xml b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/pom.xml
index 7dd7f30..92f73e6 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/pom.xml
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/pom.xml
@@ -21,7 +21,7 @@
 	</parent>
 
 	<artifactId>alert-coordinator</artifactId>
-	<packaging>war</packaging>
+	<packaging>jar</packaging>
 
 	<name>alert-coordinator</name>
 	<url>http://maven.apache.org</url>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/98508011/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/WEB-INF/web.xml
b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/WEB-INF/web.xml
index 1aa925e..2de0d8b 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/WEB-INF/web.xml
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-coordinator/src/main/webapp/WEB-INF/web.xml
@@ -50,14 +50,14 @@
 		</init-param>
 		<init-param>
 			<param-name>swagger.api.basepath</param-name>
-			<param-value>/api</param-value>
+			<param-value>/rest</param-value>
 		</init-param>
 		<load-on-startup>2</load-on-startup>
 	</servlet>
 
     <servlet-mapping>
         <servlet-name>Jersey Web Application</servlet-name>
-        <url-pattern>/api/*</url-pattern>
+        <url-pattern>/rest/*</url-pattern>
     </servlet-mapping>
     <filter>
         <filter-name>CorsFilter</filter-name>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/98508011/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/pom.xml
b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/pom.xml
index 3aff012..1318a31 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/pom.xml
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/pom.xml
@@ -21,7 +21,7 @@
 	</parent>
 
 	<artifactId>alert-metadata-service</artifactId>
-	<packaging>war</packaging>
+	<packaging>jar</packaging>
 
 	<dependencies>
 		<!-- Storm depends on org.ow2.asm:asm:4.0 -->

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/98508011/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/main/webapp/WEB-INF/web.xml
b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/main/webapp/WEB-INF/web.xml
index ab7b019..10e9504 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/main/webapp/WEB-INF/web.xml
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata-service/src/main/webapp/WEB-INF/web.xml
@@ -44,14 +44,14 @@
 		</init-param>
 		<init-param>
 			<param-name>swagger.api.basepath</param-name>
-			<param-value>/api</param-value>
+			<param-value>/rest</param-value>
 		</init-param>
 		<load-on-startup>2</load-on-startup>
 	</servlet>
 
 	<servlet-mapping>
 		<servlet-name>Jersey Web Application</servlet-name>
-		<url-pattern>/api/*</url-pattern>
+		<url-pattern>/rest/*</url-pattern>
 	</servlet-mapping>
 	<filter>
 		<filter-name>CorsFilter</filter-name>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/98508011/eagle-webservice/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-webservice/pom.xml b/eagle-webservice/pom.xml
index 80c42bc..eaa8312 100644
--- a/eagle-webservice/pom.xml
+++ b/eagle-webservice/pom.xml
@@ -316,7 +316,6 @@
 			<artifactId>spring-security-ldap</artifactId>
 			<version>${spring.framework.version}</version>
 		</dependency>
-
 		<dependency>
 			<groupId>javax.servlet</groupId>
 			<artifactId>servlet-api</artifactId>
@@ -324,6 +323,17 @@
 			<scope>provided</scope>
 		</dependency>
 
+		<!-- Integrate next generation alert engine service -->
+		<dependency>
+			<groupId>org.apache.eagle</groupId>
+			<artifactId>alert-coordinator</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.eagle</groupId>
+			<artifactId>alert-metadata-service</artifactId>
+			<version>${project.version}</version>
+		</dependency>
 	</dependencies>
 
 	<build>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/98508011/eagle-webservice/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/resources/application.conf b/eagle-webservice/src/main/resources/application.conf
index fff7d3f..eaa9895 100644
--- a/eagle-webservice/src/main/resources/application.conf
+++ b/eagle-webservice/src/main/resources/application.conf
@@ -13,15 +13,47 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
-eagle{
-	service{
-		storage-type="hbase"
-		hbase-zookeeper-quorum="sandbox.hortonworks.com"
-		hbase-zookeeper-property-clientPort=2181
-		zookeeper-znode-parent="/hbase-unsecure",
-		springActiveProfile="sandbox"
-		audit-enabled=true
+{
+	eagle {
+		service {
+			storage-type = "hbase"
+			hbase-zookeeper-quorum = "sandbox.hortonworks.com"
+			hbase-zookeeper-property-clientPort = 2181
+			zookeeper-znode-parent = "/hbase-unsecure",
+			springActiveProfile = "sandbox"
+			audit-enabled = true
+		}
+	}
+	"coordinator" : {
+		"policiesPerBolt" : 5,
+		"boltParallelism" : 5,
+		"policyDefaultParallelism" : 5,
+		"boltLoadUpbound": 0.8,
+		"topologyLoadUpbound" : 0.8,
+		"numOfAlertBoltsPerTopology" : 5,
+		"zkConfig" : {
+			"zkQuorum" : "localhost:2181",
+			"zkRoot" : "/alert",
+			"zkSessionTimeoutMs" : 10000,
+			"connectionTimeoutMs" : 10000,
+			"zkRetryTimes" : 3,
+			"zkRetryInterval" : 3000
+		},
+		"metadataService" : {
+			"host" : "localhost",
+			"port" : 8080,
+			"context" : "/rest"
+		},
+		"metadataDynamicCheck" : {
+			"initDelayMillis" : 1000,
+			"delayMillis" : 30000
+		}
+	}
+	"datastore": {
+		"metadataDao": "org.apache.eagle.alert.metadata.impl.InMemMetadataDaoImpl",
+		"connection": "localhost:27017"
 	}
 }
 
+
+

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/98508011/eagle-webservice/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/WEB-INF/web.xml b/eagle-webservice/src/main/webapp/WEB-INF/web.xml
index 1907767..e68a22e 100644
--- a/eagle-webservice/src/main/webapp/WEB-INF/web.xml
+++ b/eagle-webservice/src/main/webapp/WEB-INF/web.xml
@@ -29,7 +29,7 @@
 		<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
 		<init-param>
 			<param-name>com.sun.jersey.config.property.packages</param-name>
-			<param-value>org.apache.eagle.service;org.codehaus.jackson.jaxrs</param-value>
+			<param-value>org.apache.eagle;org.codehaus.jackson.jaxrs</param-value>
 		</init-param>
         <!--init-param> <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
             <param-value>true</param-value> </init-param -->

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/98508011/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1660e56..6b79490 100755
--- a/pom.xml
+++ b/pom.xml
@@ -1056,6 +1056,7 @@
                                 <!-- README and test data with exact format -->
                                 <exclude>README*</exclude>
                                 <exclude>**/*.log</exclude>
+                                <exclude>**/*.out</exclude>
                                 <exclude>**/eagle.log*</exclude>
                                 <exclude>**/velocity.log*</exclude>
                                 <!-- all json files should be excluded -->


Mime
View raw message