You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by qi...@apache.org on 2016/11/04 10:50:55 UTC

[1/3] incubator-eagle git commit: [EAGLE-724] Fix eagle-common checkstyle problem

Repository: incubator-eagle
Updated Branches:
  refs/heads/master 38f292644 -> ca0fae407


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/module/ModuleRegistryTest.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/module/ModuleRegistryTest.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/module/ModuleRegistryTest.java
index a7236bb..2de57f2 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/module/ModuleRegistryTest.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/module/ModuleRegistryTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
 
 public class ModuleRegistryTest {
     @Test
-    public void testPutAndGet(){
+    public void testPutAndGet() {
         ModuleRegistry registry = new ModuleRegistryImpl();
         registry.register(TestModuleScope_1.class, new AbstractModule() {
             @Override
@@ -42,11 +42,14 @@ public class ModuleRegistryTest {
 
             }
         });
-        Assert.assertEquals(2,registry.getModules(TestModuleScope_1.class).size());
-        Assert.assertEquals(1,registry.getModules(TestModuleScope_2.class).size());
-        Assert.assertEquals(3,registry.getModules().size());
+        Assert.assertEquals(2, registry.getModules(TestModuleScope_1.class).size());
+        Assert.assertEquals(1, registry.getModules(TestModuleScope_2.class).size());
+        Assert.assertEquals(3, registry.getModules().size());
     }
 
-    private class TestModuleScope_1 implements ModuleScope {}
-    private class TestModuleScope_2 implements ModuleScope {}
+    private class TestModuleScope_1 implements ModuleScope {
+    }
+
+    private class TestModuleScope_2 implements ModuleScope {
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/resources/footer.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/resources/footer.vm b/eagle-core/eagle-common/src/test/resources/footer.vm
index 8df4b06..d255988 100755
--- a/eagle-core/eagle-common/src/test/resources/footer.vm
+++ b/eagle-core/eagle-common/src/test/resources/footer.vm
@@ -16,9 +16,9 @@
  *
  * @version 0.3.0
  *#
-    </td>
-  </tr>
-  </tr>
+</td>
+</tr>
+</tr>
 </table>
 <!-- End of wrapper table -->
 </body>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/resources/header.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/resources/header.vm b/eagle-core/eagle-common/src/test/resources/header.vm
index 8bd4388..c91890f 100755
--- a/eagle-core/eagle-common/src/test/resources/header.vm
+++ b/eagle-core/eagle-common/src/test/resources/header.vm
@@ -19,281 +19,282 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
-  <title></title>
-  <style type="text/css">
-    /* Based on The MailChimp Reset INLINE: Yes. */
-    /* Client-specific Styles */
-    .outlook a {
-      color: #091D42;
-      padding: 0;
-      text-decoration: none;
-    }
-
-    /* Force Outlook to provide a "view in browser" menu link. */
-    body {
-      width: 100% !important;
-      -webkit-text-size-adjust: 100%;
-      -ms-text-size-adjust: 100%;
-      margin: 0;
-      padding: 0;
-    }
-
-    /* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/
-    .ExternalClass {
-      width: 100%;
-    }
-
-    /* Force Hotmail to display emails at full width */
-    .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
-      line-height: 100%;
-    }
-
-    /* Forces Hotmail to display normal line spacing.  More on that: http://www.emailonacid.com/forum/viewthread/43/ */
-    #backgroundTable {
-      margin: 0;
-      padding: 0;
-      width: 100% !important;
-      line-height: 100% !important;
-    }
-
-    /* End reset */
-
-    /* Some sensible defaults for images
-    Bring inline: Yes. */
-    img {
-      outline: none;
-      text-decoration: none;
-      -ms-interpolation-mode: bicubic;
-    }
-
-    a img {
-      border: none;
-    }
-
-    .image_fix {
-      display: block;
-    }
-
-    /* Yahoo paragraph fix
-    Bring inline: Yes. */
-    p {
-      margin: 1em 0;
-    }
-
-    /* Hotmail header color reset
-    Bring inline: Yes. */
-    h1, h2, h3, h4, h5, h6 {
-      color: black !important;
-    }
-
-    h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
-      color: blue !important;
-    }
-
-    h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active {
-      color: red !important; /* Preferably not the same color as the normal header link color.  There is limited support for psuedo classes in email clients, this was added just for good measure. */
-    }
-
-    h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
-      color: purple !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */
-    }
-
-    /* Outlook 07, 10 Padding issue fix
-    Bring inline: No.*/
-    table td {
-      border-collapse: collapse;
-    }
-
-    table{
-        width: 100%;
-    }
-
-    /* Remove spacing around Outlook 07, 10 tables
-    Bring inline: Yes */
-    table {
-      border-collapse: collapse;
-      mso-table-lspace: 0pt;
-      mso-table-rspace: 0pt;
-    }
-
-    /* Styling your links has become much simpler with the new Yahoo.  In fact, it falls in line with the main credo of styling in email and make sure to bring your styles inline.  Your link colors will be uniform across clients when brought inline.
-    Bring inline: Yes. */
-    a {
-      color: orange;
-    }
-
-    /***************************************************
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+    <title></title>
+    <style type="text/css">
+        /* Based on The MailChimp Reset INLINE: Yes. */
+        /* Client-specific Styles */
+        .outlook a {
+            color: #091D42;
+            padding: 0;
+            text-decoration: none;
+        }
+
+        /* Force Outlook to provide a "view in browser" menu link. */
+        body {
+            width: 100% !important;
+            -webkit-text-size-adjust: 100%;
+            -ms-text-size-adjust: 100%;
+            margin: 0;
+            padding: 0;
+        }
+
+        /* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/
+        .ExternalClass {
+            width: 100%;
+        }
+
+        /* Force Hotmail to display emails at full width */
+        .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
+            line-height: 100%;
+        }
+
+        /* Forces Hotmail to display normal line spacing.  More on that: http://www.emailonacid.com/forum/viewthread/43/ */
+        #backgroundTable {
+            margin: 0;
+            padding: 0;
+            width: 100% !important;
+            line-height: 100% !important;
+        }
+
+        /* End reset */
+
+        /* Some sensible defaults for images
+        Bring inline: Yes. */
+        img {
+            outline: none;
+            text-decoration: none;
+            -ms-interpolation-mode: bicubic;
+        }
+
+        a img {
+            border: none;
+        }
+
+        .image_fix {
+            display: block;
+        }
+
+        /* Yahoo paragraph fix
+        Bring inline: Yes. */
+        p {
+            margin: 1em 0;
+        }
+
+        /* Hotmail header color reset
+        Bring inline: Yes. */
+        h1, h2, h3, h4, h5, h6 {
+            color: black !important;
+        }
+
+        h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
+            color: blue !important;
+        }
+
+        h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active {
+            color: red !important; /* Preferably not the same color as the normal header link color.  There is limited support for psuedo classes in email clients, this was added just for good measure. */
+        }
+
+        h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
+            color: purple !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */
+        }
+
+        /* Outlook 07, 10 Padding issue fix
+        Bring inline: No.*/
+        table td {
+            border-collapse: collapse;
+        }
+
+        table {
+            width: 100%;
+        }
+
+        /* Remove spacing around Outlook 07, 10 tables
+        Bring inline: Yes */
+        table {
+            border-collapse: collapse;
+            mso-table-lspace: 0pt;
+            mso-table-rspace: 0pt;
+        }
+
+        /* Styling your links has become much simpler with the new Yahoo.  In fact, it falls in line with the main credo of styling in email and make sure to bring your styles inline.  Your link colors will be uniform across clients when brought inline.
+        Bring inline: Yes. */
+        a {
+            color: orange;
+        }
+
+        /***************************************************
+        ****************************************************
+        MOBILE TARGETING
+        ****************************************************
+        ***************************************************/
+        @media only screen and (max-device-width: 480px) {
+            /* Part one of controlling phone number linking for mobile. */
+            a[href^="tel"], a[href^="sms"] {
+                text-decoration: none;
+                color: blue; /* or whatever your want */
+                pointer-events: none;
+                cursor: default;
+            }
+
+            .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
+                text-decoration: default;
+                color: orange !important;
+                pointer-events: auto;
+                cursor: default;
+            }
+
+        }
+
+        /* More Specific Targeting */
+
+        @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
+            /* You guessed it, ipad (tablets, smaller screens, etc) */
+            /* repeating for the ipad */
+            a[href^="tel"], a[href^="sms"] {
+                text-decoration: none;
+                color: blue; /* or whatever your want */
+                pointer-events: none;
+                cursor: default;
+            }
+
+            .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
+                text-decoration: default;
+                color: orange !important;
+                pointer-events: auto;
+                cursor: default;
+            }
+        }
+
+        @media only screen and (-webkit-min-device-pixel-ratio: 2) {
+            /* Put your iPhone 4g styles in here */
+        }
+
+        /* Android targeting */
+        @media only screen and (-webkit-device-pixel-ratio: .75) {
+            /* Put CSS for low density (ldpi) Android layouts in here */
+        }
+
+        @media only screen and (-webkit-device-pixel-ratio: 1) {
+            /* Put CSS for medium density (mdpi) Android layouts in here */
+        }
+
+        @media only screen and (-webkit-device-pixel-ratio: 1.5) {
+            /* Put CSS for high density (hdpi) Android layouts in here */
+        }
+
+        /* end Android targeting */
+        .head {
+            font-family: Helvetica, Arial;
+            font-size: 30px;
+            text-decoration: none;
+            text-align: left;
+            color: #333;
+            align: left;
+            padding: 25px 0 15px 0;
+            valign: middle;
+            font-weight: 500;
+            border-bottom: 1px solid #cccccc;
+        }
+
+        .head2 {
+            font-family: Helvetica, Arial;
+            font-size: 24px;
+            text-decoration: none;
+            text-align: left;
+            color: #333;
+            align: left;
+            padding: 20px 0 10px 0;
+            valign: middle;
+            font-weight: 500;
+        }
+
+        .text {
+            font-family: Helvetica, Arial;
+            font-size: 14px;
+            text-decoration: none;
+            text-align: left;
+            color: #333;
+            align: left;
+            padding: 0.5em 0em 0.5em 0em;
+            valign: middle;
+        }
+
+        .info {
+            font-family: Helvetica, Arial;
+            font-size: 16px;
+            text-decoration: none;
+            text-align: left;
+            padding-left: 10px;
+            border-left: 3px solid #396A92;
+            background-color: #9AB4CB;
+            color: #091D42;
+            align: left;
+            padding: 1em 0em 1em 1em;
+            valign: middle;
+        }
+
+        .table-border {
+            border: 1px solid #ddd;
+            border-radius: 4px 4px 0 0;
+            box-shadow: none;
+        }
+
+        .table-border-th {
+            font-family: Helvetica, Arial;
+            font-size: 14px;
+            text-decoration: none;
+            text-align: left;
+            border-top: 1px solid #cccccc;
+            border-right: 1px solid #cccccc;
+            padding: 8px;
+        }
+
+        .table-border-td {
+            font-family: Helvetica, Arial;
+            font-size: 14px;
+            text-decoration: none;
+            text-align: left;
+            border-top: 1px solid #cccccc;
+            border-right: 1px solid #cccccc;
+            padding: 8px;
+            word-break: break-all;
+        }
+
+        .foot {
+            font-family: Arial;
+            font-size: 14px;
+            text-decoration: none;
+            text-align: left;
+            padding: 0.5em 0em 0.5em 0.5em;
+            border-top: 1px solid #cccccc;
+            color: #777;
+        }
+
+    </style>
+
+    <!-- Targeting Windows Mobile -->
+    <!--[if IEMobile 7]>
+    <style type="text/css">
+
+    </style>
+    <![endif]-->
+
+    <!-- ***********************************************
     ****************************************************
-    MOBILE TARGETING
+    END MOBILE TARGETING
     ****************************************************
-    ***************************************************/
-    @media only screen and (max-device-width: 480px) {
-      /* Part one of controlling phone number linking for mobile. */
-      a[href^="tel"], a[href^="sms"] {
-        text-decoration: none;
-        color: blue; /* or whatever your want */
-        pointer-events: none;
-        cursor: default;
-      }
-
-      .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
-        text-decoration: default;
-        color: orange !important;
-        pointer-events: auto;
-        cursor: default;
-      }
-
-    }
-
-    /* More Specific Targeting */
-
-    @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
-      /* You guessed it, ipad (tablets, smaller screens, etc) */
-      /* repeating for the ipad */
-      a[href^="tel"], a[href^="sms"] {
-        text-decoration: none;
-        color: blue; /* or whatever your want */
-        pointer-events: none;
-        cursor: default;
-      }
-
-      .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
-        text-decoration: default;
-        color: orange !important;
-        pointer-events: auto;
-        cursor: default;
-      }
-    }
-
-    @media only screen and (-webkit-min-device-pixel-ratio: 2) {
-      /* Put your iPhone 4g styles in here */
-    }
-
-    /* Android targeting */
-    @media only screen and (-webkit-device-pixel-ratio: .75) {
-      /* Put CSS for low density (ldpi) Android layouts in here */
-    }
-
-    @media only screen and (-webkit-device-pixel-ratio: 1) {
-      /* Put CSS for medium density (mdpi) Android layouts in here */
-    }
-
-    @media only screen and (-webkit-device-pixel-ratio: 1.5) {
-      /* Put CSS for high density (hdpi) Android layouts in here */
-    }
-
-    /* end Android targeting */
-    .head{
-      font-family:Helvetica, Arial;
-      font-size:30px;
-      text-decoration:none;
-      text-align:left;
-      color:#333;
-      align:left;
-      padding: 25px 0 15px 0;
-      valign:middle;
-      font-weight: 500;
-      border-bottom: 1px solid #cccccc;
-    }
-
-    .head2{
-      font-family:Helvetica, Arial;
-      font-size:24px;
-      text-decoration:none;
-      text-align:left;
-      color:#333;
-      align:left;
-      padding: 20px 0 10px 0;
-      valign:middle;
-      font-weight: 500;
-    }
-
-    .text{
-      font-family:Helvetica, Arial;
-      font-size:14px;
-      text-decoration:none;
-      text-align:left;
-      color:#333;
-      align:left;
-      padding: 0.5em 0em 0.5em 0em;
-      valign:middle;
-    }
-
-    .info {
-      font-family:Helvetica, Arial;
-      font-size:16px;
-      text-decoration:none;
-      text-align:left;
-      padding-left:10px;
-      border-left: 3px solid #396A92;
-      background-color: #9AB4CB;
-      color:#091D42;
-      align:left;
-      padding: 1em 0em 1em 1em;
-      valign:middle;
-    }
-
-    .table-border{
-      border: 1px solid #ddd;
-      border-radius: 4px 4px 0 0;
-      box-shadow: none;
-    }
-
-    .table-border-th{
-      font-family:Helvetica, Arial;
-      font-size:14px;
-      text-decoration:none;
-      text-align:left;
-      border-top: 1px solid #cccccc;
-      border-right: 1px solid #cccccc;
-      padding: 8px;
-    }
-    .table-border-td{
-      font-family:Helvetica, Arial;
-      font-size:14px;
-      text-decoration:none;
-      text-align:left;
-      border-top: 1px solid #cccccc;
-      border-right: 1px solid #cccccc;
-      padding: 8px;
-      word-break: break-all;
-    }
-
-    .foot{
-      font-family:Arial;
-      font-size:14px;
-      text-decoration:none;
-      text-align:left;
-      padding: 0.5em 0em 0.5em 0.5em;
-      border-top: 1px solid #cccccc;
-      color:#777;
-    }
-
-  </style>
-
-  <!-- Targeting Windows Mobile -->
-  <!--[if IEMobile 7]>
-  <style type="text/css">
-
-  </style>
-  <![endif]-->
-
-  <!-- ***********************************************
-  ****************************************************
-  END MOBILE TARGETING
-  ****************************************************
-  ************************************************ -->
-
-  <!--[if gte mso 9]>
-  <style>
-    /* Target Outlook 2007 and 2010 */
-  </style>
-  <![endif]-->
+    ************************************************ -->
+
+    <!--[if gte mso 9]>
+    <style>
+        /* Target Outlook 2007 and 2010 */
+    </style>
+    <![endif]-->
 </head>
 <body>
 <!-- Wrapper/Container Table: Use a wrapper table to control the width and the background color consistently of your email. Use this approach instead of setting attributes on the body tag. -->
 <table cellpadding="0" cellspacing="0" border="0" id="backgroundTable">
-  <tr>
-    <td valign="top" style="padding-left: 10px">
+    <tr>
+        <td valign="top" style="padding-left: 10px">

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/resources/log4j.properties b/eagle-core/eagle-common/src/test/resources/log4j.properties
index 5a5709e..a9ca14f 100644
--- a/eagle-core/eagle-common/src/test/resources/log4j.properties
+++ b/eagle-core/eagle-common/src/test/resources/log4j.properties
@@ -12,16 +12,13 @@
 # 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.
-
 log4j.rootLogger=INFO, DRFA, stdout
 eagle.log.dir=./logs
 eagle.log.file=eagle.log
-
 # standard output
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n
-
 # Daily Rolling File Appender
 log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender
 log4j.appender.DRFA.File=${eagle.log.dir}/${eagle.log.file}
@@ -29,6 +26,5 @@ log4j.appender.DRFA.DatePattern=.yyyy-MM-dd
 # 30-day backup
 #log4j.appender.DRFA.MaxBackupIndex=30
 log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout
-
 # Pattern format: Date LogLevel LoggerName LogMessage
 log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/resources/templates/tec_alert.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/resources/templates/tec_alert.vm b/eagle-core/eagle-common/src/test/resources/templates/tec_alert.vm
index 2219ebf..a74dfbc 100755
--- a/eagle-core/eagle-common/src/test/resources/templates/tec_alert.vm
+++ b/eagle-core/eagle-common/src/test/resources/templates/tec_alert.vm
@@ -18,102 +18,103 @@
  *#
 #parse("header.vm")
 <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" style="">
-  <tr>
-    <td class="head" width="800">
-      <span style="color: #091D42">Eagle Service <small style="color: #999999;">$startTime ~ $endTime</small></span>
-    </td>
-  </tr>
-  <tr>
-    <td class="head2" width="800">
+    <tr>
+        <td class="head" width="800">
+            <span style="color: #091D42">Eagle Service <small style="color: #999999;">$startTime
+                ~ $endTime</small></span>
+        </td>
+    </tr>
+    <tr>
+        <td class="head2" width="800">
       <span>
         Statistics
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
-      <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
-        <thead>
-        <tr>
-          <th class="table-border-th" style="width: 25%">type</th>
-          <th class="table-border-th" style="width: 25%">count</th>
-          <th class="table-border-th" style="width: 25%">type</th>
-          <th class="table-border-th" style="width: 25%">count</th>
-        </tr>
-        </thead>
-        <tbody>
-        #foreach($key in $statistics.keySet())
-          #if( $foreach.count % 2 == 1 )
-          <tr>
-          #end
-            <td class="table-border-td">$key</td>
-            <td class="table-border-td">$statistics.get($key)</td>
-          #if( $foreach.count % 2 == 0)
-          </tr>
-          #end
-          #if( $foreach.count % 2 == 1 && !$foreach.hasNext )
-          	<td class="table-border-td"></td>
-            <td class="table-border-td"></td>
-          </tr>
-          #end
-       	#end
-        </tbody>
-      </table>
-    </td>
-  </tr>
-  <tr>
-    <td class="head2" width="800">
+        </td>
+    </tr>
+    <tr>
+        <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
+            <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
+                <thead>
+                <tr>
+                    <th class="table-border-th" style="width: 25%">type</th>
+                    <th class="table-border-th" style="width: 25%">count</th>
+                    <th class="table-border-th" style="width: 25%">type</th>
+                    <th class="table-border-th" style="width: 25%">count</th>
+                </tr>
+                </thead>
+                <tbody>
+                    #foreach($key in $statistics.keySet())
+                        #if( $foreach.count % 2 == 1 )
+                        <tr>
+                        #end
+                        <td class="table-border-td">$key</td>
+                        <td class="table-border-td">$statistics.get($key)</td>
+                        #if( $foreach.count % 2 == 0)
+                        </tr>
+                        #end
+                        #if( $foreach.count % 2 == 1 && !$foreach.hasNext )
+                        <td class="table-border-td"></td>
+                        <td class="table-border-td"></td>
+                        </tr>
+                        #end
+                    #end
+                </tbody>
+            </table>
+        </td>
+    </tr>
+    <tr>
+        <td class="head2" width="800">
       <span>
         Detail Info
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td class="info" width="800">
+        </td>
+    </tr>
+    <tr>
+        <td class="info" width="800">
       <span>
           These are the alerts that we can not find its hostname.
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
-      <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
-        <thead>
-          <tr>
-            <th class="table-border-th">hostname</th>
-            <th class="table-border-th">date_reception</th>
-            <th class="table-border-th">type</th>
-            <th class="table-border-th">origin</th>
-            <th class="table-border-th">msg</th>
-          </tr>
-        </thead>
-        <tbody>
-        #foreach($entry in $noHostnameItems)
-          <tr>
-            <td class="table-border-td">$entry.hostname</td>
-            <td class="table-border-td">$entry.date_reception</td>
-            <td class="table-border-td">$entry.type</td>
-            <td class="table-border-td">$entry.origin</td>
-            <td class="table-border-td">$entry.msg</td>
-          </tr>
-       	#end
-        </tbody>
-      </table>
-    </td>
-  </tr>
+        </td>
+    </tr>
+    <tr>
+        <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
+            <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
+                <thead>
+                <tr>
+                    <th class="table-border-th">hostname</th>
+                    <th class="table-border-th">date_reception</th>
+                    <th class="table-border-th">type</th>
+                    <th class="table-border-th">origin</th>
+                    <th class="table-border-th">msg</th>
+                </tr>
+                </thead>
+                <tbody>
+                    #foreach($entry in $noHostnameItems)
+                    <tr>
+                        <td class="table-border-td">$entry.hostname</td>
+                        <td class="table-border-td">$entry.date_reception</td>
+                        <td class="table-border-td">$entry.type</td>
+                        <td class="table-border-td">$entry.origin</td>
+                        <td class="table-border-td">$entry.msg</td>
+                    </tr>
+                    #end
+                </tbody>
+            </table>
+        </td>
+    </tr>
     <tr>
         <td>
             <img src="cid:$cid.get("chart.png")"/>
         </td>
     </tr>
