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-436] Decouple Application Class-based Configuration
Date Wed, 10 Aug 2016 03:02:17 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/develop a0458ba26 -> ad5becc9f


[EAGLE-436] Decouple Application Class-based Configuration

https://issues.apache.org/jira/browse/EAGLE-436

Author: Hao Chen <hao@apache.org>

Closes #314 from haoch/EAGLE-436.


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

Branch: refs/heads/develop
Commit: ad5becc9fbac37653fc63b5f4eee75d6a410d120
Parents: a0458ba
Author: Hao Chen <hao@apache.org>
Authored: Wed Aug 10 11:01:48 2016 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Wed Aug 10 11:01:48 2016 +0800

----------------------------------------------------------------------
 .../apache/eagle/app/AbstractApplication.java   | 50 +---------------
 .../java/org/apache/eagle/app/Application.java  | 43 +-------------
 .../org/apache/eagle/app/ApplicationTool.java   | 14 +----
 .../org/apache/eagle/app/Configuration.java     | 60 -------------------
 .../org/apache/eagle/app/StormApplication.java  |  2 +-
 .../config/ApplicationProviderDescConfig.java   |  4 +-
 .../eagle/app/environment/ExecutionRuntime.java | 10 +---
 .../environment/impl/SparkExecutionRuntime.java |  5 +-
 .../app/environment/impl/StormEnvironment.java  | 12 +---
 .../environment/impl/StormExecutionRuntime.java | 19 +-----
 .../eagle/app/service/ApplicationContext.java   |  4 +-
 .../impl/ApplicationProviderServiceImpl.java    | 10 ++--
 .../apache/eagle/app/sink/KafkaStreamSink.java  | 17 ++----
 .../eagle/app/sink/LoggingStreamSink.java       | 15 +++--
 .../apache/eagle/app/sink/StormStreamSink.java  | 57 ++++++++++--------
 .../eagle/app/sink/StreamSinkProvider.java      |  1 -
 .../app/spi/AbstractApplicationProvider.java    | 25 ++++----
 .../app/utils/ApplicationConfigHelper.java      | 51 ++++++++--------
 .../app/ApplicationProviderDescConfigTest.java  |  2 +-
 .../apache/eagle/app/TestStormApplication.java  | 23 +-------
 .../eagle/app/storm/MockStormApplication.java   | 40 +------------
 .../app/storm/MockStormApplicationTest.java     | 19 +-----
 .../src/test/resources/application.conf         |  4 +-
 .../eagle/metadata/resource/RESTResponse.java   | 10 ++++
 .../SiteEntityEntityServiceMemoryImpl.java      |  1 -
 .../eagle/storage/jdbc/TestJdbcStorage.java     | 35 ++++++-----
 .../example/ExampleApplicationProvider2.java    | 62 --------------------
 .../app/example/ExampleStormApplication.java    | 11 +---
 .../eagle/app/example/ExampleStormConfig.java   | 36 ------------
 .../main/webapp/app/apps/example2/index.html    |  6 --
 .../example/ExampleApplicationProviderTest.java |  6 --
 .../app/example/ExampleApplicationTest.java     | 12 ----
 .../src/test/resources/application.conf         |  3 +-
 .../apache/eagle/app/jpm/JPMApplication.java    | 11 +---
 .../apache/eagle/app/jpm/JPMConfiguration.java  | 23 --------
 .../security/hbase/HBaseAuditLogAppConf.java    | 28 ---------
 .../hbase/HBaseAuditLogAppProvider.java         |  4 +-
 .../hbase/HBaseAuditLogApplication.java         | 10 +---
 eagle-server/pom.xml                            |  2 -
 .../eagle/server/RESTExceptionMapper.java       |  4 +-
 pom.xml                                         | 11 ++++
 41 files changed, 167 insertions(+), 595 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/AbstractApplication.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/AbstractApplication.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/AbstractApplication.java
index 5b498eb..a80ab11 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/AbstractApplication.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/AbstractApplication.java
@@ -19,56 +19,10 @@ package org.apache.eagle.app;
 import com.typesafe.config.Config;
 import org.apache.eagle.app.environment.Environment;
 import org.apache.eagle.app.environment.ExecutionRuntimeManager;
