eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [2/2] incubator-eagle git commit: [EAGLE-738] Fix eagle-metadata checkstyle warnings
Date Wed, 09 Nov 2016 14:01:19 GMT
[EAGLE-738] Fix eagle-metadata checkstyle warnings

[EAGLE-738]Fix eagle-metadata checkstyle warnings

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

Author: koone <luokun1028@126.com>

Closes #636 from koone/EAGLE-738.


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

Branch: refs/heads/master
Commit: 32582d2300306d6321fcd026b62b17ff1707d95c
Parents: a88e1ce
Author: koone <luokun1028@126.com>
Authored: Wed Nov 9 22:01:07 2016 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Wed Nov 9 22:01:07 2016 +0800

----------------------------------------------------------------------
 .../exceptions/EntityNotFoundException.java     |   2 +-
 .../metadata/model/ApplicationDependency.java   |   2 +-
 .../eagle/metadata/model/ApplicationDesc.java   |   2 +-
 .../eagle/metadata/model/ApplicationDocs.java   |   4 +-
 .../eagle/metadata/model/ApplicationEntity.java |  12 +-
 .../metadata/model/ApplicationRawEntity.java    |   4 +-
 .../apache/eagle/metadata/model/SiteEntity.java |   2 +-
 .../eagle/metadata/model/StreamSinkConfig.java  |   2 +
 .../metadata/persistence/MetadataStore.java     |   2 +-
 .../persistence/MetadataStoreModuleFactory.java |  14 +--
 .../metadata/persistence/PersistenceEntity.java |  14 +--
 .../persistence/PersistenceService.java         |   2 +
 .../eagle/metadata/resource/RESTResponse.java   | 117 ++++++++++---------
 .../eagle/metadata/resource/SiteResource.java   |  30 ++---
 .../eagle/metadata/resource/UUIDRequest.java    |   2 +-
 .../service/ApplicationDescService.java         |   1 +
 .../service/ApplicationEntityService.java       |   8 +-
 .../service/ApplicationStatusUpdateService.java |   3 +-
 .../metadata/service/SiteEntityService.java     |   5 +-
 .../ApplicationEntityServiceMemoryImpl.java     |   2 +-
 .../service/memory/MemoryMetadataStore.java     |   2 +-
 .../SiteEntityEntityServiceMemoryImpl.java      |  26 ++---
 .../metadata/utils/ConfigTemplateHelper.java    |  26 ++---
 .../metadata/utils/InnerDomAsTextHandler.java   |   8 +-
 .../eagle/metadata/utils/UUIDGenerator.java     |   2 +-
 .../metadata/utils/StreamIdConversionsTest.java |   4 +-
 .../store/jdbc/JDBCDataSourceConfig.java        |  36 +++---
 .../JDBCMetadataMetadataStoreServiceImpl.java   |   8 +-
 .../store/jdbc/JDBCMetadataQueryService.java    |  46 --------
 .../metadata/store/jdbc/JDBCMetadataStore.java  |   3 +-
 .../jdbc/provider/JDBCDataSourceProvider.java   |   8 +-
 .../JDBCMetadataStoreConfigProvider.java        |   6 +-
 .../ApplicationEntityServiceJDBCImpl.java       |  16 ++-
 .../jdbc/service/SiteEntityServiceJDBCImpl.java |   6 +-
 .../orm/ApplicationEntityToRelation.java        |   3 +-
 .../orm/RelationToApplicationEntity.java        |   2 +-
 .../jdbc/service/orm/SiteEntityToRelation.java  |   3 +-
 .../ApplicationEntityServiceJDBCImplTest.java   |   1 +
 .../store/jdbc/JDBCDataSourceProviderTest.java  |  29 ++---
 .../jdbc/JDBCMetadataQueryServiceTest.java      |   6 +-
 .../store/jdbc/JDBCMetadataTestBase.java        |  12 +-
 eagle-core/eagle-metadata/pom.xml               |  12 ++
 42 files changed, 234 insertions(+), 261 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/exceptions/EntityNotFoundException.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/exceptions/EntityNotFoundException.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/exceptions/EntityNotFoundException.java
index 990d77c..f23785a 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/exceptions/EntityNotFoundException.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/exceptions/EntityNotFoundException.java
@@ -16,7 +16,7 @@
  */
 package org.apache.eagle.metadata.exceptions;
 