-  <tr>
-    <td class="foot" width="800">
+    <tr>
+        <td class="foot" width="800">
       <span class="outlook">
          Apache Eagle <a href="http://<Eagle-Host>:9090/eagle-web/ui/eagle.html"
-                  target ="_blank" title="Hadoop Eagle">Apache Eagle</a>
+                         target="_blank" title="Hadoop Eagle">Apache Eagle</a>
       </span>
-    </td>
-  </tr>
+        </td>
+    </tr>
 </table>
 
 #parse("footer.vm")
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/resources/templates/test_anomaly_alert.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/resources/templates/test_anomaly_alert.vm b/eagle-core/eagle-common/src/test/resources/templates/test_anomaly_alert.vm
index da1f8d0..8071682 100644
--- a/eagle-core/eagle-common/src/test/resources/templates/test_anomaly_alert.vm
+++ b/eagle-core/eagle-common/src/test/resources/templates/test_anomaly_alert.vm
@@ -18,118 +18,122 @@
  *#
 #parse("header.vm")
 <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" style="">
-  <tr>
-    <td class="head" width="800">
-      <span style="color: #091D42">Eagle Job Anomaly Host Detection <small style="color: #999999;"><br>$startTime ~ $endTime</small></span>
-    </td>
-  </tr>
-  <tr>
-    <td class="head2" width="800">
+    <tr>
+        <td class="head" width="800">
+            <span style="color: #091D42">Eagle Job Anomaly Host Detection <small style="color: #999999;"><br>$startTime ~ $endTime</small></span>
+        </td>
+    </tr>
+    <tr>
+        <td class="head2" width="800">
       <span>
         Statistics
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
-      <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
-        <thead>
-        <tr>
-          <th class="table-border-th" style="width: 25%">Cluster</th>
-          <th class="table-border-th" style="width: 25%">Datacener</th>
-          <th class="table-border-th" style="width: 25%">Count</th>
-        </tr>
-        </thead>
-        <tbody>
-          <tr>
-              <td class="table-border-td">$cluster</td>
-              <td class="table-border-td">$datacenter</td>
-              <td class="table-border-td">$count</td>
-          </tr>
-        </tbody>
-      </table>
-    </td>
-  </tr>
-  <tr>
-    <td class="head2" width="800">
+        </td>
+    </tr>
+    <tr>
+        <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
+            <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
+                <thead>
+                <tr>
+                    <th class="table-border-th" style="width: 25%">Cluster</th>
+                    <th class="table-border-th" style="width: 25%">Datacener</th>
+                    <th class="table-border-th" style="width: 25%">Count</th>
+                </tr>
+                </thead>
+                <tbody>
+                <tr>
+                    <td class="table-border-td">$cluster</td>
+                    <td class="table-border-td">$datacenter</td>
+                    <td class="table-border-td">$count</td>
+                </tr>
+                </tbody>
+            </table>
+        </td>
+    </tr>
+    <tr>
+        <td class="head2" width="800">
       <span>
         Anomaly detector configurations
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
-      <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
-        <thead>
-        <tr>
-          <th class="table-border-th" style="width: 25%">Parameter Name</th>
-          <th class="table-border-th" style="width: 25%">Value</th>
-          <th class="table-border-th" style="width: 25%">Description</th>
-        </tr>
-        </thead>
-        <tbody>
-        #foreach($key in $configMap.keySet())
-        <tr>
-            <td class="table-border-td">$key</td>
-            <td class="table-border-td">$configMap.get($key)</td>
-            <td class="table-border-td">$configDescMap.get($key)</td>
-        </tr>
-       	#end
-         </tbody>
-        </table>
-      </td>
-  </tr>
-  <tr>
-    <td class="head2" width="800">
+        </td>
+    </tr>
+    <tr>
+        <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
+            <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
+                <thead>
+                <tr>
+                    <th class="table-border-th" style="width: 25%">Parameter Name</th>
+                    <th class="table-border-th" style="width: 25%">Value</th>
+                    <th class="table-border-th" style="width: 25%">Description</th>
+                </tr>
+                </thead>
+                <tbody>
+                    #foreach($key in $configMap.keySet())
+                    <tr>
+                        <td class="table-border-td">$key</td>
+                        <td class="table-border-td">$configMap.get($key)</td>
+                        <td class="table-border-td">$configDescMap.get($key)</td>
+                    </tr>
+                    #end
+                </tbody>
+            </table>
+        </td>
+    </tr>
+    <tr>
+        <td class="head2" width="800">
       <span>
         Detail Information
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td class="info" width="800">
+        </td>
+    </tr>
+    <tr>
+        <td class="info" width="800">
       <span>
           These are the anomaly hosts detected by Hadoop Eagle:
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
-      <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
-        <thead>
-          <tr>
-            <th class="table-border-th">Cluster</th>
-            <th class="table-border-th">Datacenter</th>
-            <th class="table-border-th">Hostname</th>
-            <th class="table-border-th">Description</th>
-            <th class="table-border-th">Job Types</th>
-            <th class="table-border-th">Errors</th>
-          </tr>
-        </thead>
-        <tbody>
-        #foreach($key in $anomalyHostMap.keySet())
-        <tr>
-            <td class="table-border-td">$cluster</td>
-            <td class="table-border-td">$datacenter</td>
-            <td class="table-border-td"><a href="http://123.dc1.xyz.com:9090/eagle-web/ui/AnomalyDetection.html?cluster=$cluster&datacenter=$datacenter&intervalmin=1&startTime=$startTime&endTime=$endTime&top=20">$key</a></td>
-            <td class="table-border-td">$anomalyHostMap.get($key)</td>
-            <td class="table-border-td">$jobNameMap.get($key)</td>
-            <td class="table-border-td"><a href="http://hadoop-eagle.vip.dc1.xyz.com/eagle-service/rest/list?query=TaskExecutionService[@cluster=%22$cluster%22%20AND%20@datacenter=%22$datacenter%22%20AND%20@hostname=%22$key%22%20AND%20@taskStatus=%22FAILED%22]{@error,@jobID,@taskID,@normJobName}&pageSize=1000&startTime=$startTime&endTime=$endTime">$errorMap.get($key)</a></td>
-        </tr>
-       	#end
-        </tbody>
-      </table>
-    </td>
-  </tr>
-  <br>
-  <tr>
-    <td class="foot" width="800">
+        </td>
+    </tr>
+    <tr>
+        <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
+            <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
+                <thead>
+                <tr>
+                    <th class="table-border-th">Cluster</th>
+                    <th class="table-border-th">Datacenter</th>
+                    <th class="table-border-th">Hostname</th>
+                    <th class="table-border-th">Description</th>
+                    <th class="table-border-th">Job Types</th>
+                    <th class="table-border-th">Errors</th>
+                </tr>
+                </thead>
+                <tbody>
+                    #foreach($key in $anomalyHostMap.keySet())
+                    <tr>
+                        <td class="table-border-td">$cluster</td>
+                        <td class="table-border-td">$datacenter</td>
+                        <td class="table-border-td"><a
+                                href="http://123.dc1.xyz.com:9090/eagle-web/ui/AnomalyDetection.html?cluster=$cluster&datacenter=$datacenter&intervalmin=1&startTime=$startTime&endTime=$endTime&top=20">$key</a>
+                        </td>
+                        <td class="table-border-td">$anomalyHostMap.get($key)</td>
+                        <td class="table-border-td">$jobNameMap.get($key)</td>
+                        <td class="table-border-td"><a
+                                href="http://hadoop-eagle.vip.dc1.xyz.com/eagle-service/rest/list?query=TaskExecutionService[@cluster=%22$cluster%22%20AND%20@datacenter=%22$datacenter%22%20AND%20@hostname=%22$key%22%20AND%20@taskStatus=%22FAILED%22]{@error,@jobID,@taskID,@normJobName}&pageSize=1000&startTime=$startTime&endTime=$endTime">$errorMap.get($key)</a>
+                        </td>
+                    </tr>
+                    #end
+                </tbody>
+            </table>
+        </td>
+    </tr>
+    <br>
+    <tr>
+        <td class="foot" width="800">
       <span class="outlook">
          Apache Eagle <a href="http://hadoop-eagle.vip.dc1.xyz.com"
-                  target ="_blank" title="Hadoop Eagle">Apache Eagle</a>
+                         target="_blank" title="Hadoop Eagle">Apache Eagle</a>
       </span>
-    </td>
-  </tr>
+        </td>
+    </tr>
 </table>
 <br>
 <br>



[2/3] incubator-eagle git commit: [EAGLE-724] Fix eagle-common checkstyle problem

