eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [1/2] incubator-eagle git commit: [EAGLE-536] Support application dependency
Date Tue, 13 Sep 2016 12:18:47 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master 2c30276ca -> 83bd4e3d7


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/TestWebApplication.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/TestWebApplication.java b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/TestWebApplication.java
new file mode 100644
index 0000000..398bb4f
--- /dev/null
+++ b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/TestWebApplication.java
@@ -0,0 +1,27 @@
+/*
+ * 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.app;
+
+import org.junit.Ignore;
+
+@Ignore
+public class TestWebApplication {
+    public static class Provider extends StaticWebApplicationProvider {
+
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/service/ApplicationContextTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/service/ApplicationContextTest.java b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/service/ApplicationContextTest.java
deleted file mode 100644
index b93bf2d..0000000
--- a/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/service/ApplicationContextTest.java
+++ /dev/null
@@ -1,48 +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.app.service;
-
-import com.typesafe.config.Config;
-import com.typesafe.config.ConfigFactory;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.HashMap;
-
-public class ApplicationContextTest {
-    /**
-     * appConfig.withFallback(envConfig): appConfig will override envConfig, envConfig is used as default config
-     */
-    @Test
-    public void testTypeSafeConfigMerge(){
-        Config appConfig = ConfigFactory.parseMap(new HashMap<String,String>(){{
-            put("APP_CONFIG",ApplicationContextTest.this.getClass().getCanonicalName());
-            put("SCOPE","APP");
-        }});
-
-        Config envConfig = ConfigFactory.parseMap(new HashMap<String,String>(){{
-            put("ENV_CONFIG",ApplicationContextTest.this.getClass().getCanonicalName());
-            put("SCOPE","ENV");
-        }});
-
-        Config mergedConfig = appConfig.withFallback(envConfig);
-        Assert.assertTrue(mergedConfig.hasPath("APP_CONFIG"));
-        Assert.assertTrue(mergedConfig.hasPath("ENV_CONFIG"));
-        Assert.assertEquals("appConfig.withFallback(envConfig): appConfig will override envConfig, envConfig is used as default config",
-                "APP",mergedConfig.getString("SCOPE"));
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/service/ApplicationOperationContextTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/service/ApplicationOperationContextTest.java b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/service/ApplicationOperationContextTest.java
new file mode 100644
index 0000000..21044be
--- /dev/null
+++ b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/service/ApplicationOperationContextTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.app.service;
+
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.HashMap;
+
+public class ApplicationOperationContextTest {
+    /**
+     * appConfig.withFallback(envConfig): appConfig will override envConfig, envConfig is used as default config
+     */
+    @Test
+    public void testTypeSafeConfigMerge(){
+        Config appConfig = ConfigFactory.parseMap(new HashMap<String,String>(){{
+            put("APP_CONFIG",ApplicationOperationContextTest.this.getClass().getCanonicalName());
+            put("SCOPE","APP");
+        }});
+
+        Config envConfig = ConfigFactory.parseMap(new HashMap<String,String>(){{
+            put("ENV_CONFIG",ApplicationOperationContextTest.this.getClass().getCanonicalName());
+            put("SCOPE","ENV");
+        }});
+
+        Config mergedConfig = appConfig.withFallback(envConfig);
+        Assert.assertTrue(mergedConfig.hasPath("APP_CONFIG"));
+        Assert.assertTrue(mergedConfig.hasPath("ENV_CONFIG"));
+        Assert.assertEquals("appConfig.withFallback(envConfig): appConfig will override envConfig, envConfig is used as default config",
+                "APP",mergedConfig.getString("SCOPE"));
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/providers/org.apache.eagle.app.TestStormApplication$Provider.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/providers/org.apache.eagle.app.TestStormApplication$Provider.xml b/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/providers/org.apache.eagle.app.TestStormApplication$Provider.xml
index 5d76eaa..9d33c0e 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/providers/org.apache.eagle.app.TestStormApplication$Provider.xml
+++ b/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/providers/org.apache.eagle.app.TestStormApplication$Provider.xml
@@ -21,7 +21,6 @@
     <name>Test Monitoring Application</name>
     <version>0.5.0-incubating</version>
     <appClass>org.apache.eagle.app.TestStormApplication</appClass>
-    <viewPath>/apps/example</viewPath>
     <configuration>
         <property>
             <name>message.content</name>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/providers/org.apache.eagle.app.TestWebApplication$Provider.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/providers/org.apache.eagle.app.TestWebApplication$Provider.xml b/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/providers/org.apache.eagle.app.TestWebApplication$Provider.xml
new file mode 100644
index 0000000..5456bce
--- /dev/null
+++ b/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/providers/org.apache.eagle.app.TestWebApplication$Provider.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  ~ 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.
+  -->
+
+<application>
+    <type>TEST_WEB_APPLICATION</type>
+    <name>Test Monitoring Web Application</name>
+    <version>0.5.0-incubating</version>
+    <viewPath>/apps/test_web_app</viewPath>
+    <dependencies>
+        <dependency>
+            <type>TEST_APPLICATION</type>
+            <version>0.5.0-incubating</version>
+        </dependency>
+    </dependencies>
+</application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider b/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
index 2ff0092..6810a3d 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
+++ b/eagle-core/eagle-app/eagle-app-base/src/test/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
@@ -13,4 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-org.apache.eagle.app.TestStormApplication$Provider
\ No newline at end of file
+org.apache.eagle.app.TestStormApplication$Provider
+org.apache.eagle.app.TestWebApplication$Provider
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-core/eagle-embed/eagle-embed-hbase/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-embed/eagle-embed-hbase/pom.xml b/eagle-core/eagle-embed/eagle-embed-hbase/pom.xml
index 66bbb58..1150e5f 100644
--- a/eagle-core/eagle-embed/eagle-embed-hbase/pom.xml
+++ b/eagle-core/eagle-embed/eagle-embed-hbase/pom.xml
@@ -47,10 +47,6 @@
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
         </dependency>
-        <!--<dependency>-->
-        <!--<groupId>org.slf4j</groupId>-->
-        <!--<artifactId>slf4j-log4j12</artifactId>-->
-        <!--</dependency>-->
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>log4j-over-slf4j</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDependency.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDependency.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDependency.java
new file mode 100644
index 0000000..8df63fe
--- /dev/null
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDependency.java
@@ -0,0 +1,56 @@
+/*
+ * 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.metadata.model;
+
+import javax.xml.bind.annotation.XmlElement;
+
+public class ApplicationDependency {
+    private String type;
+
+    private String version;
+    private boolean required = true;
+
+    public String getVersion() {
+        return version;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    @XmlElement(required = true)
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public boolean isRequired() {
+        return required;
+    }
+
+    public void setRequired(boolean required) {
+        this.required = required;
+    }
+
+    @Override
+    public String toString() {
+        return String.format("%s:%s (required: %s)",type,version == null ? "*":version, required);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDesc.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDesc.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDesc.java
index f8d9c41..206cf73 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDesc.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDesc.java
@@ -22,7 +22,7 @@ import java.io.Serializable;
 import java.util.List;
 
 /**
- * Static metadata provided by installed apps
+ * Static metadata provided by installed apps.
  */
 public class ApplicationDesc implements Serializable {
     private String type;
@@ -36,6 +36,8 @@ public class ApplicationDesc implements Serializable {
     private List<StreamDefinition> streams;
     private ApplicationDocs docs;
 
+    private List<ApplicationDependency> dependencies;
+
     public String getDescription() {
         return description;
     }
@@ -99,7 +101,7 @@ public class ApplicationDesc implements Serializable {
     @Override
     public String toString() {
         return String.format("ApplicationDesc [type=%s, name=%s, version=%s, appClass=%s, viewPath=%s, providerClass=%s, configuration= %s properties, description=%s",
-                    getType(),getName(),getVersion(),getAppClass(), getViewPath(),getProviderClass(), getConfiguration() == null ? 0: getConfiguration().size(),getDescription());
+            getType(), getName(), getVersion(), getAppClass(), getViewPath(), getProviderClass(), getConfiguration() == null ? 0 : getConfiguration().size(), getDescription());
     }
 
     public void setConfiguration(Configuration configuration) {
@@ -121,4 +123,12 @@ public class ApplicationDesc implements Serializable {
     public void setDocs(ApplicationDocs docs) {
         this.docs = docs;
     }
+
+    public List<ApplicationDependency> getDependencies() {
+        return dependencies;
+    }
+
+    public void setDependencies(List<ApplicationDependency> dependencies) {
+        this.dependencies = dependencies;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationEntity.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationEntity.java
index 7943491..4e3f2bc 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationEntity.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationEntity.java
@@ -1,4 +1,4 @@
-/**
+/*
  * 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.
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.eagle.metadata.model;
 
 import org.apache.eagle.metadata.persistence.PersistenceEntity;
@@ -24,15 +25,14 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * Site app management entity
+ * Site app management entity.
  */
-
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class ApplicationEntity extends PersistenceEntity {
     private String appId;
     private SiteEntity site;
-
     private ApplicationDesc descriptor;
+    private boolean executable = true;
 
     private Map<String, Object> configuration = new HashMap<>();
     private Map<String, String> context = new HashMap<>();
@@ -45,8 +45,7 @@ public class ApplicationEntity extends PersistenceEntity {
     }
 
     public ApplicationEntity(String siteId, String appType) {
-        SiteEntity siteEntity = new SiteEntity("", siteId);
-        this.site = siteEntity;
+        this.site = new SiteEntity("", siteId);
         ApplicationDesc applicationDesc = new ApplicationDesc();
         applicationDesc.setType(appType);
         this.descriptor = applicationDesc;
@@ -147,6 +146,14 @@ public class ApplicationEntity extends PersistenceEntity {
         this.streams = streams;
     }
 
+    public boolean isExecutable() {
+        return executable;
+    }
+
+    public void setExecutable(boolean executable) {
+        this.executable = executable;
+    }
+
     public static enum Status {
         INITIALIZED("INITIALIZED"),
         STARTING("STARTING"),

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/ApplicationEntityServiceMemoryImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/ApplicationEntityServiceMemoryImpl.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/ApplicationEntityServiceMemoryImpl.java
index 200b5f2..c6c2b31 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/ApplicationEntityServiceMemoryImpl.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/ApplicationEntityServiceMemoryImpl.java
@@ -22,17 +22,20 @@ import org.apache.eagle.metadata.model.ApplicationEntity;
 import org.apache.eagle.metadata.service.ApplicationDescService;
 import org.apache.eagle.metadata.service.ApplicationEntityService;
 
-import java.util.*;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
 import java.util.stream.Collectors;
 
 @Singleton
 public class ApplicationEntityServiceMemoryImpl implements ApplicationEntityService {
 
     private final ApplicationDescService applicationDescService;
-    private final Map<String,ApplicationEntity> applicationEntityMap;
+    private final Map<String, ApplicationEntity> applicationEntityMap;
 
     @Inject
-    public ApplicationEntityServiceMemoryImpl(ApplicationDescService applicationDescService){
+    public ApplicationEntityServiceMemoryImpl(ApplicationDescService applicationDescService) {
         this.applicationDescService = applicationDescService;
         this.applicationEntityMap = new HashMap<>();
     }
@@ -44,19 +47,20 @@ public class ApplicationEntityServiceMemoryImpl implements ApplicationEntityServ
 
     @Override
     public ApplicationEntity getByUUID(String uuid) {
-        if(applicationEntityMap.containsKey(uuid)) {
+        if (applicationEntityMap.containsKey(uuid)) {
             return applicationEntityMap.get(uuid);
         } else {
-            throw new IllegalArgumentException("Application (UUID: "+uuid+") is not found");
+            throw new IllegalArgumentException("Application (UUID: " + uuid + ") is not found");
         }
     }
 
     @Override
     public ApplicationEntity create(ApplicationEntity entity) {
         entity.ensureDefault();
-        if(getBySiteIdAndAppType(entity.getSite().getSiteId(),entity.getDescriptor().getType()) != null)
-            throw new IllegalArgumentException("Duplicated appId: "+entity.getAppId());
-        applicationEntityMap.put(entity.getUuid(),entity);
+        if (getBySiteIdAndAppType(entity.getSite().getSiteId(), entity.getDescriptor().getType()) != null) {
+            throw new IllegalArgumentException("Duplicated appId: " + entity.getAppId());
+        }
+        applicationEntityMap.put(entity.getUuid(), entity);
         return entity;
     }
 
@@ -67,10 +71,10 @@ public class ApplicationEntityServiceMemoryImpl implements ApplicationEntityServ
 
     @Override
     public ApplicationEntity getBySiteIdAndAppType(String siteId, String appType) {
-        Optional<ApplicationEntity>  optional =
-                applicationEntityMap.values().stream()
-                        .filter((app) -> siteId.equals(app.getSite().getSiteId()) && appType.equals(app.getDescriptor().getType())).findAny();
-        if(optional.isPresent()){
+        Optional<ApplicationEntity> optional =
+            applicationEntityMap.values().stream()
+                .filter((app) -> siteId.equals(app.getSite().getSiteId()) && appType.equals(app.getDescriptor().getType())).findAny();
+        if (optional.isPresent()) {
             return optional.get();
         } else {
             return null;
@@ -79,23 +83,23 @@ public class ApplicationEntityServiceMemoryImpl implements ApplicationEntityServ
 
     @Override
     public ApplicationEntity getByUUIDOrAppId(String uuid, String appId) {
-        if(uuid == null && appId == null)
+        if (uuid == null && appId == null) {
             throw new IllegalArgumentException("uuid and appId are both null");
-        else if(uuid !=null){
+        } else if (uuid != null) {
             return getByUUID(uuid);
-        }else {
+        } else {
             Optional<ApplicationEntity> applicationEntity = applicationEntityMap.values().stream().filter((app) -> appId.equals(app.getAppId())).findAny();
-            if(applicationEntity.isPresent()){
+            if (applicationEntity.isPresent()) {
                 return applicationEntity.get();
-            }else{
-                throw new IllegalArgumentException("Application with appId: "+appId+" not found");
+            } else {
+                throw new IllegalArgumentException("Application with appId: " + appId + " not found");
             }
         }
     }
 
     @Override
     public ApplicationEntity delete(ApplicationEntity applicationEntity) {
-        ApplicationEntity entity = getByUUIDOrAppId(applicationEntity.getUuid(),applicationEntity.getAppId());
+        ApplicationEntity entity = getByUUIDOrAppId(applicationEntity.getUuid(), applicationEntity.getAppId());
         return applicationEntityMap.remove(entity.getUuid());
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationProviderTest.java
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationProviderTest.java b/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationProviderTest.java
index 4a54edc..49e2487 100644
--- a/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationProviderTest.java
+++ b/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationProviderTest.java
@@ -36,25 +36,29 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-public class ExampleApplicationProviderTest extends ApplicationTestBase{
-    @Inject private SiteResource siteResource;
-    @Inject private ApplicationResource applicationResource;
-    @Inject private ApplicationSimulator simulator;
-    @Inject private ExampleResource exampleResource;
+public class ExampleApplicationProviderTest extends ApplicationTestBase {
+    @Inject
+    private SiteResource siteResource;
+    @Inject
+    private ApplicationResource applicationResource;
+    @Inject
+    private ApplicationSimulator simulator;
+    @Inject
+    private ExampleResource exampleResource;
 
     @Test
-    public void testApplicationProviderLoading(){
+    public void testApplicationProviderLoading() {
         Collection<ApplicationDesc> applicationDescs = applicationResource.getApplicationDescs().getData();
         Assert.assertNotNull(applicationDescs);
-        Assert.assertEquals(1,applicationDescs.size());
+        Assert.assertEquals(1, applicationDescs.size());
     }
 
     @Test
-    public void testApplicationExtensions(){
+    public void testApplicationExtensions() {
         List<ExampleEntity> entities = exampleResource.getEntities();
         Assert.assertNotNull(entities);
-        Assert.assertEquals(1,entities.size());
-        Assert.assertEquals(GlobalScope.class,exampleResource.getCommonServiceScope());
+        Assert.assertEquals(1, entities.size());
+        Assert.assertEquals(GlobalScope.class, exampleResource.getCommonServiceScope());
     }
 
     /**
@@ -76,7 +80,7 @@ public class ExampleApplicationProviderTest extends ApplicationTestBase{
         siteResource.createSite(siteEntity);
         Assert.assertNotNull(siteEntity.getUuid());
 
-        ApplicationOperations.InstallOperation installOperation = new ApplicationOperations.InstallOperation("test_site","EXAMPLE_APPLICATION", ApplicationEntity.Mode.LOCAL);
+        ApplicationOperations.InstallOperation installOperation = new ApplicationOperations.InstallOperation("test_site", "EXAMPLE_APPLICATION", ApplicationEntity.Mode.LOCAL);
         installOperation.setConfiguration(getConf());
         // Install application
         ApplicationEntity applicationEntity = applicationResource.installApplication(installOperation).getData();
@@ -88,23 +92,23 @@ public class ExampleApplicationProviderTest extends ApplicationTestBase{
         applicationResource.uninstallApplication(new ApplicationOperations.UninstallOperation(applicationEntity.getUuid()));
         try {
             applicationResource.getApplicationEntityByUUID(applicationEntity.getUuid());
-            Assert.fail("Application instance (UUID: "+applicationEntity.getUuid()+") should have been uninstalled");
-        } catch (Exception ex){
+            Assert.fail("Application instance (UUID: " + applicationEntity.getUuid() + ") should have been uninstalled");
+        } catch (Exception ex) {
             // Expected exception
         }
     }
 
     @Test
-    public void testApplicationQuickRunWithAppType(){
+    public void testApplicationQuickRunWithAppType() {
         simulator.start("EXAMPLE_APPLICATION", getConf());
     }
 
     @Test
-    public void testApplicationQuickRunWithAppProvider() throws Exception{
+    public void testApplicationQuickRunWithAppProvider() throws Exception {
         simulator.start(ExampleApplicationProvider.class, getConf());
     }
 
-    private Map<String, Object> getConf(){
+    private Map<String, Object> getConf() {
         Map<String, Object> conf = new HashMap<>();
         conf.put("dataSinkConfig.topic", "testTopic");
         conf.put("dataSinkConfig.brokerList", "broker");

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-app/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-app/pom.xml b/eagle-jpm/eagle-jpm-app/pom.xml
deleted file mode 100644
index 1b545d1..0000000
--- a/eagle-jpm/eagle-jpm-app/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>eagle-jpm-parent</artifactId>
-        <groupId>org.apache.eagle</groupId>
-        <version>0.5.0-incubating-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>eagle-jpm-app</artifactId>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>eagle-app-base</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <resources>
-            <resource>
-                <directory>src/main/webapp/app</directory>
-                <targetPath>assets/</targetPath>
-            </resource>
-            <resource>
-                <directory>src/main/resources</directory>
-            </resource>
-        </resources>
-    </build>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-app/src/main/java/org/apache/eagle/app/jpm/JPMApplication.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-app/src/main/java/org/apache/eagle/app/jpm/JPMApplication.java b/eagle-jpm/eagle-jpm-app/src/main/java/org/apache/eagle/app/jpm/JPMApplication.java
deleted file mode 100644
index ba5f9d9..0000000
--- a/eagle-jpm/eagle-jpm-app/src/main/java/org/apache/eagle/app/jpm/JPMApplication.java
+++ /dev/null
@@ -1,64 +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.app.jpm;
-
-import org.apache.eagle.app.StormApplication;
-import org.apache.eagle.app.environment.impl.StormEnvironment;
-
-import backtype.storm.generated.StormTopology;
-import backtype.storm.spout.SpoutOutputCollector;
-import backtype.storm.task.TopologyContext;
-import backtype.storm.topology.OutputFieldsDeclarer;
-import backtype.storm.topology.TopologyBuilder;
-import backtype.storm.topology.base.BaseRichSpout;
-import backtype.storm.tuple.Fields;
-import com.typesafe.config.Config;
-
-import java.util.Arrays;
-import java.util.Map;
-
-public class JPMApplication extends StormApplication {
-
-    @Override
-    public StormTopology execute(Config config, StormEnvironment environment) {
-        TopologyBuilder builder = new TopologyBuilder();
-        builder.setSpout("metric_spout", new RandomEventSpout(), 4);
-        builder.setBolt("sink_1",environment.getStreamSink("SAMPLE_STREAM_1",config)).fieldsGrouping("metric_spout",new Fields("metric"));
-        builder.setBolt("sink_2",environment.getStreamSink("SAMPLE_STREAM_2",config)).fieldsGrouping("metric_spout",new Fields("metric"));
-        return builder.createTopology();
-    }
-
-    private class RandomEventSpout extends BaseRichSpout {
-        private SpoutOutputCollector collector;
-
-        @Override
-        public void open(Map map, TopologyContext topologyContext, SpoutOutputCollector spoutOutputCollector) {
-            collector = spoutOutputCollector;
-        }
-
-        @Override
-        public void nextTuple() {
-            collector.emit(Arrays.asList("disk.usage",System.currentTimeMillis(),"host_1",56.7));
-            collector.emit(Arrays.asList("cpu.usage",System.currentTimeMillis(),"host_2",99.8));
-        }
-
-        @Override
-        public void declareOutputFields(OutputFieldsDeclarer outputFieldsDeclarer) {
-            outputFieldsDeclarer.declare(new Fields("metric","timestamp","source","value"));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-app/src/main/java/org/apache/eagle/app/jpm/JPMApplicationProvider.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-app/src/main/java/org/apache/eagle/app/jpm/JPMApplicationProvider.java b/eagle-jpm/eagle-jpm-app/src/main/java/org/apache/eagle/app/jpm/JPMApplicationProvider.java
deleted file mode 100644
index 5d2c2a9..0000000
--- a/eagle-jpm/eagle-jpm-app/src/main/java/org/apache/eagle/app/jpm/JPMApplicationProvider.java
+++ /dev/null
@@ -1,29 +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.app.jpm;
-
-import org.apache.eagle.app.spi.AbstractApplicationProvider;
-
-/**
- * Define application provider pragmatically.
- */
-public class JPMApplicationProvider extends AbstractApplicationProvider<JPMApplication> {
-    @Override
-    public JPMApplication getApplication() {
-        return new JPMApplication();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-app/src/main/resources/META-INF/providers/org.apache.eagle.app.jpm.JPMApplicationProvider.xml
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-app/src/main/resources/META-INF/providers/org.apache.eagle.app.jpm.JPMApplicationProvider.xml b/eagle-jpm/eagle-jpm-app/src/main/resources/META-INF/providers/org.apache.eagle.app.jpm.JPMApplicationProvider.xml
deleted file mode 100644
index 564615b..0000000
--- a/eagle-jpm/eagle-jpm-app/src/main/resources/META-INF/providers/org.apache.eagle.app.jpm.JPMApplicationProvider.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-  ~ 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.
-  -->
-
-<application>
-    <type>JPM_APP</type>
-    <name>Job Performance Monitoring Application</name>
-    <version>0.5.0-incubating</version>
-    <appClass>org.apache.eagle.app.jpm.JPMApplication</appClass>
-    <viewPath>/apps/jpm</viewPath>
-    <configuration>
-        <property>
-            <name>default</name>
-            <displayName>Message</displayName>
-            <value>Hello, example application!</value>
-            <description>Just an sample configuration property</description>
-        </property>
-    </configuration>
-    <streams>
-        <stream>
-            <streamId>SAMPLE_STREAM_1</streamId>
-            <description>Sample output stream #1</description>
-            <validate>true</validate>
-            <timeseries>true</timeseries>
-            <columns>
-                <column>
-                    <name>metric</name>
-                    <type>string</type>
-                </column>
-                <column>
-                    <name>source</name>
-                    <type>string</type>
-                </column>
-                <column>
-                    <name>value</name>
-                    <type>double</type>
-                    <defaultValue>0.0</defaultValue>
-                </column>
-            </columns>
-        </stream>
-        <stream>
-            <streamId>SAMPLE_STREAM_2</streamId>
-            <description>Sample output stream #2</description>
-            <validate>true</validate>
-            <timeseries>true</timeseries>
-            <columns>
-                <column>
-                    <name>metric</name>
-                    <type>string</type>
-                </column>
-                <column>
-                    <name>source</name>
-                    <type>string</type>
-                </column>
-                <column>
-                    <name>value</name>
-                    <type>double</type>
-                    <defaultValue>0.0</defaultValue>
-                </column>
-            </columns>
-        </stream>
-    </streams>
-    <docs>
-        <install>
-            # Step 1: Create source kafka topic named "${site}_example_source_topic"
-
-            ./bin/kafka-topics.sh --create --topic example_source_topic --replication-factor 1 --replication 1
-
-            # Step 2: Set up data collector to flow data into kafka topic in
-
-            ./bin/logstash -f log_collector.conf
-
-            ## `log_collector.conf` sample as following:
-
-            input {
-
-            }
-            filter {
-
-            }
-            output{
-
-            }
-
-            # Step 3: start application
-
-            # Step 4: monitor with featured portal or alert with policies
-        </install>
-        <uninstall>
-            # Step 1: stop and uninstall application
-            # Step 2: delete kafka topic named "${site}_example_source_topic"
-            # Step 3: stop logstash
-        </uninstall>
-    </docs>
-</application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-app/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-app/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider b/eagle-jpm/eagle-jpm-app/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
deleted file mode 100644
index 2a876fd..0000000
--- a/eagle-jpm/eagle-jpm-app/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
+++ /dev/null
@@ -1,16 +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.
-
-org.apache.eagle.app.jpm.JPMApplicationProvider
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-app/src/main/webapp/app/apps/jpm/index.html
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-app/src/main/webapp/app/apps/jpm/index.html b/eagle-jpm/eagle-jpm-app/src/main/webapp/app/apps/jpm/index.html
deleted file mode 100644
index c0e81f3..0000000
--- a/eagle-jpm/eagle-jpm-app/src/main/webapp/app/apps/jpm/index.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<htm>
-    <body>
-        <h1>JPM Application!</h1>
-        <i><b>url</b>: /apps/jpm</i>
-    </body>
-</htm>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-app/src/main/webapp/package.json
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-app/src/main/webapp/package.json b/eagle-jpm/eagle-jpm-app/src/main/webapp/package.json
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-app/src/test/java/org/apache/eagle/app/jpm/JPMApplicationTest.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-app/src/test/java/org/apache/eagle/app/jpm/JPMApplicationTest.java b/eagle-jpm/eagle-jpm-app/src/test/java/org/apache/eagle/app/jpm/JPMApplicationTest.java
deleted file mode 100644
index 330af73..0000000
--- a/eagle-jpm/eagle-jpm-app/src/test/java/org/apache/eagle/app/jpm/JPMApplicationTest.java
+++ /dev/null
@@ -1,86 +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.app.jpm;
-
-import com.google.inject.Inject;
-import org.apache.eagle.app.resource.ApplicationResource;
-import org.apache.eagle.app.service.ApplicationOperations;
-import org.apache.eagle.app.test.ApplicationTestBase;
-import org.apache.eagle.metadata.model.ApplicationEntity;
-import org.apache.eagle.metadata.model.SiteEntity;
-import org.apache.eagle.metadata.resource.SiteResource;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class JPMApplicationTest extends ApplicationTestBase{
-    @Inject
-    private SiteResource siteResource;
-    @Inject
-    private ApplicationResource applicationResource;
-
-    /**
-     * register site
-     * install app
-     * start app
-     * stop app
-     * uninstall app
-     *
-     * @throws InterruptedException
-     */
-    @Test
-    public void testApplicationLifecycle() throws InterruptedException {
-        // Create local site
-        SiteEntity siteEntity = new SiteEntity();
-        siteEntity.setSiteId("test_site");
-        siteEntity.setSiteName("Test Site");
-        siteEntity.setDescription("Test Site for JPMApplication");
-        siteResource.createSite(siteEntity);
-        Assert.assertNotNull(siteEntity.getUuid());
-
-        ApplicationOperations.InstallOperation installOperation = new ApplicationOperations.InstallOperation("test_site","JPM_APP", ApplicationEntity.Mode.LOCAL);
-        installOperation.setConfiguration(getConf());
-
-        // Install application
-        ApplicationEntity applicationEntity = applicationResource.installApplication(installOperation).getData();
-        // Start application
-        applicationResource.startApplication(new ApplicationOperations.StartOperation(applicationEntity.getUuid()));
-        // Stop application
-        applicationResource.stopApplication(new ApplicationOperations.StopOperation(applicationEntity.getUuid()));
-        // Uninstall application
-        applicationResource.uninstallApplication(new ApplicationOperations.UninstallOperation(applicationEntity.getUuid()));
-        try {
-            applicationResource.getApplicationEntityByUUID(applicationEntity.getUuid());
-            Assert.fail("Application instance (UUID: "+applicationEntity.getUuid()+") should have been uninstalled");
-        } catch (Exception ex){
-            // Expected exception
-        }
-    }
-
-    private Map<String, Object> getConf(){
-        Map<String, Object> conf = new HashMap<>();
-        conf.put("dataSinkConfig.topic", "testTopic");
-        conf.put("dataSinkConfig.brokerList", "broker");
-        conf.put("dataSinkConfig.serializerClass", "serializerClass");
-        conf.put("dataSinkConfig.keySerializerClass", "keySerializerClass");
-        conf.put("spoutNum", 2);
-        conf.put("mode", "LOCAL");
-        return conf;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml b/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml
index 5e69a16..1491b4b 100644
--- a/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml
+++ b/eagle-jpm/eagle-jpm-mr-history/src/main/resources/META-INF/providers/org.apache.eagle.jpm.mr.history.MRHistoryJobApplicationProvider.xml
@@ -17,8 +17,8 @@
   -->
 
 <application>
-    <type>SPARK_HISTORY_JOB_APP</type>
-    <name>Spark History Job Monitoring</name>
+    <type>MR_HISTORY_JOB_APP</type>
+    <name>Map Reduce History Job Monitoring</name>
     <version>0.5.0-incubating</version>
     <appClass>org.apache.eagle.jpm.mr.history.MRHistoryJobApplication</appClass>
     <viewPath>/apps/jpm</viewPath>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-web/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-web/pom.xml b/eagle-jpm/eagle-jpm-web/pom.xml
new file mode 100644
index 0000000..145fb95
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-web/pom.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>eagle-jpm-parent</artifactId>
+        <groupId>org.apache.eagle</groupId>
+        <version>0.5.0-incubating-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>eagle-jpm-web</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.eagle</groupId>
+            <artifactId>eagle-app-base</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.eagle</groupId>
+            <artifactId>eagle-jpm-mr-running</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.eagle</groupId>
+            <artifactId>eagle-jpm-mr-history</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/webapp/app</directory>
+                <targetPath>assets/</targetPath>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-web/src/main/java/org/apache/eagle/app/jpm/JPMWebApplicationProvider.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-web/src/main/java/org/apache/eagle/app/jpm/JPMWebApplicationProvider.java b/eagle-jpm/eagle-jpm-web/src/main/java/org/apache/eagle/app/jpm/JPMWebApplicationProvider.java
new file mode 100644
index 0000000..6c27608
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-web/src/main/java/org/apache/eagle/app/jpm/JPMWebApplicationProvider.java
@@ -0,0 +1,23 @@
+/*
+ * 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.app.jpm;
+
+import org.apache.eagle.app.StaticWebApplicationProvider;
+
+public class JPMWebApplicationProvider extends StaticWebApplicationProvider {
+    // JPMWebApplicationProvider SPI Interface
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-web/src/main/resources/META-INF/providers/org.apache.eagle.app.jpm.JPMWebApplicationProvider.xml
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-web/src/main/resources/META-INF/providers/org.apache.eagle.app.jpm.JPMWebApplicationProvider.xml b/eagle-jpm/eagle-jpm-web/src/main/resources/META-INF/providers/org.apache.eagle.app.jpm.JPMWebApplicationProvider.xml
new file mode 100644
index 0000000..6c4dccd
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-web/src/main/resources/META-INF/providers/org.apache.eagle.app.jpm.JPMWebApplicationProvider.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  ~ 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.
+  -->
+
+<application>
+    <type>JPM_WEB_APP</type>
+    <name>Job Performance Monitoring Web </name>
+    <version>0.5.0-incubating</version>
+    <viewPath>/apps/jpm</viewPath>
+    <description>Job Performance Monitoring Web</description>
+    <dependencies>
+        <dependency>
+            <type>MR_RUNNING_JOB_APP</type>
+            <required>true</required>
+        </dependency>
+        <dependency>
+            <type>MR_HISTORY_JOB_APP</type>
+            <required>true</required>
+        </dependency>
+        <!--<dependency>-->
+            <!--<type>SPARK_RUNNING_JOB_APP</type>-->
+            <!--<required>true</required>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+            <!--<type>JPM_SPARK_HISTORY_APP</type>-->
+            <!--<required>true</required>-->
+        <!--</dependency>-->
+    </dependencies>
+</application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-web/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-web/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider b/eagle-jpm/eagle-jpm-web/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
new file mode 100644
index 0000000..076b09b
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-web/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
@@ -0,0 +1,16 @@
+# 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.
+
+org.apache.eagle.app.jpm.JPMWebApplicationProvider
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-web/src/main/webapp/app/apps/jpm/index.html
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-web/src/main/webapp/app/apps/jpm/index.html b/eagle-jpm/eagle-jpm-web/src/main/webapp/app/apps/jpm/index.html
new file mode 100644
index 0000000..c0e81f3
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-web/src/main/webapp/app/apps/jpm/index.html
@@ -0,0 +1,6 @@
+<htm>
+    <body>
+        <h1>JPM Application!</h1>
+        <i><b>url</b>: /apps/jpm</i>
+    </body>
+</htm>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-web/src/main/webapp/package.json
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-web/src/main/webapp/package.json b/eagle-jpm/eagle-jpm-web/src/main/webapp/package.json
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/eagle-jpm-web/src/test/java/org/apache/eagle/app/jpm/JPMWebApplicationTest.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-web/src/test/java/org/apache/eagle/app/jpm/JPMWebApplicationTest.java b/eagle-jpm/eagle-jpm-web/src/test/java/org/apache/eagle/app/jpm/JPMWebApplicationTest.java
new file mode 100644
index 0000000..24c7660
--- /dev/null
+++ b/eagle-jpm/eagle-jpm-web/src/test/java/org/apache/eagle/app/jpm/JPMWebApplicationTest.java
@@ -0,0 +1,102 @@
+/*
+ * 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.app.jpm;
+
+import org.apache.eagle.app.resource.ApplicationResource;
+import org.apache.eagle.app.service.ApplicationOperations;
+import org.apache.eagle.app.test.ApplicationTestBase;
+import org.apache.eagle.metadata.model.ApplicationEntity;
+import org.apache.eagle.metadata.model.SiteEntity;
+import org.apache.eagle.metadata.resource.SiteResource;
+
+import com.google.inject.Inject;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class JPMWebApplicationTest extends ApplicationTestBase {
+    @Inject
+    private SiteResource siteResource;
+
+    @Inject
+    private ApplicationResource applicationResource;
+
+    private void installDependencies(){
+        ApplicationOperations.InstallOperation installDependency1 = new ApplicationOperations.InstallOperation("test_site", "MR_RUNNING_JOB_APP", ApplicationEntity.Mode.LOCAL);
+        installDependency1.setConfiguration(getConf());
+        applicationResource.installApplication(installDependency1).getData();
+
+        ApplicationOperations.InstallOperation installDependency2 = new ApplicationOperations.InstallOperation("test_site", "MR_HISTORY_JOB_APP", ApplicationEntity.Mode.LOCAL);
+        installDependency2.setConfiguration(getConf());
+        applicationResource.installApplication(installDependency2).getData();
+    }
+
+    /**
+     * register site
+     * install app
+     * start app
+     * stop app
+     * uninstall app
+     *
+     * @throws InterruptedException
+     */
+    @Test
+    public void testApplicationLifecycle() throws InterruptedException {
+        // Create local site
+        SiteEntity siteEntity = new SiteEntity();
+        siteEntity.setSiteId("test_site");
+        siteEntity.setSiteName("Test Site");
+        siteEntity.setDescription("Test Site for JPMApplication");
+        siteResource.createSite(siteEntity);
+        Assert.assertNotNull(siteEntity.getUuid());
+
+        installDependencies();
+
+        ApplicationOperations.InstallOperation installOperation = new ApplicationOperations.InstallOperation("test_site", "JPM_WEB_APP", ApplicationEntity.Mode.LOCAL);
+        installOperation.setConfiguration(getConf());
+
+        // Install application
+        ApplicationEntity applicationEntity = applicationResource.installApplication(installOperation).getData();
+
+        // Start application
+        applicationResource.startApplication(new ApplicationOperations.StartOperation(applicationEntity.getUuid()));
+        // Stop application
+        applicationResource.stopApplication(new ApplicationOperations.StopOperation(applicationEntity.getUuid()));
+        // Uninstall application
+        applicationResource.uninstallApplication(new ApplicationOperations.UninstallOperation(applicationEntity.getUuid()));
+        try {
+            applicationResource.getApplicationEntityByUUID(applicationEntity.getUuid());
+            Assert.fail("Application instance (UUID: " + applicationEntity.getUuid() + ") should have been uninstalled");
+        } catch (Exception ex) {
+            // Expected exception
+        }
+    }
+
+    private Map<String, Object> getConf() {
+        Map<String, Object> conf = new HashMap<>();
+        conf.put("dataSinkConfig.topic", "testTopic");
+        conf.put("dataSinkConfig.brokerList", "broker");
+        conf.put("dataSinkConfig.serializerClass", "serializerClass");
+        conf.put("dataSinkConfig.keySerializerClass", "keySerializerClass");
+        conf.put("spoutNum", 2);
+        conf.put("mode", "LOCAL");
+        return conf;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-jpm/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-jpm/pom.xml b/eagle-jpm/pom.xml
index 702c89d..fce9b6c 100644
--- a/eagle-jpm/pom.xml
+++ b/eagle-jpm/pom.xml
@@ -40,7 +40,7 @@
         <module>eagle-hadoop-queue</module>
         <module>eagle-jpm-util</module>
         <module>eagle-jpm-mr-running</module>
-        <module>eagle-jpm-app</module>
+        <module>eagle-jpm-web</module>
         <module>eagle-jpm-service</module>
         <module>eagle-jpm-aggregation</module>
     </modules>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HdfsAuditLogAppProvider.xml
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HdfsAuditLogAppProvider.xml b/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HdfsAuditLogAppProvider.xml
index 2fb7274..ded57ab 100644
--- a/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HdfsAuditLogAppProvider.xml
+++ b/eagle-security/eagle-security-hdfs-auditlog/src/main/resources/META-INF/providers/org.apache.eagle.security.auditlog.HdfsAuditLogAppProvider.xml
@@ -24,7 +24,6 @@
     <type>HdfsAuditLogApplication</type>
     <name>Hdfs Audit Log Monitoring Application</name>
     <version>0.5.0-incubating</version>
-    <appClass>org.apache.eagle.security.auditlog.HdfsAuditLogApplication</appClass>
     <viewPath>/apps/example</viewPath>
     <configuration>
         <!-- topology related configurations -->

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-server/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-server/pom.xml b/eagle-server/pom.xml
index 16b902a..2881821 100644
--- a/eagle-server/pom.xml
+++ b/eagle-server/pom.xml
@@ -146,37 +146,6 @@
             <version>${project.version}</version>
         </dependency>
 
-        <!-- Oozie  Auditlog monitoring -->
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>eagle-security-oozie-auditlog</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>eagle-security-oozie-web</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <!-- hdfs audit log monitoring -->
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>eagle-security-hdfs-auditlog</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>eagle-security-hdfs-web</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <!-- GC log monitoring -->
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>eagle-gc</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
         <!-- Alert unit topology as an application -->
         <dependency>
             <groupId>org.apache.eagle</groupId>
@@ -184,6 +153,66 @@
             <version>${project.version}</version>
         </dependency>
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>dev</id>
+
+        <!-- =========================================================================================================
+             TODO: Decouple following specific application related dependencies into independent module: eagle-develop
+             ========================================================================================================= -->
+
+            <dependencies>
+                <!-- App: Oozie  Auditlog monitoring -->
+                <dependency>
+                    <groupId>org.apache.eagle</groupId>
+                    <artifactId>eagle-security-oozie-auditlog</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.eagle</groupId>
+                    <artifactId>eagle-security-oozie-web</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+
+                <!-- App: hdfs audit log monitoring -->
+                <dependency>
+                    <groupId>org.apache.eagle</groupId>
+                    <artifactId>eagle-security-hdfs-auditlog</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.eagle</groupId>
+                    <artifactId>eagle-security-hdfs-web</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+
+                <!-- App: GC log monitoring -->
+                <dependency>
+                    <groupId>org.apache.eagle</groupId>
+                    <artifactId>eagle-gc</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+
+                <!--App: Job Performance Monitoring -->
+                <dependency>
+                    <groupId>org.apache.eagle</groupId>
+                    <artifactId>eagle-jpm-web</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.eagle</groupId>
+                    <artifactId>eagle-jpm-mr-history</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.eagle</groupId>
+                    <artifactId>eagle-jpm-mr-running</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
     <build>
         <resources>
             <resource>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/83bd4e3d/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
----------------------------------------------------------------------
diff --git a/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider b/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
index 0448556..2701c42 100644
--- a/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
+++ b/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
@@ -15,4 +15,4 @@
 
 org.apache.eagle.security.hbase.HBaseAuditLogAppProvider
 org.apache.eagle.app.example.ExampleApplicationProvider
-org.apache.eagle.app.jpm.JPMApplicationProvider
+org.apache.eagle.app.jpm.JPMWebApplicationProvider


Mime
View raw message