-import org.apache.eagle.app.utils.ApplicationConfigHelper;
-
-import java.lang.reflect.ParameterizedType;
-import java.util.Map;
-
-abstract class AbstractApplication<Conf extends Configuration,Env extends Environment,Proc> implements Application<Conf,Env,Proc>, ApplicationTool<Conf> {
-    private Class<Conf> parametrizedConfigClass;
-
-    @Override
-    public Proc execute(Map<String, Object> config, Env env) {
-        return execute(ApplicationConfigHelper.convertFrom(config, getConfigType()),env);
-    }
-
-    @Override
-    public Proc execute(Config config, Env environment){
-        return null;
-    }
-    /**
-     *  Map application configuration from environment
-     *
-     * @param config
-     * @return
-     */
-    private Conf loadAppConfigFromEnv(Config config){
-        return ApplicationConfigHelper.convertFrom(ApplicationConfigHelper.unwrapFrom(config,getClass().getCanonicalName()), getConfigType());
-    }
 
+public abstract class AbstractApplication<Env extends Environment,Proc> implements Application<Env,Proc>, ApplicationTool {
     @Override
     public void run(Config config) {
-//        ExecutionRuntimeManager.getInstance().getRuntime(getEnvironmentType(),config).start(this,loadAppConfigFromEnv(config));
         ExecutionRuntimeManager.getInstance().getRuntime(getEnvironmentType(),config).start(this,config);
     }
-
-    @Override
-    public void run(Configuration conf, Config config) {
-//        ExecutionRuntimeManager.getInstance().getRuntime(getEnvironmentType(), config).start(this,conf);
-    }
-
-    @Override
-    public Proc execute(Env environment) {
-        return execute(loadAppConfigFromEnv(environment.config()),environment);
-    }
-
-    /**
-     * @return Config class from Generic Type
-     */
-    public Class<Conf> getConfigType(){
-        if (parametrizedConfigClass == null) {
-            this.parametrizedConfigClass = (Class<Conf>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
-        }
-        return parametrizedConfigClass;
-    }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Application.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Application.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Application.java
index d1e4c9b..a64869e 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Application.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Application.java
@@ -20,7 +20,6 @@ import com.typesafe.config.Config;
 import org.apache.eagle.app.environment.Environment;
 
 import java.io.Serializable;
-import java.util.Map;
 
 /**
  * Application Execution Interface
@@ -33,61 +32,25 @@ import java.util.Map;
  * </ul>
  *
  * @param <Proc>
- * @param <Conf>
  * @param <Env>
  */
 public interface Application <
-    Conf extends Configuration,     //  Application Configuration
     Env extends Environment,        // Application Environment
     Proc                            // Application Process
 > extends Serializable {
     /**
-     * Execute with type-safe configuration
-     *
-     * Developer-oriented interface
+     * Execute with application configuration
      *
      * @param config application configuration
      * @param environment execution environment
      * @return execution process
      */
-    Proc execute(Conf config, Env environment);
-
-    /**
-     * Execute with raw map-based configuration
-     *
-     * Management service oriented interface
-     *
-     * @param config application configuration
-     * @param environment  execution environment
-     * @return execution process
-     */
-    Proc execute(Map<String,Object> config, Env environment);
-
-    /**
-     * Execute with type-safe configuration
-     * @param config
-     * @param environment
-     * @return
-     */
     Proc execute(Config config, Env environment);
 
     /**
-     * Execute with environment based configuration
-     *
-     * Light-weight Runner (dry-run/test purpose) oriented interface
+     * Execution Environment type
      *
-     * @param environment  execution environment
-     * @return execution process
-     */
-    Proc execute(Env environment);
-
-    /**
-     * @return application configuration type (POJO class)
-     */
-    Class<Conf> getConfigType();
-
-    /**
      * @return application environment type
      */
     Class<? extends Env> getEnvironmentType();
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationTool.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationTool.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationTool.java
index c0f8723..2b1448e 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationTool.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationTool.java
@@ -21,7 +21,7 @@ import com.typesafe.config.ConfigFactory;
 import org.apache.commons.cli.ParseException;
 import org.apache.eagle.common.config.ConfigOptionParser;
 
-public interface ApplicationTool<Conf extends Configuration> {
+public interface ApplicationTool {
     /**
      * Run application through CLI
      *
@@ -42,18 +42,6 @@ public interface ApplicationTool<Conf extends Configuration> {
      */
     void run(Config config);
 
-    /**
-     * @param appConf
-     */
-    void run(Conf appConf, Config envConfig);
-
-    /**
-     * @param appConf
-     */
-    default void run(Conf appConf){
-        run(appConf, ConfigFactory.load());
-    }
-
     default void run(){
         run(ConfigFactory.load());
     }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Configuration.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Configuration.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Configuration.java
deleted file mode 100644
index 9280158..0000000
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Configuration.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * <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.apache.eagle.metadata.model.ApplicationEntity;
-
-import java.io.Serializable;
-
-public class Configuration implements Serializable {
-    private ApplicationEntity.Mode mode;
-    private String siteId;
-    private String appId;
-    private String jarPath;
-
-    public ApplicationEntity.Mode getMode() {
-        return mode;
-    }
-
-    public void setMode(ApplicationEntity.Mode mode) {
-        this.mode = mode;
-    }
-
-    public String getAppId() {
-        return appId;
-    }
-
-    public void setAppId(String appId) {
-        this.appId = appId;
-    }
-
-    public String getJarPath() {
-        return jarPath;
-    }
-
-    public void setJarPath(String jarPath) {
-        this.jarPath = jarPath;
-    }
-
-    public String getSiteId() {
-        return siteId;
-    }
-
-    public void setSiteId(String siteId) {
-        this.siteId = siteId;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/StormApplication.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/StormApplication.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/StormApplication.java
index 5ae01fa..821e5cd 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/StormApplication.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/StormApplication.java
@@ -19,7 +19,7 @@ package org.apache.eagle.app;
 import backtype.storm.generated.StormTopology;
 import org.apache.eagle.app.environment.impl.StormEnvironment;
 
-public abstract class StormApplication<AppConf extends Configuration> extends AbstractApplication<AppConf,StormEnvironment,StormTopology>{
+public abstract class StormApplication extends AbstractApplication<StormEnvironment,StormTopology>{
     @Override
     public Class<? extends StormEnvironment> getEnvironmentType() {
         return StormEnvironment.class;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderDescConfig.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderDescConfig.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderDescConfig.java
index 824d81a..77ad848 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderDescConfig.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderDescConfig.java
@@ -111,12 +111,12 @@ public class ApplicationProviderDescConfig {
 
     private final static Logger LOG = LoggerFactory.getLogger(ApplicationProviderDescConfig.class);
 
-    public static ApplicationProviderDescConfig loadFromXML(AbstractApplicationProvider provider, String configXmlFile){
+    public static ApplicationProviderDescConfig loadFromXML(Class<?> classLoader, String configXmlFile){
         try {
             JAXBContext jc = JAXBContext.newInstance(ApplicationProviderDescConfig.class);
             Unmarshaller unmarshaller = jc.createUnmarshaller();
 //            InputStream is = ApplicationProviderDescConfig.class.getResourceAsStream(configXmlFile);
-            InputStream is = provider.getClass().getResourceAsStream(configXmlFile);
+            InputStream is = classLoader.getResourceAsStream(configXmlFile);
             if(is == null){
                 is = ApplicationProviderDescConfig.class.getResourceAsStream("/"+configXmlFile);
             }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntime.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntime.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntime.java
index c4e89f4..2cc5e78 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntime.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntime.java
@@ -18,7 +18,6 @@ package org.apache.eagle.app.environment;
 
 import com.typesafe.config.Config;
 import org.apache.eagle.app.Application;
-import org.apache.eagle.app.Configuration;
 
 /**
  * Execution Runtime Adapter
@@ -34,21 +33,18 @@ public interface ExecutionRuntime<Env extends Environment, Proc> {
     /**
      * @param executor
      * @param config
-     * @param <Conf>
      */
-    <Conf extends Configuration> void start(Application<Conf,Env, Proc> executor, Config config);
+    void start(Application<Env, Proc> executor, Config config);
 
     /**
      * @param executor
      * @param config
-     * @param <Conf>
      */
-    <Conf extends Configuration> void stop(Application<Conf,Env, Proc> executor, Config config);
+    void stop(Application<Env, Proc> executor, Config config);
 
     /**
      * @param executor
      * @param config
-     * @param <Conf>
      */
-    <Conf extends Configuration> void status(Application<Conf,Env, Proc> executor, Config config);
+    void status(Application<Env, Proc> executor, Config config);
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkExecutionRuntime.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkExecutionRuntime.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkExecutionRuntime.java
index 5d4e049..23aaa67 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkExecutionRuntime.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkExecutionRuntime.java
@@ -18,7 +18,6 @@ package org.apache.eagle.app.environment.impl;
 
 import com.typesafe.config.Config;
 import org.apache.eagle.app.Application;
-import org.apache.eagle.app.Configuration;
 import org.apache.eagle.app.environment.ExecutionRuntime;
 import org.apache.eagle.app.environment.ExecutionRuntimeProvider;
 
@@ -35,13 +34,11 @@ public class SparkExecutionRuntime implements ExecutionRuntime<SparkEnvironment,
 
     @Override
     public void start(Application executor, Config config) {
-
         throw new RuntimeException("Not implemented yet");
     }
 
     @Override
     public void stop(Application executor, Config config) {
-
         throw new RuntimeException("Not implemented yet");
     }
 
@@ -56,4 +53,4 @@ public class SparkExecutionRuntime implements ExecutionRuntime<SparkEnvironment,
             return new SparkExecutionRuntime();
         }
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormEnvironment.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormEnvironment.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormEnvironment.java
index 1112588..6715a2b 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormEnvironment.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormEnvironment.java
@@ -17,16 +17,8 @@
 package org.apache.eagle.app.environment.impl;
 
 import com.typesafe.config.Config;
-import org.apache.eagle.app.Configuration;
 import org.apache.eagle.app.environment.AbstractEnvironment;
-import org.apache.eagle.app.sink.FlattenEventMapper;
-import org.apache.eagle.app.sink.LoggingStreamSink;
 import org.apache.eagle.app.sink.StormStreamSink;
-import org.apache.eagle.app.sink.StreamSink;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import scala.Int;
-import storm.trident.spout.RichSpoutBatchExecutor;
 
 /**
  * Storm Execution Environment Context
@@ -36,7 +28,7 @@ public class StormEnvironment extends AbstractEnvironment {
         super(envConfig);
     }
 
-    public StormStreamSink getFlattenStreamSink(String streamId, Config config) {
-        return ((StormStreamSink) streamSink().getSink(streamId,config)).setEventMapper(new FlattenEventMapper(streamId));
+    public StormStreamSink getStreamSink(String streamId, Config config) {
+        return ((StormStreamSink) streamSink().getSink(streamId,config));
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java
index 06c22dc..5b236dd 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java
@@ -23,7 +23,6 @@ import backtype.storm.generated.*;
 import backtype.storm.utils.NimbusClient;
 import com.google.common.base.Preconditions;
 import org.apache.eagle.app.Application;
-import org.apache.eagle.app.Configuration;
 import org.apache.eagle.app.environment.ExecutionRuntime;
 import org.apache.eagle.app.environment.ExecutionRuntimeProvider;
 import org.apache.eagle.app.utils.DynamicJarPathFinder;
@@ -40,18 +39,6 @@ public class StormExecutionRuntime implements ExecutionRuntime<StormEnvironment,
 
     private StormEnvironment environment;
 
-//    static {
-//        Runtime.getRuntime().addShutdownHook(new Thread(){
-//            @Override
-//            public void run() {
-//                if(_localCluster != null) {
-//                    LOG.info("Shutting down local storm cluster instance");
-//                    _localCluster.shutdown();
-//                }
-//            }
-//        });
-//    }
-
     private static LocalCluster getLocalCluster(){
         if(_localCluster == null){
             _localCluster = new LocalCluster();
@@ -102,7 +89,7 @@ public class StormExecutionRuntime implements ExecutionRuntime<StormEnvironment,
     }
 
     @Override
-    public <Conf extends Configuration> void start(Application<Conf, StormEnvironment, StormTopology> executor, com.typesafe.config.Config config){
+    public void start(Application<StormEnvironment, StormTopology> executor, com.typesafe.config.Config config){
         String topologyName = config.getString("appId");
         Preconditions.checkNotNull(topologyName,"[appId] is required by null for "+executor.getClass().getCanonicalName());
         StormTopology topology = executor.execute(config, environment);
@@ -134,7 +121,7 @@ public class StormExecutionRuntime implements ExecutionRuntime<StormEnvironment,
     }
 
     @Override
-    public <Conf extends Configuration> void stop(Application<Conf,StormEnvironment, StormTopology> executor, com.typesafe.config.Config config) {
+    public void stop(Application<StormEnvironment, StormTopology> executor, com.typesafe.config.Config config) {
         String appId = config.getString("appId");
         if(config.getString("mode") == ApplicationEntity.Mode.CLUSTER.name()){
             Nimbus.Client stormClient = NimbusClient.getConfiguredClient(getStormConfig()).getClient();
@@ -151,7 +138,7 @@ public class StormExecutionRuntime implements ExecutionRuntime<StormEnvironment,
     }
 
     @Override
-    public <Conf extends Configuration> void status(Application<Conf,StormEnvironment, StormTopology> executor, com.typesafe.config.Config config) {
+    public void status(Application<StormEnvironment, StormTopology> executor, com.typesafe.config.Config config) {
         // TODO: Not implemented yet!
         throw new RuntimeException("TODO: Not implemented yet!");
     }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationContext.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationContext.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationContext.java
index 90137e5..ed89ea8 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationContext.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationContext.java
@@ -21,16 +21,13 @@ import com.typesafe.config.Config;
 import com.typesafe.config.ConfigFactory;
 import org.apache.eagle.app.Application;
 import org.apache.eagle.app.ApplicationLifecycle;
-import org.apache.eagle.app.Configuration;
 import org.apache.eagle.app.environment.ExecutionRuntime;
 import org.apache.eagle.app.environment.ExecutionRuntimeManager;
-import org.apache.eagle.app.utils.ApplicationConfigHelper;
 import org.apache.eagle.metadata.model.ApplicationEntity;
 import org.apache.eagle.metadata.model.StreamDesc;
 import org.apache.eagle.metadata.model.StreamSinkConfig;
 
 import java.io.Serializable;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -65,6 +62,7 @@ public class ApplicationContext implements Serializable, ApplicationLifecycle {
         if(applicationConfig == null) {
             applicationConfig = Collections.emptyMap();
         }
+        // TODO: Merge application config with environment config
         this.config = ConfigFactory.parseMap(applicationConfig);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationProviderServiceImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationProviderServiceImpl.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationProviderServiceImpl.java
index ec2ad6c..b32e9ca 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationProviderServiceImpl.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationProviderServiceImpl.java
@@ -44,13 +44,13 @@ public class ApplicationProviderServiceImpl implements ApplicationProviderServic
 
     @Inject
     public ApplicationProviderServiceImpl(Config config){
-        LOG.warn("Initializing {}",this.getClass().getCanonicalName());
+        LOG.info("Initializing {}",this.getClass().getCanonicalName());
         this.config = config;
         String appProviderLoaderClass = this.config.hasPath(APP_PROVIDER_LOADER_CLASS_KEY)?
                 this.config.getString(APP_PROVIDER_LOADER_CLASS_KEY):ApplicationProviderLoader.getDefaultAppProviderLoader();
-        LOG.warn("Initializing {} = {}",APP_PROVIDER_LOADER_CLASS_KEY,appProviderLoaderClass);
+        LOG.info("Initializing {} = {}",APP_PROVIDER_LOADER_CLASS_KEY,appProviderLoaderClass);
         appProviderLoader = initializeAppProviderLoader(appProviderLoaderClass);
-        LOG.warn("Initialized {}",appProviderLoader);
+        LOG.info("Initialized {}",appProviderLoader);
         reload();
     }
 
@@ -65,9 +65,9 @@ public class ApplicationProviderServiceImpl implements ApplicationProviderServic
 
     public synchronized void reload(){
         appProviderLoader.reset();
-        LOG.warn("Loading application providers ...");
+        LOG.info("Loading application providers ...");
         appProviderLoader.load();
-        LOG.warn("Loaded {} application providers",appProviderLoader.getProviders().size());
+        LOG.info("Loaded {} application providers",appProviderLoader.getProviders().size());
     }
 
     public Collection<ApplicationProvider> getProviders(){

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/KafkaStreamSink.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/KafkaStreamSink.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/KafkaStreamSink.java
index e4adfd2..9c18d88 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/KafkaStreamSink.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/KafkaStreamSink.java
@@ -56,19 +56,12 @@ public class KafkaStreamSink extends StormStreamSink<KafkaStreamSinkConfig> {
     }
 
     @Override
-    protected void onEvent(StreamEvent streamEvent) {
-    }
-
-    @Override
-    public void execute(Tuple input, BasicOutputCollector collector) {
-        LOG.info("TODO: producing {} to '{}'", input, topicId);
-
+    protected void execute(Object key, Map event,BasicOutputCollector collector) {
         try {
-            Map m = (Map) input.getValue(1);
-            String output = new ObjectMapper().writeValueAsString(m);
-            producer.send(new KeyedMessage(this.topicId, m.get("user"), output));
+            String output = new ObjectMapper().writeValueAsString(event);
+            producer.send(new KeyedMessage(this.topicId, event.get("user"), output));
         }catch(Exception ex){
-            LOG.error("", ex);
+            LOG.error(ex.getMessage(), ex);
             collector.reportError(ex);
         }
     }
@@ -107,4 +100,4 @@ public class KafkaStreamSink extends StormStreamSink<KafkaStreamSinkConfig> {
             return new KafkaStreamSink();
         }
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/LoggingStreamSink.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/LoggingStreamSink.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/LoggingStreamSink.java
index 0d835d6..787fc99 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/LoggingStreamSink.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/LoggingStreamSink.java
@@ -16,22 +16,17 @@
  */
 package org.apache.eagle.app.sink;
 
+import backtype.storm.topology.BasicOutputCollector;
 import com.typesafe.config.Config;
-import org.apache.eagle.alert.engine.coordinator.StreamDefinition;
-import org.apache.eagle.alert.engine.model.StreamEvent;
-import org.apache.eagle.app.Configuration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Map;
+
 public class LoggingStreamSink extends StormStreamSink<DefaultStreamSinkConfig> {
     private final static Logger LOGGER = LoggerFactory.getLogger(KafkaStreamSink.class);
 
     @Override
-    protected void onEvent(StreamEvent streamEvent) {
-        LOGGER.info("Receiving {}",streamEvent);
-    }
-
-    @Override
     public void onInstall() {
         LOGGER.info("Executing onInstall callback, do nothing");
     }
@@ -41,6 +36,10 @@ public class LoggingStreamSink extends StormStreamSink<DefaultStreamSinkConfig>
         LOGGER.info("Executing onUninstall callback, do nothing");
     }
 
+    @Override
+    protected void execute(Object key, Map event, BasicOutputCollector collector) {
+        LOGGER.info("Receiving {}",event);
+    }
 
     public static class Provider implements StreamSinkProvider<LoggingStreamSink,DefaultStreamSinkConfig> {
         @Override

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/StormStreamSink.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/StormStreamSink.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/StormStreamSink.java
index 6765443..d152e76 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/StormStreamSink.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/StormStreamSink.java
@@ -22,67 +22,74 @@ import backtype.storm.topology.OutputFieldsDeclarer;
 import backtype.storm.topology.base.BaseBasicBolt;
 import backtype.storm.tuple.Fields;
 import backtype.storm.tuple.Tuple;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.base.Preconditions;
+import kafka.producer.KeyedMessage;
 import org.apache.eagle.alert.engine.model.StreamEvent;
 import org.apache.eagle.metadata.model.StreamSinkConfig;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 public abstract class StormStreamSink<K extends StreamSinkConfig> extends BaseBasicBolt implements StreamSink<K> {
     private final static Logger LOG = LoggerFactory.getLogger(StormStreamSink.class);
-    private final static String KEY_FIELD = "KEY";
-    final static String VALUE_FIELD = "VALUE";
-    private StreamEventMapper streamEventMapper = null;
     private String streamId;
 
     @Override
     public void init(String streamId, K config) {
         this.streamId = streamId;
-        this.streamEventMapper = new FlattenEventMapper(streamId);
-    }
-
-    public StormStreamSink<K> setEventMapper(StreamEventMapper eventMapper){
-        this.streamEventMapper = eventMapper;
-        return this;
     }
 
     @Override
     public void prepare(Map stormConf, TopologyContext context) {
         super.prepare(stormConf, context);
-        Preconditions.checkNotNull(this.streamEventMapper);
     }
 
+    /**
+     * Implicitly hides the Tuple protocol inside code as Tuple[Key,Map]
+     */
     @Override
     public void execute(Tuple input, BasicOutputCollector collector) {
         try {
-            List<StreamEvent> streamEvents = this.streamEventMapper.map(input);
-            if(streamEvents!=null) {
-                streamEvents.forEach((streamEvent -> {
-                    try {
-                        onEvent(streamEvent);
-                    } catch (Exception e) {
-                        LOG.error("Failed to execute event {}", streamEvent);
-                        collector.reportError(e);
+            Map event = null;
+            Object key = input.getValue(0);
+            if(input.size()<2){
+                event = tupleAsMap(input);
+            } else {
+                Object value = input.getValue(1);
+                if (value != null) {
+                    if (value instanceof Map) {
+                        event = (Map) input.getValue(1);
+                    } else {
+                        event = tupleAsMap(input);
                     }
-                }));
+                }
             }
-        } catch (Exception e) {
-                LOG.error("Failed to execute event {}",input);
-                collector.reportError(e);
+            execute(key,event,collector);
+        }catch(Exception ex){
+            LOG.error(ex.getMessage(), ex);
+            collector.reportError(ex);
+        }
+    }
+
+    private Map tupleAsMap(Tuple tuple){
+        Map values = new HashMap<>();
+        for(String field:tuple.getFields()){
+            values.put(field,tuple.getValueByField(field));
         }
+        return values;
     }
 
-    protected abstract void onEvent(StreamEvent streamEvent);
+    protected abstract void execute(Object key,Map event,BasicOutputCollector collector);
 
     @Override
     public void declareOutputFields(OutputFieldsDeclarer declarer) {
-        declarer.declare(new Fields(KEY_FIELD,VALUE_FIELD));
     }
 
     public String getStreamId() {
         return streamId;
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/StreamSinkProvider.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/StreamSinkProvider.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/StreamSinkProvider.java
index 60f49ef..6fce77b 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/StreamSinkProvider.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/sink/StreamSinkProvider.java
@@ -17,7 +17,6 @@
 package org.apache.eagle.app.sink;
 
 import com.typesafe.config.Config;
-import org.apache.eagle.app.Configuration;
 import org.apache.eagle.metadata.model.StreamSinkConfig;
 
 import java.lang.reflect.ParameterizedType;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/spi/AbstractApplicationProvider.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/spi/AbstractApplicationProvider.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/spi/AbstractApplicationProvider.java
index 2299eca..b9034d9 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/spi/AbstractApplicationProvider.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/spi/AbstractApplicationProvider.java
@@ -36,19 +36,22 @@ public abstract class AbstractApplicationProvider<T extends Application> impleme
     private final static Logger LOG = LoggerFactory.getLogger(AbstractApplicationProvider.class);
     private final ApplicationDesc applicationDesc;
 
-    public AbstractApplicationProvider(){
-        applicationDesc = new ApplicationDesc();
-        applicationDesc.setProviderClass(this.getClass());
-        configure();
-    }
-
-    protected void configure (){
-        // do nothing by default
-    }
+//    Disable programmable ApplicationProvider approach
+//
+//    public AbstractApplicationProvider(){
+//        applicationDesc = new ApplicationDesc();
+//        applicationDesc.setProviderClass(this.getClass());
+//        configure();
+//    }
+//
+//    protected void configure (){
+//        // do nothing by default
+//    }
 
     protected AbstractApplicationProvider(String applicationDescConfig) {
-        this();
-        ApplicationProviderDescConfig descWrapperConfig = ApplicationProviderDescConfig.loadFromXML(this, applicationDescConfig);
+        applicationDesc = new ApplicationDesc();
+        applicationDesc.setProviderClass(this.getClass());
+        ApplicationProviderDescConfig descWrapperConfig = ApplicationProviderDescConfig.loadFromXML(this.getClass(), applicationDescConfig);
         setType(descWrapperConfig.getType());
         setVersion(descWrapperConfig.getVersion());
         setName(descWrapperConfig.getName());

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/utils/ApplicationConfigHelper.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/utils/ApplicationConfigHelper.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/utils/ApplicationConfigHelper.java
index ac73da7..f034e92 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/utils/ApplicationConfigHelper.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/utils/ApplicationConfigHelper.java
@@ -18,32 +18,31 @@ package org.apache.eagle.app.utils;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.typesafe.config.Config;
-import org.apache.eagle.app.Configuration;
 
 import java.util.Map;
 
-public class ApplicationConfigHelper {
-    private static final ObjectMapper mapper = new ObjectMapper();
-    public static <Conf extends Configuration> Conf convertFrom(Map<String,Object> configMap, Class<Conf> confClass){
-        return mapper.convertValue(configMap,confClass);
-    }
-
-    /**
-     *  Map application configuration from environment
-     *
-     * @param config
-     * @return
-     */
-    public static Map<String,Object> unwrapFrom(Config config, String namespace){
-        if(config.hasPath(namespace)) {
-            return config.getConfig(namespace).root().unwrapped();
-        }else{
-            Map<String,Object> unwrappedConfig = config.root().unwrapped();
-            if(unwrappedConfig.containsKey(namespace)){
-                return (Map<String,Object>) unwrappedConfig.get(namespace);
-            }else {
-                throw new IllegalArgumentException("Failed to load app config as config key: '"+namespace+"' was not found in: "+config);
-            }
-        }
-    }
-}
\ No newline at end of file
+//public class ApplicationConfigHelper {
+//    private static final ObjectMapper mapper = new ObjectMapper();
+//    public static <Conf extends Configuration> Conf convertFrom(Map<String,Object> configMap, Class<Conf> confClass){
+//        return mapper.convertValue(configMap,confClass);
+//    }
+//
+//    /**
+//     *  Map application configuration from environment
+//     *
+//     * @param config
+//     * @return
+//     */
+//    public static Map<String,Object> unwrapFrom(Config config, String namespace){
+//        if(config.hasPath(namespace)) {
+//            return config.getConfig(namespace).root().unwrapped();
+//        }else{
+//            Map<String,Object> unwrappedConfig = config.root().unwrapped();
+//            if(unwrappedConfig.containsKey(namespace)){
+//                return (Map<String,Object>) unwrappedConfig.get(namespace);
+//            }else {
+//                throw new IllegalArgumentException("Failed to load app config as config key: '"+namespace+"' was not found in: "+config);
+//            }
+//        }
+//    }
+//}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/ApplicationProviderDescConfigTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/ApplicationProviderDescConfigTest.java b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/ApplicationProviderDescConfigTest.java
index 30c105c..9285d7d 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/ApplicationProviderDescConfigTest.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/ApplicationProviderDescConfigTest.java
@@ -30,7 +30,7 @@ public class ApplicationProviderDescConfigTest {
     @Test
     @Ignore
     public void testApplicationDescWrapperConfigLoadFromXML(){
-        ApplicationProviderDescConfig config = ApplicationProviderDescConfig.loadFromXML(null, "TestApplicationMetadata.xml");
+        ApplicationProviderDescConfig config = ApplicationProviderDescConfig.loadFromXML(ApplicationProviderDescConfigTest.class, "TestApplicationMetadata.xml");
         Assert.assertNotNull(config);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/TestStormApplication.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/TestStormApplication.java b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/TestStormApplication.java
index f58f0aa..1d06f14 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/TestStormApplication.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/TestStormApplication.java
@@ -32,33 +32,16 @@ import java.util.Arrays;
 import java.util.Map;
 
 @Ignore
-public class TestStormApplication extends StormApplication<TestStormApplication.TestStormAppConfig>{
-    @Override
-    public StormTopology execute(TestStormAppConfig config, StormEnvironment environment){
-        return null;
-    }
-
+public class TestStormApplication extends StormApplication{
     @Override
     public StormTopology execute(Config config, StormEnvironment environment) {
         TopologyBuilder builder = new TopologyBuilder();
         builder.setSpout("metric_spout", new RandomEventSpout(), config.getInt("spoutNum"));
-        builder.setBolt("sink_1",environment.getFlattenStreamSink("TEST_STREAM_1",config)).fieldsGrouping("metric_spout",new Fields("metric"));
-        builder.setBolt("sink_2",environment.getFlattenStreamSink("TEST_STREAM_2",config)).fieldsGrouping("metric_spout",new Fields("metric"));
+        builder.setBolt("sink_1",environment.getStreamSink("TEST_STREAM_1",config)).fieldsGrouping("metric_spout",new Fields("metric"));
+        builder.setBolt("sink_2",environment.getStreamSink("TEST_STREAM_2",config)).fieldsGrouping("metric_spout",new Fields("metric"));
         return builder.createTopology();
     }
 
-    public final static class TestStormAppConfig extends Configuration{
-        private int spoutNum = 1;
-
-        public int getSpoutNum() {
-            return spoutNum;
-        }
-
-        public void setSpoutNum(int spoutNum) {
-            this.spoutNum = spoutNum;
-        }
-    }
-
     private class RandomEventSpout extends BaseRichSpout {
         private SpoutOutputCollector _collector;
         @Override

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/storm/MockStormApplication.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/storm/MockStormApplication.java b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/storm/MockStormApplication.java
index bbdfbfa..5733531 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/storm/MockStormApplication.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/storm/MockStormApplication.java
@@ -24,55 +24,22 @@ import backtype.storm.topology.TopologyBuilder;
 import backtype.storm.topology.base.BaseRichSpout;
 import backtype.storm.tuple.Fields;
 import com.typesafe.config.Config;
-import org.apache.eagle.app.Configuration;
 import org.apache.eagle.app.StormApplication;
 import org.apache.eagle.app.environment.impl.StormEnvironment;
 
 import java.util.Arrays;
 import java.util.Map;
 
-public class MockStormApplication extends StormApplication<MockStormApplication.MockStormConfiguration> {
-    private MockStormConfiguration appConfig;
-
-    @Override
-    public StormTopology execute(MockStormConfiguration config, StormEnvironment environment) {
-        return null;
-    }
-
+public class MockStormApplication extends StormApplication {
     @Override
     public StormTopology execute(Config config, StormEnvironment environment) {
         TopologyBuilder builder = new TopologyBuilder();
         builder.setSpout("metric_spout", new RandomEventSpout(), config.getInt("spoutNum"));
-        builder.setBolt("sink_1",environment.getFlattenStreamSink("TEST_STREAM_1",config)).fieldsGrouping("metric_spout",new Fields("metric"));
-        builder.setBolt("sink_2",environment.getFlattenStreamSink("TEST_STREAM_2",config)).fieldsGrouping("metric_spout",new Fields("metric"));
+        builder.setBolt("sink_1",environment.getStreamSink("TEST_STREAM_1",config)).fieldsGrouping("metric_spout",new Fields("metric"));
+        builder.setBolt("sink_2",environment.getStreamSink("TEST_STREAM_2",config)).fieldsGrouping("metric_spout",new Fields("metric"));
         return builder.createTopology();
     }
 
-    /**
-     * TODO: Load configuration from name space in application className
-     * Application Configuration
-     */
-    static class MockStormConfiguration extends Configuration {
-        private int spoutNum = 1;
-        private boolean loaded = false;
-
-        public int getSpoutNum() {
-            return spoutNum;
-        }
-
-        public void setSpoutNum(int spoutNum) {
-            this.spoutNum = spoutNum;
-        }
-
-        public boolean isLoaded() {
-            return loaded;
-        }
-
-        public void setLoaded(boolean loaded) {
-            this.loaded = loaded;
-        }
-    }
-
     private class RandomEventSpout extends BaseRichSpout {
         private SpoutOutputCollector _collector;
         @Override
@@ -85,7 +52,6 @@ public class MockStormApplication extends StormApplication<MockStormApplication.
             _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/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/storm/MockStormApplicationTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/storm/MockStormApplicationTest.java b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/storm/MockStormApplicationTest.java
index 32dae23..9c4163d 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/storm/MockStormApplicationTest.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/test/java/org/apache/eagle/app/storm/MockStormApplicationTest.java
@@ -16,36 +16,19 @@
  */
 package org.apache.eagle.app.storm;
 
-import com.typesafe.config.ConfigFactory;
 import org.apache.eagle.app.environment.impl.StormEnvironment;
-import org.apache.eagle.app.utils.DynamicJarPathFinder;
-import org.apache.eagle.metadata.model.ApplicationEntity;
 import org.junit.Assert;
 import org.junit.Test;
 
-import java.util.HashMap;
-
 public class MockStormApplicationTest {
     @Test
     public void testGetConfigClass(){
         MockStormApplication mockStormApplication = new MockStormApplication();
-        Assert.assertEquals(MockStormApplication.MockStormConfiguration.class,mockStormApplication.getConfigType());
+        Assert.assertEquals(StormEnvironment.class,mockStormApplication.getEnvironmentType());
     }
 
     @Test
     public void testRunApplicationWithSysConfig(){
         new MockStormApplication().run();
     }
-
-    @Test
-    public void testRunApplicationWithAppConfig() throws InterruptedException {
-        MockStormApplication.MockStormConfiguration appConfig = new MockStormApplication.MockStormConfiguration();
-        appConfig.setJarPath(DynamicJarPathFinder.findPath(MockStormApplication.class));
-        appConfig.setSiteId("test_site");
-        appConfig.setAppId("test_application_storm_topology");
-        appConfig.setMode(ApplicationEntity.Mode.LOCAL);
-        appConfig.setLoaded(true);
-        appConfig.setSpoutNum(4);
-        new MockStormApplication().run(appConfig);
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-app/eagle-app-base/src/test/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/test/resources/application.conf b/eagle-core/eagle-app/eagle-app-base/src/test/resources/application.conf
index 64f0974..4dbf0c4 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/test/resources/application.conf
+++ b/eagle-core/eagle-app/eagle-app-base/src/test/resources/application.conf
@@ -51,16 +51,14 @@
 			"loader": "org.apache.eagle.app.service.impl.ApplicationProviderSPILoader"
 		}
 	}
-
 	"appId":"test_topology_name"
 	"spoutNum": 3
 	"loaded": true
 	"mode":"LOCAL"
-
 	"dataSinkConfig": {
 		"topic" : "test_topic",
 		"brokerList" : "sandbox.hortonworks.com:6667",
 		"serializerClass" : "kafka.serializer.StringEncoder",
 		"keySerializerClass" : "kafka.serializer.StringEncoder"
 	}
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/RESTResponse.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/RESTResponse.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/RESTResponse.java
index 1c9d112..af0ae83 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/RESTResponse.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/RESTResponse.java
@@ -18,6 +18,8 @@ package org.apache.eagle.metadata.resource;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Response;
@@ -28,6 +30,7 @@ import java.util.function.Supplier;
 
 @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
 public class RESTResponse<T>{
+    private final static Logger LOGGER = LoggerFactory.getLogger(RESTResponse.class);
     private boolean success = false;
     private String message;
     private String exception;
@@ -147,6 +150,7 @@ public class RESTResponse<T>{
                 this.success(true).status(Response.Status.OK);
                 func.accept(this);
             } catch (Exception ex){
+                LOGGER.error("Exception: " +ex.getMessage(),ex);
                 this.success(false).data(null).status(Response.Status.BAD_REQUEST).exception(ex);
                 raiseWebAppException(ex);
             }
@@ -157,6 +161,7 @@ public class RESTResponse<T>{
             try {
                 this.success(true).status(Response.Status.OK).data(func.get());
             } catch (Throwable ex){
+                LOGGER.error("Exception: " +ex.getMessage(),ex);
                 this.success(false).status(Response.Status.BAD_REQUEST).exception(ex);
                 raiseWebAppException(ex);
             }
@@ -168,6 +173,7 @@ public class RESTResponse<T>{
                 try {
                     this.status(Response.Status.OK).success(true).data(func.get());
                 } catch (Throwable e) {
+                    LOGGER.error("Exception: " +e.getMessage(),e);
                     this.success(false).status(Response.Status.BAD_REQUEST).exception(e);
                     raiseWebAppException(e);
                 }
@@ -180,11 +186,13 @@ public class RESTResponse<T>{
             try {
                 future.get();
             } catch (InterruptedException ex) {
+                LOGGER.error("InterruptedException: "+ex.getMessage(),ex);
                 Thread.currentThread().interrupt();
                 future.cancel(true);
                 this.success(false).status(Response.Status.BAD_REQUEST).exception(ex.getCause());
                 raiseWebAppException(ex);
             } catch (ExecutionException ex) {
+                LOGGER.error("ExecutionException: "+ex.getMessage(),ex);
                 this.success(false).status(Response.Status.BAD_REQUEST).exception(ex.getCause());
                 raiseWebAppException(ex);
             }
@@ -200,6 +208,7 @@ public class RESTResponse<T>{
                     func.accept(this);
                     this.success(true);
                 } catch (Throwable ex) {
+                    LOGGER.error("Exception: " +ex.getMessage(),ex);
                     this.success(false).status(Response.Status.BAD_REQUEST).exception(ex);
                     raiseWebAppException(ex);
                 }
@@ -212,6 +221,7 @@ public class RESTResponse<T>{
             try {
                 func.accept(this);
             } catch (Throwable ex) {
+                LOGGER.error("Exception: " +ex.getMessage(),ex);
                 this.success(false).status(Response.Status.BAD_REQUEST).exception(ex);
                 raiseWebAppException(ex);
             }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/SiteEntityEntityServiceMemoryImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/SiteEntityEntityServiceMemoryImpl.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/SiteEntityEntityServiceMemoryImpl.java
index 8cd88d8..54c5bd3 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/SiteEntityEntityServiceMemoryImpl.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/SiteEntityEntityServiceMemoryImpl.java
@@ -65,7 +65,6 @@ public class SiteEntityEntityServiceMemoryImpl implements SiteEntityService {
         return siteId2EntityMap.get(siteId);
     }
 
-
     @Override
     public SiteEntity deleteBySiteId(String siteId) throws EntityNotFoundException {
         return siteId2EntityMap.remove(getBySiteId(siteId).getSiteId());

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-core/eagle-query/eagle-storage-jdbc/src/test/java/org/apache/eagle/storage/jdbc/TestJdbcStorage.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-storage-jdbc/src/test/java/org/apache/eagle/storage/jdbc/TestJdbcStorage.java b/eagle-core/eagle-query/eagle-storage-jdbc/src/test/java/org/apache/eagle/storage/jdbc/TestJdbcStorage.java
index e75c2ad..0cb5128 100644
--- a/eagle-core/eagle-query/eagle-storage-jdbc/src/test/java/org/apache/eagle/storage/jdbc/TestJdbcStorage.java
+++ b/eagle-core/eagle-query/eagle-storage-jdbc/src/test/java/org/apache/eagle/storage/jdbc/TestJdbcStorage.java
@@ -94,7 +94,7 @@ public class TestJdbcStorage extends JdbcStorageTestBase {
     public void testWrite() throws IOException {
         List<TestTimeSeriesAPIEntity> entityList = new ArrayList<TestTimeSeriesAPIEntity>();
         int i= 0;
-        while( i++ < 1000){
+        while( i++ < 5){
             TestTimeSeriesAPIEntity entity = newInstance();
 
             entityList.add(entity);
@@ -108,13 +108,13 @@ public class TestJdbcStorage extends JdbcStorageTestBase {
         // record insert init time
         long startTime = System.currentTimeMillis();
         // Write 1000 entities
-        List<TestTimeSeriesAPIEntity> entityList = new ArrayList<TestTimeSeriesAPIEntity>();
+        List<TestTimeSeriesAPIEntity> entityList = new ArrayList<>();
         int i= 0;
-        while( i++ < 1000){
+        while( i++ < 5){
             entityList.add(newInstance());
         }
         ModifyResult<String> result = storage.create(entityList, entityDefinition);
-        Assert.assertTrue(result.getSize() >= 1000);
+        Assert.assertTrue(result.getSize() >= 5);
         // record insertion finish time
         long endTime = System.currentTimeMillis();
 
@@ -126,21 +126,20 @@ public class TestJdbcStorage extends JdbcStorageTestBase {
         rawQuery.setPageSize(10000);
         CompiledQuery query = new CompiledQuery(rawQuery);
         QueryResult queryResult = storage.query(query, entityDefinition);
-        Assert.assertTrue(queryResult.getSize() >= 1000);
+        Assert.assertTrue(queryResult.getSize() >= 5);
     }
 
     @Test
     public void testWriteAndAggregation() throws IOException, QueryCompileException {
         // record insert init time
         long startTime = System.currentTimeMillis();
-        // Write 1000 entities
-        List<TestTimeSeriesAPIEntity> entityList = new ArrayList<TestTimeSeriesAPIEntity>();
+        List<TestTimeSeriesAPIEntity> entityList = new ArrayList<>();
         int i= 0;
-        while( i++ < 1000){
+        while( i++ < 5){
             entityList.add(newInstance());
         }
         ModifyResult<String> result = storage.create(entityList, entityDefinition);
-        Assert.assertTrue(result.getSize() >= 1000);
+        Assert.assertTrue(result.getSize() >= 5);
         // record insertion finish time
         long endTime = System.currentTimeMillis();
 
@@ -160,13 +159,13 @@ public class TestJdbcStorage extends JdbcStorageTestBase {
         // record insert init time
         long startTime = System.currentTimeMillis();
         // Write 1000 entities
-        List<TestTimeSeriesAPIEntity> entityList = new ArrayList<TestTimeSeriesAPIEntity>();
+        List<TestTimeSeriesAPIEntity> entityList = new ArrayList<>();
         int i= 0;
-        while( i++ < 1000){
+        while( i++ < 5){
             entityList.add(newInstance());
         }
         ModifyResult<String> result = storage.create(entityList, entityDefinition);
-        Assert.assertTrue(result.getSize() >= 1000);
+        Assert.assertTrue(result.getSize() >= 5);
         // record insertion finish time
         long endTime = System.currentTimeMillis();
 
@@ -178,23 +177,23 @@ public class TestJdbcStorage extends JdbcStorageTestBase {
         rawQuery.setPageSize(1000000);
         CompiledQuery query = new CompiledQuery(rawQuery);
         ModifyResult<String> queryResult = storage.delete(query, entityDefinition);
-        Assert.assertTrue(queryResult.getSize() >= 1000);
+        Assert.assertTrue(queryResult.getSize() >= 5);
     }
 
     @Test
     public void testWriteAndUpdate() throws IOException, QueryCompileException {
-        // Write 1000 entities
-        List<TestTimeSeriesAPIEntity> entityList = new ArrayList<TestTimeSeriesAPIEntity>();
+        // Write 5 entities
+        List<TestTimeSeriesAPIEntity> entityList = new ArrayList<>();
         int i= 0;
-        while( i++ < 1000){
+        while( i++ < 5){
             entityList.add(newInstance());
         }
         ModifyResult<String> result = storage.create(entityList, entityDefinition);
-        Assert.assertTrue(result.getSize() >= 1000);
+        Assert.assertTrue(result.getSize() >= 5);
 
         // record insertion finish time
         ModifyResult<String> queryResult = storage.update(entityList, entityDefinition);
-        Assert.assertTrue(queryResult.getSize() >= 1000);
+        Assert.assertTrue(queryResult.getSize() >= 5);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplicationProvider2.java
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplicationProvider2.java b/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplicationProvider2.java
deleted file mode 100644
index d3d0f54..0000000
--- a/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplicationProvider2.java
+++ /dev/null
@@ -1,62 +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.example;
-
-import org.apache.eagle.alert.engine.coordinator.StreamColumn;
-import org.apache.eagle.alert.engine.coordinator.StreamDefinition;
-import org.apache.eagle.app.spi.AbstractApplicationProvider;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Define application provider with metadata.xml
- */
-public class ExampleApplicationProvider2 extends AbstractApplicationProvider<ExampleStormApplication> {
-    @Override
-    protected void configure() {
-        setType("EXAMPLE_APPLICATION_2");
-        setName("Example Monitoring Application 2");
-        setVersion("0.5.0-incubating");
-        setAppClass(ExampleStormApplication.class);
-        setViewPath("/apps/example2");
-        setAppConfig("ExampleApplicationConf.xml");
-        setStreams(Arrays.asList(createSampleStreamDefinition("SAMPLE_STREAM_1"), createSampleStreamDefinition("SAMPLE_STREAM_2")));
-    }
-
-    private static StreamDefinition createSampleStreamDefinition(String streamId){
-        StreamDefinition sampleStreamDefinition = new StreamDefinition();
-        sampleStreamDefinition.setStreamId(streamId);
-        sampleStreamDefinition.setTimeseries(true);
-        sampleStreamDefinition.setValidate(true);
-        sampleStreamDefinition.setDescription("Auto generated sample Schema for "+streamId);
-        List<StreamColumn> streamColumns = new ArrayList<>();
-
-        streamColumns.add(new StreamColumn.Builder().name("metric").type(StreamColumn.Type.STRING).build());
-        streamColumns.add(new StreamColumn.Builder().name("source").type(StreamColumn.Type.STRING).build());
-        streamColumns.add(new StreamColumn.Builder().name("timestamp").type(StreamColumn.Type.LONG).build());
-        streamColumns.add(new StreamColumn.Builder().name("value").type(StreamColumn.Type.DOUBLE).build());
-        sampleStreamDefinition.setColumns(streamColumns);
-        return sampleStreamDefinition;
-    }
-
-    @Override
-    public ExampleStormApplication getApplication() {
-        return new ExampleStormApplication();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleStormApplication.java
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleStormApplication.java b/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleStormApplication.java
index d4c0e0c..c78cd3c 100644
--- a/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleStormApplication.java
+++ b/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleStormApplication.java
@@ -31,18 +31,13 @@ import org.apache.eagle.app.environment.impl.StormEnvironment;
 import java.util.Arrays;
 import java.util.Map;
 
-public class ExampleStormApplication extends StormApplication<ExampleStormConfig> {
-    @Override
-    public StormTopology execute(ExampleStormConfig config, StormEnvironment environment) {
-        return null;
-    }
-
+public class ExampleStormApplication extends StormApplication{
     @Override
     public StormTopology execute(Config config, StormEnvironment environment) {
         TopologyBuilder builder = new TopologyBuilder();
         builder.setSpout("metric_spout", new RandomEventSpout(), config.getInt("spoutNum"));
-        builder.setBolt("sink_1",environment.getFlattenStreamSink("SAMPLE_STREAM_1",config)).fieldsGrouping("metric_spout",new Fields("metric"));
-        builder.setBolt("sink_2",environment.getFlattenStreamSink("SAMPLE_STREAM_2",config)).fieldsGrouping("metric_spout",new Fields("metric"));
+        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();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleStormConfig.java
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleStormConfig.java b/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleStormConfig.java
deleted file mode 100644
index bcb84a7..0000000
--- a/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleStormConfig.java
+++ /dev/null
@@ -1,36 +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.example;
-
-import org.apache.eagle.app.Configuration;
-
-public class ExampleStormConfig extends Configuration {
-    private int spoutNum = 1;
-
-    public ExampleStormConfig(){}
-    public ExampleStormConfig(String appName){
-        this.setAppId(appName);
-    }
-
-    public int getSpoutNum() {
-        return spoutNum;
-    }
-
-    public void setSpoutNum(int spoutNum) {
-        this.spoutNum = spoutNum;
-    }
-}

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

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/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 eaf9f46..65776ce 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
@@ -96,12 +96,6 @@ public class ExampleApplicationProviderTest {
         simulator.start(ExampleApplicationProvider.class, getConf());
     }
 
-    @Ignore
-    @Test
-    public void testApplicationQuickRunWithAppProvider2() throws Exception{
-        simulator.start(ExampleApplicationProvider2.class, getConf());
-    }
-
     private Map<String, Object> getConf(){
         Map<String, Object> conf = new HashMap<>();
         conf.put("dataSinkConfig.topic", "testTopic");

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationTest.java
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationTest.java b/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationTest.java
index 7040e19..eb1ecc7 100644
--- a/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationTest.java
+++ b/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationTest.java
@@ -19,20 +19,8 @@ package org.apache.eagle.app.example;
 import org.junit.Test;
 
 public class ExampleApplicationTest {
-    @Test
-    public void testRunWithAppTool(){
-        new ExampleStormApplication().run(new ExampleStormConfig("unittest_app_topology"));
-    }
-
     /**
      * Should load application from application.conf:
-     * {
-     *     org.apache.eagle.app.example.ExampleStormApplication{
-     *          appId: VALUE,
-     *          mode: LOCAL,
-     *          {Attribute}:{Value}
-     *     }
-     * }
      */
     @Test
     public void testRunWithAppToolFromEnvConfig(){

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-examples/eagle-app-example/src/test/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/test/resources/application.conf b/eagle-examples/eagle-app-example/src/test/resources/application.conf
index 2873037..c7fdb8c 100644
--- a/eagle-examples/eagle-app-example/src/test/resources/application.conf
+++ b/eagle-examples/eagle-app-example/src/test/resources/application.conf
@@ -56,11 +56,10 @@
 		}
 	},
 
-		"appId": "unit_test_example_app"
+	"appId": "unit_test_example_app"
 	"spoutNum": 3
 	"loaded": true
 	"mode":"LOCAL"
-
 	"dataSinkConfig": {
 		"topic" : "test_topic",
 		"brokerList" : "sandbox.hortonworks.com:6667",

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/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
index 25506cc..d084008 100644
--- 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
@@ -30,18 +30,13 @@ import org.apache.eagle.app.environment.impl.StormEnvironment;
 import java.util.Arrays;
 import java.util.Map;
 
-public class JPMApplication extends StormApplication<JPMConfiguration> {
-    @Override
-    public StormTopology execute(JPMConfiguration config, StormEnvironment environment) {
-        return null;
-    }
-
+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.getFlattenStreamSink("SAMPLE_STREAM_1",config)).fieldsGrouping("metric_spout",new Fields("metric"));
-        builder.setBolt("sink_2",environment.getFlattenStreamSink("SAMPLE_STREAM_2",config)).fieldsGrouping("metric_spout",new Fields("metric"));
+        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();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-jpm/eagle-jpm-app/src/main/java/org/apache/eagle/app/jpm/JPMConfiguration.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-app/src/main/java/org/apache/eagle/app/jpm/JPMConfiguration.java b/eagle-jpm/eagle-jpm-app/src/main/java/org/apache/eagle/app/jpm/JPMConfiguration.java
deleted file mode 100644
index 7b284c6..0000000
--- a/eagle-jpm/eagle-jpm-app/src/main/java/org/apache/eagle/app/jpm/JPMConfiguration.java
+++ /dev/null
@@ -1,23 +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.Configuration;
-
-public class JPMConfiguration extends Configuration {
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogAppConf.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogAppConf.java b/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogAppConf.java
deleted file mode 100644
index 662311c..0000000
--- a/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogAppConf.java
+++ /dev/null
@@ -1,28 +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.security.hbase;
-
-import org.apache.eagle.app.Configuration;
-
-/**
- * Since 8/5/16.
- */
-public class HBaseAuditLogAppConf extends Configuration{
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogAppProvider.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogAppProvider.java b/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogAppProvider.java
index 051d8c4..23acc46 100644
--- a/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogAppProvider.java
+++ b/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogAppProvider.java
@@ -19,9 +19,7 @@
 
 package org.apache.eagle.security.hbase;
 
-import com.typesafe.config.Config;
 import org.apache.eagle.app.spi.AbstractApplicationProvider;
-import org.apache.eagle.security.service.MetadataDaoFactory;
 
 /**
  * Since 8/5/16.
@@ -35,4 +33,4 @@ public class HBaseAuditLogAppProvider extends AbstractApplicationProvider<HBaseA
     public HBaseAuditLogApplication getApplication() {
         return new HBaseAuditLogApplication();
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogApplication.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogApplication.java b/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogApplication.java
index 3d80308..4a7c2df 100644
--- a/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogApplication.java
+++ b/eagle-security/eagle-security-hbase-auditlog/src/main/java/org/apache/eagle/security/hbase/HBaseAuditLogApplication.java
@@ -32,15 +32,11 @@ import storm.kafka.StringScheme;
 /**
  * Since 7/27/16.
  */
-public class HBaseAuditLogApplication extends StormApplication<HBaseAuditLogAppConf> {
+public class HBaseAuditLogApplication extends StormApplication {
     public final static String SPOUT_TASK_NUM = "topology.numOfSpoutTasks";
     public final static String PARSER_TASK_NUM = "topology.numOfParserTasks";
     public final static String JOIN_TASK_NUM = "topology.numOfJoinTasks";
     public final static String SINK_TASK_NUM = "topology.numOfSinkTasks";
-    @Override
-    public StormTopology execute(HBaseAuditLogAppConf config1, StormEnvironment environment) {
-        return null;
-    }
 
     @Override
     public StormTopology execute(Config config, StormEnvironment environment) {
@@ -63,7 +59,7 @@ public class HBaseAuditLogApplication extends StormApplication<HBaseAuditLogAppC
         BoltDeclarer joinBoltDeclarer = builder.setBolt("joinBolt", joinBolt, numOfJoinTasks);
         joinBoltDeclarer.fieldsGrouping("parserBolt", new Fields("f1"));
 
-        StormStreamSink sinkBolt = environment.getFlattenStreamSink("hbase_audit_log_stream",config);
+        StormStreamSink sinkBolt = environment.getStreamSink("hbase_audit_log_stream",config);
         BoltDeclarer kafkaBoltDeclarer = builder.setBolt("kafkaSink", sinkBolt, numOfSinkTasks);
         kafkaBoltDeclarer.fieldsGrouping("joinBolt", new Fields("user"));
         return builder.createTopology();
@@ -74,4 +70,4 @@ public class HBaseAuditLogApplication extends StormApplication<HBaseAuditLogAppC
         HBaseAuditLogApplication app = new HBaseAuditLogApplication();
         app.run(config);
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-server/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-server/pom.xml b/eagle-server/pom.xml
index ad3a701..f065b53 100644
--- a/eagle-server/pom.xml
+++ b/eagle-server/pom.xml
@@ -71,12 +71,10 @@
         <dependency>
             <groupId>com.hubspot.dropwizard</groupId>
             <artifactId>dropwizard-guice</artifactId>
-            <version>0.7.0.2</version>
         </dependency>
         <dependency>
             <groupId>io.dropwizard</groupId>
             <artifactId>dropwizard-assets</artifactId>
-            <version>${dropwizard.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.eagle</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/eagle-server/src/main/java/org/apache/eagle/server/RESTExceptionMapper.java
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/java/org/apache/eagle/server/RESTExceptionMapper.java b/eagle-server/src/main/java/org/apache/eagle/server/RESTExceptionMapper.java
index ba7963f..64f9fe0 100644
--- a/eagle-server/src/main/java/org/apache/eagle/server/RESTExceptionMapper.java
+++ b/eagle-server/src/main/java/org/apache/eagle/server/RESTExceptionMapper.java
@@ -28,11 +28,11 @@ import java.util.concurrent.ThreadLocalRandom;
 public class RESTExceptionMapper extends LoggingExceptionMapper<Throwable> {
     @Override
     public Response toResponse(Throwable throwable) {
+        final long id = ThreadLocalRandom.current().nextLong();
+        logException(id, throwable);
         if (throwable instanceof WebApplicationException) {
             return ((WebApplicationException) throwable).getResponse();
         }
-        final long id = ThreadLocalRandom.current().nextLong();
-        logException(id, throwable);
        return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(new RESTResponse<>(throwable)).type(MediaType.APPLICATION_JSON_TYPE).build();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ad5becc9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d103c88..b71b5cc 100755
--- a/pom.xml
+++ b/pom.xml
@@ -301,6 +301,7 @@
 
         <!-- dropwizard -->
         <dropwizard.version>0.7.1</dropwizard.version>
+        <dropwizard-guice.version>0.7.0.2</dropwizard-guice.version>
     </properties>
 
     <dependencyManagement>
@@ -820,6 +821,16 @@
                 </exclusions>
             </dependency>
             <dependency>
+                <groupId>io.dropwizard</groupId>
+                <artifactId>dropwizard-assets</artifactId>
+                <version>${dropwizard.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.hubspot.dropwizard</groupId>
+                <artifactId>dropwizard-guice</artifactId>
+                <version>${dropwizard-guice.version}</version>
+            </dependency>
+            <dependency>
                 <groupId>io.swagger</groupId>
                 <artifactId>swagger-jersey-jaxrs</artifactId>
                 <version>${swagger.version}</version>


Mime
View raw message