-public class EntityNotFoundException extends Exception{
+public class EntityNotFoundException extends Exception {
     public EntityNotFoundException(Throwable cause) {
         super(cause);
     }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/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
index 8df63fe..91d197f 100644
--- 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
@@ -51,6 +51,6 @@ public class ApplicationDependency {
 
     @Override
     public String toString() {
-        return String.format("%s:%s (required: %s)",type,version == null ? "*":version, required);
+        return String.format("%s:%s (required: %s)", type, version == null ? "*" : version, required);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/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 8bc6ee3..8b0aa5c 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
@@ -119,7 +119,7 @@ public class ApplicationDesc implements Serializable {
     @Override
     public String toString() {
         return String.format("ApplicationDesc [type=%s, name=%s, version=%s, appClass=%s, viewPath=%s, jarpath=%s, providerClass=%s, configuration= %s properties, description=%s",
-            getType(), getName(), getVersion(), getAppClass(), getViewPath(),getJarPath(), getProviderClass(), getConfiguration() == null ? 0 : getConfiguration().size(), getDescription());
+            getType(), getName(), getVersion(), getAppClass(), getViewPath(), getJarPath(), getProviderClass(), getConfiguration() == null ? 0 : getConfiguration().size(), getDescription());
     }
 
     public void setConfiguration(Configuration configuration) {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDocs.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDocs.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDocs.java
index 6aafa90..33b061b 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDocs.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationDocs.java
@@ -30,12 +30,12 @@ public class ApplicationDocs {
         return install;
     }
 
-    @XmlAnyElement(value=InstallDocDomHandler.class)
+    @XmlAnyElement(value = InstallDocDomHandler.class)
     public void setInstall(String install) {
         this.install = install;
     }
 
-    @XmlAnyElement(value= UninstallDocDomHandler.class)
+    @XmlAnyElement(value = UninstallDocDomHandler.class)
     public String getUninstall() {
         return uninstall;
     }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/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 920e6c9..75f0774 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
@@ -105,10 +105,10 @@ public class ApplicationEntity extends PersistenceEntity {
     public void ensureDefault() {
         super.ensureDefault();
 
-        Preconditions.checkNotNull(this.getSite(),"site is null");
-        Preconditions.checkNotNull(this.getSite().getSiteId(),"siteId is null");
-        Preconditions.checkNotNull(this.getDescriptor(),"descriptor is null");
-        Preconditions.checkNotNull(this.getDescriptor().getType(),"descriptor type is null");
+        Preconditions.checkNotNull(this.getSite(), "site is null");
+        Preconditions.checkNotNull(this.getSite().getSiteId(), "siteId is null");
+        Preconditions.checkNotNull(this.getDescriptor(), "descriptor is null");
+        Preconditions.checkNotNull(this.getDescriptor().getType(), "descriptor type is null");
 
         if (this.appId == null) {
             this.appId = String.format("%s_%s", this.getDescriptor().getType(), this.getSite().getSiteId()).toUpperCase();
@@ -181,9 +181,9 @@ public class ApplicationEntity extends PersistenceEntity {
     }
 
     /**
-     * Update mutable fields from another ApplicationEntity
+     * Update mutable fields from another ApplicationEntity.
      */
-    public void updateMutable(ApplicationEntity entityToUpdate){
+    public void updateMutable(ApplicationEntity entityToUpdate) {
         this.ensureDefault();
 
         this.setJarPath(entityToUpdate.getJarPath());

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationRawEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationRawEntity.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationRawEntity.java
index 38d6aa7..4c79aa6 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationRawEntity.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/ApplicationRawEntity.java
@@ -21,12 +21,12 @@ import org.apache.eagle.metadata.persistence.PersistenceEntity;
 import java.util.Map;
 
 /**
- * Site app management entity
+ * Site app management entity.
  */
 public class ApplicationRawEntity extends PersistenceEntity {
     private String siteUuid;
     private String appType;
-    private Map<String,Map> configuration;
+    private Map<String, Map> configuration;
     private long createdTime;
     private long modifiedTime;
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/SiteEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/SiteEntity.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/SiteEntity.java
index 4ab197e..29497c8 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/SiteEntity.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/SiteEntity.java
@@ -21,7 +21,7 @@ import org.apache.eagle.metadata.persistence.PersistenceEntity;
 import java.util.Map;
 
 /**
- * Dynamically registered site
+ * Dynamically registered site.
  */
 public class SiteEntity extends PersistenceEntity {
     private String siteId;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/StreamSinkConfig.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/StreamSinkConfig.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/StreamSinkConfig.java
index a257265..e9ed49c 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/StreamSinkConfig.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/model/StreamSinkConfig.java
@@ -20,6 +20,8 @@ import java.io.Serializable;
 
 public interface StreamSinkConfig extends Serializable {
     String getType();
+
     Class<?> getSinkType();
+
     Class<? extends StreamSinkConfig> getConfigType();
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/MetadataStore.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/MetadataStore.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/MetadataStore.java
index 023e14a..7dd717d 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/MetadataStore.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/MetadataStore.java
@@ -20,5 +20,5 @@ import com.google.inject.AbstractModule;
 import org.apache.eagle.common.module.ModuleScope;
 
 public abstract class MetadataStore extends AbstractModule implements ModuleScope {
-    
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/MetadataStoreModuleFactory.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/MetadataStoreModuleFactory.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/MetadataStoreModuleFactory.java
index 9a71fdb..aff6618 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/MetadataStoreModuleFactory.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/MetadataStoreModuleFactory.java
@@ -23,26 +23,26 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class MetadataStoreModuleFactory {
-    private final static Logger LOG = LoggerFactory.getLogger(MetadataStore.class);
+    private static final Logger LOG = LoggerFactory.getLogger(MetadataStore.class);
     public static final String METADATA_STORE_CONFIG_KEY = "metadata.store";
 
     private static MetadataStore instance;
 
-    public static MetadataStore getModule(){
+    public static MetadataStore getModule() {
         String metadataStoreClass = null;
-        if(instance == null) {
+        if (instance == null) {
             try {
                 Config config = ConfigFactory.load();
                 if (config.hasPath(METADATA_STORE_CONFIG_KEY)) {
                     metadataStoreClass = config.getString(METADATA_STORE_CONFIG_KEY);
-                    LOG.info("Using {} = {}",METADATA_STORE_CONFIG_KEY,metadataStoreClass);
-                }else{
+                    LOG.info("Using {} = {}", METADATA_STORE_CONFIG_KEY, metadataStoreClass);
+                } else {
                     metadataStoreClass = MemoryMetadataStore.class.getCanonicalName();
-                    LOG.info("{} is not set, using default {}",METADATA_STORE_CONFIG_KEY,metadataStoreClass);
+                    LOG.info("{} is not set, using default {}", METADATA_STORE_CONFIG_KEY, metadataStoreClass);
                 }
                 instance = (MetadataStore) Class.forName(metadataStoreClass).newInstance();
             } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
-                LOG.error("Failed to instantiate {}",metadataStoreClass,e);
+                LOG.error("Failed to instantiate {}", metadataStoreClass, e);
                 throw new RuntimeException(e.getMessage(), e.getCause());
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/PersistenceEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/PersistenceEntity.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/PersistenceEntity.java
index b63fb09..0612d6b 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/PersistenceEntity.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/PersistenceEntity.java
@@ -21,18 +21,18 @@ import org.apache.eagle.metadata.utils.UUIDGenerator;
 import java.io.Serializable;
 
 /**
- * Metadata Persistence Entity
+ * Metadata Persistence Entity.
  */
-public abstract class PersistenceEntity implements Serializable{
+public abstract class PersistenceEntity implements Serializable {
     private String uuid;
     private long createdTime;
     private long modifiedTime;
 
-    public String getUuid(){
+    public String getUuid() {
         return this.uuid;
     }
 
-    public void setUuid(String uuid){
+    public void setUuid(String uuid) {
         this.uuid = uuid;
     }
 
@@ -52,11 +52,11 @@ public abstract class PersistenceEntity implements Serializable{
         this.modifiedTime = modifiedTime;
     }
 
-    public void ensureDefault(){
-        if(this.uuid == null || this.uuid.isEmpty()){
+    public void ensureDefault() {
+        if (this.uuid == null || this.uuid.isEmpty()) {
             this.uuid = UUIDGenerator.newUUID();
         }
-        if(createdTime == 0){
+        if (createdTime == 0) {
             this.createdTime = System.currentTimeMillis();
         }
         this.modifiedTime = System.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/PersistenceService.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/PersistenceService.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/PersistenceService.java
index bde8298..e20311f 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/PersistenceService.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/persistence/PersistenceService.java
@@ -22,6 +22,8 @@ import java.util.Collection;
 
 public interface PersistenceService<T extends PersistenceEntity> {
     Collection<T> findAll();
+
     T getByUUID(String uuid) throws EntityNotFoundException;
+
     T create(T entity);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/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 ce76a00..5647458 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
@@ -30,20 +30,21 @@ import java.util.concurrent.ExecutionException;
 import java.util.function.Consumer;
 import java.util.function.Supplier;
 
-@JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
-public class RESTResponse<T>{
-    private final static Logger LOGGER = LoggerFactory.getLogger(RESTResponse.class);
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+public class RESTResponse<T> {
+    private static final Logger LOGGER = LoggerFactory.getLogger(RESTResponse.class);
     private boolean success = false;
     private String message;
     private String exception;
     private T data;
 
-    public RESTResponse(){}
+    public RESTResponse() {
+    }
 
-    public RESTResponse(Throwable throwable){
-        if(throwable.getMessage() == null || throwable.getMessage().isEmpty()) {
+    public RESTResponse(Throwable throwable) {
+        if (throwable.getMessage() == null || throwable.getMessage().isEmpty()) {
             this.setMessage(throwable.getMessage());
-        }else{
+        } else {
             this.setMessage(ExceptionUtils.getMessage(throwable));
         }
         this.setException(ExceptionUtils.getStackTrace(throwable));
@@ -73,27 +74,27 @@ public class RESTResponse<T>{
         this.success = success;
     }
 
-    public static <E> RestResponseBuilder<E> builder(){
+    public static <E> RestResponseBuilder<E> builder() {
         return new RestResponseBuilder<>();
     }
 
-    public static <E> RestResponseBuilder<E> of(E data){
+    public static <E> RestResponseBuilder<E> of(E data) {
         return RESTResponse.<E>builder().data(data);
     }
 
-    public static <E> RestResponseBuilder<E> of(Consumer<RestResponseBuilder<E>> func){
+    public static <E> RestResponseBuilder<E> of(Consumer<RestResponseBuilder<E>> func) {
         return RESTResponse.<E>builder().of(func);
     }
 
-    public static <E> RestResponseBuilder<E> of(Supplier<E> func){
+    public static <E> RestResponseBuilder<E> of(Supplier<E> func) {
         return RESTResponse.<E>builder().of(func);
     }
 
-    public static <E> RestResponseBuilder<E> async(ThrowableSupplier<E,Exception> func) {
+    public static <E> RestResponseBuilder<E> async(ThrowableSupplier<E, Exception> func) {
         return RESTResponse.<E>builder().async(func);
     }
 
-    public static <E> RestResponseBuilder<E> async(ThrowableConsumer<RestResponseBuilder<E>, Exception> func){
+    public static <E> RestResponseBuilder<E> async(ThrowableConsumer<RestResponseBuilder<E>, Exception> func) {
         return RESTResponse.<E>builder().async(func);
     }
 
@@ -110,72 +111,78 @@ public class RESTResponse<T>{
     }
 
 
-    public static class RestResponseBuilder<E>{
+    public static class RestResponseBuilder<E> {
         private RESTResponse current = new RESTResponse();
         private Response.Status status = Response.Status.OK;
         private CompletableFuture future = null;
 
-        public RestResponseBuilder<E> success(boolean success){
+        public RestResponseBuilder<E> success(boolean success) {
             this.current.setSuccess(success);
             return this;
         }
 
-        public RestResponseBuilder<E> status(Response.Status status){
+        public RestResponseBuilder<E> status(Response.Status status) {
             this.status = status;
             return this;
         }
 
-        public RestResponseBuilder<E> message(String message){
+        public RestResponseBuilder<E> status(boolean success, Response.Status status) {
+            this.success(success);
+            this.status(status);
+            return this;
+        }
+
+        public RestResponseBuilder<E> message(String message) {
             this.current.setMessage(message);
             return this;
         }
 
-        public RestResponseBuilder<E> data(E data){
+        public RestResponseBuilder<E> data(E data) {
             this.current.setData(data);
             return this;
         }
 
-        public RestResponseBuilder<E> exception(Throwable exception){
+        public RestResponseBuilder<E> exception(Throwable exception) {
             this.current.setThrowable(exception);
-            if(this.current.getMessage() == null){
-                if(exception.getMessage() ==null || exception.getMessage().isEmpty()){
+            if (this.current.getMessage() == null) {
+                if (exception.getMessage() == null || exception.getMessage().isEmpty()) {
                     this.current.setMessage(ExceptionUtils.getMessage(exception));
-                }else{
+                } else {
                     this.current.setMessage(exception.getMessage());
                 }
             }
             return this;
         }
 
-        public RestResponseBuilder<E> of(Consumer<RestResponseBuilder<E>> func){
+        public RestResponseBuilder<E> of(Consumer<RestResponseBuilder<E>> func) {
             try {
                 this.success(true).status(Response.Status.OK);
                 func.accept(this);
-            } catch (Exception ex){
-                LOGGER.error("Exception: " +ex.getMessage(),ex);
+            } catch (Exception ex) {
+                LOGGER.error("Exception: " + ex.getMessage(), ex);
                 this.success(false).data(null).status(Response.Status.BAD_REQUEST).exception(ex);
                 raiseWebAppException(ex);
             }
             return this;
         }
 
-        public RestResponseBuilder<E>  of(Supplier<E> func){
+        public RestResponseBuilder<E> of(Supplier<E> func) {
             try {
                 this.success(true).status(Response.Status.OK).data(func.get());
-            } catch (Throwable ex){
-                LOGGER.error("Exception: " +ex.getMessage(),ex);
+            } catch (Throwable ex) {
+                LOGGER.error("Exception: " + ex.getMessage(), ex);
                 this.success(false).status(Response.Status.BAD_REQUEST).exception(ex);
                 raiseWebAppException(ex);
             }
             return this;
         }
 
-        public RestResponseBuilder<E> async(ThrowableSupplier<E,Exception> func) {
+        public RestResponseBuilder<E> async(ThrowableSupplier<E, Exception> func) {
             CompletableFuture future = CompletableFuture.runAsync(() -> {
                 try {
                     this.status(Response.Status.OK).success(true).data(func.get());
                 } catch (Throwable e) {
-                    LOGGER.error("Exception: " +e.getMessage(),e);
+                    LOGGER.error("Exception: " + e.getMessage(), e);
                     this.success(false).status(Response.Status.BAD_REQUEST).exception(e);
                     raiseWebAppException(e);
                 }
@@ -184,60 +191,56 @@ public class RESTResponse<T>{
             return this;
         }
 
-        private void runAsync(CompletableFuture future){
+        public RestResponseBuilder<E> async(ThrowableConsumer<RestResponseBuilder<E>, Exception> func) {
+            CompletableFuture future = CompletableFuture.runAsync(() -> {
+                try {
+                    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);
+                }
+            });
+            runAsync(future);
+            return this;
+        }
+
+        private void runAsync(CompletableFuture future) {
             try {
                 future.get();
             } catch (InterruptedException ex) {
-                LOGGER.error("InterruptedException: "+ex.getMessage(),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);
+                LOGGER.error("ExecutionException: " + ex.getMessage(), ex);
                 this.success(false).status(Response.Status.BAD_REQUEST).exception(ex.getCause());
                 raiseWebAppException(ex);
             }
         }
 
-        private void raiseWebAppException(Throwable ex){
-            throw new WebApplicationException(ex,Response.status(this.status).entity(this.current).build());
+        private void raiseWebAppException(Throwable ex) {
+            throw new WebApplicationException(ex, Response.status(this.status).entity(this.current).build());
         }
 
-        public RestResponseBuilder<E> async(ThrowableConsumer<RestResponseBuilder<E>, Exception> func){
-            CompletableFuture future = CompletableFuture.runAsync(() -> {
-                try {
-                    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);
-                }
-            });
-            runAsync(future);
-            return this;
-        }
 
-        public RestResponseBuilder<E> then(ThrowableConsumer<RestResponseBuilder<E>, Exception> func){
+        public RestResponseBuilder<E> then(ThrowableConsumer<RestResponseBuilder<E>, Exception> func) {
             try {
                 func.accept(this);
             } catch (Throwable ex) {
-                LOGGER.error("Exception: " +ex.getMessage(),ex);
+                LOGGER.error("Exception: " + ex.getMessage(), ex);
                 this.success(false).status(Response.Status.BAD_REQUEST).exception(ex);
                 raiseWebAppException(ex);
             }
             return this;
         }
 
-        public RESTResponse<E> get(){
+        public RESTResponse<E> get() {
             return current;
         }
 
-        public RestResponseBuilder<E> status(boolean success, Response.Status status) {
-            this.success(success);
-            this.status(status);
-            return this;
-        }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/SiteResource.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/SiteResource.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/SiteResource.java
index 5780f3f..a5461b3 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/SiteResource.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/SiteResource.java
@@ -35,24 +35,24 @@ public class SiteResource {
 
     @Inject
     public SiteResource(SiteEntityService siteEntityService,
-                        ApplicationEntityService applicationEntityService){
+                        ApplicationEntityService applicationEntityService) {
         this.siteEntityService = siteEntityService;
         this.entityService = applicationEntityService;
     }
 
     @GET
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<Collection<SiteEntity>> getAllSites(){
+    public RESTResponse<Collection<SiteEntity>> getAllSites() {
         return RESTResponse.async(siteEntityService::findAll).get();
     }
 
     @POST
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<SiteEntity> createSite(SiteEntity siteEntity){
-        return RESTResponse.<SiteEntity>async((builder)-> {
+    public RESTResponse<SiteEntity> createSite(SiteEntity siteEntity) {
+        return RESTResponse.<SiteEntity>async((builder) -> {
             SiteEntity entity = siteEntityService.create(siteEntity);
-            builder.message("Successfully created site (siteId:"+entity.getSiteId()+", uuid: "+entity.getUuid()+")");
+            builder.message("Successfully created site (siteId:" + entity.getSiteId() + ", uuid: " + entity.getUuid() + ")");
             builder.data(entity);
         }).get();
     }
@@ -60,15 +60,15 @@ public class SiteResource {
     @GET
     @Path("/{siteId}")
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<SiteEntity> getSiteBySiteId(@PathParam("siteId") String siteId){
-        return RESTResponse.async(()->siteEntityService.getBySiteId(siteId)).get();
+    public RESTResponse<SiteEntity> getSiteBySiteId(@PathParam("siteId") String siteId) {
+        return RESTResponse.async(() -> siteEntityService.getBySiteId(siteId)).get();
     }
 
     @DELETE
     @Path("/{siteId}")
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<SiteEntity> deleteSiteBySiteId(@PathParam("siteId") String siteId){
-        return RESTResponse.async(()-> {
+    public RESTResponse<SiteEntity> deleteSiteBySiteId(@PathParam("siteId") String siteId) {
+        return RESTResponse.async(() -> {
             int appCount = entityService.findBySiteId(siteId).size();
             if (appCount > 0) {
                 throw new SiteDeleteException("This site has enabled applications, remove them first");
@@ -80,8 +80,8 @@ public class SiteResource {
     @DELETE
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<SiteEntity> deleteSiteByUUID(UUIDRequest uuidRequest){
-        return RESTResponse.async(()-> {
+    public RESTResponse<SiteEntity> deleteSiteByUUID(UUIDRequest uuidRequest) {
+        return RESTResponse.async(() -> {
             int appCount = entityService.findBySiteId(siteEntityService.getByUUID(uuidRequest.getUuid()).getSiteId()).size();
             if (appCount > 0) {
                 throw new SiteDeleteException("This site has enabled applications, remove them first");
@@ -94,8 +94,8 @@ public class SiteResource {
     @Path("/{siteId}")
     @Produces(MediaType.APPLICATION_JSON)
     @Consumes(MediaType.APPLICATION_JSON)
-    public RESTResponse<SiteEntity> updateSite(@PathParam("siteId") String siteId,SiteEntity siteEntity){
-        return RESTResponse.async(()-> {
+    public RESTResponse<SiteEntity> updateSite(@PathParam("siteId") String siteId, SiteEntity siteEntity) {
+        return RESTResponse.async(() -> {
             siteEntity.setSiteId(siteId);
             return siteEntityService.update(siteEntity);
         }).get();
@@ -104,8 +104,8 @@ public class SiteResource {
     @PUT
     @Produces(MediaType.APPLICATION_JSON)
     @Consumes(MediaType.APPLICATION_JSON)
-    public RESTResponse<SiteEntity> updateSite(SiteEntity siteEntity){
-        return RESTResponse.async(()-> {
+    public RESTResponse<SiteEntity> updateSite(SiteEntity siteEntity) {
+        return RESTResponse.async(() -> {
             return siteEntityService.update(siteEntity);
         }).get();
     }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/UUIDRequest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/UUIDRequest.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/UUIDRequest.java
index 259252f..46c7a3f 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/UUIDRequest.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/resource/UUIDRequest.java
@@ -19,7 +19,7 @@ package org.apache.eagle.metadata.resource;
 
 import java.io.Serializable;
 
-public class UUIDRequest implements Serializable{
+public class UUIDRequest implements Serializable {
     private String uuid;
 
     public String getUuid() {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationDescService.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationDescService.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationDescService.java
index 33ab3dd..e3bf4f4 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationDescService.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationDescService.java
@@ -22,5 +22,6 @@ import java.util.Collection;
 
 public interface ApplicationDescService {
     Collection<ApplicationDesc> getApplicationDescs();
+
     ApplicationDesc getApplicationDescByType(String appType);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationEntityService.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationEntityService.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationEntityService.java
index 69dc921..27c9313 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationEntityService.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationEntityService.java
@@ -24,8 +24,12 @@ import java.util.Collection;
 
 public interface ApplicationEntityService extends PersistenceService<ApplicationEntity> {
     Collection<ApplicationEntity> findBySiteId(String siteId);
-    ApplicationEntity getBySiteIdAndAppType(String siteId,String appType);
-    ApplicationEntity getByUUIDOrAppId(String uuid,String appId);
+
+    ApplicationEntity getBySiteIdAndAppType(String siteId, String appType);
+
+    ApplicationEntity getByUUIDOrAppId(String uuid, String appId);
+
     ApplicationEntity delete(ApplicationEntity applicationEntity);
+
     ApplicationEntity update(ApplicationEntity entity);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationStatusUpdateService.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationStatusUpdateService.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationStatusUpdateService.java
index bc34eb9..66772ac 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationStatusUpdateService.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/ApplicationStatusUpdateService.java
@@ -23,5 +23,6 @@ import java.util.Collection;
 
 public abstract class ApplicationStatusUpdateService extends AbstractScheduledService {
     public abstract void updateApplicationEntityStatus(Collection<ApplicationEntity> applicationEntities);
+
     public abstract void updateApplicationEntityStatus(ApplicationEntity applicationEntity);
- }
\ No newline at end of file
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/SiteEntityService.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/SiteEntityService.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/SiteEntityService.java
index eec5da3..a1cf28d 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/SiteEntityService.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/SiteEntityService.java
@@ -20,9 +20,12 @@ import org.apache.eagle.metadata.exceptions.EntityNotFoundException;
 import org.apache.eagle.metadata.model.SiteEntity;
 import org.apache.eagle.metadata.persistence.PersistenceService;
 
-public interface SiteEntityService extends PersistenceService<SiteEntity>{
+public interface SiteEntityService extends PersistenceService<SiteEntity> {
     SiteEntity getBySiteId(String siteId) throws EntityNotFoundException;
+
     SiteEntity deleteBySiteId(String siteId) throws EntityNotFoundException;
+
     SiteEntity deleteByUUID(String uuid) throws EntityNotFoundException;
+
     SiteEntity update(SiteEntity siteEntity) throws EntityNotFoundException;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/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 9151ba2..bb5d09c 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
@@ -106,7 +106,7 @@ public class ApplicationEntityServiceMemoryImpl implements ApplicationEntityServ
 
     @Override
     public ApplicationEntity update(ApplicationEntity entity) {
-        Preconditions.checkNotNull(entity.getUuid(),"UUID");
+        Preconditions.checkNotNull(entity.getUuid(), "UUID");
         ApplicationEntity origin = getByUUID(entity.getUuid());
         origin.updateMutable(entity);
         return origin;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/MemoryMetadataStore.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/MemoryMetadataStore.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/MemoryMetadataStore.java
index 6b5845c..747c3be 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/MemoryMetadataStore.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/service/memory/MemoryMetadataStore.java
@@ -23,7 +23,7 @@ import org.apache.eagle.metadata.persistence.MetadataStore;
 import org.apache.eagle.metadata.service.ApplicationEntityService;
 import org.apache.eagle.metadata.service.SiteEntityService;
 
-public class MemoryMetadataStore extends MetadataStore{
+public class MemoryMetadataStore extends MetadataStore {
     @Override
     protected void configure() {
         bind(SiteEntityService.class).to(SiteEntityEntityServiceMemoryImpl.class).in(Singleton.class);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/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 54c5bd3..94e195f 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
@@ -29,7 +29,7 @@ import java.util.Optional;
 
 @Singleton
 public class SiteEntityEntityServiceMemoryImpl implements SiteEntityService {
-    private Map<String,SiteEntity> siteId2EntityMap = new HashMap<>();
+    private Map<String, SiteEntity> siteId2EntityMap = new HashMap<>();
 
     @Override
     public Collection<SiteEntity> findAll() {
@@ -39,28 +39,28 @@ public class SiteEntityEntityServiceMemoryImpl implements SiteEntityService {
     @Override
     public SiteEntity getByUUID(String uuid) throws EntityNotFoundException {
         Optional<SiteEntity> entityOptional = siteId2EntityMap.values().stream().filter((site) -> uuid.equals(site.getUuid())).findAny();
-        if(entityOptional.isPresent()){
+        if (entityOptional.isPresent()) {
             return entityOptional.get();
-        }else{
-            throw new EntityNotFoundException("Site with UUID: "+uuid+" not found");
+        } else {
+            throw new EntityNotFoundException("Site with UUID: " + uuid + " not found");
         }
     }
 
     @Override
     public SiteEntity create(SiteEntity entity) {
-        Preconditions.checkNotNull(entity.getSiteId(),"SiteId is null: "+entity.getSiteId());
-        if(siteId2EntityMap.containsKey(entity.getSiteId())){
-            throw new IllegalArgumentException("Duplicated siteId: "+entity.getSiteId());
+        Preconditions.checkNotNull(entity.getSiteId(), "SiteId is null: " + entity.getSiteId());
+        if (siteId2EntityMap.containsKey(entity.getSiteId())) {
+            throw new IllegalArgumentException("Duplicated siteId: " + entity.getSiteId());
         }
         entity.ensureDefault();
-        siteId2EntityMap.put(entity.getSiteId(),entity);
+        siteId2EntityMap.put(entity.getSiteId(), entity);
         return entity;
     }
 
     @Override
     public SiteEntity getBySiteId(String siteId) throws EntityNotFoundException {
-        if(!siteId2EntityMap.containsKey(siteId)){
-            throw new EntityNotFoundException("Site with siteId: "+siteId+" not exists");
+        if (!siteId2EntityMap.containsKey(siteId)) {
+            throw new EntityNotFoundException("Site with siteId: " + siteId + " not exists");
         }
         return siteId2EntityMap.get(siteId);
     }
@@ -77,14 +77,14 @@ public class SiteEntityEntityServiceMemoryImpl implements SiteEntityService {
 
     @Override
     public SiteEntity update(SiteEntity siteEntity) throws EntityNotFoundException {
-        if(siteEntity.getSiteId() == null && siteEntity.getUuid() == null){
+        if (siteEntity.getSiteId() == null && siteEntity.getUuid() == null) {
             throw new IllegalArgumentException("siteId and UUID are both null, don't know how to update");
         }
-        SiteEntity oldEntity = (siteEntity.getSiteId()!=null)? getBySiteId(siteEntity.getSiteId()) : getByUUID(siteEntity.getUuid());
+        SiteEntity oldEntity = (siteEntity.getSiteId() != null) ? getBySiteId(siteEntity.getSiteId()) : getByUUID(siteEntity.getUuid());
         siteEntity.setUuid(oldEntity.getUuid());
         siteEntity.setCreatedTime(oldEntity.getCreatedTime());
         siteEntity.ensureDefault();
-        siteId2EntityMap.put(siteEntity.getSiteId(),siteEntity);
+        siteId2EntityMap.put(siteEntity.getSiteId(), siteEntity);
         return siteEntity;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/ConfigTemplateHelper.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/ConfigTemplateHelper.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/ConfigTemplateHelper.java
index 2d4fa5f..bb59956 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/ConfigTemplateHelper.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/ConfigTemplateHelper.java
@@ -18,7 +18,6 @@ package org.apache.eagle.metadata.utils;
 
 import com.google.common.base.Preconditions;
 import org.apache.eagle.metadata.model.Configuration;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -29,15 +28,16 @@ import java.io.InputStream;
 import java.io.StringReader;
 
 public class ConfigTemplateHelper {
-    private final static Logger LOG = LoggerFactory.getLogger(ConfigTemplateHelper.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ConfigTemplateHelper.class);
+
     public static Configuration unmarshallFromXmlStream(InputStream inputStream) throws JAXBException {
-        Preconditions.checkNotNull(inputStream,"Input stream is null");
+        Preconditions.checkNotNull(inputStream, "Input stream is null");
         try {
             JAXBContext jc = JAXBContext.newInstance(Configuration.class);
             Unmarshaller unmarshaller = jc.createUnmarshaller();
-            return  (Configuration) unmarshaller.unmarshal(inputStream);
-        }catch (Exception ex){
-            LOG.error("Failed to unmarshall ConfigTemplate from stream",ex);
+            return (Configuration) unmarshaller.unmarshal(inputStream);
+        } catch (Exception ex) {
+            LOG.error("Failed to unmarshall ConfigTemplate from stream", ex);
             throw ex;
         }
     }
@@ -45,13 +45,13 @@ public class ConfigTemplateHelper {
     public static Configuration unmarshallFromResource(String resourceName) throws JAXBException {
         String source = resourceName;
         InputStream inputStream = ConfigTemplateHelper.class.getResourceAsStream(resourceName);
-        if(inputStream == null){
-            source = "/"+resourceName;
-//            LOG.debug("Unable to get resource from {}, retrying with ",resourceName,source);
+        if (inputStream == null) {
+            source = "/" + resourceName;
+            // LOG.debug("Unable to get resource from {}, retrying with ",resourceName,source);
             inputStream = ConfigTemplateHelper.class.getResourceAsStream(source);
         }
         Preconditions.checkNotNull(inputStream, "Unable to load stream from resource " + source);
-        Configuration configuration =  unmarshallFromXmlStream(inputStream);
+        Configuration configuration = unmarshallFromXmlStream(inputStream);
         return configuration;
     }
 
@@ -59,9 +59,9 @@ public class ConfigTemplateHelper {
         try {
             JAXBContext jc = JAXBContext.newInstance(Configuration.class);
             Unmarshaller unmarshaller = jc.createUnmarshaller();
-            return  (Configuration) unmarshaller.unmarshal(new StringReader(xmlConfiguration));
-        }catch (Exception ex){
-            LOG.error("Failed to unmarshall ConfigTemplate from string",ex);
+            return (Configuration) unmarshaller.unmarshal(new StringReader(xmlConfiguration));
+        } catch (Exception ex) {
+            LOG.error("Failed to unmarshall ConfigTemplate from string", ex);
             throw ex;
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/InnerDomAsTextHandler.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/InnerDomAsTextHandler.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/InnerDomAsTextHandler.java
index 1358fff..4864fcf 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/InnerDomAsTextHandler.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/InnerDomAsTextHandler.java
@@ -33,12 +33,12 @@ public abstract class InnerDomAsTextHandler implements DomHandler<String, Stream
     /**
      * Default constructor.
      *
-     * It is up to a JAXB provider to decide which DOM implementation
+     * <p>It is up to a JAXB provider to decide which DOM implementation
      * to use or how that is configured.
      */
     public InnerDomAsTextHandler(String tagName) {
-        this.startTag = String.format("<%s>",tagName);
-        this.endTag = String.format("</%s>",tagName);
+        this.startTag = String.format("<%s>", tagName);
+        this.endTag = String.format("</%s>", tagName);
     }
 
     @Override
@@ -59,7 +59,7 @@ public abstract class InnerDomAsTextHandler implements DomHandler<String, Stream
         try {
             StringReader xmlReader = new StringReader(n);
             return new StreamSource(xmlReader);
-        } catch(Exception e) {
+        } catch (Exception e) {
             throw new RuntimeException(e);
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/UUIDGenerator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/UUIDGenerator.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/UUIDGenerator.java
index e9efd99..2ca5224 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/UUIDGenerator.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/main/java/org/apache/eagle/metadata/utils/UUIDGenerator.java
@@ -19,7 +19,7 @@ package org.apache.eagle.metadata.utils;
 import java.util.UUID;
 
 public class UUIDGenerator {
-    public static String newUUID(){
+    public static String newUUID() {
         return UUID.randomUUID().toString();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-base/src/test/java/org/apache/eagle/metadata/utils/StreamIdConversionsTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-base/src/test/java/org/apache/eagle/metadata/utils/StreamIdConversionsTest.java b/eagle-core/eagle-metadata/eagle-metadata-base/src/test/java/org/apache/eagle/metadata/utils/StreamIdConversionsTest.java
index f0018bf..94fcf7a 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-base/src/test/java/org/apache/eagle/metadata/utils/StreamIdConversionsTest.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-base/src/test/java/org/apache/eagle/metadata/utils/StreamIdConversionsTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
 public class StreamIdConversionsTest {
     @Test
     public void testGenerateUniqueStreamId() {
-        Assert.assertEquals("MOCK_STREAM_TEST", StreamIdConversions.formatSiteStreamId("test","mock_stream"));
+        Assert.assertEquals("MOCK_STREAM_TEST", StreamIdConversions.formatSiteStreamId("test", "mock_stream"));
     }
 
     @Test
@@ -32,6 +32,6 @@ public class StreamIdConversionsTest {
 
     @Test
     public void testParseStreamTypeId() {
-        Assert.assertEquals("MOCK_STREAM", StreamIdConversions.parseStreamTypeId("test","MOCK_STREAM_TEST"));
+        Assert.assertEquals("MOCK_STREAM", StreamIdConversions.parseStreamTypeId("test", "MOCK_STREAM_TEST"));
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceConfig.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceConfig.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceConfig.java
index d40f465..6b629ac 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceConfig.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceConfig.java
@@ -17,31 +17,29 @@
 package org.apache.eagle.metadata.store.jdbc;
 
 /**
- *
- *
  * Configuration:
  *
- * Prefix: <code>metadata.jdbc.*</code>
+ * <p>Prefix: <code>metadata.jdbc.*</code>
  *
- * <code>
- *     metadata {
- *         jdbc {
- *             username = ""
- *             password = ""
- *             driverClassName = "org.h2.Driver"
- *             url = "jdbc:h2:./eagle"
- *             connectionProperties = "encoding=UTF8"
- *         }
- *     }
+ * <p><code>
+ * metadata {
+ * jdbc {
+ * username = ""
+ * password = ""
+ * driverClassName = "org.h2.Driver"
+ * url = "jdbc:h2:./eagle"
+ * connectionProperties = "encoding=UTF8"
+ * }
+ * }
  * </code>
  *
- * https://commons.apache.org/proper/commons-dbcp/configuration.html
+ * <p>https://commons.apache.org/proper/commons-dbcp/configuration.html
  */
 public class JDBCDataSourceConfig {
-    public final static String CONFIG_PREFIX = "metadata.jdbc";
-    private final static String DEFAULT_DRIVER_CLASS = org.h2.Driver.class.getName();
-    private final static String DEFAULT_CONNECTION_PROPERTIES = "encoding=UTF8";
-    private final static String DEFAULT_URL = "jdbc:h2:./eagle";
+    public static final String CONFIG_PREFIX = "metadata.jdbc";
+    private static final String DEFAULT_DRIVER_CLASS = org.h2.Driver.class.getName();
+    private static final String DEFAULT_CONNECTION_PROPERTIES = "encoding=UTF8";
+    private static final String DEFAULT_URL = "jdbc:h2:./eagle";
 
     private String username;
     private String password;
@@ -92,6 +90,6 @@ public class JDBCDataSourceConfig {
     @Override
     public String toString() {
         return String.format("%s { \n driverClassName=%s \n url=%s \n connectionProperties=%s \n username=%s \n password=*****\n}",
-                CONFIG_PREFIX,driverClassName,url,username,connectionProperties);
+            CONFIG_PREFIX, driverClassName, url, username, connectionProperties);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataMetadataStoreServiceImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataMetadataStoreServiceImpl.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataMetadataStoreServiceImpl.java
index 1ed4980..e62ebe4 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataMetadataStoreServiceImpl.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataMetadataStoreServiceImpl.java
@@ -17,18 +17,17 @@
 package org.apache.eagle.metadata.store.jdbc;
 
 
+import com.google.inject.Inject;
 import org.apache.eagle.common.function.ThrowableConsumer2;
 import org.apache.eagle.common.function.ThrowableFunction;
-
-import com.google.inject.Inject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.sql.DataSource;
 import java.sql.*;
 import java.util.Collection;
 import java.util.LinkedList;
 import java.util.List;
-import javax.sql.DataSource;
 
 
 public class JDBCMetadataMetadataStoreServiceImpl implements JDBCMetadataQueryService {
@@ -164,7 +163,8 @@ public class JDBCMetadataMetadataStoreServiceImpl implements JDBCMetadataQuerySe
     }
 
     @Override
-    public <T, E extends Throwable> List<T> queryWithCond(String sqlQuery, T entity, ThrowableConsumer2<PreparedStatement, T, E> mapper1, ThrowableFunction<ResultSet, T, E> mapper) throws SQLException, E {
+    public <T, E extends Throwable> List<T> queryWithCond(String sqlQuery, T entity, ThrowableConsumer2<PreparedStatement, T, E> mapper1, ThrowableFunction<ResultSet, T, E> mapper) throws
+        SQLException, E {
         Connection connection = null;
         PreparedStatement statement = null;
         ResultSet resultSet = null;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryService.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryService.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryService.java
index b64ef9f..d869305 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryService.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryService.java
@@ -26,64 +26,18 @@ import java.util.Collection;
 import java.util.List;
 
 public interface JDBCMetadataQueryService {
-    /**
-     * @param sql
-     * @return
-     * @throws SQLException
-     */
     boolean execute(String sql) throws SQLException;
 
-    /**
-     * @param tableName
-     * @return
-     * @throws SQLException
-     */
     boolean dropTable(String tableName) throws SQLException;
 
-    /**
-     * @param insertSql
-     * @param entities
-     * @param mapper
-     * @param <T>
-     * @param <E>
-     * @return
-     * @throws E
-     * @throws SQLException
-     */
     <T, E extends Throwable> int insert(String insertSql, Collection<T> entities, ThrowableConsumer2<PreparedStatement, T, E> mapper) throws E, SQLException;
 
-    /**
-     * @param tableName
-     * @return
-     * @throws SQLException
-     */
     boolean forceDropTable(String tableName);
 
-    /**
-     * @param querySql sql query text
-     * @param mapper   result set to entity mapper
-     * @param <T>
-     * @return entity list
-     */
     <T, E extends Throwable> List<T> query(String querySql, ThrowableFunction<ResultSet, T, E> mapper) throws SQLException, E;
 
-    /**
-     * @param querySql sql query text
-     * @param entity   query condition
-     * @param mapper1
-     * @param mapper   result set to entity mapper
-     * @param <T>
-     * @return entity list
-     */
     <T, E extends Throwable> List<T> queryWithCond(String querySql, T entity, ThrowableConsumer2<PreparedStatement, T, E> mapper1, ThrowableFunction<ResultSet, T, E> mapper) throws SQLException, E;
 
-    /**
-     * @param updateSql update query text
-     * @param entity   update condition
-     * @param mapper
-     * @param <T>
-     * @return entity list
-     */
     <T, E extends Throwable> int update(String updateSql, T entity, ThrowableConsumer2<PreparedStatement, T, E> mapper) throws SQLException, E;
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataStore.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataStore.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataStore.java
index 933e5e3..98d4015 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataStore.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataStore.java
@@ -17,6 +17,7 @@
 package org.apache.eagle.metadata.store.jdbc;
 
 
+import com.google.inject.Singleton;
 import org.apache.eagle.alert.metadata.IMetadataDao;
 import org.apache.eagle.alert.metadata.impl.JdbcMetadataDaoImpl;
 import org.apache.eagle.metadata.persistence.MetadataStore;
@@ -27,8 +28,6 @@ import org.apache.eagle.metadata.store.jdbc.provider.JDBCMetadataStoreConfigProv
 import org.apache.eagle.metadata.store.jdbc.service.ApplicationEntityServiceJDBCImpl;
 import org.apache.eagle.metadata.store.jdbc.service.SiteEntityServiceJDBCImpl;
 
-import com.google.inject.Singleton;
-
 import javax.sql.DataSource;
 
 public class JDBCMetadataStore extends MetadataStore {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/provider/JDBCDataSourceProvider.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/provider/JDBCDataSourceProvider.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/provider/JDBCDataSourceProvider.java
index 52203f3..751c853 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/provider/JDBCDataSourceProvider.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/provider/JDBCDataSourceProvider.java
@@ -27,7 +27,7 @@ import javax.sql.DataSource;
 import java.sql.SQLException;
 
 public class JDBCDataSourceProvider implements Provider<DataSource> {
-    private final static Logger LOGGER = LoggerFactory.getLogger(JDBCDataSourceProvider.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(JDBCDataSourceProvider.class);
 
     @Inject
     private JDBCDataSourceConfig config;
@@ -41,15 +41,15 @@ public class JDBCDataSourceProvider implements Provider<DataSource> {
         datasource.setUrl(config.getUrl());
         datasource.setConnectionProperties(config.getConnectionProperties());
         LOGGER.info("Register JDBCDataSourceShutdownHook");
-        Runtime.getRuntime().addShutdownHook(new Thread("JDBCDataSourceShutdownHook"){
+        Runtime.getRuntime().addShutdownHook(new Thread("JDBCDataSourceShutdownHook") {
             @Override
             public void run() {
                 try {
                     LOGGER.info("Shutting down data source");
                     datasource.close();
                 } catch (SQLException e) {
-                    LOGGER.error("SQLException: {}",e.getMessage(),e);
-                    throw new IllegalStateException("Failed to close datasource",e);
+                    LOGGER.error("SQLException: {}", e.getMessage(), e);
+                    throw new IllegalStateException("Failed to close datasource", e);
                 }
             }
         });

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/provider/JDBCMetadataStoreConfigProvider.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/provider/JDBCMetadataStoreConfigProvider.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/provider/JDBCMetadataStoreConfigProvider.java
index fc0d100..fdc81ff 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/provider/JDBCMetadataStoreConfigProvider.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/provider/JDBCMetadataStoreConfigProvider.java
@@ -25,7 +25,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class JDBCMetadataStoreConfigProvider implements Provider<JDBCDataSourceConfig> {
-    private final static Logger LOGGER = LoggerFactory.getLogger(JDBCMetadataStoreConfigProvider.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(JDBCMetadataStoreConfigProvider.class);
 
     @Inject
     private Config config;
@@ -33,8 +33,8 @@ public class JDBCMetadataStoreConfigProvider implements Provider<JDBCDataSourceC
     @Override
     public JDBCDataSourceConfig get() {
         JDBCDataSourceConfig dataSourceConfig = new ObjectMapper().convertValue(
-                    config.getConfig(JDBCDataSourceConfig.CONFIG_PREFIX).root().unwrapped(),JDBCDataSourceConfig.class);
-        LOGGER.info("JDBC Configuration: {}",dataSourceConfig);
+            config.getConfig(JDBCDataSourceConfig.CONFIG_PREFIX).root().unwrapped(), JDBCDataSourceConfig.class);
+        LOGGER.info("JDBC Configuration: {}", dataSourceConfig);
         return dataSourceConfig;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/ApplicationEntityServiceJDBCImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/ApplicationEntityServiceJDBCImpl.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/ApplicationEntityServiceJDBCImpl.java
index df0eebf..6ddf3c6 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/ApplicationEntityServiceJDBCImpl.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/ApplicationEntityServiceJDBCImpl.java
@@ -18,6 +18,7 @@
 package org.apache.eagle.metadata.store.jdbc.service;
 
 
+import com.google.inject.Singleton;
 import com.typesafe.config.Config;
 import com.typesafe.config.ConfigFactory;
 import org.apache.commons.lang.StringUtils;
@@ -32,13 +33,11 @@ import org.apache.eagle.metadata.service.ApplicationEntityService;
 import org.apache.eagle.metadata.store.jdbc.JDBCMetadataQueryService;
 import org.apache.eagle.metadata.store.jdbc.service.orm.ApplicationEntityToRelation;
 import org.apache.eagle.metadata.store.jdbc.service.orm.RelationToApplicationEntity;
-
-import com.google.inject.Singleton;
 import org.apache.eagle.metadata.utils.StreamIdConversions;
-import org.json.simple.JSONObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.inject.Inject;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -46,14 +45,13 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.stream.Collectors;
 
-import javax.inject.Inject;
-
 @Singleton
 public class ApplicationEntityServiceJDBCImpl implements ApplicationEntityService {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(ApplicationEntityServiceJDBCImpl.class);
 
-    private static final String insertSql = "INSERT INTO applications (siteid, apptype, appmode, jarpath, appstatus, configuration, context, createdtime, modifiedtime, uuid, appid ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+    private static final String insertSql = "INSERT INTO applications (siteid, apptype, appmode, jarpath, appstatus, configuration, context, createdtime, modifiedtime, uuid, appid ) VALUES (?, ?, "
+        + "?, ?, ?, ?, ?, ?, ?, ?, ?)";
     private static final String selectSql = "SELECT * FROM applications a INNER JOIN sites s on  a.siteid = s.siteid";
     private static final String selectSqlBySiteIdAndAppType = "SELECT * FROM applications  a INNER JOIN sites s on  a.siteid = s.siteid where a.siteid = ? and a.apptype = ?";
     private static final String selectSqlBySiteId = "SELECT * FROM applications  a INNER JOIN sites s on  a.siteid = s.siteid where a.siteid = ?";
@@ -207,12 +205,12 @@ public class ApplicationEntityServiceJDBCImpl implements ApplicationEntityServic
                 copied.setSiteId(entity.getSite().getSiteId());
                 copied.setStreamId(StreamIdConversions.formatSiteStreamId(entity.getSite().getSiteId(), copied.getStreamId()));
                 Config effectiveConfig = ConfigFactory.parseMap(new HashMap<>(entity.getConfiguration()))
-                        .withFallback(config).withFallback(ConfigFactory.parseMap(entity.getContext()));
+                    .withFallback(config).withFallback(ConfigFactory.parseMap(entity.getContext()));
 
                 ExecutionRuntime runtime = ExecutionRuntimeManager.getInstance().getRuntime(
-                        applicationProviderService.getApplicationProviderByType(entity.getDescriptor().getType()).getApplication().getEnvironmentType(), config);
+                    applicationProviderService.getApplicationProviderByType(entity.getDescriptor().getType()).getApplication().getEnvironmentType(), config);
                 StreamSinkConfig streamSinkConfig = runtime.environment()
-                        .streamSink().getSinkConfig(StreamIdConversions.parseStreamTypeId(copied.getSiteId(), copied.getStreamId()), effectiveConfig);
+                    .streamSink().getSinkConfig(StreamIdConversions.parseStreamTypeId(copied.getSiteId(), copied.getStreamId()), effectiveConfig);
                 StreamDesc streamDesc = new StreamDesc();
                 streamDesc.setSchema(copied);
                 streamDesc.setSink(streamSinkConfig);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/SiteEntityServiceJDBCImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/SiteEntityServiceJDBCImpl.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/SiteEntityServiceJDBCImpl.java
index 9946f93..18db625 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/SiteEntityServiceJDBCImpl.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/SiteEntityServiceJDBCImpl.java
@@ -17,24 +17,22 @@
 
 package org.apache.eagle.metadata.store.jdbc.service;
 
+import com.google.common.base.Preconditions;
 import org.apache.eagle.metadata.exceptions.EntityNotFoundException;
 import org.apache.eagle.metadata.model.SiteEntity;
 import org.apache.eagle.metadata.service.SiteEntityService;
 import org.apache.eagle.metadata.store.jdbc.JDBCMetadataQueryService;
 import org.apache.eagle.metadata.store.jdbc.service.orm.RelationToSiteEntity;
 import org.apache.eagle.metadata.store.jdbc.service.orm.SiteEntityToRelation;
-
-import com.google.common.base.Preconditions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.inject.Inject;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
-import javax.inject.Inject;
-
 
 public class SiteEntityServiceJDBCImpl implements SiteEntityService {
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/ApplicationEntityToRelation.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/ApplicationEntityToRelation.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/ApplicationEntityToRelation.java
index a64e27f..e6b539c 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/ApplicationEntityToRelation.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/ApplicationEntityToRelation.java
@@ -17,10 +17,9 @@
 
 package org.apache.eagle.metadata.store.jdbc.service.orm;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.eagle.common.function.ThrowableConsumer2;
 import org.apache.eagle.metadata.model.ApplicationEntity;
-
-import org.apache.commons.lang.StringUtils;
 import org.json.simple.JSONObject;
 
 import java.sql.PreparedStatement;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/RelationToApplicationEntity.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/RelationToApplicationEntity.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/RelationToApplicationEntity.java
index 81ed2c3..f184f71 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/RelationToApplicationEntity.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/RelationToApplicationEntity.java
@@ -21,7 +21,6 @@ import org.apache.eagle.common.function.ThrowableFunction;
 import org.apache.eagle.metadata.model.ApplicationDesc;
 import org.apache.eagle.metadata.model.ApplicationEntity;
 import org.apache.eagle.metadata.model.SiteEntity;
-import org.apache.eagle.metadata.store.jdbc.service.ApplicationEntityServiceJDBCImpl;
 import org.codehaus.jettison.json.JSONObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -35,6 +34,7 @@ import java.util.Map;
 public class RelationToApplicationEntity implements ThrowableFunction<ResultSet, ApplicationEntity, SQLException> {
 
     private static final Logger LOG = LoggerFactory.getLogger(RelationToApplicationEntity.class);
+
     @Override
     public ApplicationEntity apply(ResultSet resultSet) throws SQLException {
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/SiteEntityToRelation.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/SiteEntityToRelation.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/SiteEntityToRelation.java
index 7f592e3..910dec2 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/SiteEntityToRelation.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/main/java/org/apache/eagle/metadata/store/jdbc/service/orm/SiteEntityToRelation.java
@@ -18,11 +18,10 @@
 package org.apache.eagle.metadata.store.jdbc.service.orm;
 
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.eagle.common.function.ThrowableConsumer2;
 import org.apache.eagle.metadata.model.SiteEntity;
 
-import org.apache.commons.lang.StringUtils;
-
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/ApplicationEntityServiceJDBCImplTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/ApplicationEntityServiceJDBCImplTest.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/ApplicationEntityServiceJDBCImplTest.java
index 48a5ee4..0f3cd7d 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/ApplicationEntityServiceJDBCImplTest.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/ApplicationEntityServiceJDBCImplTest.java
@@ -132,6 +132,7 @@ public class ApplicationEntityServiceJDBCImplTest extends JDBCMetadataTestBase {
     public void testGetByUUIDOrAppId() {
         applicationEntityService.getByUUIDOrAppId(null, "fake appid");
     }
+
     @Test
     public void testDelApplicationEntity() {
         SiteEntity siteEntity = new SiteEntity();

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceProviderTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceProviderTest.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceProviderTest.java
index 1af1839..1ae632d 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceProviderTest.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCDataSourceProviderTest.java
@@ -33,19 +33,19 @@ public class JDBCDataSourceProviderTest extends JDBCMetadataTestBase {
     private JDBCDataSourceConfig dataSourceConfig;
 
     @Test
-    public void testSingletonDataSource(){
+    public void testSingletonDataSource() {
         DataSource dataSource1 = injector().getInstance(DataSource.class);
         DataSource dataSource2 = injector().getInstance(DataSource.class);
-        Assert.assertTrue("Should get datasource in singleton pattern",dataSource == dataSource1);
-        Assert.assertTrue("Should get datasource in singleton pattern",dataSource1 == dataSource2);
+        Assert.assertTrue("Should get datasource in singleton pattern", dataSource == dataSource1);
+        Assert.assertTrue("Should get datasource in singleton pattern", dataSource1 == dataSource2);
     }
 
     @Test
-    public void testDataSourceConfig(){
-        Assert.assertEquals("jdbc:h2:mem:test;INIT=RUNSCRIPT FROM './src/test/resources/init.sql'",dataSourceConfig.getUrl());
-        Assert.assertEquals(null,dataSourceConfig.getUsername());
-        Assert.assertEquals(null,dataSourceConfig.getPassword());
-        Assert.assertEquals("encoding=UTF8;timeout=60",dataSourceConfig.getConnectionProperties());
+    public void testDataSourceConfig() {
+        Assert.assertEquals("jdbc:h2:mem:test;INIT=RUNSCRIPT FROM './src/test/resources/init.sql'", dataSourceConfig.getUrl());
+        Assert.assertEquals(null, dataSourceConfig.getUsername());
+        Assert.assertEquals(null, dataSourceConfig.getPassword());
+        Assert.assertEquals("encoding=UTF8;timeout=60", dataSourceConfig.getConnectionProperties());
     }
 
     @Test
@@ -57,19 +57,22 @@ public class JDBCDataSourceProviderTest extends JDBCMetadataTestBase {
             connection = dataSource.getConnection();
             Assert.assertNotNull(connection);
             statement = connection.createStatement();
-            resultSet  = statement.executeQuery("SELECT 1");
+            resultSet = statement.executeQuery("SELECT 1");
             Assert.assertTrue(resultSet.next());
-            Assert.assertEquals(1,resultSet.getInt(1));
+            Assert.assertEquals(1, resultSet.getInt(1));
         } catch (SQLException e) {
             Assert.fail(e.getMessage());
             throw e;
         } finally {
-            if(resultSet!=null)
+            if (resultSet != null) {
                 resultSet.close();
-            if(statement != null)
+            }
+            if (statement != null) {
                 statement.close();
-            if(connection!=null)
+            }
+            if (connection != null) {
                 connection.close();
+            }
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/32582d23/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryServiceTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryServiceTest.java b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryServiceTest.java
index 5d608c6..9b43e8b 100644
--- a/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryServiceTest.java
+++ b/eagle-core/eagle-metadata/eagle-metadata-jdbc/src/test/java/org/apache/eagle/metadata/store/jdbc/JDBCMetadataQueryServiceTest.java
@@ -29,8 +29,8 @@ public class JDBCMetadataQueryServiceTest extends JDBCMetadataTestBase {
 
     @Test
     public void testQuery() throws SQLException {
-        List<Integer> result = queryService.query("SELECT 7",(resultSet) -> resultSet.getInt(1));
-        Assert.assertEquals(1,result.size());
-        Assert.assertEquals(7,result.get(0).intValue());
+        List<Integer> result = queryService.query("SELECT 7", (resultSet) -> resultSet.getInt(1));
+        Assert.assertEquals(1, result.size());
+        Assert.assertEquals(7, result.get(0).intValue());
     }
 }


Mime
View raw message