Posted by qi...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/LdapService.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/LdapService.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/LdapService.java
index 31f1d01..eb2b0a0 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/LdapService.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/LdapService.java
@@ -29,62 +29,66 @@ import javax.naming.directory.*;
 import java.util.*;
 
 /**
+ * Ldap Service.
  * @since : 7/11/14,2014
  */
 public class LdapService {
-    private final static Logger LOG = LoggerFactory.getLogger(LdapService.class);
+    private static final Logger LOG = LoggerFactory.getLogger(LdapService.class);
 
     private final List<String> ldapSrvs;
     private String ldapCerts;
     private final String securityPrincipal;
     private final String securityCredentials;
 
-    public final static String SECURITY_PRINCIPAL_CONFIG_NAME = "eagle.ldap.security-principal";
-    public final static String SECURITY_CREDENTIALS_CONFIG_NAME = "eagle.ldap.security-credentials";
-    public final static String LDAP_SERVER_CONFIG_NAME = "eagle.ldap.server";
-    public final static String LDAP_CERTS_CONFIG_NAME = "eagle.ldap.certs";
-    public final static String DEFAULT_LDAP_CERTS_FILE_NAME = "jssecacerts";
+    public static final String SECURITY_PRINCIPAL_CONFIG_NAME = "eagle.ldap.security-principal";
+    public static final String SECURITY_CREDENTIALS_CONFIG_NAME = "eagle.ldap.security-credentials";
+    public static final String LDAP_SERVER_CONFIG_NAME = "eagle.ldap.server";
+    public static final String LDAP_CERTS_CONFIG_NAME = "eagle.ldap.certs";
+    public static final String DEFAULT_LDAP_CERTS_FILE_NAME = "jssecacerts";
 
-    private LdapService(){
+    private LdapService() {
         EagleConfig manager = EagleConfigFactory.load();
         securityPrincipal = manager.getConfig().getString(SECURITY_PRINCIPAL_CONFIG_NAME);
         securityCredentials = manager.getConfig().getString(SECURITY_CREDENTIALS_CONFIG_NAME);
         String ldapServer = manager.getConfig().getString(LDAP_SERVER_CONFIG_NAME);
-        if(LOG.isDebugEnabled())
-            LOG.debug(SECURITY_PRINCIPAL_CONFIG_NAME+":"+securityPrincipal);
-        if(securityCredentials!=null){
-            if(LOG.isDebugEnabled())
-                LOG.debug(SECURITY_CREDENTIALS_CONFIG_NAME+": (hidden for security, length: "+securityCredentials.length()+")");
-        }else{
-            LOG.warn(SECURITY_CREDENTIALS_CONFIG_NAME+":"+null);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(SECURITY_PRINCIPAL_CONFIG_NAME + ":" + securityPrincipal);
+        }
+        if (securityCredentials != null) {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug(SECURITY_CREDENTIALS_CONFIG_NAME + ": (hidden for security, length: " + securityCredentials.length() + ")");
+            }
+        } else {
+            LOG.warn(SECURITY_CREDENTIALS_CONFIG_NAME + ":" + null);
+        }
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(LDAP_SERVER_CONFIG_NAME + ":" + ldapServer);
         }
-        if(LOG.isDebugEnabled())
-            LOG.debug(LDAP_SERVER_CONFIG_NAME+":"+ldapServer);
 
         ldapSrvs = Arrays.asList(ldapServer.split(","));
         ldapCerts = manager.getConfig().getString(LDAP_CERTS_CONFIG_NAME);
-        if(ldapCerts == null) {
+        if (ldapCerts == null) {
             ldapCerts = LdapService.class.getClassLoader().getResource(DEFAULT_LDAP_CERTS_FILE_NAME).getPath();
-        }else if(!ldapCerts.startsWith("/") && !ldapCerts.matches("[a-zA-Z]+:.*")) {
+        } else if (!ldapCerts.startsWith("/") && !ldapCerts.matches("[a-zA-Z]+:.*")) {
             ldapCerts = LdapService.class.getClassLoader().getResource(ldapCerts).getPath();
         }
-        if(LOG.isDebugEnabled()) {
-            LOG.debug(SECURITY_PRINCIPAL_CONFIG_NAME +": "+securityPrincipal);
-            if(securityCredentials == null){
-                LOG.debug(SECURITY_CREDENTIALS_CONFIG_NAME +": null");
-            }else{
-                LOG.debug(SECURITY_CREDENTIALS_CONFIG_NAME +": (hidden, length: "+securityCredentials .length()+")");
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(SECURITY_PRINCIPAL_CONFIG_NAME + ": " + securityPrincipal);
+            if (securityCredentials == null) {
+                LOG.debug(SECURITY_CREDENTIALS_CONFIG_NAME + ": null");
+            } else {
+                LOG.debug(SECURITY_CREDENTIALS_CONFIG_NAME + ": (hidden, length: " + securityCredentials.length() + ")");
             }
 
-            LOG.debug(LDAP_SERVER_CONFIG_NAME +": "+ldapSrvs);
-            LOG.debug(LDAP_CERTS_CONFIG_NAME +": "+ldapCerts);
+            LOG.debug(LDAP_SERVER_CONFIG_NAME + ": " + ldapSrvs);
+            LOG.debug(LDAP_CERTS_CONFIG_NAME + ": " + ldapCerts);
         }
     }
 
     private static LdapService instance;
 
-    public static LdapService getInstance(){
-        if(instance == null){
+    public static LdapService getInstance() {
+        if (instance == null) {
             instance = new LdapService();
         }
         return instance;
@@ -99,16 +103,16 @@ public class LdapService {
         String host = ldapSrvs.get(id);
 
         Hashtable<String, String> env = new Hashtable<String, String>();
-//		if (ldapCerts != null) {
+        //if (ldapCerts != null) {
         env.put(Context.SECURITY_PROTOCOL, "ssl");
-//		}
+        //}
         env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
         env.put(Context.PROVIDER_URL, host);
         env.put(Context.SECURITY_AUTHENTICATION, "simple");
         env.put(Context.SECURITY_PRINCIPAL, securityPrincipal);
         env.put(Context.SECURITY_CREDENTIALS, securityCredentials);
         env.put("java.naming.ldap.attributes.binary", "objectSID");
-        env.put("java.naming.ldap.factory.socket","hadoop.eagle.common.service.TrustAllSSLSocketFactory");
+        env.put("java.naming.ldap.factory.socket", "hadoop.eagle.common.service.TrustAllSSLSocketFactory");
 
         DirContext ctx = null;
         try {
@@ -120,40 +124,40 @@ public class LdapService {
         return ctx;
     }
 
-    public final static String CN= "cn";
-    public final static String DISPLAY_NAME =  "displayName";
-    public final static String DESCRIPTION= "description";
-    public final static String SAMACCOUNT_NAME= "sAMAccountName";
-    public final static String TELEPHONE_NUMBER= "telephonenumber";
-    public final static String GIVEN_NAME= "givenName";
-    public final static String UID_NUMBER =  "uidNumber";
-    public final static String L = "l";
-    public final static String ST = "st";
-    public final static String CO = "co";
-    public final static String MEMBER_OF = "memberof";
-    public final static String SN =  "sn";
-    public final static String MAIL = "mail";
-    public final static String DISTINGUISHED_NAME =  "distinguishedName";
+    public static final String CN = "cn";
+    public static final String DISPLAY_NAME = "displayName";
+    public static final String DESCRIPTION = "description";
+    public static final String SAMACCOUNT_NAME = "sAMAccountName";
+    public static final String TELEPHONE_NUMBER = "telephonenumber";
+    public static final String GIVEN_NAME = "givenName";
+    public static final String UID_NUMBER = "uidNumber";
+    public static final String L = "l";
+    public static final String ST = "st";
+    public static final String CO = "co";
+    public static final String MEMBER_OF = "memberof";
+    public static final String SN = "sn";
+    public static final String MAIL = "mail";
+    public static final String DISTINGUISHED_NAME = "distinguishedName";
 
     protected SearchControls getSearchControl() {
-        SearchControls sc = new SearchControls();
 
         String[] attributeFilter = new String[15];
         attributeFilter[0] = CN;
-        attributeFilter[1] =  DISPLAY_NAME ;
+        attributeFilter[1] = DISPLAY_NAME;
         attributeFilter[2] = DESCRIPTION;
-        attributeFilter[3] =  SAMACCOUNT_NAME;
-        attributeFilter[4] =  TELEPHONE_NUMBER;
+        attributeFilter[3] = SAMACCOUNT_NAME;
+        attributeFilter[4] = TELEPHONE_NUMBER;
         attributeFilter[5] = GIVEN_NAME;
         attributeFilter[6] = UID_NUMBER;
         attributeFilter[7] = L;
         attributeFilter[8] = ST;
-        attributeFilter[9] =CO;
+        attributeFilter[9] = CO;
         attributeFilter[10] = MEMBER_OF;
         attributeFilter[11] = SN;
         attributeFilter[12] = MAIL;
         attributeFilter[13] = DISTINGUISHED_NAME;
 
+        SearchControls sc = new SearchControls();
         sc.setReturningAttributes(attributeFilter);
         sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
 
@@ -163,16 +167,21 @@ public class LdapService {
     public Map<String, String> getUserInfo(String userName) {
         Map<String, String> infos = null;
         for (int i = 0; i < ldapSrvs.size(); i++) {
-            if(LOG.isDebugEnabled()) LOG.debug("Using server: "+ldapSrvs.get(i));
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Using server: " + ldapSrvs.get(i));
+            }
             infos = getUserInfo(i, userName);
-            if (infos.size() > 0)
+            if (infos.size() > 0) {
                 break;
+            }
         }
         return infos;
     }
 
     public Map<String, String> getUserInfo(int id, String userName) {
-        if(LOG.isDebugEnabled()) LOG.debug("Ldap get user information for id:"+id+", username:"+userName);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Ldap get user information for id:" + id + ", username:" + userName);
+        }
         DirContext ctx = getDirContext(id);
         Map<String, String> infos = new HashMap<String, String>();
 
@@ -186,28 +195,31 @@ public class LdapService {
                     SearchResult sr = (SearchResult) results.next();
                     Attributes attrs = sr.getAttributes();
 
-                    for (NamingEnumeration<?> ae = attrs.getAll(); ae.hasMoreElements();) {
+                    for (NamingEnumeration<?> ae = attrs.getAll(); ae.hasMoreElements(); ) {
                         Attribute attr = (Attribute) ae.next();
                         String attrId = attr.getID();
-                        for (NamingEnumeration<?> vals = attr.getAll(); vals.hasMore();) {
+                        for (NamingEnumeration<?> vals = attr.getAll(); vals.hasMore(); ) {
                             String thing = vals.next().toString();
                             infos.put(attrId, thing);
                         }
                     }
                 }
             } catch (NamingException e) {
-                LOG.error("LDAP authentication failed with exception: "+e.getMessage(),e);
+                LOG.error("LDAP authentication failed with exception: " + e.getMessage(), e);
             }
         }
 
-        if(LOG.isDebugEnabled()) LOG.debug(infos.toString());
+        if (LOG.isDebugEnabled()) {
+            LOG.debug(infos.toString());
+        }
         return infos;
     }
 
     public boolean authenticate(String userName, String password) {
         for (int i = 0; i < ldapSrvs.size(); i++) {
-            if (authenticate(i, userName, password))
+            if (authenticate(i, userName, password)) {
                 return true;
+            }
         }
         return false;
     }
@@ -235,15 +247,15 @@ public class LdapService {
 
                 if (userDN != null) {
                     Hashtable<String, String> uenv = new Hashtable<String, String>();
-//					if (ldapCerts != null) {
+                    //if (ldapCerts != null) {
                     uenv.put(Context.SECURITY_PROTOCOL, "ssl");
-//					}
+                    //}
                     uenv.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
                     uenv.put(Context.PROVIDER_URL, ldapSrvs.get(id));
                     uenv.put(Context.SECURITY_AUTHENTICATION, "simple");
                     uenv.put(Context.SECURITY_PRINCIPAL, userDN);
                     uenv.put(Context.SECURITY_CREDENTIALS, password);
-                    uenv.put("java.naming.ldap.factory.socket","hadoop.eagle.common.service.TrustAllSSLSocketFactory");
+                    uenv.put("java.naming.ldap.factory.socket", "hadoop.eagle.common.service.TrustAllSSLSocketFactory");
                     DirContext uctx = new InitialDirContext(uenv);
                     uctx.close();
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/POSTResultEntityBase.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/POSTResultEntityBase.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/POSTResultEntityBase.java
index e0daeb7..b1a7e97 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/POSTResultEntityBase.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/POSTResultEntityBase.java
@@ -25,18 +25,22 @@ import javax.xml.bind.annotation.XmlType;
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(propOrder = {"success", "exception"})
 public class POSTResultEntityBase {
-	private boolean success;
-	private String exception;
-	public boolean isSuccess() {
-		return success;
-	}
-	public void setSuccess(boolean success) {
-		this.success = success;
-	}
-	public String getException() {
-		return exception;
-	}
-	public void setException(String exception) {
-		this.exception = exception;
-	}
+    private boolean success;
+    private String exception;
+
+    public boolean isSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+
+    public String getException() {
+        return exception;
+    }
+
+    public void setException(String exception) {
+        this.exception = exception;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/TrustAllSSLSocketFactory.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/TrustAllSSLSocketFactory.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/TrustAllSSLSocketFactory.java
index 8058b58..22b775b 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/TrustAllSSLSocketFactory.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/TrustAllSSLSocketFactory.java
@@ -34,9 +34,10 @@ public class TrustAllSSLSocketFactory extends SSLSocketFactory {
         try {
             SSLContext ctx = SSLContext.getInstance("SSL");
             //  ctx.init(null, new TrustManager[]{new TrustAnyTrustManager() {}}, new SecureRandom());
-            ctx.init(null, new TrustManager[]{new TrustAnyTrustManager() {}}, null);
+            ctx.init(null, new TrustManager[] {new TrustAnyTrustManager() {
+            }}, null);
             socketFactory = ctx.getSocketFactory();
-        } catch ( Exception ex ) {
+        } catch (Exception ex) {
             ex.printStackTrace(System.err);
             /* handle exception */
         }
@@ -83,12 +84,12 @@ public class TrustAllSSLSocketFactory extends SSLSocketFactory {
 
     private static class TrustAnyTrustManager implements X509TrustManager {
         @Override
-        public void checkClientTrusted( final X509Certificate[] chain, final String authType ) {
+        public void checkClientTrusted(final X509Certificate[] chain, final String authType) {
 
         }
 
         @Override
-        public void checkServerTrusted( final X509Certificate[] chain, final String authType ) {
+        public void checkServerTrusted(final X509Certificate[] chain, final String authType) {
 
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/resources/footer.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/resources/footer.vm b/eagle-core/eagle-common/src/main/resources/footer.vm
index 89cf245..d255988 100755
--- a/eagle-core/eagle-common/src/main/resources/footer.vm
+++ b/eagle-core/eagle-common/src/main/resources/footer.vm
@@ -16,9 +16,9 @@
  *
  * @version 0.3.0
  *#
-	</td>
-  </tr>
-  </tr>
+</td>
+</tr>
+</tr>
 </table>
 <!-- End of wrapper table -->
 </body>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/resources/header.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/resources/header.vm b/eagle-core/eagle-common/src/main/resources/header.vm
index 6731aee..922a003 100755
--- a/eagle-core/eagle-common/src/main/resources/header.vm
+++ b/eagle-core/eagle-common/src/main/resources/header.vm
@@ -19,285 +19,286 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
-  <title></title>
-  <style type="text/css">
-    /* Based on The MailChimp Reset INLINE: Yes. */
-    /* Client-specific Styles */
-    .outlook a {
-      color: #091D42;
-      padding: 0;
-      text-decoration: none;
-    }
-
-    /* Force Outlook to provide a "view in browser" menu link. */
-    body {
-      width: 100% !important;
-      -webkit-text-size-adjust: 100%;
-      -ms-text-size-adjust: 100%;
-      margin: 0;
-      padding: 0;
-    }
-
-    /* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/
-    .ExternalClass {
-      width: 100%;
-    }
-
-    /* Force Hotmail to display emails at full width */
-    .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
-      line-height: 100%;
-    }
-
-    /* Forces Hotmail to display normal line spacing.  More on that: http://www.emailonacid.com/forum/viewthread/43/ */
-    #backgroundTable {
-      margin: 0;
-      padding: 0;
-      width: 100% !important;
-      line-height: 100% !important;
-        border: 1pt solid #BFB8AF;
-        background-color: #fff;
-    }
-
-    /* End reset */
-
-    /* Some sensible defaults for images
-    Bring inline: Yes. */
-    img {
-      outline: none;
-      text-decoration: none;
-      -ms-interpolation-mode: bicubic;
-    }
-
-    a img {
-      border: none;
-    }
-
-    .image_fix {
-      display: block;
-    }
-
-    /* Yahoo paragraph fix
-    Bring inline: Yes. */
-    p {
-      margin: 1em 0;
-    }
-
-    /* Hotmail header color reset
-    Bring inline: Yes. */
-    h1, h2, h3, h4, h5, h6 {
-      color: black !important;
-    }
-
-    h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
-      color: blue !important;
-    }
-
-    h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active {
-      color: red !important; /* Preferably not the same color as the normal header link color.  There is limited support for psuedo classes in email clients, this was added just for good measure. */
-    }
-
-    h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
-      color: purple !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */
-    }
-
-    table{
-        width: 100%;
-    }
-
-    /* Outlook 07, 10 Padding issue fix
-    Bring inline: No.*/
-    table td {
-      border-collapse: collapse;
-    }
-
-    /* Remove spacing around Outlook 07, 10 tables
-    Bring inline: Yes */
-    table {
-      border-collapse: collapse;
-      mso-table-lspace: 0pt;
-      mso-table-rspace: 0pt;
-    }
-
-    /* Styling your links has become much simpler with the new Yahoo.  In fact, it falls in line with the main credo of styling in email and make sure to bring your styles inline.  Your link colors will be uniform across clients when brought inline.
-    Bring inline: Yes. */
-    a {
-      color: orange;
-    }
-
-    /***************************************************
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+    <title></title>
+    <style type="text/css">
+        /* Based on The MailChimp Reset INLINE: Yes. */
+        /* Client-specific Styles */
+        .outlook a {
+            color: #091D42;
+            padding: 0;
+            text-decoration: none;
+        }
+
+        /* Force Outlook to provide a "view in browser" menu link. */
+        body {
+            width: 100% !important;
+            -webkit-text-size-adjust: 100%;
+            -ms-text-size-adjust: 100%;
+            margin: 0;
+            padding: 0;
+        }
+
+        /* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/
+        .ExternalClass {
+            width: 100%;
+        }
+
+        /* Force Hotmail to display emails at full width */
+        .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
+            line-height: 100%;
+        }
+
+        /* Forces Hotmail to display normal line spacing.  More on that: http://www.emailonacid.com/forum/viewthread/43/ */
+        #backgroundTable {
+            margin: 0;
+            padding: 0;
+            width: 100% !important;
+            line-height: 100% !important;
+            border: 1pt solid #BFB8AF;
+            background-color: #fff;
+        }
+
+        /* End reset */
+
+        /* Some sensible defaults for images
+        Bring inline: Yes. */
+        img {
+            outline: none;
+            text-decoration: none;
+            -ms-interpolation-mode: bicubic;
+        }
+
+        a img {
+            border: none;
+        }
+
+        .image_fix {
+            display: block;
+        }
+
+        /* Yahoo paragraph fix
+        Bring inline: Yes. */
+        p {
+            margin: 1em 0;
+        }
+
+        /* Hotmail header color reset
+        Bring inline: Yes. */
+        h1, h2, h3, h4, h5, h6 {
+            color: black !important;
+        }
+
+        h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
+            color: blue !important;
+        }
+
+        h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active {
+            color: red !important; /* Preferably not the same color as the normal header link color.  There is limited support for psuedo classes in email clients, this was added just for good measure. */
+        }
+
+        h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
+            color: purple !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */
+        }
+
+        table {
+            width: 100%;
+        }
+
+        /* Outlook 07, 10 Padding issue fix
+        Bring inline: No.*/
+        table td {
+            border-collapse: collapse;
+        }
+
+        /* Remove spacing around Outlook 07, 10 tables
+        Bring inline: Yes */
+        table {
+            border-collapse: collapse;
+            mso-table-lspace: 0pt;
+            mso-table-rspace: 0pt;
+        }
+
+        /* Styling your links has become much simpler with the new Yahoo.  In fact, it falls in line with the main credo of styling in email and make sure to bring your styles inline.  Your link colors will be uniform across clients when brought inline.
+        Bring inline: Yes. */
+        a {
+            color: orange;
+        }
+
+        /***************************************************
+        ****************************************************
+        MOBILE TARGETING
+        ****************************************************
+        ***************************************************/
+        @media only screen and (max-device-width: 480px) {
+            /* Part one of controlling phone number linking for mobile. */
+            a[href^="tel"], a[href^="sms"] {
+                text-decoration: none;
+                color: blue; /* or whatever your want */
+                pointer-events: none;
+                cursor: default;
+            }
+
+            .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
+                text-decoration: default;
+                color: orange !important;
+                pointer-events: auto;
+                cursor: default;
+            }
+
+        }
+
+        /* More Specific Targeting */
+
+        @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
+            /* You guessed it, ipad (tablets, smaller screens, etc) */
+            /* repeating for the ipad */
+            a[href^="tel"], a[href^="sms"] {
+                text-decoration: none;
+                color: blue; /* or whatever your want */
+                pointer-events: none;
+                cursor: default;
+            }
+
+            .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
+                text-decoration: default;
+                color: orange !important;
+                pointer-events: auto;
+                cursor: default;
+            }
+        }
+
+        @media only screen and (-webkit-min-device-pixel-ratio: 2) {
+            /* Put your iPhone 4g styles in here */
+        }
+
+        /* Android targeting */
+        @media only screen and (-webkit-device-pixel-ratio: .75) {
+            /* Put CSS for low density (ldpi) Android layouts in here */
+        }
+
+        @media only screen and (-webkit-device-pixel-ratio: 1) {
+            /* Put CSS for medium density (mdpi) Android layouts in here */
+        }
+
+        @media only screen and (-webkit-device-pixel-ratio: 1.5) {
+            /* Put CSS for high density (hdpi) Android layouts in here */
+        }
+
+        /* end Android targeting */
+        .head {
+            font-family: Helvetica, Arial;
+            font-size: 30px;
+            text-decoration: none;
+            text-align: left;
+            color: #333;
+            align: left;
+            padding: 25px 0 15px 0;
+            valign: middle;
+            font-weight: 500;
+            border-bottom: 1px solid #cccccc;
+        }
+
+        .head2 {
+            font-family: Helvetica, Arial;
+            font-size: 24px;
+            text-decoration: none;
+            text-align: left;
+            color: #333;
+            align: left;
+            padding: 20px 0 10px 0;
+            valign: middle;
+            font-weight: 500;
+        }
+
+        .text {
+            font-family: Helvetica, Arial;
+            font-size: 14px;
+            text-decoration: none;
+            text-align: left;
+            color: #333;
+            align: left;
+            padding: 0.5em 0em 0.5em 0em;
+            valign: middle;
+        }
+
+        .info {
+            font-family: Helvetica, Arial;
+            font-size: 16px;
+            text-decoration: none;
+            text-align: left;
+            padding-left: 10px;
+            border-left: 3px solid #396A92;
+            background-color: #9AB4CB;
+            color: #091D42;
+            align: left;
+            padding: 1em 0em 1em 1em;
+            valign: middle;
+        }
+
+        .table-border {
+            border: 1px solid #ddd;
+            border-radius: 4px 4px 0 0;
+            box-shadow: none;
+        }
+
+        .table-border-th {
+            font-family: Helvetica, Arial;
+            font-size: 14px;
+            text-decoration: none;
+            text-align: left;
+            border-top: 1px solid #cccccc;
+            border-right: 1px solid #cccccc;
+            padding: 8px;
+        }
+
+        .table-border-td {
+            font-family: Helvetica, Arial;
+            font-size: 14px;
+            text-decoration: none;
+            text-align: left;
+            border-top: 1px solid #cccccc;
+            border-right: 1px solid #cccccc;
+            padding: 8px;
+            word-break: break-all;
+        }
+
+        .foot {
+            font-family: Arial;
+            font-size: 14px;
+            text-decoration: none;
+            text-align: left;
+            padding: 0.5em 0em 0.5em 0.5em;
+            border-top: 1px solid #cccccc;
+            color: #777;
+        }
+
+        /* extend by hchen9 */
+
+    </style>
+
+    <!-- Targeting Windows Mobile -->
+    <!--[if IEMobile 7]>
+    <style type="text/css">
+
+    </style>
+    <![endif]-->
+
+    <!-- ***********************************************
     ****************************************************
-    MOBILE TARGETING
+    END MOBILE TARGETING
     ****************************************************
-    ***************************************************/
-    @media only screen and (max-device-width: 480px) {
-      /* Part one of controlling phone number linking for mobile. */
-      a[href^="tel"], a[href^="sms"] {
-        text-decoration: none;
-        color: blue; /* or whatever your want */
-        pointer-events: none;
-        cursor: default;
-      }
-
-      .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
-        text-decoration: default;
-        color: orange !important;
-        pointer-events: auto;
-        cursor: default;
-      }
-
-    }
-
-    /* More Specific Targeting */
-
-    @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
-      /* You guessed it, ipad (tablets, smaller screens, etc) */
-      /* repeating for the ipad */
-      a[href^="tel"], a[href^="sms"] {
-        text-decoration: none;
-        color: blue; /* or whatever your want */
-        pointer-events: none;
-        cursor: default;
-      }
-
-      .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
-        text-decoration: default;
-        color: orange !important;
-        pointer-events: auto;
-        cursor: default;
-      }
-    }
-
-    @media only screen and (-webkit-min-device-pixel-ratio: 2) {
-      /* Put your iPhone 4g styles in here */
-    }
-
-    /* Android targeting */
-    @media only screen and (-webkit-device-pixel-ratio: .75) {
-      /* Put CSS for low density (ldpi) Android layouts in here */
-    }
-
-    @media only screen and (-webkit-device-pixel-ratio: 1) {
-      /* Put CSS for medium density (mdpi) Android layouts in here */
-    }
-
-    @media only screen and (-webkit-device-pixel-ratio: 1.5) {
-      /* Put CSS for high density (hdpi) Android layouts in here */
-    }
-
-    /* end Android targeting */
-    .head{
-      font-family:Helvetica, Arial;
-      font-size:30px;
-      text-decoration:none;
-      text-align:left;
-      color:#333;
-      align:left;
-      padding: 25px 0 15px 0;
-      valign:middle;
-      font-weight: 500;
-      border-bottom: 1px solid #cccccc;
-    }
-
-    .head2{
-      font-family:Helvetica, Arial;
-      font-size:24px;
-      text-decoration:none;
-      text-align:left;
-      color:#333;
-      align:left;
-      padding: 20px 0 10px 0;
-      valign:middle;
-      font-weight: 500;
-    }
-
-    .text{
-      font-family:Helvetica, Arial;
-      font-size:14px;
-      text-decoration:none;
-      text-align:left;
-      color:#333;
-      align:left;
-      padding: 0.5em 0em 0.5em 0em;
-      valign:middle;
-    }
-
-    .info {
-      font-family:Helvetica, Arial;
-      font-size:16px;
-      text-decoration:none;
-      text-align:left;
-      padding-left:10px;
-      border-left: 3px solid #396A92;
-      background-color: #9AB4CB;
-      color:#091D42;
-      align:left;
-      padding: 1em 0em 1em 1em;
-      valign:middle;
-    }
-
-    .table-border{
-      border: 1px solid #ddd;
-      border-radius: 4px 4px 0 0;
-      box-shadow: none;
-    }
-
-    .table-border-th{
-      font-family:Helvetica, Arial;
-      font-size:14px;
-      text-decoration:none;
-      text-align:left;
-      border-top: 1px solid #cccccc;
-      border-right: 1px solid #cccccc;
-      padding: 8px;
-    }
-    .table-border-td{
-      font-family:Helvetica, Arial;
-      font-size:14px;
-      text-decoration:none;
-      text-align:left;
-      border-top: 1px solid #cccccc;
-      border-right: 1px solid #cccccc;
-      padding: 8px;
-      word-break: break-all;
-    }
-
-    .foot{
-      font-family:Arial;
-      font-size:14px;
-      text-decoration:none;
-      text-align:left;
-      padding: 0.5em 0em 0.5em 0.5em;
-      border-top: 1px solid #cccccc;
-      color:#777;
-    }
-
-  /* extend by hchen9 */
-
-  </style>
-
-  <!-- Targeting Windows Mobile -->
-  <!--[if IEMobile 7]>
-  <style type="text/css">
-
-  </style>
-  <![endif]-->
-
-  <!-- ***********************************************
-  ****************************************************
-  END MOBILE TARGETING
-  ****************************************************
-  ************************************************ -->
-
-  <!--[if gte mso 9]>
-  <style>
-    /* Target Outlook 2007 and 2010 */
-  </style>
-  <![endif]-->
+    ************************************************ -->
+
+    <!--[if gte mso 9]>
+    <style>
+        /* Target Outlook 2007 and 2010 */
+    </style>
+    <![endif]-->
 </head>
 <body>
 <!-- Wrapper/Container Table: Use a wrapper table to control the width and the background color consistently of your email. Use this approach instead of setting attributes on the body tag. -->
 <table cellpadding="0" cellspacing="0" border="0" id="backgroundTable" width="100%">
-  <tr>
-    <td valign="top" style="padding-left: 10px">
+    <tr>
+        <td valign="top" style="padding-left: 10px">

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/resources/templates/tec_alert.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/resources/templates/tec_alert.vm b/eagle-core/eagle-common/src/main/resources/templates/tec_alert.vm
index fa3eee5..797c351 100755
--- a/eagle-core/eagle-common/src/main/resources/templates/tec_alert.vm
+++ b/eagle-core/eagle-common/src/main/resources/templates/tec_alert.vm
@@ -18,96 +18,97 @@
  *#
 #parse("header.vm")
 <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" style="">
-  <tr>
-    <td class="head" width="800">
-      <span style="color: #091D42">Eagle Service <small style="color: #999999;">$startTime ~ $endTime</small></span>
-    </td>
-  </tr>
-  <tr>
-    <td class="head2" width="800">
+    <tr>
+        <td class="head" width="800">
+            <span style="color: #091D42">Eagle Service <small style="color: #999999;">$startTime
+                ~ $endTime</small></span>
+        </td>
+    </tr>
+    <tr>
+        <td class="head2" width="800">
       <span>
         Statistics
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
-      <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
-        <thead>
-        <tr>
-          <th class="table-border-th" style="width: 25%">type</th>
-          <th class="table-border-th" style="width: 25%">count</th>
-          <th class="table-border-th" style="width: 25%">type</th>
-          <th class="table-border-th" style="width: 25%">count</th>
-        </tr>
-        </thead>
-        <tbody>
-        #foreach($key in $statistics.keySet())
-          #if( $foreach.count % 2 == 1 )
-          <tr>
-          #end
-            <td class="table-border-td">$key</td>
-            <td class="table-border-td">$statistics.get($key)</td>
-          #if( $foreach.count % 2 == 0)
-          </tr>
-          #end
-          #if( $foreach.count % 2 == 1 && !$foreach.hasNext )
-          	<td class="table-border-td"></td>
-            <td class="table-border-td"></td>
-          </tr>
-          #end
-       	#end
-        </tbody>
-      </table>
-    </td>
-  </tr>
-  <tr>
-    <td class="head2" width="800">
+        </td>
+    </tr>
+    <tr>
+        <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
+            <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
+                <thead>
+                <tr>
+                    <th class="table-border-th" style="width: 25%">type</th>
+                    <th class="table-border-th" style="width: 25%">count</th>
+                    <th class="table-border-th" style="width: 25%">type</th>
+                    <th class="table-border-th" style="width: 25%">count</th>
+                </tr>
+                </thead>
+                <tbody>
+                    #foreach($key in $statistics.keySet())
+                        #if( $foreach.count % 2 == 1 )
+                        <tr>
+                        #end
+                        <td class="table-border-td">$key</td>
+                        <td class="table-border-td">$statistics.get($key)</td>
+                        #if( $foreach.count % 2 == 0)
+                        </tr>
+                        #end
+                        #if( $foreach.count % 2 == 1 && !$foreach.hasNext )
+                        <td class="table-border-td"></td>
+                        <td class="table-border-td"></td>
+                        </tr>
+                        #end
+                    #end
+                </tbody>
+            </table>
+        </td>
+    </tr>
+    <tr>
+        <td class="head2" width="800">
       <span>
         Detail Info
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td class="info" width="800">
+        </td>
+    </tr>
+    <tr>
+        <td class="info" width="800">
       <span>
           These are the alerts that we can not find its hostname.
       </span>
-    </td>
-  </tr>
-  <tr>
-    <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
-      <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
-        <thead>
-          <tr>
-            <th class="table-border-th">hostname</th>
-            <th class="table-border-th">date_reception</th>
-            <th class="table-border-th">type</th>
-            <th class="table-border-th">origin</th>
-            <th class="table-border-th">msg</th>
-          </tr>
-        </thead>
-        <tbody>
-        #foreach($entry in $noHostnameItems)
-          <tr>
-            <td class="table-border-td">$entry.hostname</td>
-            <td class="table-border-td">$entry.date_reception</td>
-            <td class="table-border-td">$entry.type</td>
-            <td class="table-border-td">$entry.origin</td>
-            <td class="table-border-td">$entry.msg</td>
-          </tr>
-       	#end
-        </tbody>
-      </table>
-    </td>
-  </tr>
-  <tr>
-    <td class="foot" width="800">
+        </td>
+    </tr>
+    <tr>
+        <td valign="top" style="padding: 0.5em 0em 0.5em 0em;">
+            <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border">
+                <thead>
+                <tr>
+                    <th class="table-border-th">hostname</th>
+                    <th class="table-border-th">date_reception</th>
+                    <th class="table-border-th">type</th>
+                    <th class="table-border-th">origin</th>
+                    <th class="table-border-th">msg</th>
+                </tr>
+                </thead>
+                <tbody>
+                    #foreach($entry in $noHostnameItems)
+                    <tr>
+                        <td class="table-border-td">$entry.hostname</td>
+                        <td class="table-border-td">$entry.date_reception</td>
+                        <td class="table-border-td">$entry.type</td>
+                        <td class="table-border-td">$entry.origin</td>
+                        <td class="table-border-td">$entry.msg</td>
+                    </tr>
+                    #end
+                </tbody>
+            </table>
+        </td>
+    </tr>
+    <tr>
+        <td class="foot" width="800">
       <span class="outlook">
          Apache Eagle <a href="http://<Eagle-Host>:9090/eagle-web/ui/eagle.html"
-                  target ="_blank" title="Hadoop Eagle">Apache Eagle</a>
+                         target="_blank" title="Hadoop Eagle">Apache Eagle</a>
       </span>
-    </td>
-  </tr>
+        </td>
+    </tr>
 </table>
 #parse("footer.vm")
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java
index a08c3d1..ce7fc89 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java
@@ -20,92 +20,92 @@ import org.junit.Assert;
 import org.junit.Test;
 
 public class TestByteUtil {
-	
-	@Test
-	public void testLongAndBytesConversion() {
-		long origValue = 0x1234567812345678L;
-		byte[] bytes = ByteUtil.longToBytes(origValue);
-		checkNonZeros(bytes);
-		long value = ByteUtil.bytesToLong(bytes);
-		Assert.assertEquals(origValue, value);
-		bytes = new byte[16];
-		checkZeros(bytes);
-		ByteUtil.longToBytes(origValue, bytes, 4);
-		checkZeros(bytes, 0, 4);
-		checkZeros(bytes, 12, 16);
-		checkNonZeros(bytes, 4, 12);
-		value = ByteUtil.bytesToLong(bytes, 4);
-		Assert.assertEquals(origValue, value);
-	}
-	
-	@Test
-	public void testDoubleAndBytesConversion() {
-		double origValue =  (double)0x1234567812345678L;
-		byte[] bytes = ByteUtil.doubleToBytes(origValue);
-		checkNonZeros(bytes);
-		double value = ByteUtil.bytesToDouble(bytes);
-		Assert.assertEquals(origValue, value, 0.0001);
-		bytes = new byte[16];
-		checkZeros(bytes);
-		ByteUtil.doubleToBytes(origValue, bytes, 4);
-		checkZeros(bytes, 0, 4);
-		checkZeros(bytes, 12, 16);
-		checkNonZeros(bytes, 4, 12);
-		value = ByteUtil.bytesToDouble(bytes, 4);
-		Assert.assertEquals(origValue, value, 0.0001);
-	}
-	
-	@Test
-	public void testIntAndBytesConversion() {
-		int origValue = 0x12345678;
-		byte[] bytes = ByteUtil.intToBytes(origValue);
-		Assert.assertEquals(4, bytes.length);
-		Assert.assertEquals(0x12, bytes[0]);
-		Assert.assertEquals(0x34, bytes[1]);
-		Assert.assertEquals(0x56, bytes[2]);
-		Assert.assertEquals(0x78, bytes[3]);
-		checkNonZeros(bytes);
-		int value = ByteUtil.bytesToInt(bytes);
-		Assert.assertEquals(origValue, value);
-		bytes = new byte[12];
-		checkZeros(bytes);
-		ByteUtil.intToBytes(origValue, bytes, 4);
-		checkZeros(bytes, 0, 4);
-		checkZeros(bytes, 8, 12);
-		checkNonZeros(bytes, 4, 8);
-		value = ByteUtil.bytesToInt(bytes, 4);
-		Assert.assertEquals(origValue, value);
-	}
 
-	@Test
-	public void testShortAndBytesConversion() {
-		short origValue = 0x1234;
-		byte[] bytes = ByteUtil.shortToBytes(origValue);
-		Assert.assertEquals(2, bytes.length);
-		Assert.assertEquals(0x12, bytes[0]);
-		Assert.assertEquals(0x34, bytes[1]);
-		checkNonZeros(bytes);
-		short value = ByteUtil.bytesToShort(bytes);
-		Assert.assertEquals(origValue, value);
-	}
+    @Test
+    public void testLongAndBytesConversion() {
+        long origValue = 0x1234567812345678L;
+        byte[] bytes = ByteUtil.longToBytes(origValue);
+        checkNonZeros(bytes);
+        long value = ByteUtil.bytesToLong(bytes);
+        Assert.assertEquals(origValue, value);
+        bytes = new byte[16];
+        checkZeros(bytes);
+        ByteUtil.longToBytes(origValue, bytes, 4);
+        checkZeros(bytes, 0, 4);
+        checkZeros(bytes, 12, 16);
+        checkNonZeros(bytes, 4, 12);
+        value = ByteUtil.bytesToLong(bytes, 4);
+        Assert.assertEquals(origValue, value);
+    }
 
-	private void checkZeros(byte[] bytes) {
-		checkZeros(bytes, 0, bytes.length);
-	}
-	
-	private void checkZeros(byte[] bytes, int i, int j) {
-		for (int k = i; k < j; ++k) {
-			Assert.assertEquals((byte)0, bytes[k]);
-		}
-	}
+    @Test
+    public void testDoubleAndBytesConversion() {
+        double origValue = (double) 0x1234567812345678L;
+        byte[] bytes = ByteUtil.doubleToBytes(origValue);
+        checkNonZeros(bytes);
+        double value = ByteUtil.bytesToDouble(bytes);
+        Assert.assertEquals(origValue, value, 0.0001);
+        bytes = new byte[16];
+        checkZeros(bytes);
+        ByteUtil.doubleToBytes(origValue, bytes, 4);
+        checkZeros(bytes, 0, 4);
+        checkZeros(bytes, 12, 16);
+        checkNonZeros(bytes, 4, 12);
+        value = ByteUtil.bytesToDouble(bytes, 4);
+        Assert.assertEquals(origValue, value, 0.0001);
+    }
 
-	private void checkNonZeros(byte[] bytes) {
-		checkNonZeros(bytes, 0, bytes.length);
-	}
-	
-	private void checkNonZeros(byte[] bytes, int i, int j) {
-		for (int k = i; k < j; ++k) {
-			Assert.assertNotSame((byte)0, bytes[k]);
-		}
-	}
+    @Test
+    public void testIntAndBytesConversion() {
+        int origValue = 0x12345678;
+        byte[] bytes = ByteUtil.intToBytes(origValue);
+        Assert.assertEquals(4, bytes.length);
+        Assert.assertEquals(0x12, bytes[0]);
+        Assert.assertEquals(0x34, bytes[1]);
+        Assert.assertEquals(0x56, bytes[2]);
+        Assert.assertEquals(0x78, bytes[3]);
+        checkNonZeros(bytes);
+        int value = ByteUtil.bytesToInt(bytes);
+        Assert.assertEquals(origValue, value);
+        bytes = new byte[12];
+        checkZeros(bytes);
+        ByteUtil.intToBytes(origValue, bytes, 4);
+        checkZeros(bytes, 0, 4);
+        checkZeros(bytes, 8, 12);
+        checkNonZeros(bytes, 4, 8);
+        value = ByteUtil.bytesToInt(bytes, 4);
+        Assert.assertEquals(origValue, value);
+    }
+
+    @Test
+    public void testShortAndBytesConversion() {
+        short origValue = 0x1234;
+        byte[] bytes = ByteUtil.shortToBytes(origValue);
+        Assert.assertEquals(2, bytes.length);
+        Assert.assertEquals(0x12, bytes[0]);
+        Assert.assertEquals(0x34, bytes[1]);
+        checkNonZeros(bytes);
+        short value = ByteUtil.bytesToShort(bytes);
+        Assert.assertEquals(origValue, value);
+    }
+
+    private void checkZeros(byte[] bytes) {
+        checkZeros(bytes, 0, bytes.length);
+    }
+
+    private void checkZeros(byte[] bytes, int i, int j) {
+        for (int k = i; k < j; ++k) {
+            Assert.assertEquals((byte) 0, bytes[k]);
+        }
+    }
+
+    private void checkNonZeros(byte[] bytes) {
+        checkNonZeros(bytes, 0, bytes.length);
+    }
+
+    private void checkNonZeros(byte[] bytes, int i, int j) {
+        for (int k = i; k < j; ++k) {
+            Assert.assertNotSame((byte) 0, bytes[k]);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java
index 3642635..91389d6 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java
@@ -21,54 +21,54 @@ import org.junit.Test;
 
 public class TestCircularArrayList {
 
-	@Test
-	public void testAddAndRemove() {
-		Long[] array = new Long[5];
-		CircularArrayList<Long> list = new CircularArrayList<Long>(array);
-		
-		for (long i = 0 ; i < 5; ++i) {
-			list.add(i);
-			Assert.assertEquals((Long)i, array[(int) i]);
-			Assert.assertTrue(list.contains(i));
-			Assert.assertEquals(i, list.find(i));
-		}
-		Assert.assertFalse(list.contains(6L));
-		Exception e = null;
-		try {
-			list.add((long)5);
-		} catch (Exception ex) {
-			e = ex;
-		}
-		Assert.assertNotNull(e);
-		Assert.assertEquals(0, list.tail());
-		Assert.assertEquals(0, list.head());
-		Assert.assertEquals(5, list.size());
-		Assert.assertTrue(list.isFull());
-		Long v = list.remove(1);
-		Assert.assertEquals((Long)1L, v);
-		Assert.assertEquals(4, list.size());
-		Assert.assertEquals(1, list.head());
-		Assert.assertEquals(0, list.tail());
-		list.add((long)5);
-		Assert.assertEquals(5, list.size());
-		Assert.assertEquals(1, list.head());
-		Assert.assertEquals(1, list.tail());
-		Assert.assertEquals((Long)0L, list.remove(0));
-		Assert.assertEquals(2, list.head());
-		Assert.assertEquals(1, list.tail());
-		Assert.assertEquals((Long)2L, list.remove(0));
-		Assert.assertEquals(3, list.head());
-		Assert.assertEquals(1, list.tail());
-		Assert.assertEquals((Long)3L, list.remove(0));
-		Assert.assertEquals(4, list.head());
-		Assert.assertEquals(1, list.tail());
-		Assert.assertEquals((Long)4L, list.remove(0));
-		Assert.assertEquals(0, list.head());
-		Assert.assertEquals(1, list.tail());
-		Assert.assertEquals((Long)5L, list.remove(0));
-		Assert.assertEquals(1, list.head());
-		Assert.assertEquals(1, list.tail());
-		Assert.assertTrue(list.isEmpty());
-		Assert.assertFalse(list.isFull());
-	}
+    @Test
+    public void testAddAndRemove() {
+        Long[] array = new Long[5];
+        CircularArrayList<Long> list = new CircularArrayList<Long>(array);
+
+        for (long i = 0; i < 5; ++i) {
+            list.add(i);
+            Assert.assertEquals((Long) i, array[(int) i]);
+            Assert.assertTrue(list.contains(i));
+            Assert.assertEquals(i, list.find(i));
+        }
+        Assert.assertFalse(list.contains(6L));
+        Exception e = null;
+        try {
+            list.add((long) 5);
+        } catch (Exception ex) {
+            e = ex;
+        }
+        Assert.assertNotNull(e);
+        Assert.assertEquals(0, list.tail());
+        Assert.assertEquals(0, list.head());
+        Assert.assertEquals(5, list.size());
+        Assert.assertTrue(list.isFull());
+        Long v = list.remove(1);
+        Assert.assertEquals((Long) 1L, v);
+        Assert.assertEquals(4, list.size());
+        Assert.assertEquals(1, list.head());
+        Assert.assertEquals(0, list.tail());
+        list.add((long) 5);
+        Assert.assertEquals(5, list.size());
+        Assert.assertEquals(1, list.head());
+        Assert.assertEquals(1, list.tail());
+        Assert.assertEquals((Long) 0L, list.remove(0));
+        Assert.assertEquals(2, list.head());
+        Assert.assertEquals(1, list.tail());
+        Assert.assertEquals((Long) 2L, list.remove(0));
+        Assert.assertEquals(3, list.head());
+        Assert.assertEquals(1, list.tail());
+        Assert.assertEquals((Long) 3L, list.remove(0));
+        Assert.assertEquals(4, list.head());
+        Assert.assertEquals(1, list.tail());
+        Assert.assertEquals((Long) 4L, list.remove(0));
+        Assert.assertEquals(0, list.head());
+        Assert.assertEquals(1, list.tail());
+        Assert.assertEquals((Long) 5L, list.remove(0));
+        Assert.assertEquals(1, list.head());
+        Assert.assertEquals(1, list.tail());
+        Assert.assertTrue(list.isEmpty());
+        Assert.assertFalse(list.isFull());
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java
index e4fbb18..aab5d6f 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java
@@ -21,38 +21,38 @@ import org.junit.Test;
 
 public class TestCircularArrayListSortedSet {
 
-	@Test
-	public void testInsertAndRemove() {
-		Long[] array = new Long[5];
-		CircularArrayListSortedSet<Long> set = new CircularArrayListSortedSet<Long>(array);
-		
-		set.insert(3L);
-		set.insert(2L);
-		set.insert(1L);
-		set.insert(5L);
-		set.insert(4L);
-		
-		for (int i = 0; i < 5; ++i) {
-			Assert.assertEquals((Long)(long)(i + 1),set.get(i));
-			Assert.assertEquals(i, set.binarySearch((Long)(long)(i + 1)));
-		}
-		Assert.assertEquals(0, set.head());
-		Assert.assertEquals(0, set.tail());
-		Assert.assertTrue(set.isFull());
-		Assert.assertEquals(-(5 + 1), set.binarySearch(6L));
-		
-		Assert.assertEquals(2, set.remove(3L));
-		Assert.assertEquals(2, set.remove(4L));
-		Assert.assertEquals(-(2 + 1), set.binarySearch(3L));
-		set.insert(3L);
-		set.insert(4L);
-		
-		for (int i = 0; i < 5; ++i) {
-			Assert.assertEquals((Long)(long)(i + 1),set.get(i));
-			Assert.assertEquals(i, set.binarySearch((Long)(long)(i + 1)));
-		}
-		Assert.assertEquals(2, set.head());
-		Assert.assertEquals(2, set.tail());
-		Assert.assertTrue(set.isFull());
-	}
+    @Test
+    public void testInsertAndRemove() {
+        Long[] array = new Long[5];
+        CircularArrayListSortedSet<Long> set = new CircularArrayListSortedSet<Long>(array);
+
+        set.insert(3L);
+        set.insert(2L);
+        set.insert(1L);
+        set.insert(5L);
+        set.insert(4L);
+
+        for (int i = 0; i < 5; ++i) {
+            Assert.assertEquals((Long) (long) (i + 1), set.get(i));
+            Assert.assertEquals(i, set.binarySearch((Long) (long) (i + 1)));
+        }
+        Assert.assertEquals(0, set.head());
+        Assert.assertEquals(0, set.tail());
+        Assert.assertTrue(set.isFull());
+        Assert.assertEquals(-(5 + 1), set.binarySearch(6L));
+
+        Assert.assertEquals(2, set.remove(3L));
+        Assert.assertEquals(2, set.remove(4L));
+        Assert.assertEquals(-(2 + 1), set.binarySearch(3L));
+        set.insert(3L);
+        set.insert(4L);
+
+        for (int i = 0; i < 5; ++i) {
+            Assert.assertEquals((Long) (long) (i + 1), set.get(i));
+            Assert.assertEquals(i, set.binarySearch((Long) (long) (i + 1)));
+        }
+        Assert.assertEquals(2, set.head());
+        Assert.assertEquals(2, set.tail());
+        Assert.assertTrue(set.isFull());
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java
index 062d44a..a008723 100755
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java
@@ -16,72 +16,72 @@
  */
 package org.apache.eagle.common;
 
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
 public class TestDateTimeUtil {
-	@Test
-	public void testRound1(){
-		long tsInMS = 1397016731576L;
-		long tsInMin = DateTimeUtil.roundDown(Calendar.MINUTE, tsInMS);
-		Assert.assertEquals(1397016720000L, tsInMin);
-		
-		GregorianCalendar cal = new GregorianCalendar();
-		cal.setTimeInMillis(tsInMS);
-		cal.set(Calendar.SECOND, 0);
-		cal.set(Calendar.MILLISECOND, 0);
-		Assert.assertEquals(tsInMin, cal.getTimeInMillis());
-	}
-	
-	@Test
-	public void testRound2(){
-		long tsInMS = 1397016731576L;
-		long tsInHour = DateTimeUtil.roundDown(Calendar.HOUR, tsInMS);
-		Assert.assertEquals(1397016000000L, tsInHour);
-		
-		GregorianCalendar cal = new GregorianCalendar();
-		cal.setTimeInMillis(tsInMS);
-		cal.set(Calendar.MINUTE, 0);
-		cal.set(Calendar.SECOND, 0);
-		cal.set(Calendar.MILLISECOND, 0);
-		Assert.assertEquals(tsInHour, cal.getTimeInMillis());
-	}
-	
-	@Test
-	public void testRound3(){
-		long tsInMS = 1L;
-		long tsInDay = DateTimeUtil.roundDown(Calendar.DATE, tsInMS);
-		Assert.assertEquals(0L, tsInDay);
+    @Test
+    public void testRound1() {
+        long tsInMS = 1397016731576L;
+        long tsInMin = DateTimeUtil.roundDown(Calendar.MINUTE, tsInMS);
+        Assert.assertEquals(1397016720000L, tsInMin);
+
+        GregorianCalendar cal = new GregorianCalendar();
+        cal.setTimeInMillis(tsInMS);
+        cal.set(Calendar.SECOND, 0);
+        cal.set(Calendar.MILLISECOND, 0);
+        Assert.assertEquals(tsInMin, cal.getTimeInMillis());
+    }
+
+    @Test
+    public void testRound2() {
+        long tsInMS = 1397016731576L;
+        long tsInHour = DateTimeUtil.roundDown(Calendar.HOUR, tsInMS);
+        Assert.assertEquals(1397016000000L, tsInHour);
+
+        GregorianCalendar cal = new GregorianCalendar();
+        cal.setTimeInMillis(tsInMS);
+        cal.set(Calendar.MINUTE, 0);
+        cal.set(Calendar.SECOND, 0);
+        cal.set(Calendar.MILLISECOND, 0);
+        Assert.assertEquals(tsInHour, cal.getTimeInMillis());
+    }
+
+    @Test
+    public void testRound3() {
+        long tsInMS = 1L;
+        long tsInDay = DateTimeUtil.roundDown(Calendar.DATE, tsInMS);
+        Assert.assertEquals(0L, tsInDay);
 //		Assert.assertEquals("1970-01-01 08:00:00", DateTimeUtil.millisecondsToHumanDateWithSeconds(tsInDay));
-	}
-	
-	@Test
-	public void testRound4(){
-		long tsInMS = 0L;
-		long tsInDay = DateTimeUtil.roundDown(Calendar.DATE, tsInMS);
-		Assert.assertEquals(0L, tsInDay);
-		String str = DateTimeUtil.millisecondsToHumanDateWithSeconds(tsInMS);
-		System.out.println(str);
-	}
-	
-	@Test
-	public void testRound5(){
-		long tsInMS = 8*3600*1000L;
-		long tsInDay = DateTimeUtil.roundDown(Calendar.DATE, tsInMS);
-		Assert.assertEquals(0L, tsInDay);
-		String str = DateTimeUtil.millisecondsToHumanDateWithSeconds(tsInDay);
-		System.out.println(str);
-	}
-	
-	@Test
-	public void testDayOfWeek() {
-		GregorianCalendar cal = new GregorianCalendar();
-		long tsInMS = 0L;
-		cal.setTimeInMillis(tsInMS);
-		//cal.setTimeInMillis(System.currentTimeMillis());
-		System.out.println(cal.get(Calendar.DAY_OF_WEEK));
-	}
+    }
+
+    @Test
+    public void testRound4() {
+        long tsInMS = 0L;
+        long tsInDay = DateTimeUtil.roundDown(Calendar.DATE, tsInMS);
+        Assert.assertEquals(0L, tsInDay);
+        String str = DateTimeUtil.millisecondsToHumanDateWithSeconds(tsInMS);
+        System.out.println(str);
+    }
+
+    @Test
+    public void testRound5() {
+        long tsInMS = 8 * 3600 * 1000L;
+        long tsInDay = DateTimeUtil.roundDown(Calendar.DATE, tsInMS);
+        Assert.assertEquals(0L, tsInDay);
+        String str = DateTimeUtil.millisecondsToHumanDateWithSeconds(tsInDay);
+        System.out.println(str);
+    }
+
+    @Test
+    public void testDayOfWeek() {
+        GregorianCalendar cal = new GregorianCalendar();
+        long tsInMS = 0L;
+        cal.setTimeInMillis(tsInMS);
+        //cal.setTimeInMillis(System.currentTimeMillis());
+        System.out.println(cal.get(Calendar.DAY_OF_WEEK));
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java
index 384c274..40e0e5b 100755
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java
@@ -19,20 +19,20 @@ package org.apache.eagle.common;
 import org.junit.Test;
 
 public class TestEagleBase64Wrapper {
-	@Test
-	public void test(){
-		byte[] b = EagleBase64Wrapper.decode("BgVz-6vkdM8AAbGAf__-trtos5aqSGPod4Q1GwA268vF50iNBgmpmAxLXKkGbxkREWcmOzT3YIx3hDUb");
-		byte[] c = EagleBase64Wrapper.decode("BgVz-6vkdM8AAbGAf__-trtos5aqSGPod4Q1G6pLeJcAATVuADbry8XnSI0GCamYDEtcqQZvGRERZyY7NPdgjHeENRs");
-		
-		System.out.println(new String(b));
-		System.out.println(new String(c));
-		
-		int hash = "jobType".hashCode();
-		byte b1 = (byte)((hash >> 24) & 0xff);
-		byte b2 = (byte)(((hash << 8) >> 24) & 0xff);
-		byte b3 = (byte)(((hash << 16) >> 24) & 0xff);
-		byte b4 = (byte)(((hash << 24) >> 24) & 0xff);
-		
-		System.out.println(b1 + "," + b2 + "," + b3 + "," + b4);
-	}
+    @Test
+    public void test() {
+        byte[] b = EagleBase64Wrapper.decode("BgVz-6vkdM8AAbGAf__-trtos5aqSGPod4Q1GwA268vF50iNBgmpmAxLXKkGbxkREWcmOzT3YIx3hDUb");
+        byte[] c = EagleBase64Wrapper.decode("BgVz-6vkdM8AAbGAf__-trtos5aqSGPod4Q1G6pLeJcAATVuADbry8XnSI0GCamYDEtcqQZvGRERZyY7NPdgjHeENRs");
+
+        System.out.println(new String(b));
+        System.out.println(new String(c));
+
+        int hash = "jobType".hashCode();
+        byte b1 = (byte) ((hash >> 24) & 0xff);
+        byte b2 = (byte) (((hash << 8) >> 24) & 0xff);
+        byte b3 = (byte) (((hash << 16) >> 24) & 0xff);
+        byte b4 = (byte) (((hash << 24) >> 24) & 0xff);
+
+        System.out.println(b1 + "," + b2 + "," + b3 + "," + b4);
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSerializableUtils.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSerializableUtils.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSerializableUtils.java
index 4404258..0016086 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSerializableUtils.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSerializableUtils.java
@@ -23,27 +23,28 @@ import java.io.Serializable;
 
 public class TestSerializableUtils {
     @Test
-    public void testSerializeObject(){
+    public void testSerializeObject() {
         SerializableUtils.ensureSerializable(0.5);
         byte[] bytes = SerializableUtils.serializeToByteArray(0.5);
         Assert.assertNotNull(bytes);
-        Assert.assertEquals(0.5,SerializableUtils.deserializeFromByteArray(bytes,"0.5"));
+        Assert.assertEquals(0.5, SerializableUtils.deserializeFromByteArray(bytes, "0.5"));
     }
+
     @Test
-    public void testSerializeObjectWithCompression(){
+    public void testSerializeObjectWithCompression() {
         SerializableUtils.ensureSerializable(0.5);
         byte[] bytes = SerializableUtils.serializeToCompressedByteArray(0.5);
         Assert.assertNotNull(bytes);
-        Assert.assertEquals(0.5,SerializableUtils.deserializeFromCompressedByteArray(bytes,"0.5"));
+        Assert.assertEquals(0.5, SerializableUtils.deserializeFromCompressedByteArray(bytes, "0.5"));
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testUnserializableObject(){
+    public void testUnserializableObject() {
         SerializableUtils.serializeToByteArray(new Object());
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testEnsureUnserializableObject(){
+    public void testEnsureUnserializableObject() {
         SerializableUtils.ensureSerializable(new UnserializablePOJO());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSiddhiAggregator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSiddhiAggregator.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSiddhiAggregator.java
index 86d6016..d12ff87 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSiddhiAggregator.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/TestSiddhiAggregator.java
@@ -31,10 +31,10 @@ import java.util.concurrent.atomic.AtomicInteger;
  */
 public class TestSiddhiAggregator {
     @Test
-    public void testSiddhi() throws Exception{
+    public void testSiddhi() throws Exception {
         String ql = "define stream s (host string, timestamp long, metric string, site string, value double);" +
-                " @info(name='query') " +
-                " from s[metric == \"missingblocks\"]#window.externalTimeBatch(timestamp, 1 min, 0) select host, count(value) as avg group by host insert into tmp; ";
+            " @info(name='query') " +
+            " from s[metric == \"missingblocks\"]#window.externalTimeBatch(timestamp, 1 min, 0) select host, count(value) as avg group by host insert into tmp; ";
         SiddhiManager sm = new SiddhiManager();
         ExecutionPlanRuntime runtime = sm.createExecutionPlanRuntime(ql);
 
@@ -43,30 +43,30 @@ public class TestSiddhiAggregator {
         AtomicInteger index = new AtomicInteger(0);
 
         runtime.addCallback("query", new QueryCallback() {
-                @Override
-                public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                    printEvents(inEvents);
-                    if(index.get() == 0){
-                        Assert.assertEquals(3, inEvents.length);
-                        Assert.assertEquals("host1", inEvents[0].getData()[0]);
-                        Assert.assertEquals(3L, inEvents[0].getData()[1]);
-                        Assert.assertEquals("host2", inEvents[1].getData()[0]);
-                        Assert.assertEquals(4L, inEvents[1].getData()[1]);
-                        Assert.assertEquals("host3", inEvents[2].getData()[0]);
-                        Assert.assertEquals(2L, inEvents[2].getData()[1]);
-                        index.incrementAndGet();
-                    }else if(index.get() == 1){
-                        Assert.assertEquals(3, inEvents.length);
-                        Assert.assertEquals("host1", inEvents[0].getData()[0]);
-                        Assert.assertEquals(1L, inEvents[0].getData()[1]);
-                        Assert.assertEquals("host2", inEvents[1].getData()[0]);
-                        Assert.assertEquals(2L, inEvents[1].getData()[1]);
-                        Assert.assertEquals("host3", inEvents[2].getData()[0]);
-                        Assert.assertEquals(2L, inEvents[2].getData()[1]);
-                        index.incrementAndGet();
-                    }
+            @Override
+            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
+                printEvents(inEvents);
+                if (index.get() == 0) {
+                    Assert.assertEquals(3, inEvents.length);
+                    Assert.assertEquals("host1", inEvents[0].getData()[0]);
+                    Assert.assertEquals(3L, inEvents[0].getData()[1]);
+                    Assert.assertEquals("host2", inEvents[1].getData()[0]);
+                    Assert.assertEquals(4L, inEvents[1].getData()[1]);
+                    Assert.assertEquals("host3", inEvents[2].getData()[0]);
+                    Assert.assertEquals(2L, inEvents[2].getData()[1]);
+                    index.incrementAndGet();
+                } else if (index.get() == 1) {
+                    Assert.assertEquals(3, inEvents.length);
+                    Assert.assertEquals("host1", inEvents[0].getData()[0]);
+                    Assert.assertEquals(1L, inEvents[0].getData()[1]);
+                    Assert.assertEquals("host2", inEvents[1].getData()[0]);
+                    Assert.assertEquals(2L, inEvents[1].getData()[1]);
+                    Assert.assertEquals("host3", inEvents[2].getData()[0]);
+                    Assert.assertEquals(2L, inEvents[2].getData()[1]);
+                    index.incrementAndGet();
                 }
-            });
+            }
+        });
         runtime.start();
 
         sendEvents(3, 4, 2, input, 1000L);
@@ -78,34 +78,35 @@ public class TestSiddhiAggregator {
         Thread.sleep(1000);
     }
 
-    void sendEvents(int countHost1, int countHost2, int countHost3, InputHandler input, long startTime) throws Exception{
-        for(int i=0; i<countHost1; i++){
-            Event e = createEvent("host1", startTime + i*100);
+    void sendEvents(int countHost1, int countHost2, int countHost3, InputHandler input, long startTime) throws Exception {
+        for (int i = 0; i < countHost1; i++) {
+            Event e = createEvent("host1", startTime + i * 100);
             input.send(e);
         }
         startTime += 2000;
-        for(int i=0; i<countHost2; i++){
-            Event e = createEvent("host2", startTime + i*100);
+        for (int i = 0; i < countHost2; i++) {
+            Event e = createEvent("host2", startTime + i * 100);
             input.send(e);
         }
         startTime += 4000;
-       for(int i=0; i<countHost3; i++){
-            Event e = createEvent("host3", startTime + i*100);
+        for (int i = 0; i < countHost3; i++) {
+            Event e = createEvent("host3", startTime + i * 100);
             input.send(e);
         }
     }
 
-    void printEvents(Event[] inEvents){
-        for(Event e : inEvents) {
+    void printEvents(Event[] inEvents) {
+        for (Event e : inEvents) {
             System.out.print(e);
             System.out.print(",");
         }
         System.out.println();
     }
-    Event createEvent(String host, long timestamp){
+
+    Event createEvent(String host, long timestamp) {
         Event e = new Event();
         e.setTimestamp(timestamp);
-        e.setData(new Object[]{host, timestamp, "missingblocks", "site1", 14.0});
+        e.setData(new Object[] {host, timestamp, "missingblocks", "site1", 14.0});
         return e;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiAggregator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiAggregator.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiAggregator.java
index 75b50ea..b8a6d3b 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiAggregator.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiAggregator.java
@@ -30,7 +30,7 @@ import java.util.List;
  */
 public class TestSiddhiAggregator {
     @Test
-    public void test() throws Exception{
+    public void test() throws Exception {
         TimeBatchWindowSpec spec = new TimeBatchWindowSpec();
         Agg agg = new Agg();
         agg.field = "value";
@@ -76,18 +76,18 @@ public class TestSiddhiAggregator {
             }
         });
 
-        aggregator.add(new Object[]{"host1", 1000L, "missingblocks", "site1", 10.0});
-        aggregator.add(new Object[]{"host2", 2000L, "missingblocks", "site1", 16.0});
-        aggregator.add(new Object[]{"host3", 2000L, "missingblocks", "site1", 11.0});
-        aggregator.add(new Object[]{"host1", 21000L, "missingblocks", "site1", 20.0});
+        aggregator.add(new Object[] {"host1", 1000L, "missingblocks", "site1", 10.0});
+        aggregator.add(new Object[] {"host2", 2000L, "missingblocks", "site1", 16.0});
+        aggregator.add(new Object[] {"host3", 2000L, "missingblocks", "site1", 11.0});
+        aggregator.add(new Object[] {"host1", 21000L, "missingblocks", "site1", 20.0});
 
-        aggregator.add(new Object[]{"host1", 61000L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host2", 61500L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host3", 62000L, "missingblocks", "site1", 13.0});
-        aggregator.add(new Object[]{"host2", 63500L, "missingblocks", "site1", 19.0});
+        aggregator.add(new Object[] {"host1", 61000L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host2", 61500L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host3", 62000L, "missingblocks", "site1", 13.0});
+        aggregator.add(new Object[] {"host2", 63500L, "missingblocks", "site1", 19.0});
 
-        aggregator.add(new Object[]{"host1", 121000L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host2", 121000L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host3", 122000L, "missingblocks", "site1", 13.0});
+        aggregator.add(new Object[] {"host1", 121000L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host2", 121000L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host3", 122000L, "missingblocks", "site1", 13.0});
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiExternalTimeBatch.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiExternalTimeBatch.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiExternalTimeBatch.java
index d664ab3..6d03c70 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiExternalTimeBatch.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestSiddhiExternalTimeBatch.java
@@ -25,8 +25,6 @@ import org.wso2.siddhi.core.SiddhiManager;
 import org.wso2.siddhi.core.event.Event;
 import org.wso2.siddhi.core.query.output.callback.QueryCallback;
 import org.wso2.siddhi.core.stream.input.InputHandler;
-import org.wso2.siddhi.core.stream.output.StreamCallback;
-import org.wso2.siddhi.core.util.EventPrinter;
 
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -35,10 +33,10 @@ import java.util.concurrent.atomic.AtomicInteger;
  */
 public class TestSiddhiExternalTimeBatch {
     @Test
-    public void testSiddhi() throws Exception{
+    public void testSiddhi() throws Exception {
         String ql = "define stream s (host string, timestamp long, metric string, site string, value double);" +
-                " @info(name='query') " +
-                " from s[metric == \"missingblocks\"]#window.externalTimeBatch(timestamp, 1 min, 0) select host, count(value) as avg group by host insert into tmp; ";
+            " @info(name='query') " +
+            " from s[metric == \"missingblocks\"]#window.externalTimeBatch(timestamp, 1 min, 0) select host, count(value) as avg group by host insert into tmp; ";
         System.out.println("query: " + ql);
         SiddhiManager sm = new SiddhiManager();
         ExecutionPlanRuntime runtime = sm.createExecutionPlanRuntime(ql);
@@ -48,30 +46,30 @@ public class TestSiddhiExternalTimeBatch {
         AtomicInteger index = new AtomicInteger(0);
 
         runtime.addCallback("query", new QueryCallback() {
-                @Override
-                public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
-                    printEvents(inEvents);
-                    if(index.get() == 0){
-                        Assert.assertEquals(3, inEvents.length);
-                        Assert.assertEquals("host1", inEvents[0].getData()[0]);
-                        Assert.assertEquals(3L, inEvents[0].getData()[1]);
-                        Assert.assertEquals("host2", inEvents[1].getData()[0]);
-                        Assert.assertEquals(4L, inEvents[1].getData()[1]);
-                        Assert.assertEquals("host3", inEvents[2].getData()[0]);
-                        Assert.assertEquals(2L, inEvents[2].getData()[1]);
-                        index.incrementAndGet();
-                    }else if(index.get() == 1){
-                        Assert.assertEquals(3, inEvents.length);
-                        Assert.assertEquals("host1", inEvents[0].getData()[0]);
-                        Assert.assertEquals(1L, inEvents[0].getData()[1]);
-                        Assert.assertEquals("host2", inEvents[1].getData()[0]);
-                        Assert.assertEquals(2L, inEvents[1].getData()[1]);
-                        Assert.assertEquals("host3", inEvents[2].getData()[0]);
-                        Assert.assertEquals(2L, inEvents[2].getData()[1]);
-                        index.incrementAndGet();
-                    }
+            @Override
+            public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
+                printEvents(inEvents);
+                if (index.get() == 0) {
+                    Assert.assertEquals(3, inEvents.length);
+                    Assert.assertEquals("host1", inEvents[0].getData()[0]);
+                    Assert.assertEquals(3L, inEvents[0].getData()[1]);
+                    Assert.assertEquals("host2", inEvents[1].getData()[0]);
+                    Assert.assertEquals(4L, inEvents[1].getData()[1]);
+                    Assert.assertEquals("host3", inEvents[2].getData()[0]);
+                    Assert.assertEquals(2L, inEvents[2].getData()[1]);
+                    index.incrementAndGet();
+                } else if (index.get() == 1) {
+                    Assert.assertEquals(3, inEvents.length);
+                    Assert.assertEquals("host1", inEvents[0].getData()[0]);
+                    Assert.assertEquals(1L, inEvents[0].getData()[1]);
+                    Assert.assertEquals("host2", inEvents[1].getData()[0]);
+                    Assert.assertEquals(2L, inEvents[1].getData()[1]);
+                    Assert.assertEquals("host3", inEvents[2].getData()[0]);
+                    Assert.assertEquals(2L, inEvents[2].getData()[1]);
+                    index.incrementAndGet();
                 }
-            });
+            }
+        });
         runtime.start();
 
         sendEvents(3, 4, 2, input, 1000L);
@@ -83,34 +81,35 @@ public class TestSiddhiExternalTimeBatch {
         Thread.sleep(1000);
     }
 
-    void sendEvents(int countHost1, int countHost2, int countHost3, InputHandler input, long startTime) throws Exception{
-        for(int i=0; i<countHost1; i++){
-            Event e = createEvent("host1", startTime + i*100);
+    void sendEvents(int countHost1, int countHost2, int countHost3, InputHandler input, long startTime) throws Exception {
+        for (int i = 0; i < countHost1; i++) {
+            Event e = createEvent("host1", startTime + i * 100);
             input.send(e);
         }
         startTime += 2000;
-        for(int i=0; i<countHost2; i++){
-            Event e = createEvent("host2", startTime + i*100);
+        for (int i = 0; i < countHost2; i++) {
+            Event e = createEvent("host2", startTime + i * 100);
             input.send(e);
         }
         startTime += 4000;
-       for(int i=0; i<countHost3; i++){
-            Event e = createEvent("host3", startTime + i*100);
+        for (int i = 0; i < countHost3; i++) {
+            Event e = createEvent("host3", startTime + i * 100);
             input.send(e);
         }
     }
 
-    void printEvents(Event[] inEvents){
-        for(Event e : inEvents) {
+    void printEvents(Event[] inEvents) {
+        for (Event e : inEvents) {
             System.out.print(e);
             System.out.print(",");
         }
         System.out.println();
     }
-    Event createEvent(String host, long timestamp){
+
+    Event createEvent(String host, long timestamp) {
         Event e = new Event();
         e.setTimestamp(timestamp);
-        e.setData(new Object[]{host, timestamp, "missingblocks", "site1", 14.0});
+        e.setData(new Object[] {host, timestamp, "missingblocks", "site1", 14.0});
         return e;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestStreamAggregator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestStreamAggregator.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestStreamAggregator.java
index 76b2264..b298823 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestStreamAggregator.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/agg/TestStreamAggregator.java
@@ -28,38 +28,38 @@ import java.util.List;
  */
 public class TestStreamAggregator {
     @Test
-    public void test() throws Exception{
+    public void test() throws Exception {
         SiddhiAggregator aggregator = StreamAggregator.builder()
-                .columnDef("host", "string")
-                .columnDef("timestamp", "long")
-                .columnDef("metric", "string")
-                .columnDef("site", "string")
-                .columnDef("value", "double")
-                .filter("metric==\"missingblocks\"")
-                .groupby("host")
-                .agg("avg", "value", "avg")
-                .timeColumn("timestamp")
-                .window("1 min", 0)
-                .aggregateHandler(new AggregateHandler() {
-                    @Override
-                    public void onAggregate(List<AggregateResult> result) {
-                        System.out.println(result);
-                    }
-                })
-                .build();
+            .columnDef("host", "string")
+            .columnDef("timestamp", "long")
+            .columnDef("metric", "string")
+            .columnDef("site", "string")
+            .columnDef("value", "double")
+            .filter("metric==\"missingblocks\"")
+            .groupby("host")
+            .agg("avg", "value", "avg")
+            .timeColumn("timestamp")
+            .window("1 min", 0)
+            .aggregateHandler(new AggregateHandler() {
+                @Override
+                public void onAggregate(List<AggregateResult> result) {
+                    System.out.println(result);
+                }
+            })
+            .build();
 
-        aggregator.add(new Object[]{"host1", 1000L, "missingblocks", "site1", 10.0});
-        aggregator.add(new Object[]{"host2", 2000L, "missingblocks", "site1", 16.0});
-        aggregator.add(new Object[]{"host3", 2000L, "missingblocks", "site1", 11.0});
-        aggregator.add(new Object[]{"host1", 21000L, "missingblocks", "site1", 20.0});
+        aggregator.add(new Object[] {"host1", 1000L, "missingblocks", "site1", 10.0});
+        aggregator.add(new Object[] {"host2", 2000L, "missingblocks", "site1", 16.0});
+        aggregator.add(new Object[] {"host3", 2000L, "missingblocks", "site1", 11.0});
+        aggregator.add(new Object[] {"host1", 21000L, "missingblocks", "site1", 20.0});
 
-        aggregator.add(new Object[]{"host1", 61000L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host2", 61500L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host3", 62000L, "missingblocks", "site1", 13.0});
-        aggregator.add(new Object[]{"host2", 63500L, "missingblocks", "site1", 19.0});
+        aggregator.add(new Object[] {"host1", 61000L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host2", 61500L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host3", 62000L, "missingblocks", "site1", 13.0});
+        aggregator.add(new Object[] {"host2", 63500L, "missingblocks", "site1", 19.0});
 
-        aggregator.add(new Object[]{"host1", 121000L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host2", 121000L, "missingblocks", "site1", 14.0});
-        aggregator.add(new Object[]{"host3", 122000L, "missingblocks", "site1", 13.0});
+        aggregator.add(new Object[] {"host1", 121000L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host2", 121000L, "missingblocks", "site1", 14.0});
+        aggregator.add(new Object[] {"host3", 122000L, "missingblocks", "site1", 13.0});
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java
index 7e96433..9bd3c55 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java
@@ -27,16 +27,16 @@ import java.util.TimeZone;
 public class TestEagleConfig {
 
     @Test
-    public void testLoadConfig(){
+    public void testLoadConfig() {
         System.setProperty("config.resource", "application-test.conf");
         EagleConfig config = EagleConfigFactory.load();
-        Assert.assertEquals("test",config.getEnv());
-        Assert.assertEquals("localhost-for-test",config.getZKQuorum());
-        Assert.assertEquals("1234",config.getZKPort());
-        Assert.assertEquals("hbase",config.getStorageType());
-        Assert.assertEquals(true,config.isCoprocessorEnabled());
-        Assert.assertEquals(9090,config.getServicePort());
-        Assert.assertEquals("localhost",config.getServiceHost());
-        Assert.assertEquals(TimeZone.getTimeZone("UTC"),config.getTimeZone());
+        Assert.assertEquals("test", config.getEnv());
+        Assert.assertEquals("localhost-for-test", config.getZKQuorum());
+        Assert.assertEquals("1234", config.getZKPort());
+        Assert.assertEquals("hbase", config.getStorageType());
+        Assert.assertEquals(true, config.isCoprocessorEnabled());
+        Assert.assertEquals(9090, config.getServicePort());
+        Assert.assertEquals("localhost", config.getServiceHost());
+        Assert.assertEquals(TimeZone.getTimeZone("UTC"), config.getTimeZone());
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java
index 894961b..ab13628 100644
--- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java
+++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java
@@ -26,7 +26,7 @@ import java.util.HashMap;
  */
 public class TestAlertContext {
     @Test
-    public void test(){
+    public void test() {
         HashMap<String, String> map = new HashMap<String, String>();
         map.put("key1", "value1");
         map.put("key2", "value2");


[3/3] incubator-eagle git commit: [EAGLE-724] Fix eagle-common checkstyle problem

Posted by qi...@apache.org.
[EAGLE-724] Fix eagle-common checkstyle problem

<!--
{% comment %}
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{% endcomment %}
-->

Fix eagle-common checkstyle problem

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

---

Author: koone <lu...@126.com>

Closes #610 from koone/EAGLE-724.


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

Branch: refs/heads/master
Commit: ca0fae40712fe5bb6962554b5fe17e7ff360763f
Parents: 38f2926
Author: koone <lu...@126.com>
Authored: Fri Nov 4 18:50:43 2016 +0800
Committer: Zhao, Qingwen <qi...@apache.org>
Committed: Fri Nov 4 18:50:43 2016 +0800

----------------------------------------------------------------------
 eagle-core/eagle-common/pom.xml                 |  13 +
 .../java/org/apache/eagle/common/Base64.java    |  34 +-
 .../java/org/apache/eagle/common/ByteUtil.java  | 292 +++++-----
 .../apache/eagle/common/CircularArrayList.java  |  64 +--
 .../common/CircularArrayListSortedSet.java      | 106 ++--
 .../org/apache/eagle/common/DateTimeUtil.java   |   9 +-
 .../apache/eagle/common/EagleBase64Wrapper.java |  16 +-
 .../eagle/common/EagleExceptionWrapper.java     |   2 +-
 .../org/apache/eagle/common/Environment.java    |   6 +-
 .../main/java/org/apache/eagle/common/OS.java   |  30 +-
 .../apache/eagle/common/SerializableUtils.java  | 168 +++---
 .../eagle/common/agg/AggregateResult.java       |  11 +-
 .../eagle/common/agg/SiddhiAggregator.java      |  36 +-
 .../eagle/common/agg/StreamAggregator.java      |  37 +-
 .../eagle/common/authentication/User.java       |   3 +-
 .../config/AbstractConfigOptionParser.java      |  20 +-
 .../eagle/common/config/ConfigOptionParser.java |  30 +-
 .../apache/eagle/common/config/EagleConfig.java |   2 +-
 .../common/config/EagleConfigConstants.java     |   2 +-
 .../eagle/common/config/EagleConfigFactory.java |  17 +-
 .../eagle/common/config/EagleConfigHelper.java  |   8 +-
 .../common/function/ThrowableConsumer2.java     |   4 +-
 .../common/function/ThrowableFunction.java      |   2 -
 .../eagle/common/metric/AlertContext.java       | 119 ++--
 .../eagle/common/module/CommonGuiceModule.java  |   2 +-
 .../apache/eagle/common/module/GlobalScope.java |   5 +-
 .../eagle/common/module/GuiceJUnitRunner.java   |   9 +-
 .../eagle/common/module/ModuleRegistry.java     |  26 +-
 .../eagle/common/module/ModuleRegistryImpl.java |  12 +-
 .../apache/eagle/common/module/ModuleScope.java |   6 +-
 .../org/apache/eagle/common/module/Modules.java |   7 +-
 .../common/service/HadoopAccountService.java    |   2 +-
 .../apache/eagle/common/service/HadoopUser.java |  29 +-
 .../eagle/common/service/LdapService.java       | 134 +++--
 .../common/service/POSTResultEntityBase.java    |  32 +-
 .../service/TrustAllSSLSocketFactory.java       |   9 +-
 .../eagle-common/src/main/resources/footer.vm   |   6 +-
 .../eagle-common/src/main/resources/header.vm   | 553 ++++++++++---------
 .../src/main/resources/templates/tec_alert.vm   | 159 +++---
 .../org/apache/eagle/common/TestByteUtil.java   | 170 +++---
 .../eagle/common/TestCircularArrayList.java     | 100 ++--
 .../common/TestCircularArrayListSortedSet.java  |  68 +--
 .../apache/eagle/common/TestDateTimeUtil.java   | 126 ++---
 .../eagle/common/TestEagleBase64Wrapper.java    |  32 +-
 .../eagle/common/TestSerializableUtils.java     |  13 +-
 .../eagle/common/TestSiddhiAggregator.java      |  75 +--
 .../eagle/common/agg/TestSiddhiAggregator.java  |  24 +-
 .../common/agg/TestSiddhiExternalTimeBatch.java |  77 ++-
 .../eagle/common/agg/TestStreamAggregator.java  |  58 +-
 .../eagle/common/config/TestEagleConfig.java    |  18 +-
 .../eagle/common/metric/TestAlertContext.java   |   2 +-
 .../eagle/common/module/ModuleRegistryTest.java |  15 +-
 .../eagle-common/src/test/resources/footer.vm   |   6 +-
 .../eagle-common/src/test/resources/header.vm   | 545 +++++++++---------
 .../src/test/resources/log4j.properties         |   4 -
 .../src/test/resources/templates/tec_alert.vm   | 159 +++---
 .../resources/templates/test_anomaly_alert.vm   | 198 +++----
 57 files changed, 1888 insertions(+), 1824 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/pom.xml b/eagle-core/eagle-common/pom.xml
index 639d4d5..26b8f8f 100644
--- a/eagle-core/eagle-common/pom.xml
+++ b/eagle-core/eagle-common/pom.xml
@@ -98,5 +98,18 @@
             <version>${guice.version}</version>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <failOnViolation>true</failOnViolation>
+                    <failsOnError>true</failsOnError>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/Base64.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/Base64.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/Base64.java
index aec84a3..42f028e 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/Base64.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/Base64.java
@@ -14,31 +14,27 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/**
- * 
- */
 package org.apache.eagle.common;
 
-import java.io.UnsupportedEncodingException;
-
 import javax.xml.bind.DatatypeConverter;
+import java.io.UnsupportedEncodingException;
 
 public class Base64 {
 
-	public static String decode(String salted) {
-		try {
-			return new String(DatatypeConverter.parseBase64Binary(salted), "UTF-8");
-		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("UTF-8 must be supported", e);
-		}
-	}
+    public static String decode(String salted) {
+        try {
+            return new String(DatatypeConverter.parseBase64Binary(salted), "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException("UTF-8 must be supported", e);
+        }
+    }
 
-	public static String encode(String plain) {
-		try {
-			return DatatypeConverter.printBase64Binary(plain.getBytes("UTF-8"));
-		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException("UTF-8 must be supported", e);
-		}
-	}
+    public static String encode(String plain) {
+        try {
+            return DatatypeConverter.printBase64Binary(plain.getBytes("UTF-8"));
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException("UTF-8 must be supported", e);
+        }
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/ByteUtil.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/ByteUtil.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/ByteUtil.java
index c1d4976..909279c 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/ByteUtil.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/ByteUtil.java
@@ -17,135 +17,135 @@
 package org.apache.eagle.common;
 
 public class ByteUtil {
-	
-	public static double bytesToDouble(byte[] bytes, int offset){
-		return Double.longBitsToDouble(bytesToLong(bytes, offset));
-	}
-	
-	public static double bytesToDouble(byte[] bytes){
-		return Double.longBitsToDouble(bytesToLong(bytes));
-	}
-	
-	public static void doubleToBytes(double v, byte[] bytes){
-		doubleToBytes(v, bytes, 0);
-	}
-	
-	public static void doubleToBytes(double v, byte[] bytes, int offset){
-		longToBytes(Double.doubleToLongBits(v), bytes, offset);
-	}
-	
-	public static byte[] doubleToBytes(double v){
-		return longToBytes(Double.doubleToLongBits(v));
-	}
-	
-	public static long bytesToLong(byte[] bytes){
-		return bytesToLong(bytes, 0);
-	}
-	
-	public static long bytesToLong(byte[] bytes, int offset){
-		long value = 0;
-		for(int i=0; i<8; i++){
-			value <<= 8;
-			value |= (bytes[i+offset] & 0xFF);
-		}
-		return value;
-	}
-	
-	public static void longToBytes(long v, byte[] bytes){
-		longToBytes(v, bytes, 0);
-	}
-	
-	public static void longToBytes(long v, byte[] bytes, int offset){
-		long tmp = v;
-		for(int i=0; i<8; i++){
-			bytes[offset + 7 - i] = (byte)(tmp & 0xFF);
-			tmp >>= 8;
-		}
-	}
-	
-	public static byte[] longToBytes(long v){
-		long tmp = v;
-		byte[] b = new byte[8];
-		for(int i=0; i<8; i++){
-			b[7-i] = (byte)(tmp & 0xFF);
-			tmp >>= 8;
-		}
-		return b;
-	}
-	
-	public static int bytesToInt(byte[] bytes){
-		return bytesToInt(bytes, 0);
-	}
-	
-	public static int bytesToInt(byte[] bytes, int offset){
-		int value = 0;
-		for(int i=0; i<4; i++){
-			value <<= 8;
-			value |= (bytes[i+offset] & 0xFF);
-		}
-		return value;
-	}
-	
-	public static void intToBytes(int v, byte[] bytes){
-		intToBytes(v, bytes, 0);
-	}
-	
-	public static void intToBytes(int v, byte[] bytes, int offset){
-		int tmp = v;
-		for(int i=0; i<4; i++){
-			bytes[offset + 3 - i] = (byte)(tmp & 0xFF);
-			tmp >>= 8;
-		}
-	}
-
-	public static byte[] intToBytes(int v){
-		int tmp = v;
-		byte[] b = new byte[4];
-		for(int i=0; i<4; i++){
-			b[3-i] = (byte)(tmp & 0xFF);
-			tmp >>= 8;
-		}
-		return b;
-	}
-
-	//////
-	
-	public static short bytesToShort(byte[] bytes){
-		return bytesToShort(bytes, 0);
-	}
-	
-	public static short bytesToShort(byte[] bytes, int offset){
-		short value = 0;
-		for(int i=0; i < 2; i++){
-			value <<= 8;
-			value |= (bytes[i+offset] & 0xFF);
-		}
-		return value;
-	}
-	
-	public static void shortToBytes(short v, byte[] bytes){
-		shortToBytes(v, bytes, 0);
-	}
-	
-	public static void shortToBytes(short v, byte[] bytes, int offset){
-		int tmp = v;
-		for(int i=0; i < 2; i++){
-			bytes[offset + 1 - i] = (byte)(tmp & 0xFF);
-			tmp >>= 8;
-		}
-	}
-
-	public static byte[] shortToBytes(short v){
-		int tmp = v;
-		byte[] b = new byte[2];
-		for(int i=0; i<2; i++){
-			b[1-i] = (byte)(tmp & 0xFF);
-			tmp >>= 8;
-		}
-		return b;
-	}
-
-	public static byte[] concat(byte[]... arrays) {
+
+    public static double bytesToDouble(byte[] bytes, int offset) {
+        return Double.longBitsToDouble(bytesToLong(bytes, offset));
+    }
+
+    public static double bytesToDouble(byte[] bytes) {
+        return Double.longBitsToDouble(bytesToLong(bytes));
+    }
+
+    public static void doubleToBytes(double v, byte[] bytes) {
+        doubleToBytes(v, bytes, 0);
+    }
+
+    public static void doubleToBytes(double v, byte[] bytes, int offset) {
+        longToBytes(Double.doubleToLongBits(v), bytes, offset);
+    }
+
+    public static byte[] doubleToBytes(double v) {
+        return longToBytes(Double.doubleToLongBits(v));
+    }
+
+    public static long bytesToLong(byte[] bytes) {
+        return bytesToLong(bytes, 0);
+    }
+
+    public static long bytesToLong(byte[] bytes, int offset) {
+        long value = 0;
+        for (int i = 0; i < 8; i++) {
+            value <<= 8;
+            value |= (bytes[i + offset] & 0xFF);
+        }
+        return value;
+    }
+
+    public static void longToBytes(long v, byte[] bytes) {
+        longToBytes(v, bytes, 0);
+    }
+
+    public static void longToBytes(long v, byte[] bytes, int offset) {
+        long tmp = v;
+        for (int i = 0; i < 8; i++) {
+            bytes[offset + 7 - i] = (byte) (tmp & 0xFF);
+            tmp >>= 8;
+        }
+    }
+
+    public static byte[] longToBytes(long v) {
+        long tmp = v;
+        byte[] b = new byte[8];
+        for (int i = 0; i < 8; i++) {
+            b[7 - i] = (byte) (tmp & 0xFF);
+            tmp >>= 8;
+        }
+        return b;
+    }
+
+    public static int bytesToInt(byte[] bytes) {
+        return bytesToInt(bytes, 0);
+    }
+
+    public static int bytesToInt(byte[] bytes, int offset) {
+        int value = 0;
+        for (int i = 0; i < 4; i++) {
+            value <<= 8;
+            value |= (bytes[i + offset] & 0xFF);
+        }
+        return value;
+    }
+
+    public static void intToBytes(int v, byte[] bytes) {
+        intToBytes(v, bytes, 0);
+    }
+
+    public static void intToBytes(int v, byte[] bytes, int offset) {
+        int tmp = v;
+        for (int i = 0; i < 4; i++) {
+            bytes[offset + 3 - i] = (byte) (tmp & 0xFF);
+            tmp >>= 8;
+        }
+    }
+
+    public static byte[] intToBytes(int v) {
+        int tmp = v;
+        byte[] b = new byte[4];
+        for (int i = 0; i < 4; i++) {
+            b[3 - i] = (byte) (tmp & 0xFF);
+            tmp >>= 8;
+        }
+        return b;
+    }
+
+    //////
+
+    public static short bytesToShort(byte[] bytes) {
+        return bytesToShort(bytes, 0);
+    }
+
+    public static short bytesToShort(byte[] bytes, int offset) {
+        short value = 0;
+        for (int i = 0; i < 2; i++) {
+            value <<= 8;
+            value |= (bytes[i + offset] & 0xFF);
+        }
+        return value;
+    }
+
+    public static void shortToBytes(short v, byte[] bytes) {
+        shortToBytes(v, bytes, 0);
+    }
+
+    public static void shortToBytes(short v, byte[] bytes, int offset) {
+        int tmp = v;
+        for (int i = 0; i < 2; i++) {
+            bytes[offset + 1 - i] = (byte) (tmp & 0xFF);
+            tmp >>= 8;
+        }
+    }
+
+    public static byte[] shortToBytes(short v) {
+        int tmp = v;
+        byte[] b = new byte[2];
+        for (int i = 0; i < 2; i++) {
+            b[1 - i] = (byte) (tmp & 0xFF);
+            tmp >>= 8;
+        }
+        return b;
+    }
+
+    public static byte[] concat(byte[]... arrays) {
         int length = 0;
         for (byte[] array : arrays) {
             length += array.length;
@@ -158,21 +158,21 @@ public class ByteUtil {
         }
         return result;
     }
-	
-//    public static void main(String[] args){ 
-//    	int a = "ThreadName".hashCode();
-//    	byte[] b = intToBytes(a);
-//    	byte[] c = intToBytes(1676687583);
-//    	String s = new String(b);
-//    	System.out.println(s);
-    	
-//    	byte[] d = intToBytes(8652353);
-//    	System.out.println(bytesToInt(d));
-    	
-//    	byte[] e = longToBytes(12131513513l);
-//    	System.out.println(bytesToLong(e));
-//    	if(12131513513l == bytesToLong(e)){
-//    		System.out.println("yes");
-//    	}
-//    }
+
+    public static void main(String[] args) {
+        int a = "ThreadName".hashCode();
+        byte[] b = intToBytes(a);
+        byte[] c = intToBytes(1676687583);
+        String s = new String(b);
+        System.out.println(s);
+
+        byte[] d = intToBytes(8652353);
+        System.out.println(bytesToInt(d));
+
+        byte[] e = longToBytes(12131513513L);
+        System.out.println(bytesToLong(e));
+        if (12131513513L == bytesToLong(e)) {
+            System.out.println("yes");
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayList.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayList.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayList.java
index 49695e5..ccb7b65 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayList.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayList.java
@@ -20,45 +20,45 @@ import java.util.AbstractList;
 import java.util.RandomAccess;
 
 /**
- * Circular array implementation
+ * Circular array implementation.
  *
  * @param <E>
  */
 public class CircularArrayList<E> extends AbstractList<E> implements RandomAccess {
-  
+
     private final E[] buf; // a List implementing RandomAccess
     private int head = 0;
     private int tail = 0;
     private boolean full = false;
-  
+
     public CircularArrayList(E[] array) {
         buf = array;
         full = (buf.length == 0);
     }
-  
+
     public int capacity() {
         return buf.length;
     }
-    
+
     public int head() {
-    	return head;
+        return head;
     }
-    
+
     public int tail() {
-    	return tail;
+        return tail;
     }
-    
+
     public boolean isFull() {
-    	return full;
+        return full;
     }
-    
+
     @Override
     public void clear() {
         head = 0;
         tail = 0;
         full = false;
         for (int i = 0; i < buf.length; ++i) {
-        	buf[i] = null;
+            buf[i] = null;
         }
     }
 
@@ -69,7 +69,7 @@ public class CircularArrayList<E> extends AbstractList<E> implements RandomAcces
         }
         return m;
     }
-  
+
     // This method is O(n) but will never be called if the
     // CircularArrayList is used in its typical/intended role.
     private void shiftBlock(int startIndex, int endIndex) {
@@ -78,25 +78,25 @@ public class CircularArrayList<E> extends AbstractList<E> implements RandomAcces
             set(i + 1, get(i));
         }
     }
-    
+
     public int find(E e) {
-    	final int size = size();
-    	for (int i = 0; i < size; ++i) {
-    		if (e.equals(get(i))) {
-    			return i;
-    		}
-    	}
-    	return -1;
+        final int size = size();
+        for (int i = 0; i < size; ++i) {
+            if (e.equals(get(i))) {
+                return i;
+            }
+        }
+        return -1;
     }
-  
+
     @Override
     public int size() {
-    	if (full) {
-    		return buf.length;
-    	}
+        if (full) {
+            return buf.length;
+        }
         return tail - head + (tail < head ? buf.length : 0);
     }
-  
+
     @Override
     public E get(int i) {
         if (i < 0 || i >= size()) {
@@ -104,21 +104,21 @@ public class CircularArrayList<E> extends AbstractList<E> implements RandomAcces
         }
         return buf[wrapIndex(head + i)];
     }
-  
+
     @Override
     public E set(int i, E e) {
         if (i < 0 || i >= size()) {
             throw new IndexOutOfBoundsException();
         }
-        return buf[wrapIndex(head + i)] =  e;
+        return buf[wrapIndex(head + i)] = e;
     }
-  
+
     @Override
     public void add(int i, E e) {
         int s = size();
         if (s == buf.length) {
             throw new IllegalStateException("Cannot add element."
-                    + " CircularArrayList is filled to capacity.");
+                + " CircularArrayList is filled to capacity.");
         }
         full = (s + 1 == buf.length);
         if (i < 0 || i > s) {
@@ -130,7 +130,7 @@ public class CircularArrayList<E> extends AbstractList<E> implements RandomAcces
         }
         set(i, e);
     }
-  
+
     @Override
     public E remove(int i) {
         int s = size();
@@ -141,7 +141,7 @@ public class CircularArrayList<E> extends AbstractList<E> implements RandomAcces
         if (i > 0) {
             shiftBlock(0, i);
         }
-    	buf[head] = null;
+        buf[head] = null;
         head = wrapIndex(head + 1);
         full = false;
         return e;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayListSortedSet.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayListSortedSet.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayListSortedSet.java
index ef47624..0dc6ab3 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayListSortedSet.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/CircularArrayListSortedSet.java
@@ -22,85 +22,85 @@ import java.util.List;
 
 public class CircularArrayListSortedSet<E> {
 
-	private final CircularArrayList<E> list;
+    private final CircularArrayList<E> list;
     private final Comparator<? super E> comparator;
 
-	public CircularArrayListSortedSet(E[] array) {
-		this.list = new CircularArrayList<E>(array);
-		this.comparator = null;
-	}
-	
-	public CircularArrayListSortedSet(E[] array, Comparator<? super E> comparator) {
-		this.list = new CircularArrayList<E>(array);
-		this.comparator = comparator;
-	}
-	
+    public CircularArrayListSortedSet(E[] array) {
+        this.list = new CircularArrayList<E>(array);
+        this.comparator = null;
+    }
+
+    public CircularArrayListSortedSet(E[] array, Comparator<? super E> comparator) {
+        this.list = new CircularArrayList<E>(array);
+        this.comparator = comparator;
+    }
+
     public int capacity() {
         return list.capacity();
     }
-    
+
     public int head() {
-    	return list.head();
+        return list.head();
     }
-    
+
     public int tail() {
-    	return list.tail();
+        return list.tail();
     }
-    
+
     public boolean isFull() {
-    	return list.isFull();
+        return list.isFull();
     }
-  
+
     public void clear() {
-    	list.clear();
+        list.clear();
     }
-    
+
     public int size() {
-    	return list.size();
+        return list.size();
     }
-  
+
     public E get(int i) {
         return list.get(i);
     }
-    
+
     @SuppressWarnings("unchecked")
-	public int binarySearch(E e) {
-    	if (comparator != null) {
-    		return Collections.binarySearch(list, e, comparator);
-    	} else {
-    		return Collections.binarySearch((List<? extends Comparable<? super E>>)list, e);
-    	}
+    public int binarySearch(E e) {
+        if (comparator != null) {
+            return Collections.binarySearch(list, e, comparator);
+        } else {
+            return Collections.binarySearch((List<? extends Comparable<? super E>>) list, e);
+        }
     }
-    
+
     public int replace(E e) {
-    	int index = binarySearch(e);
-    	if (index < 0) {
-    		return -1;
-    	}
-    	list.set(index, e);
-    	return index;
+        int index = binarySearch(e);
+        if (index < 0) {
+            return -1;
+        }
+        list.set(index, e);
+        return index;
     }
-  
+
     public int insert(E e) {
-    	int index = binarySearch(e);
-    	if (index > 0) {
-    		return -1;
-    	}
-    	index = 0 - index - 1;
-    	list.add(index, e);
-    	return index;
+        int index = binarySearch(e);
+        if (index > 0) {
+            return -1;
+        }
+        index = 0 - index - 1;
+        list.add(index, e);
+        return index;
     }
-  
+
     public E remove(int i) {
-    	return list.remove(i);
+        return list.remove(i);
     }
-    
+
     public int remove(E e) {
-    	final int index = binarySearch(e);
-    	if (index > 0) {
-        	list.remove(index);
-        	return index;
-    	}
-    	return -1;
+        final int index = binarySearch(e);
+        if (index > 0) {
+            list.remove(index);
+            return index;
+        }
+        return -1;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/DateTimeUtil.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/DateTimeUtil.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/DateTimeUtil.java
index c21d2bc..74b733d 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/DateTimeUtil.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/DateTimeUtil.java
@@ -36,6 +36,7 @@ public class DateTimeUtil {
     public static final long ONEHOUR = 1L * 60L * 60L * 1000L;
     public static final long ONEDAY = 24L * 60L * 60L * 1000L;
     private static TimeZone CURRENT_TIME_ZONE;
+
     static {
         Config config = ConfigFactory.load();
         CURRENT_TIME_ZONE = TimeZone.getTimeZone((config.hasPath(EagleConfigConstants.EAGLE_TIME_ZONE)
@@ -151,10 +152,10 @@ public class DateTimeUtil {
 
     //For mapr
     //exp: 2015-06-06T10:44:22.800Z
-    public static long maprhumanDateToMilliseconds(String date) throws ParseException{
-        date = date.replace('T',' ');
-        date = date.replace('Z',' ');
-        date = date.replace('.',',');
+    public static long maprhumanDateToMilliseconds(String date) throws ParseException {
+        date = date.replace('T', ' ');
+        date = date.replace('Z', ' ');
+        date = date.replace('.', ',');
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS ");
         sdf.setTimeZone(CURRENT_TIME_ZONE);
         Date d = sdf.parse(date);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/EagleBase64Wrapper.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/EagleBase64Wrapper.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/EagleBase64Wrapper.java
index e31ef99..65f858c 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/EagleBase64Wrapper.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/EagleBase64Wrapper.java
@@ -19,14 +19,14 @@ package org.apache.eagle.common;
 import org.apache.commons.net.util.Base64;
 
 /**
- * wrap base64 encoding and decoding, so reduce the confuse of using many Base64 methods. 
+ * wrap base64 encoding and decoding, so reduce the confuse of using many Base64 methods.
  */
 public class EagleBase64Wrapper {
-	public static String encodeByteArray2URLSafeString(byte[] bytes){
-		return Base64.encodeBase64URLSafeString(bytes);
-	}
-	
-	public static byte[] decode(String input){
-		return Base64.decodeBase64(input);
-	}
+    public static String encodeByteArray2URLSafeString(byte[] bytes) {
+        return Base64.encodeBase64URLSafeString(bytes);
+    }
+
+    public static byte[] decode(String input) {
+        return Base64.decodeBase64(input);
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/EagleExceptionWrapper.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/EagleExceptionWrapper.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/EagleExceptionWrapper.java
index 4ab2b78..74bbe2c 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/EagleExceptionWrapper.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/EagleExceptionWrapper.java
@@ -25,7 +25,7 @@ public class EagleExceptionWrapper {
     }
 
     public static String wrap(Exception ex, int maxdepth) {
-        if(ex == null) {
+        if (ex == null) {
             return null;
         }
         int d = maxdepth;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/Environment.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/Environment.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/Environment.java
index dd69ed5..2350a44 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/Environment.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/Environment.java
@@ -17,7 +17,7 @@
 package org.apache.eagle.common;
 
 public enum Environment {
-	dev,
-	test,
-	prod,
+    dev,
+    test,
+    prod,
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/OS.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/OS.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/OS.java
index 05e8db1..029f298 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/OS.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/OS.java
@@ -18,24 +18,24 @@ package org.apache.eagle.common;
 
 public class OS {
 
-	private final static String os = System.getProperty("os.name")
-			.toLowerCase();
+    private static final String os = System.getProperty("os.name")
+        .toLowerCase();
 
-	public static boolean isWindows() {
-		return (os.indexOf("win") >= 0);
-	}
+    public static boolean isWindows() {
+        return (os.indexOf("win") >= 0);
+    }
 
-	public static boolean isMac() {
-		return (os.indexOf("mac") >= 0);
-	}
+    public static boolean isMac() {
+        return (os.indexOf("mac") >= 0);
+    }
 
-	public static boolean isUnix() {
-		return (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0 || os
-				.indexOf("aix") > 0);
-	}
+    public static boolean isUnix() {
+        return (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0 || os
+            .indexOf("aix") > 0);
+    }
 
-	public static boolean isSolaris() {
-		return (os.indexOf("sunos") >= 0);
-	}
+    public static boolean isSolaris() {
+        return (os.indexOf("sunos") >= 0);
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/SerializableUtils.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/SerializableUtils.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/SerializableUtils.java
index c5823ea..ee1c330 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/SerializableUtils.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/SerializableUtils.java
@@ -27,100 +27,100 @@ import java.io.*;
 /**
  * Utilities for working with Serializables.
  *
- * Derived from "com.google.cloud.dataflow.sdk.util.SerializableUtils":
+ * <p>Derived from "com.google.cloud.dataflow.sdk.util.SerializableUtils":
  * https://github.com/apache/incubator-beam/blob/master/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/util/SerializableUtils.java
  */
 public class SerializableUtils {
-  /**
-   * Serializes the argument into an array of bytes, and returns it.
-   *
-   * @throws IllegalArgumentException if there are errors when serializing
-   */
-  public static byte[] serializeToCompressedByteArray(Object value) {
-    try {
-      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-      try (ObjectOutputStream oos = new ObjectOutputStream(new SnappyOutputStream(buffer))) {
-        oos.writeObject(value);
-      }
-      return buffer.toByteArray();
-    } catch (IOException exn) {
-      throw new IllegalArgumentException(
-          "unable to serialize " + value,
-          exn);
+    /**
+     * Serializes the argument into an array of bytes, and returns it.
+     *
+     * @throws IllegalArgumentException if there are errors when serializing
+     */
+    public static byte[] serializeToCompressedByteArray(Object value) {
+        try {
+            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+            try (ObjectOutputStream oos = new ObjectOutputStream(new SnappyOutputStream(buffer))) {
+                oos.writeObject(value);
+            }
+            return buffer.toByteArray();
+        } catch (IOException exn) {
+            throw new IllegalArgumentException(
+                "unable to serialize " + value,
+                exn);
+        }
     }
-  }
 
-  /**
-   * Serializes the argument into an array of bytes, and returns it.
-   *
-   * @throws IllegalArgumentException if there are errors when serializing
-   */
-  public static byte[] serializeToByteArray(Object value) {
-    try {
-      ByteArrayOutputStream buffer = new ByteArrayOutputStream();
-      try (ObjectOutputStream oos = new ObjectOutputStream(buffer)) {
-        oos.writeObject(value);
-      }
-      return buffer.toByteArray();
-    } catch (IOException exn) {
-      throw new IllegalArgumentException("unable to serialize " + value, exn);
+    /**
+     * Serializes the argument into an array of bytes, and returns it.
+     *
+     * @throws IllegalArgumentException if there are errors when serializing
+     */
+    public static byte[] serializeToByteArray(Object value) {
+        try {
+            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+            try (ObjectOutputStream oos = new ObjectOutputStream(buffer)) {
+                oos.writeObject(value);
+            }
+            return buffer.toByteArray();
+        } catch (IOException exn) {
+            throw new IllegalArgumentException("unable to serialize " + value, exn);
+        }
     }
-  }
 
-  /**
-   * Deserializes an object from the given array of bytes, e.g., as
-   * serialized using {@link #serializeToCompressedByteArray}, and returns it.
-   *
-   * @throws IllegalArgumentException if there are errors when
-   * deserializing, using the provided description to identify what
-   * was being deserialized
-   */
-  public static Object deserializeFromByteArray(byte[] encodedValue,
-                                                          String description) {
-    try {
-      try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(encodedValue))) {
-        return ois.readObject();
-      }
-    } catch (IOException | ClassNotFoundException exn) {
-      throw new IllegalArgumentException(
-          "unable to deserialize " + description,
-          exn);
+    /**
+     * Deserializes an object from the given array of bytes, e.g., as
+     * serialized using {@link #serializeToCompressedByteArray}, and returns it.
+     *
+     * @throws IllegalArgumentException if there are errors when
+     *                                  deserializing, using the provided description to identify what
+     *                                  was being deserialized
+     */
+    public static Object deserializeFromByteArray(byte[] encodedValue,
+                                                  String description) {
+        try {
+            try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(encodedValue))) {
+                return ois.readObject();
+            }
+        } catch (IOException | ClassNotFoundException exn) {
+            throw new IllegalArgumentException(
+                "unable to deserialize " + description,
+                exn);
+        }
     }
-  }
 
-  /**
-   * Deserializes an object from the given array of bytes, e.g., as
-   * serialized using {@link #serializeToCompressedByteArray}, and returns it.
-   *
-   * @throws IllegalArgumentException if there are errors when
-   * deserializing, using the provided description to identify what
-   * was being deserialized
-   */
-  public static Object deserializeFromCompressedByteArray(byte[] encodedValue,
-                                                          String description) {
-    try {
-      try (ObjectInputStream ois = new ObjectInputStream(
-          new SnappyInputStream(new ByteArrayInputStream(encodedValue)))) {
-        return ois.readObject();
-      }
-    } catch (IOException | ClassNotFoundException exn) {
-      throw new IllegalArgumentException(
-          "unable to deserialize " + description,
-          exn);
+    /**
+     * Deserializes an object from the given array of bytes, e.g., as
+     * serialized using {@link #serializeToCompressedByteArray}, and returns it.
+     *
+     * @throws IllegalArgumentException if there are errors when
+     *                                  deserializing, using the provided description to identify what
+     *                                  was being deserialized
+     */
+    public static Object deserializeFromCompressedByteArray(byte[] encodedValue,
+                                                            String description) {
+        try {
+            try (ObjectInputStream ois = new ObjectInputStream(
+                new SnappyInputStream(new ByteArrayInputStream(encodedValue)))) {
+                return ois.readObject();
+            }
+        } catch (IOException | ClassNotFoundException exn) {
+            throw new IllegalArgumentException(
+                "unable to deserialize " + description,
+                exn);
+        }
     }
-  }
 
-  public static <T extends Serializable> T ensureSerializable(T value) {
-    @SuppressWarnings("unchecked")
-    T copy = (T) deserializeFromCompressedByteArray(serializeToCompressedByteArray(value),
-        value.toString());
-    return copy;
-  }
+    public static <T extends Serializable> T ensureSerializable(T value) {
+        @SuppressWarnings("unchecked")
+        T copy = (T) deserializeFromCompressedByteArray(serializeToCompressedByteArray(value),
+            value.toString());
+        return copy;
+    }
 
-  public static <T extends Serializable> T clone(T value) {
-    @SuppressWarnings("unchecked")
-    T copy = (T) deserializeFromCompressedByteArray(serializeToCompressedByteArray(value),
-        value.toString());
-    return copy;
-  }
+    public static <T extends Serializable> T clone(T value) {
+        @SuppressWarnings("unchecked")
+        T copy = (T) deserializeFromCompressedByteArray(serializeToCompressedByteArray(value),
+            value.toString());
+        return copy;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/AggregateResult.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/AggregateResult.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/AggregateResult.java
index bb0ac5d..5ce644f 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/AggregateResult.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/AggregateResult.java
@@ -30,25 +30,26 @@ public class AggregateResult {
     private Object[] data;
     private Map<String, Integer> colIndices;
     private List<String> colNames;
-    public AggregateResult(Object[] data, Map<String, Integer> colIndices, List<String> colNames){
+
+    public AggregateResult(Object[] data, Map<String, Integer> colIndices, List<String> colNames) {
         this.data = data;
         this.colIndices = colIndices;
         this.colNames = colNames;
     }
 
-    public Object get(int index){
+    public Object get(int index) {
         return data[index];
     }
 
-    public Object get(String fieldName){
+    public Object get(String fieldName) {
         int index = colIndices.get(fieldName);
         return get(index);
     }
 
-    public String toString(){
+    public String toString() {
         StringBuilder sb = new StringBuilder();
         sb.append("{");
-        for(int i=0; i<data.length; i++){
+        for (int i = 0; i < data.length; i++) {
             sb.append(colNames.get(i));
             sb.append("=");
             sb.append(data[i]);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/SiddhiAggregator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/SiddhiAggregator.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/SiddhiAggregator.java
index d0b3987..cbe0ff9 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/SiddhiAggregator.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/SiddhiAggregator.java
@@ -37,18 +37,19 @@ public class SiddhiAggregator {
     private TimeBatchWindowSpec spec;
     private StreamDefinition sd;
     private InputHandler input;
-    public SiddhiAggregator(TimeBatchWindowSpec spec, StreamDefinition sd, final AggregateHandler handler){
+
+    public SiddhiAggregator(TimeBatchWindowSpec spec, StreamDefinition sd, final AggregateHandler handler) {
         this.spec = spec;
         this.sd = sd;
 
         Map<String, Integer> colIndices = new HashMap<>();
         List<String> colNames = new ArrayList<>();
         int i = 0;
-        for(String col : spec.groupby.cols){
+        for (String col : spec.groupby.cols) {
             colIndices.put(col, i++);
             colNames.add(col);
         }
-        for(Agg agg : spec.aggs){
+        for (Agg agg : spec.aggs) {
             colIndices.put(agg.alias, i++);
             colNames.add(agg.alias);
         }
@@ -63,7 +64,7 @@ public class SiddhiAggregator {
             @Override
             public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
                 List<AggregateResult> rows = new ArrayList<AggregateResult>();
-                for(Event e : inEvents) {
+                for (Event e : inEvents) {
                     AggregateResult result = new AggregateResult(e.getData(), colIndices, colNames);
                     rows.add(result);
                 }
@@ -73,28 +74,29 @@ public class SiddhiAggregator {
         runtime.start();
     }
 
-    public void add(Object[] data) throws Exception{
+    public void add(Object[] data) throws Exception {
         input.send(data);
     }
 
     /**
      * example siddhi query
-     *   String ql = "define stream s (host string, timestamp long, metric string, site string, value double);" +
-          "@info(name='query') " +
-          " from s[metric == \"missingblocks\"]#window.externalTimeBatch(timestamp, 1 min, 0) select host, count(value) as avg group by host insert into tmp; ";
+     * String ql = "define stream s (host string, timestamp long, metric string, site string, value double);" +
+     * "@info(name='query') " +
+     * " from s[metric == \"missingblocks\"]#window.externalTimeBatch(timestamp, 1 min, 0) select host, count(value) as avg group by host insert into tmp; ";
+     *
      * @return
      */
-    private String buildSiddhiAggQuery(){
+    private String buildSiddhiAggQuery() {
         StringBuilder sb = new StringBuilder();
         sb.append("define stream s(");
-        if(sd.columns == null || sd.columns.size() == 0) {
+        if (sd.columns == null || sd.columns.size() == 0) {
             throw new IllegalStateException("input stream should contains at least one column");
         }
-        for(Column col : sd.columns){
+        for (Column col : sd.columns) {
             appendColumnDef(sb, col);
             sb.append(",");
         }
-        sb.deleteCharAt(sb.length()-1);
+        sb.deleteCharAt(sb.length() - 1);
         sb.append(");");
 
         sb.append(" @info(name='query') ");
@@ -108,14 +110,14 @@ public class SiddhiAggregator {
         sb.append(spec.start);
         sb.append(")");
         sb.append(" select ");
-        for(String gbField : spec.groupby.cols){
+        for (String gbField : spec.groupby.cols) {
             sb.append(gbField);
             sb.append(",");
         }
-        if(spec.aggs == null){
+        if (spec.aggs == null) {
             throw new IllegalStateException("at least one aggregate function should be present");
         }
-        for(Agg agg : spec.aggs){
+        for (Agg agg : spec.aggs) {
             sb.append(agg.function);
             sb.append("(");
             sb.append(agg.field);
@@ -125,7 +127,7 @@ public class SiddhiAggregator {
         }
         sb.deleteCharAt(sb.length() - 1);
         sb.append(" group by ");
-        for(String gbField : spec.groupby.cols){
+        for (String gbField : spec.groupby.cols) {
             sb.append(gbField);
             sb.append(",");
         }
@@ -135,7 +137,7 @@ public class SiddhiAggregator {
         return sb.toString();
     }
 
-    private void appendColumnDef(StringBuilder sb, Column col){
+    private void appendColumnDef(StringBuilder sb, Column col) {
         sb.append(col.name);
         sb.append(" ");
         sb.append(col.type);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/StreamAggregator.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/StreamAggregator.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/StreamAggregator.java
index 37802fd..2977be3 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/StreamAggregator.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/agg/StreamAggregator.java
@@ -27,10 +27,11 @@ import java.util.List;
  * Since 8/4/16.
  */
 public class StreamAggregator {
-    public static StreamAggregatorBuilder builder(){
+    public static StreamAggregatorBuilder builder() {
         return new StreamAggregatorBuilder();
     }
-    public static class StreamAggregatorBuilder{
+
+    public static class StreamAggregatorBuilder {
         private Groupby gb = new Groupby();
         private String windowDuration;
         private long start;
@@ -39,28 +40,34 @@ public class StreamAggregator {
         private String timestampColumn;
         private StreamDefinition sd = new StreamDefinition();
         private AggregateHandler handler;
-        public StreamAggregatorBuilder groupby(String ... gbFields){
+
+        public StreamAggregatorBuilder groupby(String... gbFields) {
             gb.cols = Arrays.asList(gbFields);
             return this;
         }
-        public StreamAggregatorBuilder window(String windowDuration){
+
+        public StreamAggregatorBuilder window(String windowDuration) {
             window(windowDuration, 0);
             return this;
         }
-        public StreamAggregatorBuilder window(String windowDuration, long start){
+
+        public StreamAggregatorBuilder window(String windowDuration, long start) {
             this.windowDuration = windowDuration;
             this.start = start;
             return this;
         }
-        public StreamAggregatorBuilder timeColumn(String timestampColumn){
+
+        public StreamAggregatorBuilder timeColumn(String timestampColumn) {
             this.timestampColumn = timestampColumn;
             return this;
         }
-        public StreamAggregatorBuilder filter(String filter){
+
+        public StreamAggregatorBuilder filter(String filter) {
             this.filter = filter;
             return this;
         }
-        public StreamAggregatorBuilder agg(String function, String field, String alias){
+
+        public StreamAggregatorBuilder agg(String function, String field, String alias) {
             Agg agg = new Agg();
             agg.function = function;
             agg.field = field;
@@ -68,25 +75,29 @@ public class StreamAggregator {
             aggs.add(agg);
             return this;
         }
-        public StreamAggregatorBuilder columnDef(String colName, String colType){
+
+        public StreamAggregatorBuilder columnDef(String colName, String colType) {
             Column col = new Column();
             col.name = colName;
             col.type = colType;
-            if(sd.columns == null){
+            if (sd.columns == null) {
                 sd.columns = new ArrayList<>();
             }
             sd.columns.add(col);
             return this;
         }
-        public StreamAggregatorBuilder streamDef(StreamDefinition sd){
+
+        public StreamAggregatorBuilder streamDef(StreamDefinition sd) {
             this.sd = sd;
             return this;
         }
-        public StreamAggregatorBuilder aggregateHandler(AggregateHandler handler){
+
+        public StreamAggregatorBuilder aggregateHandler(AggregateHandler handler) {
             this.handler = handler;
             return this;
         }
-        public SiddhiAggregator build(){
+
+        public SiddhiAggregator build() {
             TimeBatchWindowSpec spec = new TimeBatchWindowSpec();
             spec.aggs = aggs;
             spec.filter = filter;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/authentication/User.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/authentication/User.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/authentication/User.java
index 85388cd..e967624 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/authentication/User.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/authentication/User.java
@@ -24,7 +24,8 @@ public class User implements Principal, Serializable {
     private String username = "Unauthenticated";
     private Set<String> roles = null;
 
-    public User() {}
+    public User() {
+    }
 
     public User(String username) {
         this.username = username;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/AbstractConfigOptionParser.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/AbstractConfigOptionParser.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/AbstractConfigOptionParser.java
index a8a4b69..b2845a4 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/AbstractConfigOptionParser.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/AbstractConfigOptionParser.java
@@ -25,47 +25,47 @@ import org.apache.commons.cli.Parser;
 
 import java.util.Map;
 
-/**
- * @since 8/22/15
- */
+
 public abstract class AbstractConfigOptionParser {
 
     // private final Options options;
     private final Parser parser;
 
-    public AbstractConfigOptionParser(){
+    public AbstractConfigOptionParser() {
         parser = parser();
         //options = options();
     }
 
     /**
+     * Get parser.
      * @return Parser
      */
     protected abstract Parser parser();
 
     /**
+     * Get options.
      * @return Options
      */
     protected abstract Options options();
 
-    public abstract Map<String,String> parseConfig(String[] arguments) throws ParseException;
+    public abstract Map<String, String> parseConfig(String[] arguments) throws ParseException;
 
     /**
-     * Load config as system properties
+     * Load config as system properties.
      *
      * @param arguments command line arguments
      * @throws ParseException
      */
     public Config load(String[] arguments) throws ParseException {
-        Map<String,String> configProps = parseConfig(arguments);
-        for(Map.Entry<String,String> entry:configProps.entrySet()){
-            System.setProperty(entry.getKey(),entry.getValue());
+        Map<String, String> configProps = parseConfig(arguments);
+        for (Map.Entry<String, String> entry : configProps.entrySet()) {
+            System.setProperty(entry.getKey(), entry.getValue());
         }
         System.setProperty("config.trace", "loads");
         return ConfigFactory.load();
     }
 
     public CommandLine parse(String[] arguments) throws ParseException {
-        return this.parser.parse(this.options(),arguments);
+        return this.parser.parse(this.options(), arguments);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/ConfigOptionParser.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/ConfigOptionParser.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/ConfigOptionParser.java
index 3cb42ca..6c75a29 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/ConfigOptionParser.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/ConfigOptionParser.java
@@ -23,7 +23,7 @@ import java.util.Map;
 
 
 public class ConfigOptionParser extends AbstractConfigOptionParser {
-    private final static String CONFIG_OPT_FLAG = "D";
+    private static final String CONFIG_OPT_FLAG = "D";
 
     @Override
     protected Parser parser() {
@@ -38,27 +38,27 @@ public class ConfigOptionParser extends AbstractConfigOptionParser {
     }
 
     @Override
-    public Map<String,String> parseConfig(String[] arguments) throws ParseException {
+    public Map<String, String> parseConfig(String[] arguments) throws ParseException {
         CommandLine cmd = parse(arguments);
         return parseCommand(cmd);
     }
 
-    protected Map<String,String> parseCommand(CommandLine cmd) throws ParseException {
-        Map<String,String> result = new HashMap<>();
-        if(cmd.hasOption(CONFIG_OPT_FLAG)){
+    protected Map<String, String> parseCommand(CommandLine cmd) throws ParseException {
+        Map<String, String> result = new HashMap<>();
+        if (cmd.hasOption(CONFIG_OPT_FLAG)) {
             String[] values = cmd.getOptionValues(CONFIG_OPT_FLAG);
-            for(String value:values){
+            for (String value : values) {
                 int eqIndex = value.indexOf("=");
-                if(eqIndex>0 && eqIndex<value.length()){
-                    String k = value.substring(0,eqIndex);
-                    String v = value.substring(eqIndex+1,value.length());
-                    if(result.containsKey(k)){
-                        throw new ParseException("Duplicated "+CONFIG_OPT_FLAG+" "+value);
-                    }else{
-                        result.put(k,v);
+                if (eqIndex > 0 && eqIndex < value.length()) {
+                    String k = value.substring(0, eqIndex);
+                    String v = value.substring(eqIndex + 1, value.length());
+                    if (result.containsKey(k)) {
+                        throw new ParseException("Duplicated " + CONFIG_OPT_FLAG + " " + value);
+                    } else {
+                        result.put(k, v);
                     }
-                }else{
-                    throw new ParseException("Invalid format: -"+CONFIG_OPT_FLAG+" "+value+", required: -"+CONFIG_OPT_FLAG+" key=value");
+                } else {
+                    throw new ParseException("Invalid format: -" + CONFIG_OPT_FLAG + " " + value + ", required: -" + CONFIG_OPT_FLAG + " key=value");
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfig.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfig.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfig.java
index 8b4b959..f85d161 100755
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfig.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfig.java
@@ -16,9 +16,9 @@
  */
 package org.apache.eagle.common.config;
 
+import com.typesafe.config.Config;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.client.HTableInterface;
-import com.typesafe.config.Config;
 
 import java.util.TimeZone;
 import java.util.concurrent.ThreadPoolExecutor;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigConstants.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigConstants.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigConstants.java
index 693041d..c700c61 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigConstants.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigConstants.java
@@ -44,7 +44,7 @@ public final class EagleConfigConstants {
     public static final int DEFAULT_SERVICE_PORT = 8080;
     public static final String DEFAULT_ZOOKEEPER_ZNODE_PARENT = "/hbase-unsecure";
 
-    public static final String EAGLE_PROPS="eagleProps";
+    public static final String EAGLE_PROPS = "eagleProps";
     public static final String EAGLE_SERVICE = "eagleService";
     public static final String HOST = "host";
     public static final String PORT = "port";

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigFactory.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigFactory.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigFactory.java
index 2bd144d..65d93e9 100755
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigFactory.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigFactory.java
@@ -103,6 +103,7 @@ public class EagleConfigFactory implements EagleConfig {
             ? config.getString(EagleConfigConstants.SERVICE_ZOOKEEPER_ZNODE_PARENT) : EagleConfigConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT;
         String clientIPCPoolSize = getString(config, EagleConfigConstants.SERVICE_HBASE_CLIENT_IPC_POOL_SIZE, "10");
         this.hbaseConf = HBaseConfiguration.create();
+        this.hbaseConf.set("hbase.client.ipc.pool.size", clientIPCPoolSize);
 
         if (this.zkQuorum != null) {
             this.hbaseConf.set("hbase.zookeeper.quorum", this.zkQuorum);
@@ -118,18 +119,22 @@ public class EagleConfigFactory implements EagleConfig {
             this.hbaseConf.set("zookeeper.znode.parent", EagleConfigConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT);
         }
 
-        this.hbaseConf.set("hbase.client.ipc.pool.size", clientIPCPoolSize);
 
         this.eagleServiceHost = config.hasPath(EagleConfigConstants.SERVICE_HOST) ? config.getString(EagleConfigConstants.SERVICE_HOST) : EagleConfigConstants.DEFAULT_SERVICE_HOST;
         this.storageType = config.hasPath(EagleConfigConstants.SERVICE_STORAGE_TYPE) ? config.getString(EagleConfigConstants.SERVICE_STORAGE_TYPE) : EagleConfigConstants.DEFAULT_STORAGE_TYPE;
         this.isCoprocessorEnabled = config.hasPath(EagleConfigConstants.SERVICE_COPROCESSOR_ENABLED) && config.getBoolean(EagleConfigConstants.SERVICE_COPROCESSOR_ENABLED);
         this.eagleServicePort = config.hasPath(EagleConfigConstants.SERVICE_PORT) ? config.getInt(EagleConfigConstants.SERVICE_PORT) : EagleConfigConstants.DEFAULT_SERVICE_PORT;
-        this.tableNamePrefixedWithEnv = config.hasPath(EagleConfigConstants.SERVICE_TABLE_NAME_PREFIXED_WITH_ENVIRONMENT) && config.getBoolean(EagleConfigConstants.SERVICE_TABLE_NAME_PREFIXED_WITH_ENVIRONMENT);
-        this.hbaseClientScanCacheSize = config.hasPath(EagleConfigConstants.SERVICE_HBASE_CLIENT_SCAN_CACHE_SIZE) ? config.getInt(EagleConfigConstants.SERVICE_HBASE_CLIENT_SCAN_CACHE_SIZE) : hbaseClientScanCacheSize;
+        this.tableNamePrefixedWithEnv = config.hasPath(EagleConfigConstants.SERVICE_TABLE_NAME_PREFIXED_WITH_ENVIRONMENT) && config.getBoolean(EagleConfigConstants
+            .SERVICE_TABLE_NAME_PREFIXED_WITH_ENVIRONMENT);
+        this.hbaseClientScanCacheSize = config.hasPath(EagleConfigConstants.SERVICE_HBASE_CLIENT_SCAN_CACHE_SIZE) ? config.getInt(EagleConfigConstants.SERVICE_HBASE_CLIENT_SCAN_CACHE_SIZE) :
+            hbaseClientScanCacheSize;
         // initilize eagle service thread pool for parallel execution of hbase scan etc.
-        int threadPoolCoreSize = config.hasPath(EagleConfigConstants.SERVICE_THREADPOOL_CORE_SIZE) ? config.getInt(EagleConfigConstants.SERVICE_THREADPOOL_CORE_SIZE) : EagleConfigConstants.DEFAULT_THREAD_POOL_CORE_SIZE;
-        int threadPoolMaxSize = config.hasPath(EagleConfigConstants.SERVICE_THREADPOOL_MAX_SIZE) ? config.getInt(EagleConfigConstants.SERVICE_THREADPOOL_MAX_SIZE) : EagleConfigConstants.DEFAULT_THREAD_POOL_MAX_SIZE;
-        long threadPoolShrinkTime = config.hasPath(EagleConfigConstants.SERVICE_THREADPOOL_SHRINK_SIZE) ? config.getLong(EagleConfigConstants.SERVICE_THREADPOOL_SHRINK_SIZE) : EagleConfigConstants.DEFAULT_THREAD_POOL_SHRINK_TIME;
+        int threadPoolCoreSize = config.hasPath(EagleConfigConstants.SERVICE_THREADPOOL_CORE_SIZE) ? config.getInt(EagleConfigConstants.SERVICE_THREADPOOL_CORE_SIZE) : EagleConfigConstants
+            .DEFAULT_THREAD_POOL_CORE_SIZE;
+        int threadPoolMaxSize = config.hasPath(EagleConfigConstants.SERVICE_THREADPOOL_MAX_SIZE) ? config.getInt(EagleConfigConstants.SERVICE_THREADPOOL_MAX_SIZE) : EagleConfigConstants
+            .DEFAULT_THREAD_POOL_MAX_SIZE;
+        long threadPoolShrinkTime = config.hasPath(EagleConfigConstants.SERVICE_THREADPOOL_SHRINK_SIZE) ? config.getLong(EagleConfigConstants.SERVICE_THREADPOOL_SHRINK_SIZE) : EagleConfigConstants
+            .DEFAULT_THREAD_POOL_SHRINK_TIME;
         this.isServiceAuditingEnabled = config.hasPath(EagleConfigConstants.SERVICE_AUDITING_ENABLED) && config.getBoolean(EagleConfigConstants.SERVICE_AUDITING_ENABLED);
 
         this.executor = new ThreadPoolExecutor(threadPoolCoreSize, threadPoolMaxSize, threadPoolShrinkTime, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigHelper.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigHelper.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigHelper.java
index 2f15cd6..f79c340 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigHelper.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/config/EagleConfigHelper.java
@@ -32,12 +32,12 @@ public class EagleConfigHelper {
     }
 
     public static String getServiceUser(Config config) {
-        return config.hasPath(EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME) ?
-               config.getString(EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME) : null;
+        return config.hasPath(EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME) ? config.getString(EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.USERNAME)
+            : null;
     }
 
     public static String getServicePassword(Config config) {
-        return config.hasPath(EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD) ?
-                config.getString(EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD) : null;
+        return config.hasPath(EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD) ? config.getString(EagleConfigConstants.EAGLE_SERVICE + "." + EagleConfigConstants.PASSWORD)
+            : null;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/function/ThrowableConsumer2.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/function/ThrowableConsumer2.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/function/ThrowableConsumer2.java
index 330d48e..c78e770 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/function/ThrowableConsumer2.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/function/ThrowableConsumer2.java
@@ -17,6 +17,6 @@ package org.apache.eagle.common.function;
  * limitations under the License.
  */
 @FunctionalInterface
-public interface ThrowableConsumer2<T1,T2, E extends Throwable> {
-    void accept(T1 o1,T2 o2) throws E;
+public interface ThrowableConsumer2<T1, T2, E extends Throwable> {
+    void accept(T1 o1, T2 o2) throws E;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/function/ThrowableFunction.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/function/ThrowableFunction.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/function/ThrowableFunction.java
index 562abea..b91f927 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/function/ThrowableFunction.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/function/ThrowableFunction.java
@@ -1,7 +1,5 @@
 package org.apache.eagle.common.function;
 
-import java.sql.SQLException;
-
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/metric/AlertContext.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/metric/AlertContext.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/metric/AlertContext.java
index f8b11c3..bf719fc 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/metric/AlertContext.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/metric/AlertContext.java
@@ -24,71 +24,70 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- * not thread safe
+ * not thread safe.
  */
-public class AlertContext implements Serializable{
-	private static final Logger LOG = org.slf4j.LoggerFactory.getLogger(AlertContext.class);
+public class AlertContext implements Serializable {
+    private static final Logger LOG = org.slf4j.LoggerFactory.getLogger(AlertContext.class);
 
-	private Map<String, String> properties = new HashMap<String, String>();
-	
-	public AlertContext(){
-	}
-	
-	public AlertContext(AlertContext context){
-		this.properties = new HashMap<String, String>(context.properties);
-	}
-	
-	public String removeProperty(String name)
-	{
-		return properties.remove(name);
-	}
-	
-	public AlertContext addProperty(String name, String value){
-		properties.put(name, value);
-		return this;
-	}
+    private Map<String, String> properties = new HashMap<String, String>();
 
-	public AlertContext addAll(Map<String,String> propHash){
-		this.properties.putAll(propHash);
-		return this;
-	}
+    public AlertContext() {
+    }
 
-	public String toJsonString(){
-		ObjectMapper objectMapper = new ObjectMapper();
-		try {
-			return objectMapper.writeValueAsString(properties);
-		}catch(Exception ex){
-			LOG.error("fail converting alertcontext into string", ex);
-			return null;
-		}
-	}
+    public AlertContext(AlertContext context) {
+        this.properties = new HashMap<String, String>(context.properties);
+    }
 
-	public static AlertContext fromJsonString(String json){
-		ObjectMapper objectMapper = new ObjectMapper();
-		try{
-			Map m = objectMapper.readValue(json, Map.class);
-			AlertContext c = new AlertContext();
-			c.addAll(m);
-			return c;
-		}catch(Exception ex){
-			LOG.error("fail converting string into alertcontext", ex);
-			return null;
-		}
-	}
+    public String removeProperty(String name) {
+        return properties.remove(name);
+    }
 
-	public String getProperty(String name){
-		return properties.get(name);
-	}
-	
-	public String toString(){
-		return properties.toString();
-	}
+    public AlertContext addProperty(String name, String value) {
+        properties.put(name, value);
+        return this;
+    }
 
-	public Map<String, String> getProperties(){
-		return properties;
-	}
-	
-	public void setProperties(Map<String, String> properties){
-		this.properties = properties;
-	}
+    public AlertContext addAll(Map<String, String> propHash) {
+        this.properties.putAll(propHash);
+        return this;
+    }
+
+    public String toJsonString() {
+        ObjectMapper objectMapper = new ObjectMapper();
+        try {
+            return objectMapper.writeValueAsString(properties);
+        } catch (Exception ex) {
+            LOG.error("fail converting alertcontext into string", ex);
+            return null;
+        }
+    }
+
+    public static AlertContext fromJsonString(String json) {
+        ObjectMapper objectMapper = new ObjectMapper();
+        try {
+            Map m = objectMapper.readValue(json, Map.class);
+            AlertContext c = new AlertContext();
+            c.addAll(m);
+            return c;
+        } catch (Exception ex) {
+            LOG.error("fail converting string into alertcontext", ex);
+            return null;
+        }
+    }
+
+    public String getProperty(String name) {
+        return properties.get(name);
+    }
+
+    public String toString() {
+        return properties.toString();
+    }
+
+    public Map<String, String> getProperties() {
+        return properties;
+    }
+
+    public void setProperties(Map<String, String> properties) {
+        this.properties = properties;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/CommonGuiceModule.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/CommonGuiceModule.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/CommonGuiceModule.java
index c44ca01..86a3ea1 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/CommonGuiceModule.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/CommonGuiceModule.java
@@ -20,7 +20,7 @@ import com.google.inject.AbstractModule;
 import com.google.inject.Singleton;
 import com.typesafe.config.Config;
 
-public class CommonGuiceModule extends AbstractModule{
+public class CommonGuiceModule extends AbstractModule {
     @Override
     protected void configure() {
         bind(Config.class).toProvider(ConfigServiceProvider.class).in(Singleton.class);

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/GlobalScope.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/GlobalScope.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/GlobalScope.java
index e7c73e4..ee2f435 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/GlobalScope.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/GlobalScope.java
@@ -17,6 +17,7 @@
 package org.apache.eagle.common.module;
 
 /**
- * Global Scope
+ * Global Scope.
  */
-public enum GlobalScope implements ModuleScope {}
\ No newline at end of file
+public enum GlobalScope implements ModuleScope {
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/GuiceJUnitRunner.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/GuiceJUnitRunner.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/GuiceJUnitRunner.java
index ce04058..d22195d 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/GuiceJUnitRunner.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/GuiceJUnitRunner.java
@@ -28,6 +28,7 @@ import java.util.List;
 
 public class GuiceJUnitRunner extends BlockJUnit4ClassRunner {
     private final Injector injector;
+
     public GuiceJUnitRunner(Class<?> klass) throws InitializationError {
         super(klass);
         injector = createInjectorFor(getModulesFor(klass));
@@ -43,14 +44,15 @@ public class GuiceJUnitRunner extends BlockJUnit4ClassRunner {
 
     /**
      * Create a Guice Injector for the class under test.
+     *
      * @param classes Guice Modules
      * @return A Guice Injector instance.
      * @throws InitializationError If couldn't instantiate a module.
      */
     private Injector createInjectorFor(final Class<?>[] classes)
-            throws InitializationError {
+        throws InitializationError {
         final List<Module> modules = new ArrayList<>();
-        if(classes!= null) {
+        if (classes != null) {
             for (final Class<?> module : Arrays.asList(classes)) {
                 try {
                     modules.add((Module) module.newInstance());
@@ -65,12 +67,13 @@ public class GuiceJUnitRunner extends BlockJUnit4ClassRunner {
     /**
      * Get the list of Guice Modules request by GuiceModules annotation in the
      * class under test.
+     *
      * @param klass Class under test.
      * @return A Class Array of Guice Modules required by this class.
      * @throws InitializationError If the annotation is not present.
      */
     private Class<?>[] getModulesFor(final Class<?> klass)
-            throws InitializationError {
+        throws InitializationError {
         final Modules annotation = klass.getAnnotation(Modules.class);
         if (annotation == null) {
             return null;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleRegistry.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleRegistry.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleRegistry.java
index 8ae3984..49c1548 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleRegistry.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleRegistry.java
@@ -21,32 +21,38 @@ import com.google.inject.Module;
 import java.util.List;
 
 /**
- * Module Registry Repository
+ * Module Registry Repository.
  */
 public interface ModuleRegistry {
+
     /**
+     * Get Register.
      * @param modules
      */
-    void register(Class<? extends ModuleScope> scope, Module ... modules);
+    void register(Class<? extends ModuleScope> scope, Module... modules);
+
+    default void register(Module... modules) {
+        register(GlobalScope.class, modules);
+    }
 
     /**
-     *
+     * Get Module With Scope.
      * @param moduleScope
      * @return
      */
     List<Module> getModules(Class<? extends ModuleScope> moduleScope);
 
     /**
-     * @return
+     * Get All Modules.
+     * @return all modules
      */
-    List<Class<? extends ModuleScope>> getScopes();
+    List<Module> getModules();
 
     /**
-     * @return all modules
+     * Get All Scopes.
+     * @return
      */
-    List<Module> getModules();
+    List<Class<? extends ModuleScope>> getScopes();
+
 
-    default void register(Module ... modules){
-        register(GlobalScope.class,modules);
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleRegistryImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleRegistryImpl.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleRegistryImpl.java
index 3c45dac..4f13e50 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleRegistryImpl.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleRegistryImpl.java
@@ -24,7 +24,8 @@ import java.util.List;
 
 public class ModuleRegistryImpl implements ModuleRegistry {
     private final LinkedListMultimap<Class<? extends ModuleScope>, Module> moduleRepo;
-    public ModuleRegistryImpl(){
+
+    public ModuleRegistryImpl() {
         moduleRepo = LinkedListMultimap.create();
     }
 
@@ -39,12 +40,13 @@ public class ModuleRegistryImpl implements ModuleRegistry {
     }
 
     @Override
-    public List<Class<? extends ModuleScope>> getScopes() {
-        return Arrays.asList((Class<? extends ModuleScope>[]) moduleRepo.keys().toArray());
+    public List<Module> getModules() {
+        return moduleRepo.values();
     }
 
     @Override
-    public List<Module> getModules() {
-        return moduleRepo.values();
+    public List<Class<? extends ModuleScope>> getScopes() {
+        return Arrays.asList((Class<? extends ModuleScope>[]) moduleRepo.keys().toArray());
     }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleScope.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleScope.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleScope.java
index b385fba..b79a112 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleScope.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/ModuleScope.java
@@ -21,18 +21,20 @@ import com.google.inject.Module;
 import java.util.List;
 
 /**
+ * Module Scope.
  * @see ModuleRegistry
  */
 public interface ModuleScope {
     /**
+     * Get Modules.
      * @param registry ModuleRegistry
      * @return
      */
-    default List<Module> getModules(ModuleRegistry registry){
+    default List<Module> getModules(ModuleRegistry registry) {
         return registry.getModules(this.getClass());
     }
 
-    default String getName(){
+    default String getName() {
         return getClass().getName();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/Modules.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/Modules.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/Modules.java
index 8292e08..0f53948 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/Modules.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/module/Modules.java
@@ -17,11 +17,8 @@
 package org.apache.eagle.common.module;
 
 import com.google.inject.AbstractModule;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+
+import java.lang.annotation.*;
 
 /**
  * Defines the Guice Modules in use in the test class.

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/HadoopAccountService.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/HadoopAccountService.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/HadoopAccountService.java
index 0b4893a..925142d 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/HadoopAccountService.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/HadoopAccountService.java
@@ -19,5 +19,5 @@ package org.apache.eagle.common.service;
 import java.util.List;
 
 public interface HadoopAccountService {
-	public List<HadoopUser> searchByUsername(List<String> username);
+    public List<HadoopUser> searchByUsername(List<String> username);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/HadoopUser.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/HadoopUser.java b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/HadoopUser.java
index 2e84f77..5c9cf80 100644
--- a/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/HadoopUser.java
+++ b/eagle-core/eagle-common/src/main/java/org/apache/eagle/common/service/HadoopUser.java
@@ -19,26 +19,27 @@ package org.apache.eagle.common.service;
 import java.util.List;
 
 /**
+ * Hadoop User.
  * @since : 7/11/14,2014
  */
 public class HadoopUser {
-	public String getUsername() {
-		return username;
-	}
+    public String getUsername() {
+        return username;
+    }
 
-	public void setUsername(String username) {
-		this.username = username;
-	}
+    public void setUsername(String username) {
+        this.username = username;
+    }
 
-	protected String username;
+    protected String username;
 
-	public List<String> getEmail() {
-		return email;
-	}
+    public List<String> getEmail() {
+        return email;
+    }
 
-	public void setEmail(List<String> emails) {
-		this.email = emails;
-	}
+    public void setEmail(List<String> emails) {
+        this.email = emails;
+    }
 
-	protected List<String> email;
+    protected List<String> email;
 }
\ No newline at end of file