eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [02/11] incubator-eagle git commit: [EAGLE-382][EAGLE-385] Monitoring Application Framework Core
Date Thu, 21 Jul 2016 12:28:46 GMT
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/main/resources/header.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/main/resources/header.vm b/eagle-core/eagle-query/eagle-common/src/main/resources/header.vm
deleted file mode 100755
index 6731aee..0000000
--- a/eagle-core/eagle-query/eagle-common/src/main/resources/header.vm
+++ /dev/null
@@ -1,303 +0,0 @@
-#*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @version 0.3.0
- *#
-<!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;
-    }
-
-    /***************************************************
-    ****************************************************
-    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]-->
-</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">

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/main/resources/templates/tec_alert.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/main/resources/templates/tec_alert.vm b/eagle-core/eagle-query/eagle-common/src/main/resources/templates/tec_alert.vm
deleted file mode 100755
index fa3eee5..0000000
--- a/eagle-core/eagle-query/eagle-common/src/main/resources/templates/tec_alert.vm
+++ /dev/null
@@ -1,113 +0,0 @@
-#*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @version 0.3.0
- *#
-#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">
-      <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">
-      <span>
-        Detail Info
-      </span>
-    </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">
-      <span class="outlook">
-         Apache Eagle <a href="http://<Eagle-Host>:9090/eagle-web/ui/eagle.html"
-                  target ="_blank" title="Hadoop Eagle">Apache Eagle</a>
-      </span>
-    </td>
-  </tr>
-</table>
-#parse("footer.vm")
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java b/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java
deleted file mode 100644
index a08c3d1..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestByteUtil.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.common;
-
-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);
-	}
-
-	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/e21b073f/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java b/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java
deleted file mode 100644
index 3642635..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayList.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.common;
-
-import org.junit.Assert;
-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());
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java b/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java
deleted file mode 100644
index e4fbb18..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestCircularArrayListSortedSet.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.common;
-
-import org.junit.Assert;
-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());
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java b/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java
deleted file mode 100755
index 062d44a..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestDateTimeUtil.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.common;
-
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-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);
-//		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));
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java b/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java
deleted file mode 100755
index 384c274..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/TestEagleBase64Wrapper.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.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);
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java b/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java
deleted file mode 100644
index 892db0c..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/config/TestEagleConfig.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.common.config;
-
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @since 9/22/15
- */
-public class TestEagleConfig {
-    private EagleConfig config;
-
-    @Before
-    public void setUp(){
-        System.setProperty("config.resource","test-service-config.conf");
-        config = EagleConfigFactory.load();
-    }
-
-    @Test
-    public void testInit(){
-        Assert.assertEquals("test",config.getEnv());
-        Assert.assertEquals("localhost",config.getServiceHost());
-        Assert.assertEquals(9090,config.getServicePort());
-        Assert.assertEquals("hbase",config.getStorageType());
-        Assert.assertEquals(false,config.isCoprocessorEnabled());
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java b/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java
deleted file mode 100644
index 894961b..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/java/org/apache/eagle/common/metric/TestAlertContext.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.eagle.common.metric;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.HashMap;
-
-/**
- * since 1/20/16.
- */
-public class TestAlertContext {
-    @Test
-    public void test(){
-        HashMap<String, String> map = new HashMap<String, String>();
-        map.put("key1", "value1");
-        map.put("key2", "value2");
-        AlertContext context = new AlertContext();
-        context.addAll(map);
-        String json = context.toJsonString();
-        System.out.println(json);
-        Assert.assertEquals(map, AlertContext.fromJsonString(json).getProperties());
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/test/resources/footer.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/resources/footer.vm b/eagle-core/eagle-query/eagle-common/src/test/resources/footer.vm
deleted file mode 100755
index 8df4b06..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/resources/footer.vm
+++ /dev/null
@@ -1,25 +0,0 @@
-#*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @version 0.3.0
- *#
-    </td>
-  </tr>
-  </tr>
-</table>
-<!-- End of wrapper table -->
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/test/resources/header.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/resources/header.vm b/eagle-core/eagle-query/eagle-common/src/test/resources/header.vm
deleted file mode 100755
index 8bd4388..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/resources/header.vm
+++ /dev/null
@@ -1,299 +0,0 @@
-#*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @version 0.3.0
- *#
-<!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;
-    }
-
-    /***************************************************
-    ****************************************************
-    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]-->
-</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">

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/resources/log4j.properties b/eagle-core/eagle-query/eagle-common/src/test/resources/log4j.properties
deleted file mode 100644
index 5a5709e..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-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}
-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/e21b073f/eagle-core/eagle-query/eagle-common/src/test/resources/templates/tec_alert.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/resources/templates/tec_alert.vm b/eagle-core/eagle-query/eagle-common/src/test/resources/templates/tec_alert.vm
deleted file mode 100755
index 2219ebf..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/resources/templates/tec_alert.vm
+++ /dev/null
@@ -1,119 +0,0 @@
-#*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @version 0.3.0
- *#
-#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">
-      <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">
-      <span>
-        Detail Info
-      </span>
-    </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>
-            <img src="cid:$cid.get("chart.png")"/>
-        </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>
-      </span>
-    </td>
-  </tr>
-</table>
-
-#parse("footer.vm")
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/test/resources/templates/test_anomaly_alert.vm
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/resources/templates/test_anomaly_alert.vm b/eagle-core/eagle-query/eagle-common/src/test/resources/templates/test_anomaly_alert.vm
deleted file mode 100644
index da1f8d0..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/resources/templates/test_anomaly_alert.vm
+++ /dev/null
@@ -1,137 +0,0 @@
-#*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @version 0.3.0
- *#
-#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">
-      <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">
-      <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">
-      <span>
-        Detail Information
-      </span>
-    </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">
-      <span class="outlook">
-         Apache Eagle <a href="http://hadoop-eagle.vip.dc1.xyz.com"
-                  target ="_blank" title="Hadoop Eagle">Apache Eagle</a>
-      </span>
-    </td>
-  </tr>
-</table>
-<br>
-<br>
-
-#parse("footer.vm")
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-common/src/test/resources/test-service-config.conf
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-common/src/test/resources/test-service-config.conf b/eagle-core/eagle-query/eagle-common/src/test/resources/test-service-config.conf
deleted file mode 100644
index 848391d..0000000
--- a/eagle-core/eagle-query/eagle-common/src/test/resources/test-service-config.conf
+++ /dev/null
@@ -1,30 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-eagle {
-	timezone = "UTC"
-
-	service {
-		env = "test"
-		host = "localhost"
-		port = 9090
-		storage-type = "hbase"
-		table-name-prefixed-with-environment = true
-		hbase-zookeeper-quorum = "localhost"
-		hbase-zookeeper-property-clientPort = 2181
-		zookeeper-znode-parent = "/hbase-unsecure"
-		coprocessor-enabled = false
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/eagle-service-base/src/main/java/org/apache/eagle/service/generic/GenericObjectMapperProvider.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/eagle-service-base/src/main/java/org/apache/eagle/service/generic/GenericObjectMapperProvider.java b/eagle-core/eagle-query/eagle-service-base/src/main/java/org/apache/eagle/service/generic/GenericObjectMapperProvider.java
index c10c28d..35dd4b7 100755
--- a/eagle-core/eagle-query/eagle-service-base/src/main/java/org/apache/eagle/service/generic/GenericObjectMapperProvider.java
+++ b/eagle-core/eagle-query/eagle-service-base/src/main/java/org/apache/eagle/service/generic/GenericObjectMapperProvider.java
@@ -16,6 +16,7 @@
  */
 package org.apache.eagle.service.generic;
 
+import com.google.inject.Singleton;
 import org.apache.eagle.log.base.taggedlog.TaggedLogAPIEntity;
 import org.codehaus.jackson.map.ObjectMapper;
 import org.codehaus.jackson.map.ser.FilterProvider;
@@ -27,6 +28,7 @@ import javax.ws.rs.ext.Provider;
 
 @Provider
 @Produces(MediaType.APPLICATION_JSON)
+@Singleton
 public class GenericObjectMapperProvider implements ContextResolver<ObjectMapper> {
     private final static ObjectMapper OBJECT_MAPPER = new ObjectMapper();
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/eagle-query/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-query/pom.xml b/eagle-core/eagle-query/pom.xml
index 798e138..bc6f729 100644
--- a/eagle-core/eagle-query/pom.xml
+++ b/eagle-core/eagle-query/pom.xml
@@ -31,7 +31,6 @@
 	<name>eagle-query-parent</name>
 
 	<modules>
-		<module>eagle-common</module>
 		<module>eagle-antlr</module>
 		<module>eagle-entity-base</module>
 		<module>eagle-audit-base</module>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-core/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/pom.xml b/eagle-core/pom.xml
index 0bcab2a..320ea74 100644
--- a/eagle-core/pom.xml
+++ b/eagle-core/pom.xml
@@ -41,6 +41,8 @@
         <module>eagle-query</module>
         <module>eagle-embed</module>
         <module>eagle-metric</module>
-        <module>eagle-application-management</module>
+        <module>eagle-metadata</module>
+        <module>eagle-common</module>
+        <module>eagle-app</module>
     </modules>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-examples/eagle-app-example/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/pom.xml b/eagle-examples/eagle-app-example/pom.xml
new file mode 100644
index 0000000..45c887c
--- /dev/null
+++ b/eagle-examples/eagle-app-example/pom.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>eagle-examples</artifactId>
+        <groupId>org.apache.eagle</groupId>
+        <version>0.5.0-incubating-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>eagle-app-example</artifactId>
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.eagle</groupId>
+            <artifactId>eagle-app-base</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>1.10.19</version>
+        </dependency>
+    </dependencies>
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/webapp/app</directory>
+                <targetPath>assets/</targetPath>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+        </resources>
+    </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplication.java
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplication.java b/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplication.java
new file mode 100644
index 0000000..71037b3
--- /dev/null
+++ b/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplication.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.eagle.app.example;
+
+import backtype.storm.topology.TopologyBuilder;
+import backtype.storm.tuple.Fields;
+import org.apache.eagle.app.ApplicationContext;
+import org.apache.eagle.app.AbstractApplication;
+
+public class ExampleApplication extends AbstractApplication {
+    protected void buildTopology(TopologyBuilder builder, ApplicationContext context) {
+        builder.setSpout("mockMetricSpout", new RandomEventSpout(), 4);
+        builder.setBolt("sink_1",context.getStreamSink("SAMPLE_STREAM_1")).fieldsGrouping("mockMetricSpout",new Fields("key"));
+        builder.setBolt("sink_2",context.getStreamSink("SAMPLE_STREAM_2")).fieldsGrouping("mockMetricSpout",new Fields("key"));
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplicationProvider.java
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplicationProvider.java b/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplicationProvider.java
new file mode 100644
index 0000000..bd4e9b1
--- /dev/null
+++ b/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplicationProvider.java
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.eagle.app.example;
+
+import org.apache.eagle.alert.engine.coordinator.StreamColumn;
+import org.apache.eagle.alert.engine.coordinator.StreamDefinition;
+import org.apache.eagle.app.spi.AbstractApplicationProvider;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Define application provider programmatically
+ */
+public class ExampleApplicationProvider extends AbstractApplicationProvider<ExampleApplication> {
+    @Override
+    protected void configure() {
+        setType("EXAMPLE_APPLICATION");
+        setName("Example Monitoring Application");
+        setVersion("0.5.0-incubating");
+        setAppClass(ExampleApplication.class);
+        setViewPath("/apps/example");
+        setAppConfig("ExampleApplicationConf.xml");
+        setStreams(Arrays.asList(createSampleStreamDefinition("SAMPLE_STREAM_1"), createSampleStreamDefinition("SAMPLE_STREAM_2")));
+    }
+
+    private static StreamDefinition createSampleStreamDefinition(String streamId){
+        StreamDefinition sampleStreamDefinition = new StreamDefinition();
+        sampleStreamDefinition.setStreamId(streamId);
+        sampleStreamDefinition.setTimeseries(true);
+        sampleStreamDefinition.setValidate(true);
+        sampleStreamDefinition.setDescription("Auto generated sample Schema for "+streamId);
+        List<StreamColumn> streamColumns = new ArrayList<>();
+
+        streamColumns.add(new StreamColumn.Builder().name("name").type(StreamColumn.Type.STRING).build());
+        streamColumns.add(new StreamColumn.Builder().name("host").type(StreamColumn.Type.STRING).build());
+        streamColumns.add(new StreamColumn.Builder().name("flag").type(StreamColumn.Type.BOOL).build());
+        streamColumns.add(new StreamColumn.Builder().name("timestamp").type(StreamColumn.Type.LONG).build());
+        streamColumns.add(new StreamColumn.Builder().name("value").type(StreamColumn.Type.DOUBLE).build());
+        sampleStreamDefinition.setColumns(streamColumns);
+        return sampleStreamDefinition;
+    }
+
+    @Override
+    public ExampleApplication getApplication() {
+        return new ExampleApplication();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplicationProvider2.java
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplicationProvider2.java b/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplicationProvider2.java
new file mode 100644
index 0000000..f4b3f2f
--- /dev/null
+++ b/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/ExampleApplicationProvider2.java
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.eagle.app.example;
+
+import org.apache.eagle.app.spi.AbstractApplicationProvider;
+
+/**
+ * Define application provider with metadata.xml
+ */
+public class ExampleApplicationProvider2 extends AbstractApplicationProvider<ExampleApplication> {
+    public ExampleApplicationProvider2() {
+        super("ExampleApplicationMetadata.xml");
+    }
+
+    @Override
+    public ExampleApplication getApplication() {
+        return new ExampleApplication();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/RandomEventSpout.java
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/RandomEventSpout.java b/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/RandomEventSpout.java
new file mode 100644
index 0000000..ac507b6
--- /dev/null
+++ b/eagle-examples/eagle-app-example/src/main/java/org/apache/eagle/app/example/RandomEventSpout.java
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.eagle.app.example;
+
+import backtype.storm.spout.SpoutOutputCollector;
+import backtype.storm.task.TopologyContext;
+import backtype.storm.topology.OutputFieldsDeclarer;
+import backtype.storm.topology.base.BaseRichSpout;
+import backtype.storm.tuple.Fields;
+import backtype.storm.tuple.Values;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Map;
+
+public class RandomEventSpout extends BaseRichSpout {
+        private final static Logger LOG = LoggerFactory.getLogger(RandomEventSpout.class);
+        SpoutOutputCollector _collector;
+
+        @SuppressWarnings("rawtypes")
+        @Override
+        public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) {
+            _collector = collector;
+        }
+
+        @Override
+        public void nextTuple() {
+
+        }
+
+        @Override
+        public void ack(Object id) {
+            //Ignored
+        }
+
+        @Override
+        public void fail(Object id) {
+            _collector.emit(new Values(id), id);
+        }
+
+        @Override
+        public void declareOutputFields(OutputFieldsDeclarer declarer) {
+            declarer.declare(new Fields("key","event"));
+        }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-examples/eagle-app-example/src/main/resources/ExampleApplicationConf.xml
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/main/resources/ExampleApplicationConf.xml b/eagle-examples/eagle-app-example/src/main/resources/ExampleApplicationConf.xml
new file mode 100644
index 0000000..4a31c5e
--- /dev/null
+++ b/eagle-examples/eagle-app-example/src/main/resources/ExampleApplicationConf.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<configuration>
+    <property>
+        <name>kafka.topic</name>
+        <displayName>Kafka Topic</displayName>
+        <value>hdfs_audit</value>
+        <description>Kafka Topic</description>
+    </property>
+    <property>
+        <name>zookeeper.server</name>
+        <displayName>Zookeeper Server</displayName>
+        <value>localhost:2181</value>
+        <description>Zookeeper Server address</description>
+    </property>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-examples/eagle-app-example/src/main/resources/ExampleApplicationMetadata.xml
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/main/resources/ExampleApplicationMetadata.xml b/eagle-examples/eagle-app-example/src/main/resources/ExampleApplicationMetadata.xml
new file mode 100644
index 0000000..b61ed54
--- /dev/null
+++ b/eagle-examples/eagle-app-example/src/main/resources/ExampleApplicationMetadata.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<application>
+    <type>EXAMPLE_APPLICATION_2</type>
+    <name>Example Monitoring Application</name>
+    <version>0.5.0-incubating</version>
+    <appClass>org.apache.eagle.app.example.ExampleApplication</appClass>
+    <viewPath>/apps/example</viewPath>
+    <configuration>
+        <property>
+            <name>message</name>
+            <displayName>Message</displayName>
+            <value>Hello, example application!</value>
+            <description>Just an sample configuration property</description>
+        </property>
+    </configuration>
+    <streams>
+        <stream>
+            <streamId>SAMPLE_STREAM_1</streamId>
+            <description>Sample output stream #1</description>
+            <validate>true</validate>
+            <timeseries>true</timeseries>
+            <columns>
+                <column>
+                    <name>metric</name>
+                    <type>string</type>
+                </column>
+                <column>
+                    <name>value</name>
+                    <type>double</type>
+                    <defaultValue>0.0</defaultValue>
+                </column>
+            </columns>
+        </stream>
+        <stream>
+            <streamId>SAMPLE_STREAM_2</streamId>
+            <description>Sample output stream #2</description>
+            <validate>true</validate>
+            <timeseries>true</timeseries>
+            <columns>
+                <column>
+                    <name>metric</name>
+                    <type>string</type>
+                </column>
+                <column>
+                    <name>value</name>
+                    <type>double</type>
+                    <defaultValue>0.0</defaultValue>
+                </column>
+            </columns>
+        </stream>
+    </streams>
+    <docs>
+        <install>
+# Step 1: Create source kafka topic named "${site}_example_source_topic"
+
+./bin/kafka-topics.sh --create --topic example_source_topic --replication-factor 1 --replication 1
+
+# Step 2: Set up data collector to flow data into kafka topic in
+
+./bin/logstash -f log_collector.conf
+
+## `log_collector.conf` sample as following:
+
+input {
+
+}
+filter {
+
+}
+output{
+
+}
+
+# Step 3: start application
+
+# Step 4: monitor with featured portal or alert with policies
+        </install>
+        <uninstall>
+# Step 1: stop and uninstall application
+# Step 2: delete kafka topic named "${site}_example_source_topic"
+# Step 3: stop logstash
+        </uninstall>
+    </docs>
+</application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-examples/eagle-app-example/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider b/eagle-examples/eagle-app-example/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
new file mode 100644
index 0000000..808e4ab
--- /dev/null
+++ b/eagle-examples/eagle-app-example/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+org.apache.eagle.app.example.ExampleApplicationProvider
+org.apache.eagle.app.example.ExampleApplicationProvider2
\ No newline at end of file

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

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-examples/eagle-app-example/src/main/webapp/package.json
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/main/webapp/package.json b/eagle-examples/eagle-app-example/src/main/webapp/package.json
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationTest.java
----------------------------------------------------------------------
diff --git a/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationTest.java b/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationTest.java
new file mode 100644
index 0000000..3002025
--- /dev/null
+++ b/eagle-examples/eagle-app-example/src/test/java/org/apache/eagle/app/example/ExampleApplicationTest.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.eagle.app.example;
+
+import com.google.inject.Inject;
+import org.apache.eagle.app.resource.ApplicationResource;
+import org.apache.eagle.app.service.AppOperations;
+import org.apache.eagle.app.test.AppSimulator;
+import org.apache.eagle.app.test.AppUnitTestRunner;
+import org.apache.eagle.metadata.model.ApplicationDesc;
+import org.apache.eagle.metadata.model.ApplicationEntity;
+import org.apache.eagle.metadata.model.SiteEntity;
+import org.apache.eagle.metadata.resource.SiteResource;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.Collection;
+
+@RunWith(AppUnitTestRunner.class)
+public class ExampleApplicationTest {
+    @Inject private SiteResource siteResource;
+    @Inject private ApplicationResource applicationResource;
+    @Inject private AppSimulator simulator;
+
+    @Test
+    public void testApplicationProviderLoading(){
+        Collection<ApplicationDesc> applicationDescs = applicationResource.getApplicationDescs();
+        Assert.assertNotNull(applicationDescs);
+        Assert.assertEquals(2,applicationDescs.size());
+    }
+
+    /**
+     * register site
+     * install app
+     * start app
+     * stop app
+     * uninstall app
+     *
+     * @throws InterruptedException
+     */
+    @Test
+    public void testApplicationLifecycle() throws InterruptedException {
+        // Create local site
+        SiteEntity siteEntity = new SiteEntity();
+        siteEntity.setSiteId("test_site");
+        siteEntity.setSiteName("Test Site");
+        siteEntity.setDescription("Test Site for ExampleApplicationTest");
+        siteResource.createSite(siteEntity);
+        Assert.assertNotNull(siteEntity.getUuid());
+
+        // Install application
+        ApplicationEntity applicationEntity = applicationResource.installApplication(new AppOperations.InstallOperation("test_site","EXAMPLE_APPLICATION", ApplicationEntity.Mode.LOCAL));
+        // Start application
+        applicationResource.startApplication(new AppOperations.StartOperation(applicationEntity.getUuid()));
+        // Stop application
+        applicationResource.stopApplication(new AppOperations.StopOperation(applicationEntity.getUuid()));
+        // Uninstall application
+        applicationResource.uninstallApplication(new AppOperations.UninstallOperation(applicationEntity.getUuid()));
+        try {
+            applicationResource.getApplicationEntityByUUID(applicationEntity.getUuid());
+            Assert.fail("Application instance (UUID: "+applicationEntity.getUuid()+") should have been uninstalled");
+        } catch (Exception ex){
+            // Expected exception
+        }
+    }
+
+    @Test
+    public void testApplicationQuickRunWithAppType(){
+        simulator.submit("EXAMPLE_APPLICATION");
+    }
+
+    @Test
+    public void testApplicationQuickRunWithAppProvider(){
+        simulator.submit(ExampleApplicationProvider.class);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/e21b073f/eagle-examples/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-examples/pom.xml b/eagle-examples/pom.xml
index 9b0f38f..108c649 100644
--- a/eagle-examples/pom.xml
+++ b/eagle-examples/pom.xml
@@ -27,5 +27,6 @@
     <packaging>pom</packaging>
     <modules>
         <module>eagle-topology-example</module>
+        <module>eagle-app-example</module>
     </modules>
 </project>



Mime
View raw message