You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by st...@apache.org on 2014/06/23 23:47:37 UTC

[01/13] git commit: SLIDER-154 HBASE_LOG_DIR shouldn't contain comma

Repository: incubator-slider
Updated Branches:
  refs/heads/feature/SLIDER-153_add_slider_py_command 19d313d7f -> acdfe5bd6


SLIDER-154 HBASE_LOG_DIR shouldn't contain comma


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

Branch: refs/heads/feature/SLIDER-153_add_slider_py_command
Commit: 1a8062e3ec06c39d10b80f7adc764a7e2c155944
Parents: 5023eb5
Author: tedyu <yu...@gmail.com>
Authored: Fri Jun 20 16:38:27 2014 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Fri Jun 20 16:38:27 2014 -0700

----------------------------------------------------------------------
 .../org/apache/slider/providers/hbase/HBaseProviderService.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/1a8062e3/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java b/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java
index 407f39a..5405753 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java
+++ b/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java
@@ -127,13 +127,14 @@ public class HBaseProviderService extends AbstractProviderService implements
     // Set the environment
     launcher.putEnv(SliderUtils.buildEnvMap(appComponent));
 
-    launcher.setEnv(HBASE_LOG_DIR, providerUtils.getLogdir());
+    String logDir = providerUtils.getLogdir();
+    int idx = logDir.indexOf(",");
+    launcher.setEnv(HBASE_LOG_DIR, idx > 0 ? logDir.substring(0, idx) : logDir);
 
     launcher.setEnv(PROPAGATED_CONFDIR,
         ProviderUtils.convertToAppRelativePath(
             SliderKeys.PROPAGATED_CONF_DIR_NAME) );
 
-
     //local resources
 
     //add the configuration resources


[10/13] git commit: Merge branch 'develop' into feature/SLIDER-153_add_slider_py_command

Posted by st...@apache.org.
Merge branch 'develop' into feature/SLIDER-153_add_slider_py_command


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

Branch: refs/heads/feature/SLIDER-153_add_slider_py_command
Commit: e519fbcc645894541bdf93d1fef9ceba36ded847
Parents: 19d313d 537d87c
Author: Steve Loughran <st...@apache.org>
Authored: Mon Jun 23 13:33:20 2014 -0700
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Jun 23 13:33:20 2014 -0700

----------------------------------------------------------------------
 app-packages/hbase-v0_96/README.txt             |  33 --
 app-packages/hbase-v0_96/appConfig.json         |  67 ----
 .../hbase-v0_96/configuration/global.xml        | 160 --------
 .../hbase-v0_96/configuration/hbase-log4j.xml   | 142 --------
 .../hbase-v0_96/configuration/hbase-policy.xml  |  53 ---
 .../hbase-v0_96/configuration/hbase-site.xml    | 365 -------------------
 app-packages/hbase-v0_96/ganglia_metrics.json   |  38 --
 app-packages/hbase-v0_96/jmx_metrics.json       |  56 ---
 app-packages/hbase-v0_96/metainfo.xml           | 109 ------
 .../hbase-0.96.1-hadoop2-bin.tar.gz.REPLACE     |  16 -
 .../hbase-v0_96/package/scripts/__init__.py     |  19 -
 .../hbase-v0_96/package/scripts/functions.py    |  40 --
 .../hbase-v0_96/package/scripts/hbase.py        | 125 -------
 .../hbase-v0_96/package/scripts/hbase_client.py |  43 ---
 .../hbase-v0_96/package/scripts/hbase_master.py |  63 ----
 .../package/scripts/hbase_regionserver.py       |  66 ----
 .../package/scripts/hbase_service.py            |  45 ---
 .../hbase-v0_96/package/scripts/params.py       | 109 ------
 .../package/scripts/status_params.py            |  26 --
 ...-metrics2-hbase.properties-GANGLIA-MASTER.j2 |  62 ----
 ...doop-metrics2-hbase.properties-GANGLIA-RS.j2 |  62 ----
 .../package/templates/hbase-env.sh.j2           |  81 ----
 .../package/templates/hbase_client_jaas.conf.j2 |  22 --
 .../package/templates/hbase_master_jaas.conf.j2 |  25 --
 .../templates/hbase_regionserver_jaas.conf.j2   |  25 --
 .../package/templates/regionservers.j2          |  20 -
 app-packages/hbase-v0_96/resources.json         |  19 -
 app-packages/hbase/README.txt                   |   8 +-
 slider-agent/conf/agent.ini                     |   2 +
 .../src/main/python/agent/AgentConfig.py        |  21 ++
 slider-agent/src/main/python/agent/Constants.py |   3 +
 .../src/main/python/agent/Controller.py         |  23 +-
 slider-agent/src/main/python/agent/main.py      |   4 +
 .../src/test/python/agent/TestController.py     |  30 ++
 slider-agent/src/test/python/agent/TestMain.py  |   5 +-
 .../providers/AbstractProviderService.java      |  15 +-
 .../slider/providers/ProviderService.java       |   5 +-
 .../slider/providers/agent/AgentKeys.java       |   3 +
 .../providers/agent/AgentLaunchParameter.java   | 130 +++++++
 .../providers/agent/AgentProviderService.java   | 179 +++++++--
 .../slider/providers/agent/AgentRoles.java      |  18 +-
 .../apache/slider/providers/agent/Command.java  |  13 +-
 .../slider/providers/agent/CommandResult.java   |  16 +-
 .../providers/agent/ComponentInstanceState.java |  24 ++
 .../slider/providers/agent/ContainerState.java  |  41 +++
 .../providers/agent/HeartbeatMonitor.java       | 116 ++++++
 .../server/appmaster/AMViewForProviders.java    |  27 ++
 .../server/appmaster/SliderAppMaster.java       |  32 +-
 .../slider/server/appmaster/state/AppState.java |  20 +
 .../services/workflow/ForkedProcessService.java |  25 +-
 .../services/workflow/LongLivedProcess.java     |  13 +
 .../test_command_log/appConfig_fast_no_reg.json |  29 ++
 .../test_command_log/appConfig_no_hb.json       |  29 ++
 .../model/mock/MockProviderService.groovy       |   4 +-
 .../agent/TestAgentLaunchParameter.java         |  76 ++++
 .../providers/agent/TestHeartbeatMonitor.java   | 136 +++++++
 .../publisher/TestAgentProviderService.java     |   5 +-
 .../TestWorkflowForkedProcessService.java       |   3 +-
 .../lifecycle/AgentCommandTestBase.groovy       | 100 +++--
 .../lifecycle/TestAgentClusterLifecycle.groovy  |   2 +-
 .../funtest/lifecycle/TestAgentFailures.groovy  | 103 ++++++
 .../funtest/lifecycle/TestAgentFailures2.groovy | 103 ++++++
 .../lifecycle/TestAppsThroughAgent.groovy       |  90 ++---
 .../providers/hbase/HBaseProviderService.java   |  13 +-
 .../slider_specs/creating_app_definitions.md    |  80 ++--
 65 files changed, 1349 insertions(+), 2088 deletions(-)
----------------------------------------------------------------------



[08/13] git commit: SLIDER-157 Remove app-packages/hbase-v0_96

Posted by st...@apache.org.
SLIDER-157 Remove app-packages/hbase-v0_96


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

Branch: refs/heads/feature/SLIDER-153_add_slider_py_command
Commit: bc0c672843efaa8d83a97a94d1152f6ebd1c27c1
Parents: 7729653
Author: tedyu <yu...@gmail.com>
Authored: Mon Jun 23 09:24:46 2014 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Mon Jun 23 09:24:46 2014 -0700

----------------------------------------------------------------------
 .../slider_specs/creating_app_definitions.md    | 80 +++++++++++---------
 1 file changed, 43 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/bc0c6728/src/site/markdown/slider_specs/creating_app_definitions.md
----------------------------------------------------------------------
diff --git a/src/site/markdown/slider_specs/creating_app_definitions.md b/src/site/markdown/slider_specs/creating_app_definitions.md
index be3dd33..ab9f51c 100644
--- a/src/site/markdown/slider_specs/creating_app_definitions.md
+++ b/src/site/markdown/slider_specs/creating_app_definitions.md
@@ -70,45 +70,51 @@ Additional configuration parameters are described in `app-packages/accumulo/READ
 
 For other app packages, follow this example:
 
-* cd slider/app-packages/hbase-v0_96
-* zip -r hbase_v096.zip .
-* Looking at the content through unzip -l "$@" hbase_v096.zip
+* cd slider/app-packages/hbase
+* zip -r hbase-v098.zip .
+* Looking at the content through unzip -l "$@" hbase-v098.zip
 
 ```
-Archive:  hbase_v096.zip
-  Length     Date   Time    Name
- --------    ----   ----    ----
-     3163  05-16-14 16:32   appConfig.json
-        0  05-02-14 07:51   configuration/
-     5077  05-02-14 07:51   configuration/global.xml
-     5248  05-02-14 07:51   configuration/hbase-log4j.xml
-     2250  05-02-14 07:51   configuration/hbase-policy.xml
-    14705  05-02-14 07:51   configuration/hbase-site.xml
-     3332  05-16-14 16:33   metainfo.xml
-        0  05-02-14 07:51   package/
-        0  05-19-14 20:36   package/files/
- 83154798  05-19-14 20:36   package/files/hbase-0.96.1-hadoop2-bin.tar.gz
-        0  05-02-14 07:51   package/scripts/
-      787  05-02-14 07:51   package/scripts/__init__.py
-     1378  05-02-14 07:51   package/scripts/functions.py
-     3599  05-02-14 07:51   package/scripts/hbase.py
-     1205  05-02-14 07:51   package/scripts/hbase_client.py
-     1640  05-02-14 07:51   package/scripts/hbase_master.py
-     1764  05-02-14 07:51   package/scripts/hbase_regionserver.py
-     1482  05-02-14 07:51   package/scripts/hbase_service.py
-     4924  05-02-14 07:51   package/scripts/params.py
-      973  05-02-14 07:51   package/scripts/status_params.py
-        0  05-02-14 07:51   package/templates/
-     2723  05-02-14 07:51   package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2
-     2723  05-02-14 07:51   package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2
-     3878  05-02-14 07:51   package/templates/hbase-env.sh.j2
-      909  05-02-14 07:51   package/templates/hbase_client_jaas.conf.j2
-      989  05-02-14 07:51   package/templates/hbase_master_jaas.conf.j2
-     1001  05-02-14 07:51   package/templates/hbase_regionserver_jaas.conf.j2
-      837  05-02-14 07:51   package/templates/regionservers.j2
-      357  05-12-14 12:04   resources.json
- --------                   -------
- 83219742                   29 files
+Archive:  hbase-v098.zip
+  Length      Date    Time    Name
+---------  ---------- -----   ----
+     3158  06-19-2014 22:08   appConfig.json
+        0  06-19-2014 22:15   configuration/
+     5077  06-19-2014 22:15   configuration/global.xml
+     5248  06-19-2014 22:15   configuration/hbase-log4j.xml
+     2250  06-19-2014 22:15   configuration/hbase-policy.xml
+    14705  06-19-2014 22:15   configuration/hbase-site.xml
+     2142  06-19-2014 22:17   jmx_metrics.json
+     3991  06-19-2014 22:45   metainfo.xml
+        0  06-19-2014 22:33   package/
+        0  06-19-2014 22:31   package/files/
+ 83278591  06-19-2014 22:31   package/files/hbase-0.98.3-hadoop2-bin.tar.gz
+        0  06-19-2014 22:29   package/scripts/
+      787  06-19-2014 22:27   package/scripts/__init__.py
+     1378  06-19-2014 22:27   package/scripts/functions.py
+     3738  06-19-2014 22:27   package/scripts/hbase.py
+     1205  06-19-2014 22:27   package/scripts/hbase_client.py
+     1640  06-19-2014 22:27   package/scripts/hbase_master.py
+     1764  06-19-2014 22:27   package/scripts/hbase_regionserver.py
+     1482  06-19-2014 22:27   package/scripts/hbase_service.py
+     5089  06-19-2014 22:27   package/scripts/params.py
+      973  06-19-2014 22:27   package/scripts/status_params.py
+        0  06-19-2014 22:34   package/templates/
+     2799  06-19-2014 22:34   package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2
+     2799  06-19-2014 22:34   package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2
+     3878  06-19-2014 22:34   package/templates/hbase-env.sh.j2
+      909  06-19-2014 22:34   package/templates/hbase_client_jaas.conf.j2
+      989  06-19-2014 22:34   package/templates/hbase_master_jaas.conf.j2
+     1001  06-19-2014 22:34   package/templates/hbase_regionserver_jaas.conf.j2
+      837  06-19-2014 22:34   package/templates/regionservers.j2
+     3486  06-19-2014 22:39   pom.xml
+     1921  06-19-2014 21:53   README.txt
+      358  06-19-2014 22:36   resources.json
+        0  06-19-2014 22:40   src/
+        0  06-19-2014 23:02   src/assembly/
+     2400  06-19-2014 22:45   src/assembly/hbase.xml
+---------                     -------
+ 83354595                     35 files
 ```
 
 Sample **resources.json** and **appConfig.json** files are also included in the enlistment. These are samples and are typically tested on one node test installations.


[06/13] SLIDER-157 Remove app-packages/hbase-v0_96

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase/README.txt
----------------------------------------------------------------------
diff --git a/app-packages/hbase/README.txt b/app-packages/hbase/README.txt
index 941579d..fb84750 100644
--- a/app-packages/hbase/README.txt
+++ b/app-packages/hbase/README.txt
@@ -17,11 +17,17 @@
 
 How to create a Slider package for HBase?
 
-  mvn clean package -DskipTests -Phbase-app-package
+Copy the tarball for HBase:
+  cp ~/Downloads/hbase-0.98.3-hadoop2-bin.tar.gz package/files/
 
+If, HBase tarball is publised in maven repository, you can use:
+  mvn clean package -DskipTests -Phbase-app-package
 App package can be found in
   app-packages/HBase/target/apache-slider-hbase-${hbase.version}-app-package-${slider.version}.zip
 
+Create a zip package at the root of the package (<slider enlistment>/app-packages/hbase/)
+  zip -r hbase-v098.zip .
+
 Verify the content using
   zip -Tv apache-slider-hbase-*.zip
 


[04/13] git commit: Merge branch 'feature/SLIDER_126_handle_heartbeat_failures' into develop

Posted by st...@apache.org.
Merge branch 'feature/SLIDER_126_handle_heartbeat_failures' into develop


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

Branch: refs/heads/feature/SLIDER-153_add_slider_py_command
Commit: 45f5d7968d03f24c9d6f1af03f9afb4c1925e8c7
Parents: 1a8062e 3aca57d
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Sat Jun 21 18:22:00 2014 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Sat Jun 21 18:22:00 2014 -0700

----------------------------------------------------------------------
 slider-agent/conf/agent.ini                     |   2 +
 .../src/main/python/agent/AgentConfig.py        |  21 +++
 slider-agent/src/main/python/agent/Constants.py |   3 +
 .../src/main/python/agent/Controller.py         |  23 ++-
 slider-agent/src/main/python/agent/main.py      |   4 +
 .../src/test/python/agent/TestController.py     |  30 ++++
 slider-agent/src/test/python/agent/TestMain.py  |   5 +-
 .../providers/AbstractProviderService.java      |  15 +-
 .../slider/providers/ProviderService.java       |   5 +-
 .../slider/providers/agent/AgentKeys.java       |   3 +
 .../providers/agent/AgentLaunchParameter.java   | 130 ++++++++++++++
 .../providers/agent/AgentProviderService.java   | 179 ++++++++++++++++---
 .../slider/providers/agent/AgentRoles.java      |  18 +-
 .../apache/slider/providers/agent/Command.java  |  13 +-
 .../slider/providers/agent/CommandResult.java   |  16 +-
 .../providers/agent/ComponentInstanceState.java |  24 +++
 .../slider/providers/agent/ContainerState.java  |  41 +++++
 .../providers/agent/HeartbeatMonitor.java       | 116 ++++++++++++
 .../server/appmaster/AMViewForProviders.java    |  27 +++
 .../server/appmaster/SliderAppMaster.java       |  32 +++-
 .../slider/server/appmaster/state/AppState.java |  20 +++
 .../test_command_log/appConfig_fast_no_reg.json |  29 +++
 .../test_command_log/appConfig_no_hb.json       |  29 +++
 .../model/mock/MockProviderService.groovy       |   4 +-
 .../agent/TestAgentLaunchParameter.java         |  76 ++++++++
 .../providers/agent/TestHeartbeatMonitor.java   | 136 ++++++++++++++
 .../publisher/TestAgentProviderService.java     |   5 +-
 .../lifecycle/AgentCommandTestBase.groovy       | 100 ++++++++---
 .../lifecycle/TestAgentClusterLifecycle.groovy  |   2 +-
 .../funtest/lifecycle/TestAgentFailures.groovy  | 103 +++++++++++
 .../funtest/lifecycle/TestAgentFailures2.groovy | 103 +++++++++++
 .../lifecycle/TestAppsThroughAgent.groovy       |  90 ++++------
 32 files changed, 1253 insertions(+), 151 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/45f5d796/slider-core/src/main/java/org/apache/slider/providers/AbstractProviderService.java
----------------------------------------------------------------------


[11/13] git commit: SLIDER-153 stub main()

Posted by st...@apache.org.
SLIDER-153 stub main()


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

Branch: refs/heads/feature/SLIDER-153_add_slider_py_command
Commit: d6131ca426bee6e8aa9819a377bb82345fc97b56
Parents: e519fbc
Author: Steve Loughran <st...@apache.org>
Authored: Mon Jun 23 13:41:18 2014 -0700
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Jun 23 13:41:18 2014 -0700

----------------------------------------------------------------------
 slider-assembly/src/main/scripts/slider.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/d6131ca4/slider-assembly/src/main/scripts/slider.py
----------------------------------------------------------------------
diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py
index f154210..d5891ed 100644
--- a/slider-assembly/src/main/scripts/slider.py
+++ b/slider-assembly/src/main/scripts/slider.py
@@ -15,8 +15,14 @@
 # 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.
+import sys
+import subprocess
 
 # Slider main method
-
+def main():
+  
+  
 if __name__ == '__main__':
-    print "slider python script"
\ No newline at end of file
+    print "slider python script"
+    rv = main()
+    sys.exit(rv)


[05/13] git commit: SLIDER-156 Utilize multiple log directories when possible

Posted by st...@apache.org.
SLIDER-156 Utilize multiple log directories when possible


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

Branch: refs/heads/feature/SLIDER-153_add_slider_py_command
Commit: 57a9c9f88d7bc41ee80320dd146244be5c3d420f
Parents: 45f5d79
Author: tedyu <yu...@gmail.com>
Authored: Sun Jun 22 17:52:20 2014 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Sun Jun 22 17:52:20 2014 -0700

----------------------------------------------------------------------
 .../slider/providers/hbase/HBaseProviderService.java  | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/57a9c9f8/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java
----------------------------------------------------------------------
diff --git a/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java b/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java
index 5405753..a578441 100644
--- a/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java
+++ b/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java
@@ -60,6 +60,7 @@ import java.net.URL;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Random;
 
 import static org.apache.slider.server.appmaster.web.rest.RestPaths.SLIDER_PATH_PUBLISHER;
 
@@ -127,9 +128,16 @@ public class HBaseProviderService extends AbstractProviderService implements
     // Set the environment
     launcher.putEnv(SliderUtils.buildEnvMap(appComponent));
 
-    String logDir = providerUtils.getLogdir();
-    int idx = logDir.indexOf(",");
-    launcher.setEnv(HBASE_LOG_DIR, idx > 0 ? logDir.substring(0, idx) : logDir);
+    String logDirs = providerUtils.getLogdir();
+    String logDir;
+    int idx = logDirs.indexOf(",");
+    if (idx > 0) {
+      // randomly choose a log dir candidate
+      String[] segments = logDirs.split(",");
+      Random rand = new Random();
+      logDir = segments[rand.nextInt(segments.length)];
+    } else logDir = logDirs;
+    launcher.setEnv(HBASE_LOG_DIR, logDir);
 
     launcher.setEnv(PROPAGATED_CONFDIR,
         ProviderUtils.convertToAppRelativePath(


[12/13] git commit: SLIDER-153 building up exec

Posted by st...@apache.org.
SLIDER-153 building up exec


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

Branch: refs/heads/feature/SLIDER-153_add_slider_py_command
Commit: 918e746d83c4ad0f4a25bba39050942f5689599a
Parents: d6131ca
Author: Steve Loughran <st...@apache.org>
Authored: Mon Jun 23 14:40:34 2014 -0700
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Jun 23 14:40:34 2014 -0700

----------------------------------------------------------------------
 slider-assembly/src/main/scripts/slider    |   1 -
 slider-assembly/src/main/scripts/slider.py | 109 +++++++++++++++++++++++-
 2 files changed, 106 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/918e746d/slider-assembly/src/main/scripts/slider
----------------------------------------------------------------------
diff --git a/slider-assembly/src/main/scripts/slider b/slider-assembly/src/main/scripts/slider
index e9522cf..caf275b 100755
--- a/slider-assembly/src/main/scripts/slider
+++ b/slider-assembly/src/main/scripts/slider
@@ -32,7 +32,6 @@ function usage
 this="${BASH_SOURCE-$0}"
 bindir=$(cd -P -- "$(dirname -- "$this")" && pwd -P)
 script="$(basename -- "$this")"
-this="$bin/$script"
 
 # lib directory is one up; it is expected to contain 
 # slider.jar and any other dependencies that are not in the

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/918e746d/slider-assembly/src/main/scripts/slider.py
----------------------------------------------------------------------
diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py
index d5891ed..e846e64 100644
--- a/slider-assembly/src/main/scripts/slider.py
+++ b/slider-assembly/src/main/scripts/slider.py
@@ -16,13 +16,116 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 import sys
+import os
 import subprocess
 
-# Slider main method
+CONF = "conf"
+
+LIB = "lib"
+
+SLIDER_CONF_DIR = "SLIDER_CONF_DIR"
+SLIDER_JVM_OPTS = "SLIDER_JVM_OPTS"
+SLIDER_CLASSPATH_EXTRA = "SLIDER_CLASSPATH_EXTRA"
+
+SLIDER_CLASSNAME = "org.apache.slider.Slider"
+DEFAULT_JVM__OPTS = "-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Xmx256m -Djava.confdir=%s"
+
+"""Launches slider
+
+
+"""
+
+
+
+print os.environ['HOME']
+
+
+def scriptDir():
+  """ 
+  get the script path
+  """
+  return os.path.dirname(os.path.realpath(__file__))
+
+def sliderDir():
+  return os.path.dirname(scriptDir())
+
+def libDir(sliderdir) :
+  return os.path.join(sliderdir, LIB)
+
+def confDir(sliderdir):
+  """
+  determine the active configuration directory 
+  :param sliderdir: slider directory 
+  :return: the configuration directory -any env var will
+  override the relative path
+  """
+  localconf = os.path.join(sliderdir, CONF)
+  return os.environ.get(SLIDER_CONF_DIR,localconf) 
+
+def dirMustExist(dir):
+  if not os.path.exists(dir):
+    raise Exception("Directory does not exist: %s " % dir)
+  return dir
+
+
+def usage():
+  print "Usage: slider <action> <arguments>"
+  return 1
+
+
 def main():
+  """
+  Slider main method
+  :return: exit code of the process
+  """
+  if len(sys.argv)==1 :
+    return usage()
+  args = sys.argv[1:]
+  slider_home = sliderDir()
+  libdir = dirMustExist(libDir(slider_home))
+  confdir = dirMustExist(confDir(slider_home))
+  default_jvm_opts = DEFAULT_JVM__OPTS % confdir
+  slider_jvm_opts = os.environ.get(SLIDER_JVM_OPTS, default_jvm_opts)
+  slider_classpath_extra = os.environ.get(SLIDER_CLASSPATH_EXTRA, "")
+  p = os.pathsep    # path separator
+  d = os.sep        # dir separator
+  slider_classpath = '"' + \
+                     libdir + d + "*" + p \
+                     + confdir + p \
+                     + slider_classpath_extra \
+                     + '"'
+
+  print "slider_home = \"%s\"" % slider_home
+  print "slider_jvm_opts = \"%s\"" % slider_jvm_opts
+  print "slider_classpath = \"%s\"" % slider_classpath
   
   
+  commandline = ["java",]
+  # commandline.append(slider_jvm_opts)
+  commandline.append("-classpath")
+  commandline.append(slider_classpath)
+  commandline.append(SLIDER_CLASSNAME)
+  commandline.extend(args)
+  print "ready to exec : %s" % commandline
+  # docs warn of using PIPE on stderr 
+  return subprocess.call(commandline,
+                         stdin=None,
+                         stdout=subprocess.PIPE,
+                         stderr=subprocess.PIPE,
+                         shell=False)
+
+
+
+
+
 if __name__ == '__main__':
-    print "slider python script"
+  print "slider python script"
+  try:
     rv = main()
-    sys.exit(rv)
+    if rv != 0:
+      print "exit code = %d" % rv
+  except Exception as e:
+    print "Exception: %s " % e.message
+    rv = -1
+  
+  sys.exit(rv)


[09/13] git commit: SLIDER-159 Jenkins testEcho failing

Posted by st...@apache.org.
SLIDER-159 Jenkins testEcho failing


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

Branch: refs/heads/feature/SLIDER-153_add_slider_py_command
Commit: 537d87c25e20e3c11994dbfdcfcb89ba20f59859
Parents: bc0c672
Author: Steve Loughran <st...@apache.org>
Authored: Mon Jun 23 13:25:41 2014 -0700
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Jun 23 13:25:41 2014 -0700

----------------------------------------------------------------------
 .../services/workflow/ForkedProcessService.java | 25 ++++++++++++++++----
 .../services/workflow/LongLivedProcess.java     | 13 ++++++++++
 .../TestWorkflowForkedProcessService.java       |  3 ++-
 3 files changed, 35 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/537d87c2/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java b/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java
index b0c503d..7e73005 100644
--- a/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java
+++ b/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java
@@ -269,15 +269,28 @@ public class ForkedProcessService extends AbstractWorkflowExecutorService implem
 
   /**
    * Get the recent output from the process, or [] if not defined
-   * @param duration the duration, in ms, which we wait for recent output to become non-empty
+   *
+   * @param finalOutput flag to indicate "wait for the final output of the process"
+   * @param duration the duration, in ms, 
+   * ro wait for recent output to become non-empty
    * @return a possibly empty list
    */
-  public List<String> getRecentOutput(int duration) {
-    if (process == null) return new LinkedList<String>();
+  public List<String> getRecentOutput(boolean finalOutput, int duration) {
+    if (process == null) {
+      return new LinkedList<String>();
+    }
     long start = System.currentTimeMillis();
-    while (process.isRecentOutputEmpty() && System.currentTimeMillis() - start <= duration) {
+    while (System.currentTimeMillis() - start <= duration) {
+      if (finalOutput && process.isFinalOutputProcessed()) {
+        //end of stream, break
+        break;
+      }
+      if (!process.isRecentOutputEmpty()) {
+        // there is some output
+        break;
+      }
       try {
-        Thread.sleep(20);
+        Thread.sleep(100);
       } catch (InterruptedException ie) {
         Thread.currentThread().interrupt();
         break;
@@ -285,4 +298,6 @@ public class ForkedProcessService extends AbstractWorkflowExecutorService implem
     }
     return process.getRecentOutput();
   }
+  
+  
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/537d87c2/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java b/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java
index 7b9863f..d9ddecb 100644
--- a/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java
+++ b/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java
@@ -35,6 +35,7 @@ import java.util.Set;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * Execute a long-lived process.
@@ -82,6 +83,7 @@ public class LongLivedProcess implements Runnable {
   private final List<String> recentLines = new LinkedList<String>();
   private int recentLineLimit = RECENT_LINE_LOG_LIMIT;
   private LongLivedProcessLifecycleEvent lifecycleCallback;
+  private final AtomicBoolean finalOutputProcessed = new AtomicBoolean(false);
 
   
   /**
@@ -347,6 +349,14 @@ public class LongLivedProcess implements Runnable {
   }
 
   /**
+   * Query to see if the final output has been processed
+   * @return
+   */
+  public boolean isFinalOutputProcessed() {
+    return finalOutputProcessed.get();
+  }
+
+  /**
    * add the recent line to the list of recent lines; deleting
    * an earlier on if the limit is reached.
    *
@@ -499,6 +509,9 @@ public class LongLivedProcess implements Runnable {
         LOG.warn("encountered {}", ignored, ignored);
         //process connection has been torn down
       } finally {
+        //mark output as done
+        finalOutputProcessed.set(true);
+        // close streams
         IOUtils.closeStream(errReader);
         IOUtils.closeStream(outReader);
       }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/537d87c2/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
----------------------------------------------------------------------
diff --git a/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java b/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
index d46f07c..6d08156 100644
--- a/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
+++ b/slider-core/src/test/java/org/apache/slider/server/services/workflow/TestWorkflowForkedProcessService.java
@@ -43,6 +43,7 @@ public class TestWorkflowForkedProcessService extends WorkflowServiceTestBase {
   private static final Logger
       processLog =
       LoggerFactory.getLogger("org.apache.hadoop.services.workflow.Process");
+  public static final int RECENT_OUTPUT_SLEEP_DURATION = 4000;
 
 
   private ForkedProcessService process;
@@ -118,7 +119,7 @@ public class TestWorkflowForkedProcessService extends WorkflowServiceTestBase {
    * @return the last output
    */
   private List<String> getFinalOutput() {
-    return process.getRecentOutput(2000);
+    return process.getRecentOutput(true, RECENT_OUTPUT_SLEEP_DURATION);
   }
 
   private ForkedProcessService initProcess(List<String> commands) throws


[07/13] git commit: SLIDER-157 Remove app-packages/hbase-v0_96

Posted by st...@apache.org.
SLIDER-157 Remove app-packages/hbase-v0_96


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

Branch: refs/heads/feature/SLIDER-153_add_slider_py_command
Commit: 7729653f73ab4208945794bde7e9f7f22fe89aa3
Parents: 57a9c9f
Author: tedyu <yu...@gmail.com>
Authored: Mon Jun 23 09:07:16 2014 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Mon Jun 23 09:07:16 2014 -0700

----------------------------------------------------------------------
 app-packages/hbase-v0_96/README.txt             |  33 --
 app-packages/hbase-v0_96/appConfig.json         |  67 ----
 .../hbase-v0_96/configuration/global.xml        | 160 --------
 .../hbase-v0_96/configuration/hbase-log4j.xml   | 142 --------
 .../hbase-v0_96/configuration/hbase-policy.xml  |  53 ---
 .../hbase-v0_96/configuration/hbase-site.xml    | 365 -------------------
 app-packages/hbase-v0_96/ganglia_metrics.json   |  38 --
 app-packages/hbase-v0_96/jmx_metrics.json       |  56 ---
 app-packages/hbase-v0_96/metainfo.xml           | 109 ------
 .../hbase-0.96.1-hadoop2-bin.tar.gz.REPLACE     |  16 -
 .../hbase-v0_96/package/scripts/__init__.py     |  19 -
 .../hbase-v0_96/package/scripts/functions.py    |  40 --
 .../hbase-v0_96/package/scripts/hbase.py        | 125 -------
 .../hbase-v0_96/package/scripts/hbase_client.py |  43 ---
 .../hbase-v0_96/package/scripts/hbase_master.py |  63 ----
 .../package/scripts/hbase_regionserver.py       |  66 ----
 .../package/scripts/hbase_service.py            |  45 ---
 .../hbase-v0_96/package/scripts/params.py       | 109 ------
 .../package/scripts/status_params.py            |  26 --
 ...-metrics2-hbase.properties-GANGLIA-MASTER.j2 |  62 ----
 ...doop-metrics2-hbase.properties-GANGLIA-RS.j2 |  62 ----
 .../package/templates/hbase-env.sh.j2           |  81 ----
 .../package/templates/hbase_client_jaas.conf.j2 |  22 --
 .../package/templates/hbase_master_jaas.conf.j2 |  25 --
 .../templates/hbase_regionserver_jaas.conf.j2   |  25 --
 .../package/templates/regionservers.j2          |  20 -
 app-packages/hbase-v0_96/resources.json         |  19 -
 app-packages/hbase/README.txt                   |   8 +-
 28 files changed, 7 insertions(+), 1892 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/README.txt
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/README.txt b/app-packages/hbase-v0_96/README.txt
deleted file mode 100644
index 33c93df..0000000
--- a/app-packages/hbase-v0_96/README.txt
+++ /dev/null
@@ -1,33 +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.
--->
-
-How to create a Slider package?
-
-Replace the placeholder tarball for HBase.
-  cp ~/Downloads/hbase-0.96.1-hadoop2-bin.tar.gz package/files/
-  rm package/files/hbase-0.96.1-hadoop2-bin.tar.gz.REPLACE
-
-Create a zip package at the root of the package (<slider enlistment>/app-packages/hbase-v0_96/) 
-  zip -r hbase_v096.zip .
-
-Verify the content using  
-  unzip -l "$@" hbase_v096.zip
-
-While appConfig.json and resources.json are not required for the package they work
-well as the default configuration for Slider apps. So its advisable that when you
-create an application package for Slider, include sample/default resources.json and
-appConfig.json for a minimal Yarn cluster.

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/appConfig.json
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/appConfig.json b/app-packages/hbase-v0_96/appConfig.json
deleted file mode 100644
index 1d828e2..0000000
--- a/app-packages/hbase-v0_96/appConfig.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
-  "schema": "http://example.org/specification/v2.0.0",
-  "metadata": {
-  },
-  "global": {
-    "agent.conf": "/slider/agent/conf/agent.ini",
-    "application.def": "/slider/hbase_v096.zip",
-    "config_types": "core-site,hdfs-site,hbase-site",
-    "java_home": "/usr/jdk64/jdk1.7.0_45",
-    "package_list": "files/hbase-0.96.1-hadoop2-bin.tar.gz",
-    "site.global.app_user": "yarn",
-    "site.global.app_log_dir": "${AGENT_LOG_ROOT}/app/log",
-    "site.global.app_pid_dir": "${AGENT_WORK_ROOT}/app/run",
-    "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/hbase-0.96.1-hadoop2",
-    "site.global.app_install_dir": "${AGENT_WORK_ROOT}/app/install",
-    "site.global.hbase_master_heapsize": "1024m",
-    "site.global.hbase_regionserver_heapsize": "1024m",
-    "site.global.user_group": "hadoop",
-    "site.global.security_enabled": "false",
-    "site.global.ganglia_server_host": "${NN_HOST}",
-    "site.global.ganglia_server_port": "8667",
-    "site.global.ganglia_server_id": "Application1",
-    "site.hbase-site.hbase.hstore.flush.retries.number": "120",
-    "site.hbase-site.hbase.client.keyvalue.maxsize": "10485760",
-    "site.hbase-site.hbase.hstore.compactionThreshold": "3",
-    "site.hbase-site.hbase.rootdir": "${DEFAULT_DATA_DIR}/data",
-    "site.hbase-site.hbase.stagingdir": "${DEFAULT_DATA_DIR}/staging",
-    "site.hbase-site.hbase.regionserver.handler.count": "60",
-    "site.hbase-site.hbase.regionserver.global.memstore.lowerLimit": "0.38",
-    "site.hbase-site.hbase.hregion.memstore.block.multiplier": "2",
-    "site.hbase-site.hbase.hregion.memstore.flush.size": "134217728",
-    "site.hbase-site.hbase.superuser": "yarn",
-    "site.hbase-site.hbase.zookeeper.property.clientPort": "2181",
-    "site.hbase-site.hbase.regionserver.global.memstore.upperLimit": "0.4",
-    "site.hbase-site.zookeeper.session.timeout": "30000",
-    "site.hbase-site.hbase.tmp.dir": "${AGENT_WORK_ROOT}/work/app/tmp",
-    "site.hbase-site.hbase.local.dir": "${hbase.tmp.dir}/local",
-    "site.hbase-site.hbase.hregion.max.filesize": "10737418240",
-    "site.hbase-site.hfile.block.cache.size": "0.40",
-    "site.hbase-site.hbase.security.authentication": "simple",
-    "site.hbase-site.hbase.defaults.for.version.skip": "true",
-    "site.hbase-site.hbase.zookeeper.quorum": "${ZK_HOST}",
-    "site.hbase-site.zookeeper.znode.parent": "/hbase-unsecure",
-    "site.hbase-site.hbase.hstore.blockingStoreFiles": "10",
-    "site.hbase-site.hbase.hregion.majorcompaction": "86400000",
-    "site.hbase-site.hbase.security.authorization": "false",
-    "site.hbase-site.hbase.cluster.distributed": "true",
-    "site.hbase-site.hbase.hregion.memstore.mslab.enabled": "true",
-    "site.hbase-site.hbase.client.scanner.caching": "100",
-    "site.hbase-site.hbase.zookeeper.useMulti": "true",
-    "site.hbase-site.hbase.regionserver.info.port": "0",
-    "site.hbase-site.hbase.master.info.port": "${HBASE_MASTER.ALLOCATED_PORT}",
-    "site.hbase-site.hbase.regionserver.port": "0",
-    "site.core-site.fs.defaultFS": "${NN_URI}",
-    "site.hdfs-site.dfs.namenode.https-address": "${NN_HOST}:50470",
-    "site.hdfs-site.dfs.namenode.http-address": "${NN_HOST}:50070"
-  },
-  "components": {
-    "HBASE_MASTER": {
-    },
-    "slider-appmaster": {
-      "jvm.heapsize": "256M"
-    },
-    "HBASE_REGIONSERVER": {
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/configuration/global.xml
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/configuration/global.xml b/app-packages/hbase-v0_96/configuration/global.xml
deleted file mode 100644
index b2c57bd..0000000
--- a/app-packages/hbase-v0_96/configuration/global.xml
+++ /dev/null
@@ -1,160 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<!--
-/**
- * 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>hbasemaster_host</name>
-    <value></value>
-    <description>HBase Master Host.</description>
-  </property>
-  <property>
-    <name>regionserver_hosts</name>
-    <value></value>
-    <description>Region Server Hosts</description>
-  </property>
-  <property>
-    <name>hbase_log_dir</name>
-    <value>/var/log/hbase</value>
-    <description>Log Directories for HBase.</description>
-  </property>
-  <property>
-    <name>hbase_pid_dir</name>
-    <value>/var/run/hbase</value>
-    <description>Log Directories for HBase.</description>
-  </property>
-  <property>
-    <name>hbase_log_dir</name>
-    <value>/var/log/hbase</value>
-    <description>Log Directories for HBase.</description>
-  </property>
-  <property>
-    <name>hbase_regionserver_heapsize</name>
-    <value>1024</value>
-    <description>Log Directories for HBase.</description>
-  </property>
-  <property>
-    <name>hbase_master_heapsize</name>
-    <value>1024</value>
-    <description>HBase Master Heap Size</description>
-  </property>
-  <property>
-    <name>hstore_compactionthreshold</name>
-    <value>3</value>
-    <description>HBase HStore compaction threshold.</description>
-  </property>
-  <property>
-    <name>hfile_blockcache_size</name>
-    <value>0.40</value>
-    <description>HFile block cache size.</description>
-  </property>
-  <property>
-    <name>hstorefile_maxsize</name>
-    <value>10737418240</value>
-    <description>Maximum HStoreFile Size</description>
-  </property>
-    <property>
-    <name>regionserver_handlers</name>
-    <value>60</value>
-    <description>HBase RegionServer Handler</description>
-  </property>
-    <property>
-    <name>hregion_majorcompaction</name>
-    <value>604800000</value>
-    <description>The time between major compactions of all HStoreFiles in a region. Set to 0 to disable automated major compactions.</description>
-  </property>
-    <property>
-    <name>hregion_blockmultiplier</name>
-    <value>2</value>
-    <description>HBase Region Block Multiplier</description>
-  </property>
-    <property>
-    <name>hregion_memstoreflushsize</name>
-    <value></value>
-    <description>HBase Region MemStore Flush Size.</description>
-  </property>
-    <property>
-    <name>client_scannercaching</name>
-    <value>100</value>
-    <description>Base Client Scanner Caching</description>
-  </property>
-    <property>
-    <name>zookeeper_sessiontimeout</name>
-    <value>30000</value>
-    <description>ZooKeeper Session Timeout</description>
-  </property>
-    <property>
-    <name>hfile_max_keyvalue_size</name>
-    <value>10485760</value>
-    <description>HBase Client Maximum key-value Size</description>
-  </property>
-  <property>
-    <name>hbase_hdfs_root_dir</name>
-    <value>/apps/hbase/data</value>
-    <description>HBase Relative Path to HDFS.</description>
-  </property>
-   <property>
-    <name>hbase_conf_dir</name>
-    <value>/etc/hbase</value>
-    <description>Config Directory for HBase.</description>
-  </property>
-   <property>
-    <name>hdfs_enable_shortcircuit_read</name>
-    <value>true</value>
-    <description>HDFS Short Circuit Read</description>
-  </property>
-   <property>
-    <name>hdfs_support_append</name>
-    <value>true</value>
-    <description>HDFS append support</description>
-  </property>
-   <property>
-    <name>hstore_blockingstorefiles</name>
-    <value>10</value>
-    <description>HStore blocking storefiles.</description>
-  </property>
-   <property>
-    <name>regionserver_memstore_lab</name>
-    <value>true</value>
-    <description>Region Server memstore.</description>
-  </property>
-   <property>
-    <name>regionserver_memstore_lowerlimit</name>
-    <value>0.38</value>
-    <description>Region Server memstore lower limit.</description>
-  </property>
-   <property>
-    <name>regionserver_memstore_upperlimit</name>
-    <value>0.4</value>
-    <description>Region Server memstore upper limit.</description>
-  </property>
-   <property>
-    <name>hbase_conf_dir</name>
-    <value>/etc/hbase</value>
-    <description>HBase conf dir.</description>
-  </property>
-   <property>
-    <name>hbase_user</name>
-    <value>hbase</value>
-    <description>HBase User Name.</description>
-  </property>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/configuration/hbase-log4j.xml
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/configuration/hbase-log4j.xml b/app-packages/hbase-v0_96/configuration/hbase-log4j.xml
deleted file mode 100644
index 3bbc549..0000000
--- a/app-packages/hbase-v0_96/configuration/hbase-log4j.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<!--
-/**
- * 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>content</name>
-    <value>
-# 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.
-
-
-# Define some default values that can be overridden by system properties
-hbase.root.logger=INFO,console
-hbase.security.logger=INFO,console
-hbase.log.dir=.
-hbase.log.file=hbase.log
-
-# Define the root logger to the system property "hbase.root.logger".
-log4j.rootLogger=${hbase.root.logger}
-
-# Logging Threshold
-log4j.threshold=ALL
-
-#
-# Daily Rolling File Appender
-#
-log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.DRFA.File=${hbase.log.dir}/${hbase.log.file}
-
-# Rollver at midnight
-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} %-5p [%t] %c{2}: %m%n
-
-# Rolling File Appender properties
-hbase.log.maxfilesize=256MB
-hbase.log.maxbackupindex=20
-
-# Rolling File Appender
-log4j.appender.RFA=org.apache.log4j.RollingFileAppender
-log4j.appender.RFA.File=${hbase.log.dir}/${hbase.log.file}
-
-log4j.appender.RFA.MaxFileSize=${hbase.log.maxfilesize}
-log4j.appender.RFA.MaxBackupIndex=${hbase.log.maxbackupindex}
-
-log4j.appender.RFA.layout=org.apache.log4j.PatternLayout
-log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n
-
-#
-# Security audit appender
-#
-hbase.security.log.file=SecurityAuth.audit
-hbase.security.log.maxfilesize=256MB
-hbase.security.log.maxbackupindex=20
-log4j.appender.RFAS=org.apache.log4j.RollingFileAppender
-log4j.appender.RFAS.File=${hbase.log.dir}/${hbase.security.log.file}
-log4j.appender.RFAS.MaxFileSize=${hbase.security.log.maxfilesize}
-log4j.appender.RFAS.MaxBackupIndex=${hbase.security.log.maxbackupindex}
-log4j.appender.RFAS.layout=org.apache.log4j.PatternLayout
-log4j.appender.RFAS.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
-log4j.category.SecurityLogger=${hbase.security.logger}
-log4j.additivity.SecurityLogger=false
-#log4j.logger.SecurityLogger.org.apache.hadoop.hbase.security.access.AccessController=TRACE
-
-#
-# Null Appender
-#
-log4j.appender.NullAppender=org.apache.log4j.varia.NullAppender
-
-#
-# console
-# Add "console" to rootlogger above if you want to use this
-#
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.target=System.err
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}: %m%n
-
-# Custom Logging levels
-
-log4j.logger.org.apache.zookeeper=INFO
-#log4j.logger.org.apache.hadoop.fs.FSNamesystem=DEBUG
-log4j.logger.org.apache.hadoop.hbase=DEBUG
-# Make these two classes INFO-level. Make them DEBUG to see more zk debug.
-log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKUtil=INFO
-log4j.logger.org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher=INFO
-#log4j.logger.org.apache.hadoop.dfs=DEBUG
-# Set this class to log INFO only otherwise its OTT
-# Enable this to get detailed connection error/retry logging.
-# log4j.logger.org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation=TRACE
-
-
-# Uncomment this line to enable tracing on _every_ RPC call (this can be a lot of output)
-#log4j.logger.org.apache.hadoop.ipc.HBaseServer.trace=DEBUG
-
-# Uncomment the below if you want to remove logging of client region caching'
-# and scan of .META. messages
-# log4j.logger.org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation=INFO
-# log4j.logger.org.apache.hadoop.hbase.client.MetaScanner=INFO
-
-    </value>
-  </property>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/configuration/hbase-policy.xml
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/configuration/hbase-policy.xml b/app-packages/hbase-v0_96/configuration/hbase-policy.xml
deleted file mode 100644
index e45f23c..0000000
--- a/app-packages/hbase-v0_96/configuration/hbase-policy.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<!--
-/**
- * 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>security.client.protocol.acl</name>
-    <value>*</value>
-    <description>ACL for HRegionInterface protocol implementations (ie. 
-    clients talking to HRegionServers)
-    The ACL is a comma-separated list of user and group names. The user and 
-    group list is separated by a blank. For e.g. "alice,bob users,wheel". 
-    A special value of "*" means all users are allowed.</description>
-  </property>
-
-  <property>
-    <name>security.admin.protocol.acl</name>
-    <value>*</value>
-    <description>ACL for HMasterInterface protocol implementation (ie. 
-    clients talking to HMaster for admin operations).
-    The ACL is a comma-separated list of user and group names. The user and 
-    group list is separated by a blank. For e.g. "alice,bob users,wheel". 
-    A special value of "*" means all users are allowed.</description>
-  </property>
-
-  <property>
-    <name>security.masterregion.protocol.acl</name>
-    <value>*</value>
-    <description>ACL for HMasterRegionInterface protocol implementations
-    (for HRegionServers communicating with HMaster)
-    The ACL is a comma-separated list of user and group names. The user and 
-    group list is separated by a blank. For e.g. "alice,bob users,wheel". 
-    A special value of "*" means all users are allowed.</description>
-  </property>
-</configuration>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/configuration/hbase-site.xml
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/configuration/hbase-site.xml b/app-packages/hbase-v0_96/configuration/hbase-site.xml
deleted file mode 100644
index cf9416e..0000000
--- a/app-packages/hbase-v0_96/configuration/hbase-site.xml
+++ /dev/null
@@ -1,365 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
-<!--
-/**
- * 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>hbase.rootdir</name>
-    <value>hdfs://localhost:8020/apps/hbase/data</value>
-    <description>The directory shared by region servers and into
-    which HBase persists.  The URL should be 'fully-qualified'
-    to include the filesystem scheme.  For example, to specify the
-    HDFS directory '/hbase' where the HDFS instance's namenode is
-    running at namenode.example.org on port 9000, set this value to:
-    hdfs://namenode.example.org:9000/hbase.  By default HBase writes
-    into /tmp.  Change this configuration else all data will be lost
-    on machine restart.
-    </description>
-  </property>
-  <property>
-    <name>hbase.cluster.distributed</name>
-    <value>true</value>
-    <description>The mode the cluster will be in. Possible values are
-      false for standalone mode and true for distributed mode.  If
-      false, startup will run all HBase and ZooKeeper daemons together
-      in the one JVM.
-    </description>
-  </property>
-  <property>
-    <name>hbase.tmp.dir</name>
-    <value>/hadoop/hbase</value>
-    <description>Temporary directory on the local filesystem.
-    Change this setting to point to a location more permanent
-    than '/tmp' (The '/tmp' directory is often cleared on
-    machine restart).
-    </description>
-  </property>
-  <property>
-    <name>hbase.local.dir</name>
-    <value>${hbase.tmp.dir}/local</value>
-    <description>Directory on the local filesystem to be used as a local storage
-    </description>
-  </property>
-  <property>
-    <name>hbase.master.info.bindAddress</name>
-    <value></value>
-    <description>The bind address for the HBase Master web UI
-    </description>
-  </property>
-  <property>
-    <name>hbase.master.info.port</name>
-    <value></value>
-    <description>The port for the HBase Master web UI.</description>
-  </property>
-  <property>
-    <name>hbase.regionserver.info.port</name>
-    <value></value>
-    <description>The port for the HBase RegionServer web UI.</description>
-  </property>
-  <property>
-    <name>hbase.regionserver.global.memstore.upperLimit</name>
-    <value>0.4</value>
-    <description>Maximum size of all memstores in a region server before new
-      updates are blocked and flushes are forced. Defaults to 40% of heap
-    </description>
-  </property>
-  <property>
-    <name>hbase.regionserver.handler.count</name>
-    <value>60</value>
-    <description>Count of RPC Listener instances spun up on RegionServers.
-    Same property is used by the Master for count of master handlers.
-    Default is 10.
-    </description>
-  </property>
-  <property>
-    <name>hbase.hregion.majorcompaction</name>
-    <value>86400000</value>
-    <description>The time (in milliseconds) between 'major' compactions of all
-    HStoreFiles in a region.  Default: 1 day.
-    Set to 0 to disable automated major compactions.
-    </description>
-  </property>
-  
-  <property>
-    <name>hbase.regionserver.global.memstore.lowerLimit</name>
-    <value>0.38</value>
-    <description>When memstores are being forced to flush to make room in
-      memory, keep flushing until we hit this mark. Defaults to 35% of heap.
-      This value equal to hbase.regionserver.global.memstore.upperLimit causes
-      the minimum possible flushing to occur when updates are blocked due to
-      memstore limiting.
-    </description>
-  </property>
-  <property>
-    <name>hbase.hregion.memstore.block.multiplier</name>
-    <value>2</value>
-    <description>Block updates if memstore has hbase.hregion.memstore.block.multiplier
-    time hbase.hregion.flush.size bytes.  Useful preventing
-    runaway memstore during spikes in update traffic.  Without an
-    upper-bound, memstore fills such that when it flushes the
-    resultant flush files take a long time to compact or split, or
-    worse, we OOME
-    </description>
-  </property>
-  <property>
-    <name>hbase.hregion.memstore.flush.size</name>
-    <value>134217728</value>
-    <description>
-    Memstore will be flushed to disk if size of the memstore
-    exceeds this number of bytes.  Value is checked by a thread that runs
-    every hbase.server.thread.wakefrequency.
-    </description>
-  </property>
-  <property>
-    <name>hbase.hregion.memstore.mslab.enabled</name>
-    <value>true</value>
-    <description>
-      Enables the MemStore-Local Allocation Buffer,
-      a feature which works to prevent heap fragmentation under
-      heavy write loads. This can reduce the frequency of stop-the-world
-      GC pauses on large heaps.
-    </description>
-  </property>
-  <property>
-    <name>hbase.hregion.max.filesize</name>
-    <value>10737418240</value>
-    <description>
-    Maximum HStoreFile size. If any one of a column families' HStoreFiles has
-    grown to exceed this value, the hosting HRegion is split in two.
-    Default: 1G.
-    </description>
-  </property>
-  <property>
-    <name>hbase.client.scanner.caching</name>
-    <value>100</value>
-    <description>Number of rows that will be fetched when calling next
-    on a scanner if it is not served from (local, client) memory. Higher
-    caching values will enable faster scanners but will eat up more memory
-    and some calls of next may take longer and longer times when the cache is empty.
-    Do not set this value such that the time between invocations is greater
-    than the scanner timeout; i.e. hbase.regionserver.lease.period
-    </description>
-  </property>
-  <property>
-    <name>zookeeper.session.timeout</name>
-    <value>30000</value>
-    <description>ZooKeeper session timeout.
-      HBase passes this to the zk quorum as suggested maximum time for a
-      session (This setting becomes zookeeper's 'maxSessionTimeout').  See
-      http://hadoop.apache.org/zookeeper/docs/current/zookeeperProgrammers.html#ch_zkSessions
-      "The client sends a requested timeout, the server responds with the
-      timeout that it can give the client. " In milliseconds.
-    </description>
-  </property>
-  <property>
-    <name>hbase.client.keyvalue.maxsize</name>
-    <value>10485760</value>
-    <description>Specifies the combined maximum allowed size of a KeyValue
-    instance. This is to set an upper boundary for a single entry saved in a
-    storage file. Since they cannot be split it helps avoiding that a region
-    cannot be split any further because the data is too large. It seems wise
-    to set this to a fraction of the maximum region size. Setting it to zero
-    or less disables the check.
-    </description>
-  </property>
-  <property>
-    <name>hbase.hstore.compactionThreshold</name>
-    <value>3</value>
-    <description>
-    If more than this number of HStoreFiles in any one HStore
-    (one HStoreFile is written per flush of memstore) then a compaction
-    is run to rewrite all HStoreFiles files as one.  Larger numbers
-    put off compaction but when it runs, it takes longer to complete.
-    </description>
-  </property>
-  <property>
-    <name>hbase.hstore.flush.retries.number</name>
-    <value>120</value>
-    <description>
-    The number of times the region flush operation will be retried.
-    </description>
-  </property>
-  
-  <property>
-    <name>hbase.hstore.blockingStoreFiles</name>
-    <value>10</value>
-    <description>
-    If more than this number of StoreFiles in any one Store
-    (one StoreFile is written per flush of MemStore) then updates are
-    blocked for this HRegion until a compaction is completed, or
-    until hbase.hstore.blockingWaitTime has been exceeded.
-    </description>
-  </property>
-  <property>
-    <name>hfile.block.cache.size</name>
-    <value>0.40</value>
-    <description>
-        Percentage of maximum heap (-Xmx setting) to allocate to block cache
-        used by HFile/StoreFile. Default of 0.25 means allocate 25%.
-        Set to 0 to disable but it's not recommended.
-    </description>
-  </property>
-
-  <!-- The following properties configure authentication information for
-       HBase processes when using Kerberos security.  There are no default
-       values, included here for documentation purposes -->
-  <property>
-    <name>hbase.master.keytab.file</name>
-    <value></value>
-    <description>Full path to the kerberos keytab file to use for logging in
-    the configured HMaster server principal.
-    </description>
-  </property>
-  <property>
-    <name>hbase.master.kerberos.principal</name>
-    <value></value>
-    <description>Ex. "hbase/_HOST@EXAMPLE.COM".  The kerberos principal name
-    that should be used to run the HMaster process.  The principal name should
-    be in the form: user/hostname@DOMAIN.  If "_HOST" is used as the hostname
-    portion, it will be replaced with the actual hostname of the running
-    instance.
-    </description>
-  </property>
-  <property>
-    <name>hbase.regionserver.keytab.file</name>
-    <value></value>
-    <description>Full path to the kerberos keytab file to use for logging in
-    the configured HRegionServer server principal.
-    </description>
-  </property>
-  <property>
-    <name>hbase.regionserver.kerberos.principal</name>
-    <value></value>
-    <description>Ex. "hbase/_HOST@EXAMPLE.COM".  The kerberos principal name
-    that should be used to run the HRegionServer process.  The principal name
-    should be in the form: user/hostname@DOMAIN.  If "_HOST" is used as the
-    hostname portion, it will be replaced with the actual hostname of the
-    running instance.  An entry for this principal must exist in the file
-    specified in hbase.regionserver.keytab.file
-    </description>
-  </property>
-
-  <!-- Additional configuration specific to HBase security -->
-  <property>
-    <name>hbase.superuser</name>
-    <value>hbase</value>
-    <description>List of users or groups (comma-separated), who are allowed
-    full privileges, regardless of stored ACLs, across the cluster.
-    Only used when HBase security is enabled.
-    </description>
-  </property>
-
-  <property>
-    <name>hbase.security.authentication</name>
-    <value>simple</value>
-    <description>  Controls whether or not secure authentication is enabled for HBase. Possible values are 'simple'
-      (no authentication), and 'kerberos'.
-    </description>
-  </property>
-
-  <property>
-    <name>hbase.security.authorization</name>
-    <value>false</value>
-    <description>Enables HBase authorization. Set the value of this property to false to disable HBase authorization.
-    </description>
-  </property>
-
-  <property>
-    <name>hbase.coprocessor.region.classes</name>
-    <value></value>
-    <description>A comma-separated list of Coprocessors that are loaded by
-    default on all tables. For any override coprocessor method, these classes
-    will be called in order. After implementing your own Coprocessor, just put
-    it in HBase's classpath and add the fully qualified class name here.
-    A coprocessor can also be loaded on demand by setting HTableDescriptor.
-    </description>
-  </property>
-
-  <property>
-    <name>hbase.coprocessor.master.classes</name>
-    <value></value>
-    <description>A comma-separated list of
-      org.apache.hadoop.hbase.coprocessor.MasterObserver coprocessors that are
-      loaded by default on the active HMaster process. For any implemented
-      coprocessor methods, the listed classes will be called in order. After
-      implementing your own MasterObserver, just put it in HBase's classpath
-      and add the fully qualified class name here.
-    </description>
-  </property>
-
-  <property>
-    <name>hbase.zookeeper.property.clientPort</name>
-    <value>2181</value>
-    <description>Property from ZooKeeper's config zoo.cfg.
-    The port at which the clients will connect.
-    </description>
-  </property>
-
-  <!--
-  The following three properties are used together to create the list of
-  host:peer_port:leader_port quorum servers for ZooKeeper.
-  -->
-  <property>
-    <name>hbase.zookeeper.quorum</name>
-    <value>localhost</value>
-    <description>Comma separated list of servers in the ZooKeeper Quorum.
-    For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
-    By default this is set to localhost for local and pseudo-distributed modes
-    of operation. For a fully-distributed setup, this should be set to a full
-    list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh
-    this is the list of servers which we will start/stop ZooKeeper on.
-    </description>
-  </property>
-  <!-- End of properties used to generate ZooKeeper host:port quorum list. -->
-
-  <property>
-    <name>hbase.zookeeper.useMulti</name>
-    <value>true</value>
-    <description>Instructs HBase to make use of ZooKeeper's multi-update functionality.
-    This allows certain ZooKeeper operations to complete more quickly and prevents some issues
-    with rare Replication failure scenarios (see the release note of HBASE-2611 for an example).·
-    IMPORTANT: only set this to true if all ZooKeeper servers in the cluster are on version 3.4+
-    and will not be downgraded.  ZooKeeper versions before 3.4 do not support multi-update and will
-    not fail gracefully if multi-update is invoked (see ZOOKEEPER-1495).
-    </description>
-  </property>
-  <property>
-    <name>zookeeper.znode.parent</name>
-    <value>/hbase-unsecure</value>
-    <description>Root ZNode for HBase in ZooKeeper. All of HBase's ZooKeeper
-      files that are configured with a relative path will go under this node.
-      By default, all of HBase's ZooKeeper file path are configured with a
-      relative path, so they will all go under this directory unless changed.
-    </description>
-  </property>
-
-  <property>
-    <name>hbase.defaults.for.version.skip</name>
-    <value>true</value>
-    <description>Disables version verification.</description>
-  </property>
-
-  <property>
-    <name>dfs.domain.socket.path</name>
-    <value>/var/lib/hadoop-hdfs/dn_socket</value>
-    <description>Path to domain socket.</description>
-  </property>
-
-</configuration>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/ganglia_metrics.json
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/ganglia_metrics.json b/app-packages/hbase-v0_96/ganglia_metrics.json
deleted file mode 100644
index da73d48..0000000
--- a/app-packages/hbase-v0_96/ganglia_metrics.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
-    "Component": {
-        "HBASE_REGIONSERVER": {
-            "readRequestsCount": {
-                "metric": "regionserver.Server.readRequestCount",
-                "pointInTime": false,
-                "temporal": true
-            },
-            "regions": {
-                "metric": "regionserver.Server.regionCount",
-                "pointInTime": false,
-                "temporal": true
-            },
-            "flushQueueSize": {
-                "metric": "regionserver.Server.flushQueueLength",
-                "pointInTime": false,
-                "temporal": true
-            }
-        },
-        "HBASE_MASTER": {
-            "cluster_requests": {
-                "metric": "master.Server.clusterRequests",
-                "pointInTime": false,
-                "temporal": true
-            },
-            "splitTime_avg_time": {
-                "metric": "master.FileSystem.HlogSplitTime_mean",
-                "pointInTime": false,
-                "temporal": true
-            },
-            "splitSize_avg_time": {
-                "metric": "master.FileSystem.HlogSplitSize_mean",
-                "pointInTime": false,
-                "temporal": true
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/jmx_metrics.json
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/jmx_metrics.json b/app-packages/hbase-v0_96/jmx_metrics.json
deleted file mode 100644
index ac0640e..0000000
--- a/app-packages/hbase-v0_96/jmx_metrics.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-    "Component": {
-        "HBASE_MASTER": {
-            "MetricAverageLoad": {
-                "metric": "Hadoop:service=HBase,name=Master,sub=Server.averageLoad",
-                "pointInTime": true,
-                "temporal": false
-            },
-            "DeadRegionServers": {
-                "metric": "Hadoop:service=HBase,name=Master,sub=Server.numDeadRegionServers",
-                "pointInTime": true,
-                "temporal": false
-            },
-            "ClusterId": {
-                "metric": "Hadoop:service=HBase,name=Master,sub=Server.tag.clusterId",
-                "pointInTime": true,
-                "temporal": false
-            },
-            "IsActiveMaster": {
-                "metric": "Hadoop:service=HBase,name=Master,sub=Server.tag.isActiveMaster",
-                "pointInTime": true,
-                "temporal": false
-            },
-            "MasterActiveTime": {
-                "metric": "Hadoop:service=HBase,name=Master,sub=Server.masterActiveTime",
-                "pointInTime": true,
-                "temporal": false
-            },
-            "MasterStartTime": {
-                "metric": "Hadoop:service=HBase,name=Master,sub=Server.masterStartTime",
-                "pointInTime": true,
-                "temporal": false
-            },
-            "RegionServers": {
-                "metric": "Hadoop:service=HBase,name=Master,sub=Server.numRegionServers",
-                "pointInTime": true,
-                "temporal": false
-            },
-            "ServerName": {
-                "metric": "Hadoop:service=HBase,name=Master,sub=Server.tag.serverName",
-                "pointInTime": true,
-                "temporal": false
-            },
-            "ZookeeperQuorum": {
-                "metric": "Hadoop:service=HBase,name=Master,sub=Server.tag.zookeeperQuorum",
-                "pointInTime": true,
-                "temporal": false
-            },
-            "ClusterRequests": {
-                "metric": "Hadoop:service=HBase,name=Master,sub=Server.clusterRequests",
-                "pointInTime": true,
-                "temporal": false
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/metainfo.xml
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/metainfo.xml b/app-packages/hbase-v0_96/metainfo.xml
deleted file mode 100644
index 7eb6867..0000000
--- a/app-packages/hbase-v0_96/metainfo.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.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.
--->
-<metainfo>
-  <schemaVersion>2.0</schemaVersion>
-  <services>
-    <service>
-      <name>HBASE</name>
-      <comment>
-        Apache HBase is the Hadoop database, a distributed, scalable, big data store.
-        Requirements:
-        1. Ensure parent dir for path (hbase-site/hbase.rootdir) is accessible to the App owner.
-        2. Ensure ZK root (hbase-site/zookeeper.znode.parent) is unique for the App instance.
-      </comment>
-      <version>0.96.0.2.1.1</version>
-      <type>YARN-APP</type>
-      <minHadoopVersion>2.1.0</minHadoopVersion>
-      <exportGroups>
-        <exportGroup>
-          <name>QuickLinks</name>
-          <exports>
-            <export>
-              <name>org.apache.slider.jmx</name>
-              <value>http://${HBASE_MASTER_HOST}:${site.hbase-site.hbase.master.info.port}/jmx</value>
-            </export>
-            <export>
-              <name>org.apache.slider.monitor</name>
-              <value>http://${HBASE_MASTER_HOST}:${site.hbase-site.hbase.master.info.port}/master-status</value>
-            </export>
-            <export>
-              <name>org.apache.slider.metrics</name>
-              <value>http://${site.global.ganglia_server_host}/cgi-bin/rrd.py?c=${site.global.ganglia_server_id}</value>
-            </export>
-            <export>
-              <name>org.apache.slider.ganglia</name>
-              <value>http://${site.global.ganglia_server_host}/ganglia?c=${site.global.ganglia_server_id}</value>
-            </export>
-          </exports>
-        </exportGroup>
-      </exportGroups>
-      <commandOrders>
-        <commandOrder>
-          <command>HBASE_REGIONSERVER-START</command>
-          <requires>HBASE_MASTER-STARTED</requires>
-        </commandOrder>
-      </commandOrders>
-      <components>
-        <component>
-          <name>HBASE_MASTER</name>
-          <category>MASTER</category>
-          <minInstanceCount>1</minInstanceCount>
-          <maxInstanceCount>2</maxInstanceCount>
-          <commandScript>
-            <script>scripts/hbase_master.py</script>
-            <scriptType>PYTHON</scriptType>
-            <timeout>600</timeout>
-          </commandScript>
-        </component>
-
-        <component>
-          <name>HBASE_REGIONSERVER</name>
-          <category>SLAVE</category>
-          <minInstanceCount>1</minInstanceCount>
-          <commandScript>
-            <script>scripts/hbase_regionserver.py</script>
-            <scriptType>PYTHON</scriptType>
-          </commandScript>
-        </component>
-
-        <component>
-          <name>HBASE_CLIENT</name>
-          <category>CLIENT</category>
-          <minInstanceCount>0</minInstanceCount>
-          <commandScript>
-            <script>scripts/hbase_client.py</script>
-            <scriptType>PYTHON</scriptType>
-          </commandScript>
-        </component>
-      </components>
-
-      <osSpecifics>
-        <osSpecific>
-          <osType>any</osType>
-          <packages>
-            <package>
-              <type>tarball</type>
-              <name>files/hbase-0.96.1-hadoop2-bin.tar.gz</name>
-            </package>
-          </packages>
-        </osSpecific>
-      </osSpecifics>
-
-    </service>
-  </services>
-</metainfo>

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/files/hbase-0.96.1-hadoop2-bin.tar.gz.REPLACE
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/files/hbase-0.96.1-hadoop2-bin.tar.gz.REPLACE b/app-packages/hbase-v0_96/package/files/hbase-0.96.1-hadoop2-bin.tar.gz.REPLACE
deleted file mode 100644
index 5d03caa..0000000
--- a/app-packages/hbase-v0_96/package/files/hbase-0.96.1-hadoop2-bin.tar.gz.REPLACE
+++ /dev/null
@@ -1,16 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-Replace with actual hbase tarball.

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/scripts/__init__.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/scripts/__init__.py b/app-packages/hbase-v0_96/package/scripts/__init__.py
deleted file mode 100644
index 5561e10..0000000
--- a/app-packages/hbase-v0_96/package/scripts/__init__.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/scripts/functions.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/scripts/functions.py b/app-packages/hbase-v0_96/package/scripts/functions.py
deleted file mode 100644
index e6e7fb9..0000000
--- a/app-packages/hbase-v0_96/package/scripts/functions.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-import os
-import re
-import math
-import datetime
-
-from resource_management.core.shell import checked_call
-
-def calc_xmn_from_xms(heapsize_str, xmn_percent, xmn_max):
-  """
-  @param heapsize_str: str (e.g '1000m')
-  @param xmn_percent: float (e.g 0.2)
-  @param xmn_max: integer (e.g 512)
-  """
-  heapsize = int(re.search('\d+',heapsize_str).group(0))
-  heapsize_unit = re.search('\D+',heapsize_str).group(0)
-  xmn_val = int(math.floor(heapsize*xmn_percent))
-  xmn_val -= xmn_val % 8
-  
-  result_xmn_val = xmn_max if xmn_val > xmn_max else xmn_val
-  return str(result_xmn_val) + heapsize_unit

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/scripts/hbase.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/scripts/hbase.py b/app-packages/hbase-v0_96/package/scripts/hbase.py
deleted file mode 100644
index ed6ec51..0000000
--- a/app-packages/hbase-v0_96/package/scripts/hbase.py
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-import os
-
-from resource_management import *
-import sys
-
-def hbase(name=None # 'master' or 'regionserver' or 'client'
-              ):
-  import params
-
-  if name in ["master","regionserver"]:
-    params.HdfsDirectory(params.hbase_hdfs_root_dir,
-                         action="create_delayed"
-    )
-    params.HdfsDirectory(params.hbase_staging_dir,
-                         action="create_delayed",
-                         mode=0711
-    )
-    params.HdfsDirectory(None, action="create")
-  Directory( params.conf_dir,
-      owner = params.hbase_user,
-      group = params.user_group,
-      recursive = True
-  )
-
-  Directory (params.tmp_dir,
-             owner = params.hbase_user,
-             recursive = True
-  )
-
-  Directory (os.path.join(params.local_dir, "jars"),
-             owner = params.hbase_user,
-             group = params.user_group,
-             mode=0775,
-             recursive = True
-  )
-
-  XmlConfig( "hbase-site.xml",
-            conf_dir = params.conf_dir,
-            configurations = params.config['configurations']['hbase-site'],
-            owner = params.hbase_user,
-            group = params.user_group
-  )
-
-  XmlConfig( "hdfs-site.xml",
-            conf_dir = params.conf_dir,
-            configurations = params.config['configurations']['hdfs-site'],
-            owner = params.hbase_user,
-            group = params.user_group
-  )
-
-  if 'hbase-policy' in params.config['configurations']:
-    XmlConfig( "hbase-policy.xml",
-      configurations = params.config['configurations']['hbase-policy'],
-      owner = params.hbase_user,
-      group = params.user_group
-    )
-  # Manually overriding ownership of file installed by hadoop package
-  else: 
-    File( format("{conf_dir}/hbase-policy.xml"),
-      owner = params.hbase_user,
-      group = params.user_group
-    )
-  
-  hbase_TemplateConfig( 'hbase-env.sh')
-
-  hbase_TemplateConfig( params.metric_prop_file_name,
-                        tag = 'GANGLIA-MASTER' if name == 'master' else 'GANGLIA-RS'
-  )
-       
-  if params.security_enabled:
-    hbase_TemplateConfig( format("hbase_{name}_jaas.conf"))
-  
-  if name != "client":
-    Directory( params.pid_dir,
-      owner = params.hbase_user,
-      recursive = True
-    )
-  
-    Directory (params.log_dir,
-      owner = params.hbase_user,
-      recursive = True
-    )
-
-  if (params.log4j_props != None):
-    File(format("{params.conf_dir}/log4j.properties"),
-         mode=0644,
-         group=params.user_group,
-         owner=params.hbase_user,
-         content=params.log4j_props
-    )
-  elif (os.path.exists(format("{params.conf_dir}/log4j.properties"))):
-    File(format("{params.conf_dir}/log4j.properties"),
-      mode=0644,
-      group=params.user_group,
-      owner=params.hbase_user
-    )
-
-def hbase_TemplateConfig(name, 
-                         tag=None
-                         ):
-  import params
-
-  TemplateConfig( format("{conf_dir}/{name}"),
-      owner = params.hbase_user,
-      template_tag = tag
-  )

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/scripts/hbase_client.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/scripts/hbase_client.py b/app-packages/hbase-v0_96/package/scripts/hbase_client.py
deleted file mode 100644
index 043ad11..0000000
--- a/app-packages/hbase-v0_96/package/scripts/hbase_client.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-import sys
-from resource_management import *
-
-from hbase import hbase
-
-         
-class HbaseClient(Script):
-  def install(self, env):
-    self.install_packages(env)
-    self.configure(env)
-    
-  def configure(self, env):
-    import params
-    env.set_params(params)
-    
-    hbase(name='client')
-
-  def status(self, env):
-    raise ClientComponentHasNoStatus()
-
-
-if __name__ == "__main__":
-  HbaseClient().execute()

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/scripts/hbase_master.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/scripts/hbase_master.py b/app-packages/hbase-v0_96/package/scripts/hbase_master.py
deleted file mode 100644
index 47b2409..0000000
--- a/app-packages/hbase-v0_96/package/scripts/hbase_master.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-import sys
-from resource_management import *
-
-from hbase import hbase
-from hbase_service import hbase_service
-
-         
-class HbaseMaster(Script):
-  def install(self, env):
-    self.install_packages(env)
-    
-  def configure(self, env):
-    import params
-    env.set_params(params)
-
-    hbase(name='master')
-    
-  def start(self, env):
-    import params
-    env.set_params(params)
-    self.configure(env) # for security
-
-    hbase_service( 'master',
-      action = 'start'
-    )
-    
-  def stop(self, env):
-    import params
-    env.set_params(params)
-
-    hbase_service( 'master',
-      action = 'stop'
-    )
-
-  def status(self, env):
-    import status_params
-    env.set_params(status_params)
-    pid_file = format("{pid_dir}/hbase-{hbase_user}-master.pid")
-    check_process_status(pid_file)
-
-
-if __name__ == "__main__":
-  HbaseMaster().execute()

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/scripts/hbase_regionserver.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/scripts/hbase_regionserver.py b/app-packages/hbase-v0_96/package/scripts/hbase_regionserver.py
deleted file mode 100644
index 8d66dcc..0000000
--- a/app-packages/hbase-v0_96/package/scripts/hbase_regionserver.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-import sys
-from resource_management import *
-
-from hbase import hbase
-from hbase_service import hbase_service
-
-         
-class HbaseRegionServer(Script):
-  def install(self, env):
-    self.install_packages(env)
-    
-  def configure(self, env):
-    import params
-    env.set_params(params)
-
-    hbase(name='regionserver')
-      
-  def start(self, env):
-    import params
-    env.set_params(params)
-    self.configure(env) # for security
-
-    hbase_service( 'regionserver',
-      action = 'start'
-    )
-    
-  def stop(self, env):
-    import params
-    env.set_params(params)
-
-    hbase_service( 'regionserver',
-      action = 'stop'
-    )
-
-  def status(self, env):
-    import status_params
-    env.set_params(status_params)
-    pid_file = format("{pid_dir}/hbase-{hbase_user}-regionserver.pid")
-    check_process_status(pid_file)
-    
-  def decommission(self, env):
-    print "Decommission not yet implemented!"
-    
-
-if __name__ == "__main__":
-  HbaseRegionServer().execute()

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/scripts/hbase_service.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/scripts/hbase_service.py b/app-packages/hbase-v0_96/package/scripts/hbase_service.py
deleted file mode 100644
index 2b30083..0000000
--- a/app-packages/hbase-v0_96/package/scripts/hbase_service.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-
-def hbase_service(
-  name,
-  action = 'start'): # 'start' or 'stop' or 'status'
-    
-    import params
-  
-    role = name
-    cmd = format("{daemon_script} --config {conf_dir}")
-    pid_file = format("{pid_dir}/hbase-{hbase_user}-{role}.pid")
-    
-    daemon_cmd = None
-    no_op_test = None
-    
-    if action == 'start':
-      daemon_cmd = format("{cmd} start {role}")
-      no_op_test = format("ls {pid_file} >/dev/null 2>&1 && ps `cat {pid_file}` >/dev/null 2>&1")
-    elif action == 'stop':
-      daemon_cmd = format("{cmd} stop {role} && rm -f {pid_file}")
-
-    if daemon_cmd is not None:
-      Execute ( daemon_cmd,
-        not_if = no_op_test
-      )

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/scripts/params.py b/app-packages/hbase-v0_96/package/scripts/params.py
deleted file mode 100644
index 0d8b04b..0000000
--- a/app-packages/hbase-v0_96/package/scripts/params.py
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from functions import calc_xmn_from_xms
-from resource_management import *
-import status_params
-
-# server configurations
-config = Script.get_config()
-
-hbase_root = config['configurations']['global']['app_root']
-conf_dir = format("{hbase_root}/conf")
-daemon_script = format("{hbase_root}/bin/hbase-daemon.sh")
-
-hbase_user = status_params.hbase_user
-_authentication = config['configurations']['core-site']['hadoop.security.authentication']
-security_enabled = ( not is_empty(_authentication) and _authentication == 'kerberos')
-user_group = config['configurations']['global']['user_group']
-
-# this is "hadoop-metrics.properties" for 1.x stacks
-metric_prop_file_name = "hadoop-metrics2-hbase.properties"
-
-# not supporting 32 bit jdk.
-java64_home = config['hostLevelParams']['java_home']
-
-log_dir = config['configurations']['global']['app_log_dir']
-master_heapsize = config['configurations']['global']['hbase_master_heapsize']
-
-regionserver_heapsize = config['configurations']['global']['hbase_regionserver_heapsize']
-regionserver_xmn_size = calc_xmn_from_xms(regionserver_heapsize, 0.2, 512)
-
-pid_dir = status_params.pid_dir
-tmp_dir = config['configurations']['hbase-site']['hbase.tmp.dir']
-local_dir = substitute_vars(config['configurations']['hbase-site']['hbase.local.dir'], config['configurations']['hbase-site'])
-
-client_jaas_config_file = default('hbase_client_jaas_config_file', format("{conf_dir}/hbase_client_jaas.conf"))
-master_jaas_config_file = default('hbase_master_jaas_config_file', format("{conf_dir}/hbase_master_jaas.conf"))
-regionserver_jaas_config_file = default('hbase_regionserver_jaas_config_file', format("{conf_dir}/hbase_regionserver_jaas.conf"))
-
-ganglia_server_host = default('/configurations/global/ganglia_server_host', '')
-ganglia_server_port = default('/configurations/global/ganglia_server_port', '8663')
-
-if security_enabled:
-  
-  _use_hostname_in_principal = default('instance_name', True)
-  _master_primary_name = config['configurations']['global']['hbase_master_primary_name']
-  _hostname_lowercase = config['hostname'].lower()
-  _kerberos_domain = config['configurations']['global']['kerberos_domain']
-  _master_principal_name = config['configurations']['global']['hbase_master_principal_name']
-  _regionserver_primary_name = config['configurations']['global']['hbase_regionserver_primary_name']
-  
-  if _use_hostname_in_principal:
-    master_jaas_princ = format("{_master_primary_name}/{_hostname_lowercase}@{_kerberos_domain}")
-    regionserver_jaas_princ = format("{_regionserver_primary_name}/{_hostname_lowercase}@{_kerberos_domain}")
-  else:
-    master_jaas_princ = format("{_master_principal_name}@{_kerberos_domain}")
-    regionserver_jaas_princ = format("{_regionserver_primary_name}@{_kerberos_domain}")
-    
-master_keytab_path = config['configurations']['hbase-site']['hbase.master.keytab.file']
-regionserver_keytab_path = config['configurations']['hbase-site']['hbase.regionserver.keytab.file']
-kinit_path_local = functions.get_kinit_path([default("kinit_path_local",None), "/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
-if security_enabled:
-  kinit_cmd = format("{kinit_path_local} -kt {hbase_user_keytab} {hbase_user};")
-else:
-  kinit_cmd = ""
-
-#log4j.properties
-if (('hbase-log4j' in config['configurations']) and ('content' in config['configurations']['hbase-log4j'])):
-  log4j_props = config['configurations']['hbase-log4j']['content']
-else:
-  log4j_props = None
-
-
-hbase_hdfs_root_dir = config['configurations']['hbase-site']['hbase.rootdir']
-hbase_staging_dir = config['configurations']['hbase-site']['hbase.stagingdir']
-#for create_hdfs_directory
-hostname = config["hostname"]
-hadoop_conf_dir = "/etc/hadoop/conf"
-hdfs_user_keytab = config['configurations']['global']['hdfs_user_keytab']
-hdfs_user = config['configurations']['global']['hdfs_user']
-kinit_path_local = functions.get_kinit_path([default("kinit_path_local",None), "/usr/bin", "/usr/kerberos/bin", "/usr/sbin"])
-import functools
-#create partial functions with common arguments for every HdfsDirectory call
-#to create hdfs directory we need to call params.HdfsDirectory in code
-HdfsDirectory = functools.partial(
-  HdfsDirectory,
-  conf_dir=hadoop_conf_dir,
-  hdfs_user=hdfs_user,
-  security_enabled = security_enabled,
-  keytab = hdfs_user_keytab,
-  kinit_path_local = kinit_path_local
-)

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/scripts/status_params.py b/app-packages/hbase-v0_96/package/scripts/status_params.py
deleted file mode 100644
index c18cbb9..0000000
--- a/app-packages/hbase-v0_96/package/scripts/status_params.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env python
-"""
-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.
-
-"""
-
-from resource_management import *
-
-config = Script.get_config()
-
-pid_dir = config['configurations']['global']['app_pid_dir']
-hbase_user = config['configurations']['global']['app_user']

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2 b/app-packages/hbase-v0_96/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2
deleted file mode 100644
index a3eb1fc..0000000
--- a/app-packages/hbase-v0_96/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2
+++ /dev/null
@@ -1,62 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# 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.
-
-# See http://wiki.apache.org/hadoop/GangliaMetrics
-#
-# Make sure you know whether you are using ganglia 3.0 or 3.1.
-# If 3.1, you will have to patch your hadoop instance with HADOOP-4675
-# And, yes, this file is named hadoop-metrics.properties rather than
-# hbase-metrics.properties because we're leveraging the hadoop metrics
-# package and hadoop-metrics.properties is an hardcoded-name, at least
-# for the moment.
-#
-# See also http://hadoop.apache.org/hbase/docs/current/metrics.html
-
-# HBase-specific configuration to reset long-running stats (e.g. compactions)
-# If this variable is left out, then the default is no expiration.
-hbase.extendedperiod = 3600
-
-# Configuration of the "hbase" context for ganglia
-# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
-# hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext
-hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
-hbase.period=10
-hbase.servers={{ganglia_server_host}}:{{ganglia_server_port}}
-
-# Configuration of the "jvm" context for ganglia
-# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
-# jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext
-jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
-jvm.period=10
-jvm.servers={{ganglia_server_host}}:{{ganglia_server_port}}
-
-# Configuration of the "rpc" context for ganglia
-# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
-# rpc.class=org.apache.hadoop.metrics.ganglia.GangliaContext
-rpc.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
-rpc.period=10
-rpc.servers={{ganglia_server_host}}:{{ganglia_server_port}}
-
-#Ganglia following hadoop example
-hbase.sink.ganglia.class=org.apache.hadoop.metrics2.sink.ganglia.GangliaSink31
-hbase.sink.ganglia.period=10
-
-# default for supportsparse is false
-*.sink.ganglia.supportsparse=true
-
-.sink.ganglia.slope=jvm.metrics.gcCount=zero,jvm.metrics.memHeapUsedM=both
-.sink.ganglia.dmax=jvm.metrics.threadsBlocked=70,jvm.metrics.memHeapUsedM=40
-
-hbase.sink.ganglia.servers={{ganglia_server_host}}:{{ganglia_server_port}}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2 b/app-packages/hbase-v0_96/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2
deleted file mode 100644
index a3eb1fc..0000000
--- a/app-packages/hbase-v0_96/package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2
+++ /dev/null
@@ -1,62 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# 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.
-
-# See http://wiki.apache.org/hadoop/GangliaMetrics
-#
-# Make sure you know whether you are using ganglia 3.0 or 3.1.
-# If 3.1, you will have to patch your hadoop instance with HADOOP-4675
-# And, yes, this file is named hadoop-metrics.properties rather than
-# hbase-metrics.properties because we're leveraging the hadoop metrics
-# package and hadoop-metrics.properties is an hardcoded-name, at least
-# for the moment.
-#
-# See also http://hadoop.apache.org/hbase/docs/current/metrics.html
-
-# HBase-specific configuration to reset long-running stats (e.g. compactions)
-# If this variable is left out, then the default is no expiration.
-hbase.extendedperiod = 3600
-
-# Configuration of the "hbase" context for ganglia
-# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
-# hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext
-hbase.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
-hbase.period=10
-hbase.servers={{ganglia_server_host}}:{{ganglia_server_port}}
-
-# Configuration of the "jvm" context for ganglia
-# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
-# jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext
-jvm.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
-jvm.period=10
-jvm.servers={{ganglia_server_host}}:{{ganglia_server_port}}
-
-# Configuration of the "rpc" context for ganglia
-# Pick one: Ganglia 3.0 (former) or Ganglia 3.1 (latter)
-# rpc.class=org.apache.hadoop.metrics.ganglia.GangliaContext
-rpc.class=org.apache.hadoop.metrics.ganglia.GangliaContext31
-rpc.period=10
-rpc.servers={{ganglia_server_host}}:{{ganglia_server_port}}
-
-#Ganglia following hadoop example
-hbase.sink.ganglia.class=org.apache.hadoop.metrics2.sink.ganglia.GangliaSink31
-hbase.sink.ganglia.period=10
-
-# default for supportsparse is false
-*.sink.ganglia.supportsparse=true
-
-.sink.ganglia.slope=jvm.metrics.gcCount=zero,jvm.metrics.memHeapUsedM=both
-.sink.ganglia.dmax=jvm.metrics.threadsBlocked=70,jvm.metrics.memHeapUsedM=40
-
-hbase.sink.ganglia.servers={{ganglia_server_host}}:{{ganglia_server_port}}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/templates/hbase-env.sh.j2
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/templates/hbase-env.sh.j2 b/app-packages/hbase-v0_96/package/templates/hbase-env.sh.j2
deleted file mode 100644
index 4aa79ad..0000000
--- a/app-packages/hbase-v0_96/package/templates/hbase-env.sh.j2
+++ /dev/null
@@ -1,81 +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.
-#
-
-# Set environment variables here.
-
-# The java implementation to use. Java 1.6 required.
-export JAVA_HOME={{java64_home}}
-
-# HBase Configuration directory
-export HBASE_CONF_DIR=${HBASE_CONF_DIR:-{{conf_dir}}}
-
-# Extra Java CLASSPATH elements. Optional.
-export HBASE_CLASSPATH=${HBASE_CLASSPATH}
-
-# The maximum amount of heap to use, in MB. Default is 1000.
-# export HBASE_HEAPSIZE=1000
-
-# Extra Java runtime options.
-# Below are what we set by default. May only work with SUN JVM.
-# For more on why as well as other possible settings,
-# see http://wiki.apache.org/hadoop/PerformanceTuning
-export HBASE_OPTS="-XX:+UseConcMarkSweepGC -XX:ErrorFile={{log_dir}}/hs_err_pid%p.log"
-export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:{{log_dir}}/gc.log-`date +'%Y%m%d%H%M'`"
-# Uncomment below to enable java garbage collection logging.
-# export HBASE_OPTS="$HBASE_OPTS -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$HBASE_HOME/logs/gc-hbase.log"
-
-# Uncomment and adjust to enable JMX exporting
-# See jmxremote.password and jmxremote.access in $JRE_HOME/lib/management to configure remote password access.
-# More details at: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
-#
-# export HBASE_JMX_BASE="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
-export HBASE_MASTER_OPTS="-Xmx{{master_heapsize}}"
-export HBASE_REGIONSERVER_OPTS="-Xmn{{regionserver_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70  -Xms{{regionserver_heapsize}} -Xmx{{regionserver_heapsize}}"
-# export HBASE_THRIFT_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10103"
-# export HBASE_ZOOKEEPER_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10104"
-
-# File naming hosts on which HRegionServers will run. $HBASE_HOME/conf/regionservers by default.
-export HBASE_REGIONSERVERS=${HBASE_CONF_DIR}/regionservers
-
-# Extra ssh options. Empty by default.
-# export HBASE_SSH_OPTS="-o ConnectTimeout=1 -o SendEnv=HBASE_CONF_DIR"
-
-# Where log files are stored. $HBASE_HOME/logs by default.
-export HBASE_LOG_DIR={{log_dir}}
-
-# A string representing this instance of hbase. $USER by default.
-# export HBASE_IDENT_STRING=$USER
-
-# The scheduling priority for daemon processes. See 'man nice'.
-# export HBASE_NICENESS=10
-
-# The directory where pid files are stored. /tmp by default.
-export HBASE_PID_DIR={{pid_dir}}
-
-# Seconds to sleep between slave commands. Unset by default. This
-# can be useful in large clusters, where, e.g., slave rsyncs can
-# otherwise arrive faster than the master can service them.
-# export HBASE_SLAVE_SLEEP=0.1
-
-# Tell HBase whether it should manage it's own instance of Zookeeper or not.
-export HBASE_MANAGES_ZK=false
-
-{% if security_enabled %}
-export HBASE_OPTS="$HBASE_OPTS -Djava.security.auth.login.config={{client_jaas_config_file}}"
-export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -Djava.security.auth.login.config={{master_jaas_config_file}}"
-export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -Djava.security.auth.login.config={{regionserver_jaas_config_file}}"
-{% endif %}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/templates/hbase_client_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/templates/hbase_client_jaas.conf.j2 b/app-packages/hbase-v0_96/package/templates/hbase_client_jaas.conf.j2
deleted file mode 100644
index bb4279c..0000000
--- a/app-packages/hbase-v0_96/package/templates/hbase_client_jaas.conf.j2
+++ /dev/null
@@ -1,22 +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.
- */
-Client {
-com.sun.security.auth.module.Krb5LoginModule required
-useKeyTab=false
-useTicketCache=true;
-};

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/templates/hbase_master_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/templates/hbase_master_jaas.conf.j2 b/app-packages/hbase-v0_96/package/templates/hbase_master_jaas.conf.j2
deleted file mode 100644
index 91ce3ef..0000000
--- a/app-packages/hbase-v0_96/package/templates/hbase_master_jaas.conf.j2
+++ /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.
- */
-Client {
-com.sun.security.auth.module.Krb5LoginModule required
-useKeyTab=true
-storeKey=true
-useTicketCache=false
-keyTab="{{master_keytab_path}}"
-principal="{{master_jaas_princ}}";
-};

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/templates/hbase_regionserver_jaas.conf.j2
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/templates/hbase_regionserver_jaas.conf.j2 b/app-packages/hbase-v0_96/package/templates/hbase_regionserver_jaas.conf.j2
deleted file mode 100644
index 2a9b9f3..0000000
--- a/app-packages/hbase-v0_96/package/templates/hbase_regionserver_jaas.conf.j2
+++ /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.
- */
-Client {
-com.sun.security.auth.module.Krb5LoginModule required
-useKeyTab=true
-storeKey=true
-useTicketCache=false
-keyTab="{{regionserver_keytab_path}}"
-principal="{{regionserver_jaas_princ}}";
-};

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/package/templates/regionservers.j2
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/package/templates/regionservers.j2 b/app-packages/hbase-v0_96/package/templates/regionservers.j2
deleted file mode 100644
index 81d060b..0000000
--- a/app-packages/hbase-v0_96/package/templates/regionservers.j2
+++ /dev/null
@@ -1,20 +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.
-#}
-
-{% for host in rs_hosts %}{{host}}
-{% endfor %}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase-v0_96/resources.json
----------------------------------------------------------------------
diff --git a/app-packages/hbase-v0_96/resources.json b/app-packages/hbase-v0_96/resources.json
deleted file mode 100644
index 9cc1b47..0000000
--- a/app-packages/hbase-v0_96/resources.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "schema": "http://example.org/specification/v2.0.0",
-  "metadata": {
-  },
-  "global": {
-  },
-  "components": {
-    "HBASE_MASTER": {
-      "yarn.role.priority": "1",
-      "yarn.component.instances": "1"
-    },
-    "slider-appmaster": {
-    },
-    "HBASE_REGIONSERVER": {
-      "yarn.role.priority": "2",
-      "yarn.component.instances": "1"
-    }
-  }
-}
\ No newline at end of file


[13/13] git commit: SLIDER-153 more on execing scripts

Posted by st...@apache.org.
SLIDER-153 more on execing scripts


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

Branch: refs/heads/feature/SLIDER-153_add_slider_py_command
Commit: acdfe5bd6dfe59daca573a5e28271d9950467b16
Parents: 918e746
Author: Steve Loughran <st...@apache.org>
Authored: Mon Jun 23 14:47:28 2014 -0700
Committer: Steve Loughran <st...@apache.org>
Committed: Mon Jun 23 14:47:28 2014 -0700

----------------------------------------------------------------------
 slider-assembly/src/main/scripts/slider.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/acdfe5bd/slider-assembly/src/main/scripts/slider.py
----------------------------------------------------------------------
diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py
index e846e64..2c1f4b3 100644
--- a/slider-assembly/src/main/scripts/slider.py
+++ b/slider-assembly/src/main/scripts/slider.py
@@ -89,11 +89,10 @@ def main():
   slider_classpath_extra = os.environ.get(SLIDER_CLASSPATH_EXTRA, "")
   p = os.pathsep    # path separator
   d = os.sep        # dir separator
-  slider_classpath = '"' + \
-                     libdir + d + "*" + p \
+  slider_classpath = libdir + d + "*" + p \
                      + confdir + p \
-                     + slider_classpath_extra \
-                     + '"'
+                     + slider_classpath_extra 
+                     
 
   print "slider_home = \"%s\"" % slider_home
   print "slider_jvm_opts = \"%s\"" % slider_jvm_opts
@@ -111,7 +110,7 @@ def main():
   return subprocess.call(commandline,
                          stdin=None,
                          stdout=subprocess.PIPE,
-                         stderr=subprocess.PIPE,
+                         stderr=subprocess.STDOUT,
                          shell=False)
 
 


[03/13] git commit: SLIDER-126. Slider-Agent and Agent Provider need to handle component instance install/start failure gracefully

Posted by st...@apache.org.
SLIDER-126. Slider-Agent and Agent Provider need to handle component instance install/start failure gracefully


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

Branch: refs/heads/feature/SLIDER-153_add_slider_py_command
Commit: 3aca57d2c0d8e06fc720b023583d5a7ce1f4273e
Parents: 7003c06
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Sat Jun 21 18:09:42 2014 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Sat Jun 21 18:09:42 2014 -0700

----------------------------------------------------------------------
 slider-agent/conf/agent.ini                     |   2 +
 .../src/main/python/agent/AgentConfig.py        |  21 +++
 slider-agent/src/main/python/agent/Constants.py |   3 +
 .../src/main/python/agent/Controller.py         |  23 ++-
 slider-agent/src/main/python/agent/main.py      |   4 +
 .../src/test/python/agent/TestController.py     |  30 ++++
 slider-agent/src/test/python/agent/TestMain.py  |   5 +-
 .../providers/AbstractProviderService.java      |  15 +-
 .../slider/providers/ProviderService.java       |   5 +-
 .../slider/providers/agent/AgentKeys.java       |   3 +
 .../providers/agent/AgentLaunchParameter.java   | 130 ++++++++++++++
 .../providers/agent/AgentProviderService.java   | 179 ++++++++++++++++---
 .../slider/providers/agent/AgentRoles.java      |  18 +-
 .../apache/slider/providers/agent/Command.java  |  13 +-
 .../slider/providers/agent/CommandResult.java   |  16 +-
 .../providers/agent/ComponentInstanceState.java |  24 +++
 .../slider/providers/agent/ContainerState.java  |  41 +++++
 .../providers/agent/HeartbeatMonitor.java       | 116 ++++++++++++
 .../server/appmaster/AMViewForProviders.java    |  27 +++
 .../server/appmaster/SliderAppMaster.java       |  32 +++-
 .../slider/server/appmaster/state/AppState.java |  20 +++
 .../test_command_log/appConfig_fast_no_reg.json |  29 +++
 .../test_command_log/appConfig_no_hb.json       |  29 +++
 .../model/mock/MockProviderService.groovy       |   4 +-
 .../agent/TestAgentLaunchParameter.java         |  76 ++++++++
 .../providers/agent/TestHeartbeatMonitor.java   | 136 ++++++++++++++
 .../publisher/TestAgentProviderService.java     |   5 +-
 .../lifecycle/AgentCommandTestBase.groovy       | 100 ++++++++---
 .../lifecycle/TestAgentClusterLifecycle.groovy  |   2 +-
 .../funtest/lifecycle/TestAgentFailures.groovy  | 103 +++++++++++
 .../funtest/lifecycle/TestAgentFailures2.groovy | 103 +++++++++++
 .../lifecycle/TestAppsThroughAgent.groovy       |  90 ++++------
 32 files changed, 1253 insertions(+), 151 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-agent/conf/agent.ini
----------------------------------------------------------------------
diff --git a/slider-agent/conf/agent.ini b/slider-agent/conf/agent.ini
index 87d73a7..b52bec9 100644
--- a/slider-agent/conf/agent.ini
+++ b/slider-agent/conf/agent.ini
@@ -25,6 +25,8 @@ heartbeat_path=/ws/v1/slider/agents/{name}/heartbeat
 app_pkg_dir=app/definition
 app_install_dir=app/install
 app_run_dir=app/run
+app_dbg_cmd=
+debug_mode_enabled=true
 
 app_task_dir=app/command-log
 app_log_dir=app/log

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-agent/src/main/python/agent/AgentConfig.py
----------------------------------------------------------------------
diff --git a/slider-agent/src/main/python/agent/AgentConfig.py b/slider-agent/src/main/python/agent/AgentConfig.py
index e0981f6..91adfdd 100644
--- a/slider-agent/src/main/python/agent/AgentConfig.py
+++ b/slider-agent/src/main/python/agent/AgentConfig.py
@@ -21,6 +21,9 @@ limitations under the License.
 import ConfigParser
 import StringIO
 import os
+import logging
+
+logger = logging.getLogger()
 
 config = ConfigParser.RawConfigParser()
 content = """
@@ -37,6 +40,8 @@ heartbeat_path=/ws/v1/slider/agents/{name}/heartbeat
 app_pkg_dir=app/definition
 app_install_dir=app/install
 app_run_dir=app/run
+app_dbg_cmd=
+debug_mode_enabled=true
 
 app_task_dir=app/command-log
 app_log_dir=app/log
@@ -79,6 +84,10 @@ class AgentConfig:
   APP_INSTALL_DIR = "app_install_dir"
   # the location to store component instance PID directories
   APP_RUN_DIR = "app_run_dir"
+  # debug hint for agents
+  APP_DBG_CMD = "app_dbg_cmd"
+  # allow agent to operate in debug mode
+  DEBUG_MODE_ENABLED = "debug_mode_enabled"
 
   # run time dir for command executions
   APP_TASK_DIR = "app_task_dir"
@@ -137,6 +146,18 @@ class AgentConfig:
     global config
     return config.get(category, name)
 
+  def isDebugEnabled(self):
+    global config
+    enabled = config.get(AgentConfig.AGENT_SECTION, AgentConfig.DEBUG_MODE_ENABLED)
+    return enabled == "true";
+
+  def debugCommand(self):
+    global config
+    command = config.get(AgentConfig.AGENT_SECTION, AgentConfig.APP_DBG_CMD)
+    if command == None:
+      return ""
+    return command
+
   def set(self, category, name, value):
     global config
     return config.set(category, name, value)

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-agent/src/main/python/agent/Constants.py
----------------------------------------------------------------------
diff --git a/slider-agent/src/main/python/agent/Constants.py b/slider-agent/src/main/python/agent/Constants.py
index b937cd2..88cd564 100644
--- a/slider-agent/src/main/python/agent/Constants.py
+++ b/slider-agent/src/main/python/agent/Constants.py
@@ -27,3 +27,6 @@ ALLOCATED_PORTS = "allocated_ports"
 FOLDERS = "folders"
 AGENT_WORK_ROOT = "AGENT_WORK_ROOT"
 AGENT_LOG_ROOT = "AGENT_LOG_ROOT"
+DO_NOT_REGISTER = "DO_NOT_REGISTER"
+DO_NOT_HEARTBEAT = "DO_NOT_HEARTBEAT"
+DO_NOT_HEARTBEAT_AFTER_ = "DO_NOT_HEARTBEAT_AFTER_"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-agent/src/main/python/agent/Controller.py
----------------------------------------------------------------------
diff --git a/slider-agent/src/main/python/agent/Controller.py b/slider-agent/src/main/python/agent/Controller.py
index fe5760d..b5dca92 100644
--- a/slider-agent/src/main/python/agent/Controller.py
+++ b/slider-agent/src/main/python/agent/Controller.py
@@ -36,6 +36,7 @@ from ActionQueue import ActionQueue
 from NetUtil import NetUtil
 import ssl
 import ProcessHelper
+import Constants
 
 
 logger = logging.getLogger()
@@ -84,10 +85,29 @@ class Controller(threading.Thread):
     logger.info("Server connection disconnected.")
     pass
 
+  def processDebugCommandForRegister(self):
+    self.processDebugCommand(Constants.DO_NOT_REGISTER)
+    pass
+
+  def processDebugCommandForHeartbeat(self):
+    self.processDebugCommand(Constants.DO_NOT_HEARTBEAT)
+    pass
+
+  def processDebugCommand(self, command):
+    if self.config.isDebugEnabled() and self.config.debugCommand() == command:
+      ## Test support - sleep for 10 minutes
+      logger.info("Received debug command: "
+                  + self.config.debugCommand() + " Sleeping for 10 minutes")
+      time.sleep(60*10)
+      pass
+    pass
+
   def registerWithServer(self):
     id = -1
     ret = {}
 
+    self.processDebugCommandForRegister()
+
     while not self.isRegistered:
       try:
         data = json.dumps(self.register.build(id))
@@ -170,7 +190,8 @@ class Controller(threading.Thread):
     retry = False
     certVerifFailed = False
 
-    id = 0
+    self.processDebugCommandForHeartbeat()
+
     while not self.DEBUG_STOP_HEARTBEATING:
 
       if self.shouldStopAgent():

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-agent/src/main/python/agent/main.py
----------------------------------------------------------------------
diff --git a/slider-agent/src/main/python/agent/main.py b/slider-agent/src/main/python/agent/main.py
index afe3595..3632157 100644
--- a/slider-agent/src/main/python/agent/main.py
+++ b/slider-agent/src/main/python/agent/main.py
@@ -176,6 +176,7 @@ def main():
   parser.add_option("-l", "--label", dest="label", help="label of the agent", default=None)
   parser.add_option("--host", dest="host", help="AppMaster host", default=None)
   parser.add_option("--port", dest="port", help="AppMaster port", default=None)
+  parser.add_option("--debug", dest="debug", help="Agent debug hint", default="")
   (options, args) = parser.parse_args()
 
   if not 'AGENT_WORK_ROOT' in os.environ:
@@ -200,6 +201,9 @@ def main():
   if options.port:
       agentConfig.set(AgentConfig.SERVER_SECTION, "port", options.port)
 
+  if options.debug:
+    agentConfig.set(AgentConfig.AGENT_SECTION, AgentConfig.APP_DBG_CMD, options.debug)
+
   logFile = os.path.join(agentConfig.getResolvedPath(AgentConfig.LOG_DIR), logFileName)
   perform_prestart_checks(agentConfig)
   ensure_folder_layout(agentConfig)

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-agent/src/test/python/agent/TestController.py
----------------------------------------------------------------------
diff --git a/slider-agent/src/test/python/agent/TestController.py b/slider-agent/src/test/python/agent/TestController.py
index 8dc7458..8c671da 100644
--- a/slider-agent/src/test/python/agent/TestController.py
+++ b/slider-agent/src/test/python/agent/TestController.py
@@ -557,6 +557,36 @@ class TestController(unittest.TestCase):
     #Conroller thread and the agent stop if the repeatRegistration flag is False
     self.assertFalse(self.controller.repeatRegistration)
 
+  @patch("time.sleep")
+  def test_debugSetupForRegister(self, sleepMock):
+    original_value = self.controller.config
+    self.controller.config = AgentConfig("", "")
+    self.controller.config.set(AgentConfig.AGENT_SECTION, AgentConfig.DEBUG_MODE_ENABLED, "true")
+    self.controller.processDebugCommandForRegister()
+    self.controller.processDebugCommandForHeartbeat()
+    assert not sleepMock.called, 'sleep should not have been called'
+
+    self.controller.config.set(AgentConfig.AGENT_SECTION, AgentConfig.APP_DBG_CMD, "DO_NOT_RERISTER")
+    self.controller.config.set(AgentConfig.AGENT_SECTION, AgentConfig.APP_DBG_CMD, "DO_NOT_HEARTBEET")
+    self.controller.processDebugCommandForRegister()
+    self.controller.processDebugCommandForHeartbeat()
+    assert not sleepMock.called, 'sleep should not have been called'
+
+    self.controller.config.set(AgentConfig.AGENT_SECTION, AgentConfig.APP_DBG_CMD, "DO_NOT_REGISTER")
+    self.controller.processDebugCommandForRegister()
+    assert sleepMock.called, 'sleep should have been called'
+
+    self.controller.processDebugCommandForHeartbeat()
+    assert sleepMock.call_count == 1, 'sleep should have been called once'
+
+    self.controller.config.set(AgentConfig.AGENT_SECTION, AgentConfig.APP_DBG_CMD, "DO_NOT_HEARTBEAT")
+    self.controller.processDebugCommandForHeartbeat()
+    assert sleepMock.call_count == 2, 'sleep should have been called twice'
+
+    self.controller.config = original_value
+    pass
+
+
 if __name__ == "__main__":
   logging.basicConfig(format='%(asctime)s %(message)s',level=logging.DEBUG)
   unittest.main()

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-agent/src/test/python/agent/TestMain.py
----------------------------------------------------------------------
diff --git a/slider-agent/src/test/python/agent/TestMain.py b/slider-agent/src/test/python/agent/TestMain.py
index 5273623..179d1b4 100644
--- a/slider-agent/src/test/python/agent/TestMain.py
+++ b/slider-agent/src/test/python/agent/TestMain.py
@@ -259,11 +259,12 @@ class TestMain(unittest.TestCase):
     self.assertTrue(start_mock.called)
 
   class AgentOptions:
-      def __init__(self, label, host, port, verbose):
+      def __init__(self, label, host, port, verbose, debug):
           self.label = label
           self.host = host
           self.port = port
           self.verbose = verbose
+          self.debug = debug
 
   @patch.object(main, "setup_logging")
   @patch.object(main, "bind_signal_handlers")
@@ -289,7 +290,7 @@ class TestMain(unittest.TestCase):
       Controller_init_mock.return_value = None
       isAlive_mock.return_value = False
       parse_args_mock.return_value = (
-          TestMain.AgentOptions("agent", "host1", "8080", True), [])
+          TestMain.AgentOptions("agent", "host1", "8080", True, ""), [])
       tmpdir = tempfile.gettempdir()
 
       #testing call without command-line arguments

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/providers/AbstractProviderService.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/AbstractProviderService.java b/slider-core/src/main/java/org/apache/slider/providers/AbstractProviderService.java
index 7c9b38e..bbad90f 100644
--- a/slider-core/src/main/java/org/apache/slider/providers/AbstractProviderService.java
+++ b/slider-core/src/main/java/org/apache/slider/providers/AbstractProviderService.java
@@ -30,6 +30,7 @@ import org.apache.slider.core.exceptions.SliderException;
 import org.apache.slider.core.main.ExitCodeProvider;
 import org.apache.slider.core.registry.info.RegisteredEndpoint;
 import org.apache.slider.core.registry.info.ServiceInstanceData;
+import org.apache.slider.server.appmaster.AMViewForProviders;
 import org.apache.slider.server.appmaster.state.StateAccessForProviders;
 import org.apache.slider.server.appmaster.web.rest.agent.AgentRestOperations;
 import org.apache.slider.server.services.registry.RegistryViewForProviders;
@@ -66,6 +67,7 @@ public abstract class AbstractProviderService
   protected AgentRestOperations restOps;
   protected RegistryViewForProviders registry;
   protected ServiceInstanceData registryInstanceData;
+  protected AMViewForProviders amView;
   protected URL amWebAPI;
 
   public AbstractProviderService(String name) {
@@ -81,15 +83,20 @@ public abstract class AbstractProviderService
     return amState;
   }
 
+  public AMViewForProviders getAppMaster() {
+    return amView;
+  }
+
   public void setAmState(StateAccessForProviders amState) {
     this.amState = amState;
   }
 
   @Override
   public void bind(StateAccessForProviders stateAccessor,
-      RegistryViewForProviders reg) {
+      RegistryViewForProviders reg, AMViewForProviders amView) {
     this.amState = stateAccessor;
     this.registry = reg;
+    this.amView = amView;
   }
 
   @Override
@@ -129,16 +136,16 @@ public abstract class AbstractProviderService
 
   /**
    * No-op implementation of this method.
-   * 
+   *
    * {@inheritDoc}
    */
   @Override
   public void validateApplicationConfiguration(AggregateConf instance,
                                                File confDir,
                                                boolean secure) throws
-                                                               IOException,
+      IOException,
       SliderException {
-    
+
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/providers/ProviderService.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/ProviderService.java b/slider-core/src/main/java/org/apache/slider/providers/ProviderService.java
index d77135c..1778197 100644
--- a/slider-core/src/main/java/org/apache/slider/providers/ProviderService.java
+++ b/slider-core/src/main/java/org/apache/slider/providers/ProviderService.java
@@ -31,6 +31,7 @@ import org.apache.slider.core.exceptions.SliderException;
 import org.apache.slider.core.launch.ContainerLauncher;
 import org.apache.slider.core.main.ExitCodeProvider;
 import org.apache.slider.core.registry.info.ServiceInstanceData;
+import org.apache.slider.server.appmaster.AMViewForProviders;
 import org.apache.slider.server.appmaster.state.StateAccessForProviders;
 import org.apache.slider.server.appmaster.web.rest.agent.AgentRestOperations;
 import org.apache.slider.server.services.registry.RegistryViewForProviders;
@@ -138,9 +139,11 @@ public interface ProviderService extends ProviderCore, Service,
    * bind operation -invoked before the service is started
    * @param stateAccessor interface offering read access to the state
    * @param registry
+   * @param amView
    */
   void bind(StateAccessForProviders stateAccessor,
-      RegistryViewForProviders registry);
+            RegistryViewForProviders registry,
+            AMViewForProviders amView);
 
   /**
    * Returns the agent rest operations interface.

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/providers/agent/AgentKeys.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentKeys.java b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentKeys.java
index 7136fd9..dea39ea 100644
--- a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentKeys.java
+++ b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentKeys.java
@@ -71,6 +71,7 @@ public interface AgentKeys {
   String ARG_LABEL = "--label";
   String ARG_HOST = "--host";
   String ARG_PORT = "--port";
+  String ARG_DEBUG = "--debug";
   String AGENT_MAIN_SCRIPT_ROOT = "./infra/agent/slider-agent/";
   String AGENT_MAIN_SCRIPT = "agent/main.py";
 
@@ -88,6 +89,8 @@ public interface AgentKeys {
   String COMPONENT_SCRIPT = "role.script";
   String WAIT_HEARTBEAT = "wait.heartbeat";
   String PYTHON_EXE = "python";
+  String HEARTBEAT_MONITOR_INTERVAL = "heartbeat.monitor.interval";
+  String AGENT_INSTANCE_DEBUG_DATA = "agent.instance.debug.data";
 }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/providers/agent/AgentLaunchParameter.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentLaunchParameter.java b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentLaunchParameter.java
new file mode 100644
index 0000000..b839e58
--- /dev/null
+++ b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentLaunchParameter.java
@@ -0,0 +1,130 @@
+/*
+ * 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.slider.providers.agent;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+class AgentLaunchParameter {
+  public static final Logger log =
+      LoggerFactory.getLogger(AgentLaunchParameter.class);
+  private static final String DEFAULT_PARAMETER = "";
+  private static final String ANY_COMPONENT = "ANY";
+  private static final String NONE_VALUE = "NONE";
+  private final Map<String, CommandTracker> launchParameterTracker;
+
+  public AgentLaunchParameter(String parameters) {
+    launchParameterTracker = parseExpectedLaunchParameters(parameters);
+  }
+
+  /**
+   * Get command for the component type
+   *
+   * @param componentName
+   *
+   * @return
+   */
+  public String getNextLaunchParameter(String componentName) {
+    if (launchParameterTracker != null) {
+      if (launchParameterTracker.containsKey(componentName)
+          || launchParameterTracker.containsKey(ANY_COMPONENT)) {
+        synchronized (this) {
+          CommandTracker indexTracker = null;
+          if (launchParameterTracker.containsKey(componentName)) {
+            indexTracker = launchParameterTracker.get(componentName);
+          } else {
+            indexTracker = launchParameterTracker.get(ANY_COMPONENT);
+          }
+
+          return indexTracker.getNextCommand();
+        }
+      }
+    }
+
+    return DEFAULT_PARAMETER;
+  }
+
+  /**
+   * Parse launch parameters of the form ANY:PARAM_FOR_FIRST:PARAM_FOR_SECOND:...:PARAM_FOR_REST|HBASE_MASTER:...
+   *
+   * E.g. ANY:DO_NOT_REGISTER:DO_NOT_HEARTBEAT:NONE For any container, first one gets DO_NOT_REGISTER second one gets
+   * DO_NOT_HEARTBEAT, then all of the rest get nothing
+   *
+   * E.g. HBASE_MASTER:FAIL_AFTER_START:NONE For HBASE_MASTER, first one gets FAIL_AFTER_START then "" for all
+   *
+   * @param launchParameters
+   *
+   * @return
+   */
+  Map<String, CommandTracker> parseExpectedLaunchParameters(String launchParameters) {
+    Map<String, CommandTracker> trackers = null;
+    if (launchParameters != null && launchParameters.length() > 0) {
+      String[] componentSpecificParameters = launchParameters.split(Pattern.quote("|"));
+      for (String componentSpecificParameter : componentSpecificParameters) {
+        if (componentSpecificParameter.length() != 0) {
+          String[] parameters = componentSpecificParameter.split(Pattern.quote(":"));
+
+          if (parameters.length > 1 && parameters[0].length() > 0) {
+
+            for (int index = 1; index < parameters.length; index++) {
+              if (parameters[index].equals(NONE_VALUE)) {
+                parameters[index] = DEFAULT_PARAMETER;
+              }
+            }
+
+            if (trackers == null) {
+              trackers = new HashMap<>(10);
+            }
+            String componentName = parameters[0];
+            CommandTracker tracker = new CommandTracker(Arrays.copyOfRange(parameters, 1, parameters.length));
+            trackers.put(componentName, tracker);
+          }
+        }
+      }
+    }
+
+    return trackers;
+  }
+
+  class CommandTracker {
+    private final int maxIndex;
+    private final String[] launchCommands;
+    private int currentIndex;
+
+    CommandTracker(String[] launchCommands) {
+      this.currentIndex = 0;
+      this.maxIndex = launchCommands.length - 1;
+      this.launchCommands = launchCommands;
+    }
+
+    String getNextCommand() {
+      String retVal = launchCommands[currentIndex];
+      if (currentIndex != maxIndex) {
+        currentIndex++;
+      }
+
+      return retVal;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java
index 5ac142b..85945d8 100644
--- a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java
+++ b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java
@@ -91,7 +91,9 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 import static org.apache.slider.server.appmaster.web.rest.RestPaths.SLIDER_PATH_AGENTS;
 
-/** This class implements the server-side aspects of an agent deployment */
+/** This class implements the server-side logic for application deployment
+ *  through Slider application package
+ **/
 public class AgentProviderService extends AbstractProviderService implements
     ProviderCore,
     AgentKeys,
@@ -106,13 +108,16 @@ public class AgentProviderService extends AbstractProviderService implements
   private static final String GLOBAL_CONFIG_TAG = "global";
   private static final String LOG_FOLDERS_TAG = "LogFolders";
   private static final int MAX_LOG_ENTRIES = 20;
+  private static final int DEFAULT_HEARTBEAT_MONITOR_INTERVAL = 60 * 1000;
   private final Object syncLock = new Object();
   private final Map<String, String> allocatedPorts = new ConcurrentHashMap<>();
+  private int heartbeatMonitorInterval = 0;
   private AgentClientProvider clientProvider;
-  private Map<String, ComponentInstanceState> componentStatuses = new HashMap<>();
+  private Map<String, ComponentInstanceState> componentStatuses = new ConcurrentHashMap<>();
   private AtomicInteger taskId = new AtomicInteger(0);
   private volatile Metainfo metainfo = null;
   private ComponentCommandOrder commandOrder = null;
+  private HeartbeatMonitor monitor;
   private Map<String, String> workFolders =
       Collections.synchronizedMap(new LinkedHashMap<String, String>(MAX_LOG_ENTRIES, 0.75f, false) {
         protected boolean removeEldestEntry(Map.Entry eldest) {
@@ -120,10 +125,15 @@ public class AgentProviderService extends AbstractProviderService implements
         }
       });
   private Boolean canAnyMasterPublish = null;
+  private AgentLaunchParameter agentLaunchParameter = null;
 
+  /**
+   * Create an instance of AgentProviderService
+   */
   public AgentProviderService() {
     super("AgentProviderService");
     setAgentRestOperations(this);
+    setHeartbeatMonitorInterval(DEFAULT_HEARTBEAT_MONITOR_INTERVAL);
   }
 
   @Override
@@ -170,6 +180,9 @@ public class AgentProviderService extends AbstractProviderService implements
     if (metainfo == null) {
       synchronized (syncLock) {
         if (metainfo == null) {
+          readAndSetHeartbeatMonitoringInterval(instanceDefinition);
+          initializeAgentDebugCommands(instanceDefinition);
+
           metainfo = getApplicationMetainfo(fileSystem, appDef);
           if (metainfo == null || metainfo.getServices() == null || metainfo.getServices().size() == 0) {
             log.error("metainfo.xml is unavailable or malformed at {}.", appDef);
@@ -177,6 +190,8 @@ public class AgentProviderService extends AbstractProviderService implements
           }
 
           commandOrder = new ComponentCommandOrder(metainfo.getServices().get(0).getCommandOrder());
+          monitor = new HeartbeatMonitor(this, getHeartbeatMonitorInterval());
+          monitor.start();
         }
       }
     }
@@ -246,6 +261,12 @@ public class AgentProviderService extends AbstractProviderService implements
     operation.add(ARG_PORT);
     operation.add(getClusterInfoPropertyValue(StatusKeys.INFO_AM_WEB_PORT));
 
+    String debugCmd = agentLaunchParameter.getNextLaunchParameter(role);
+    if (debugCmd != null && debugCmd.length() != 0) {
+      operation.add(ARG_DEBUG);
+      operation.add(debugCmd);
+    }
+
     launcher.addCommand(operation.build());
 
     // initialize the component instance state
@@ -256,15 +277,66 @@ public class AgentProviderService extends AbstractProviderService implements
                               getClusterInfoPropertyValue(OptionKeys.APPLICATION_NAME)));
   }
 
+  /**
+   * Reads and sets the heartbeat monitoring interval. If bad value is provided then log it and set to default.
+   * @param instanceDefinition
+   */
+  private void readAndSetHeartbeatMonitoringInterval(AggregateConf instanceDefinition) {
+    String hbMonitorInterval = instanceDefinition.getAppConfOperations().
+        getGlobalOptions().getOption(AgentKeys.HEARTBEAT_MONITOR_INTERVAL,
+                                     Integer.toString(DEFAULT_HEARTBEAT_MONITOR_INTERVAL));
+    try {
+      setHeartbeatMonitorInterval(Integer.parseInt(hbMonitorInterval));
+    }catch (NumberFormatException e) {
+      log.warn(
+          "Bad value {} for {}. Defaulting to ",
+          hbMonitorInterval,
+          HEARTBEAT_MONITOR_INTERVAL,
+          DEFAULT_HEARTBEAT_MONITOR_INTERVAL);
+    }
+  }
+
+  /**
+   * Reads and sets the heartbeat monitoring interval. If bad value is provided then log it and set to default.
+   * @param instanceDefinition
+   */
+  private void initializeAgentDebugCommands(AggregateConf instanceDefinition) {
+    String launchParameterStr = instanceDefinition.getAppConfOperations().
+        getGlobalOptions().getOption(AgentKeys.AGENT_INSTANCE_DEBUG_DATA, "");
+    agentLaunchParameter = new AgentLaunchParameter(launchParameterStr);
+  }
+
+  @VisibleForTesting
   protected Metainfo getMetainfo() {
     return this.metainfo;
   }
 
+  @VisibleForTesting
+  protected Map<String, ComponentInstanceState> getComponentStatuses() {
+    return componentStatuses;
+  }
+
+  @VisibleForTesting
   protected Metainfo getApplicationMetainfo(SliderFileSystem fileSystem,
                                             String appDef) throws IOException {
     return AgentUtils.getApplicationMetainfo(fileSystem, appDef);
   }
 
+  @VisibleForTesting
+  protected void setHeartbeatMonitorInterval(int heartbeatMonitorInterval) {
+    this.heartbeatMonitorInterval = heartbeatMonitorInterval;
+  }
+
+  private int getHeartbeatMonitorInterval() {
+    return this.heartbeatMonitorInterval;
+  }
+
+  /**
+   * Publish a named config bag that may contain name-value pairs for app configurations such as hbase-site
+   * @param name
+   * @param description
+   * @param entries
+   */
   protected void publishComponentConfiguration(String name, String description,
                                                Iterable<Map.Entry<String, String>> entries) {
     PublishedConfiguration pubconf = new PublishedConfiguration();
@@ -274,6 +346,10 @@ public class AgentProviderService extends AbstractProviderService implements
     getAmState().getPublishedSliderConfigurations().put(name, pubconf);
   }
 
+  /**
+   * Get a list of all hosts for all role/container per role
+   * @return
+   */
   protected Map<String, Map<String, ClusterNode>> getRoleClusterNodeMapping() {
     amState.refreshClusterStatus();
     return (Map<String, Map<String, ClusterNode>>)
@@ -293,6 +369,25 @@ public class AgentProviderService extends AbstractProviderService implements
   }
 
   /**
+   * Lost heartbeat from the container - release it and ask for a replacement
+   *
+   * @param label
+   *
+   * @return if release is requested successfully
+   */
+  protected boolean releaseContainer(String label) {
+    componentStatuses.remove(label);
+    try {
+      getAppMaster().refreshContainer(getContainerId(label), true);
+    } catch (SliderException e) {
+      log.info("Error while requesting container release for {}. Message: {}", label, e.getMessage());
+      return false;
+    }
+
+    return true;
+  }
+
+  /**
    * Run this service
    *
    * @param instanceDefinition component description
@@ -329,12 +424,18 @@ public class AgentProviderService extends AbstractProviderService implements
     return true;
   }
 
+  /**
+   * Handle registration calls from the agents
+   * @param registration
+   * @return
+   */
   @Override
   public RegistrationResponse handleRegistration(Register registration) {
     RegistrationResponse response = new RegistrationResponse();
     String label = registration.getHostname();
     if (componentStatuses.containsKey(label)) {
       response.setResponseStatus(RegistrationStatus.OK);
+      componentStatuses.get(label).setLastHeartbeat(System.currentTimeMillis());
     } else {
       response.setResponseStatus(RegistrationStatus.FAILED);
       response.setLog("Label not recognized.");
@@ -342,31 +443,11 @@ public class AgentProviderService extends AbstractProviderService implements
     return response;
   }
 
-  private Command getCommand(String commandVal) {
-    if (commandVal.equals(Command.START.toString())) {
-      return Command.START;
-    }
-    if (commandVal.equals(Command.INSTALL.toString())) {
-      return Command.INSTALL;
-    }
-
-    return Command.NOP;
-  }
-
-  private CommandResult getCommandResult(String commandResVal) {
-    if (commandResVal.equals(CommandResult.COMPLETED.toString())) {
-      return CommandResult.COMPLETED;
-    }
-    if (commandResVal.equals(CommandResult.FAILED.toString())) {
-      return CommandResult.FAILED;
-    }
-    if (commandResVal.equals(CommandResult.IN_PROGRESS.toString())) {
-      return CommandResult.IN_PROGRESS;
-    }
-
-    throw new IllegalArgumentException("Unrecognized value " + commandResVal);
-  }
-
+  /**
+   * Handle heartbeat response from agents
+   * @param heartBeat
+   * @return
+   */
   @Override
   public HeartBeatResponse handleHeartBeat(HeartBeat heartBeat) {
     HeartBeatResponse response = new HeartBeatResponse();
@@ -391,6 +472,7 @@ public class AgentProviderService extends AbstractProviderService implements
 
     Boolean isMaster = isMaster(roleName);
     ComponentInstanceState componentStatus = componentStatuses.get(label);
+    componentStatus.setLastHeartbeat(System.currentTimeMillis());
     // If no Master can explicitly publish then publish if its a master
     // Otherwise, wait till the master that can publish is ready
     if (isMaster &&
@@ -408,8 +490,8 @@ public class AgentProviderService extends AbstractProviderService implements
           this.allocatedPorts.put(port.getKey(), port.getValue());
         }
       }
-      CommandResult result = getCommandResult(report.getStatus());
-      Command command = getCommand(report.getRoleCommand());
+      CommandResult result = CommandResult.getCommandResult(report.getStatus());
+      Command command = Command.getCommand(report.getRoleCommand());
       componentStatus.applyCommandResult(result, command);
       log.info("Component operation. Status: {}", result);
 
@@ -461,6 +543,12 @@ public class AgentProviderService extends AbstractProviderService implements
     return response;
   }
 
+  /**
+   * Format the folder locations before publishing in the registry service
+   * @param folders
+   * @param containerId
+   * @param hostFqdn
+   */
   private void processFolderPaths(Map<String, String> folders, String containerId, String hostFqdn) {
     for (String key : folders.keySet()) {
       workFolders.put(String.format("%s-%s-%s", hostFqdn, containerId, key), folders.get(key));
@@ -469,6 +557,11 @@ public class AgentProviderService extends AbstractProviderService implements
     publishComponentConfiguration(LOG_FOLDERS_TAG, LOG_FOLDERS_TAG, (new HashMap<>(this.workFolders)).entrySet());
   }
 
+  /**
+   * Process return status for component instances
+   * @param heartBeat
+   * @param componentStatus
+   */
   protected void processReturnedStatus(HeartBeat heartBeat, ComponentInstanceState componentStatus) {
     List<ComponentStatus> statuses = heartBeat.getComponentStatus();
     if (statuses != null && !statuses.isEmpty()) {
@@ -529,6 +622,11 @@ public class AgentProviderService extends AbstractProviderService implements
     }
   }
 
+  /**
+   * Extract script path from the application metainfo
+   * @param roleName
+   * @return
+   */
   protected String getScriptPathFromMetainfo(String roleName) {
     String scriptPath = null;
     List<Service> services = getMetainfo().getServices();
@@ -545,6 +643,11 @@ public class AgentProviderService extends AbstractProviderService implements
     return scriptPath;
   }
 
+  /**
+   * Is the role of type MASTER
+   * @param roleName
+   * @return
+   */
   protected boolean isMaster(String roleName) {
     List<Service> services = getMetainfo().getServices();
     if (services.size() != 1) {
@@ -564,6 +667,11 @@ public class AgentProviderService extends AbstractProviderService implements
     return false;
   }
 
+  /**
+   * Can the role publish configuration
+   * @param roleName
+   * @return
+   */
   protected boolean canPublishConfig(String roleName) {
     List<Service> services = getMetainfo().getServices();
     if (services.size() != 1) {
@@ -579,6 +687,10 @@ public class AgentProviderService extends AbstractProviderService implements
     return false;
   }
 
+  /**
+   * Can any master publish config explicitly, if not a random master is used
+   * @return
+   */
   protected boolean canAnyMasterPublishConfig() {
     if (canAnyMasterPublish == null) {
       List<Service> services = getMetainfo().getServices();
@@ -609,6 +721,15 @@ public class AgentProviderService extends AbstractProviderService implements
     return label.substring(0, label.indexOf(LABEL_MAKER));
   }
 
+  /**
+   * Add install command to the heartbeat response
+   * @param roleName
+   * @param containerId
+   * @param response
+   * @param scriptPath
+   * @throws SliderException
+   */
+  @VisibleForTesting
   protected void addInstallCommand(String roleName, String containerId, HeartBeatResponse response, String scriptPath)
       throws SliderException {
     assert getAmState().isApplicationLive();

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/providers/agent/AgentRoles.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentRoles.java b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentRoles.java
index d8aefc6..281895a 100644
--- a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentRoles.java
+++ b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentRoles.java
@@ -18,7 +18,6 @@
 
 package org.apache.slider.providers.agent;
 
-import org.apache.slider.common.SliderKeys;
 import org.apache.slider.providers.ProviderRole;
 
 import java.util.ArrayList;
@@ -27,22 +26,11 @@ import java.util.List;
 public class AgentRoles {
 
   /**
-   * List of roles
+   * List of roles Agent provider does not have any roles by default. All roles are read from the application
+   * specification.
    */
   protected static final List<ProviderRole> ROLES =
-    new ArrayList<ProviderRole>();
-
-  public static final int KEY_NODE =
-                                 SliderKeys.ROLE_AM_PRIORITY_INDEX + 1;
-    /**
-     * Initialize role list
-     */
-/*
-    static {
-      ROLES.add(new ProviderRole(AgentKeys.ROLE_NODE, KEY_NODE));
-  }
-*/
-
+      new ArrayList<ProviderRole>();
 
   public static List<ProviderRole> getRoles() {
     return ROLES;

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/providers/agent/Command.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/Command.java b/slider-core/src/main/java/org/apache/slider/providers/agent/Command.java
index 541dcc2..cbeb69d 100644
--- a/slider-core/src/main/java/org/apache/slider/providers/agent/Command.java
+++ b/slider-core/src/main/java/org/apache/slider/providers/agent/Command.java
@@ -22,5 +22,16 @@ package org.apache.slider.providers.agent;
 public enum Command {
   NOP,      // do nothing
   INSTALL,  // Install the component
-  START     // Start the component
+  START;     // Start the component
+
+  public static Command getCommand(String commandVal) {
+    if (commandVal.equals(Command.START.toString())) {
+      return Command.START;
+    }
+    if (commandVal.equals(Command.INSTALL.toString())) {
+      return Command.INSTALL;
+    }
+
+    return Command.NOP;
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/providers/agent/CommandResult.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/CommandResult.java b/slider-core/src/main/java/org/apache/slider/providers/agent/CommandResult.java
index f318096..35d9116 100644
--- a/slider-core/src/main/java/org/apache/slider/providers/agent/CommandResult.java
+++ b/slider-core/src/main/java/org/apache/slider/providers/agent/CommandResult.java
@@ -22,5 +22,19 @@ package org.apache.slider.providers.agent;
 public enum CommandResult {
   IN_PROGRESS,  // Command is in progress
   COMPLETED,    // Command has successfully completed
-  FAILED        // Command has failed
+  FAILED;        // Command has failed
+
+  public static CommandResult getCommandResult(String commandResVal) {
+    if (commandResVal.equals(CommandResult.COMPLETED.toString())) {
+      return CommandResult.COMPLETED;
+    }
+    if (commandResVal.equals(CommandResult.FAILED.toString())) {
+      return CommandResult.FAILED;
+    }
+    if (commandResVal.equals(CommandResult.IN_PROGRESS.toString())) {
+      return CommandResult.IN_PROGRESS;
+    }
+
+    throw new IllegalArgumentException("Unrecognized value " + commandResVal);
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/providers/agent/ComponentInstanceState.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/ComponentInstanceState.java b/slider-core/src/main/java/org/apache/slider/providers/agent/ComponentInstanceState.java
index 2ad16af..60a6f82 100644
--- a/slider-core/src/main/java/org/apache/slider/providers/agent/ComponentInstanceState.java
+++ b/slider-core/src/main/java/org/apache/slider/providers/agent/ComponentInstanceState.java
@@ -37,6 +37,8 @@ public class ComponentInstanceState {
   private State targetState = State.STARTED;
   private int failuresSeen = 0;
   private Boolean configReported = false;
+  private long lastHeartbeat = 0;
+  private ContainerState containerState;
 
   public ComponentInstanceState(String compName,
                                 String containerId,
@@ -44,6 +46,8 @@ public class ComponentInstanceState {
     this.compName = compName;
     this.containerId = containerId;
     this.applicationId = applicationId;
+    this.containerState = ContainerState.INIT;
+    this.lastHeartbeat = System.currentTimeMillis();
   }
 
   public String getCompName() {
@@ -58,6 +62,26 @@ public class ComponentInstanceState {
     this.configReported = configReported;
   }
 
+  public ContainerState getContainerState() {
+    return containerState;
+  }
+
+  public void setContainerState(ContainerState containerState) {
+    this.containerState = containerState;
+  }
+
+  public long getLastHeartbeat() {
+    return lastHeartbeat;
+  }
+
+  public void setLastHeartbeat(long lastHeartbeat) {
+    this.lastHeartbeat = lastHeartbeat;
+    if(this.containerState == ContainerState.UNHEALTHY ||
+       this.containerState == ContainerState.INIT) {
+      this.containerState = ContainerState.HEALTHY;
+    }
+  }
+
   public void commandIssued(Command command) {
     Command expected = getNextCommand();
     if (expected != command) {

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/providers/agent/ContainerState.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/ContainerState.java b/slider-core/src/main/java/org/apache/slider/providers/agent/ContainerState.java
new file mode 100644
index 0000000..0394ba2
--- /dev/null
+++ b/slider-core/src/main/java/org/apache/slider/providers/agent/ContainerState.java
@@ -0,0 +1,41 @@
+/*
+ * 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.slider.providers.agent;
+
+/** The states a component instance can be. */
+public enum ContainerState {
+  INIT,           // Container is not net activated
+  HEALTHY,     // Agent is heartbeating
+  UNHEALTHY,      // Container is unhealthy - no heartbeat for some interval
+  HEARTBEAT_LOST;  // Container is lost - request a new instance
+
+  /**
+   * Indicates whether or not it is a valid state to produce a command.
+   *
+   * @return true if command can be issued for this state.
+   */
+  public boolean canIssueCommands() {
+    switch (this) {
+      case HEALTHY:
+        return true;
+      default:
+        return false;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/providers/agent/HeartbeatMonitor.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/HeartbeatMonitor.java b/slider-core/src/main/java/org/apache/slider/providers/agent/HeartbeatMonitor.java
new file mode 100644
index 0000000..3aeff66
--- /dev/null
+++ b/slider-core/src/main/java/org/apache/slider/providers/agent/HeartbeatMonitor.java
@@ -0,0 +1,116 @@
+/**
+ * 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.slider.providers.agent;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Map;
+
+/** Monitors the container state and heartbeats. */
+public class HeartbeatMonitor implements Runnable {
+  protected static final Logger log =
+      LoggerFactory.getLogger(HeartbeatMonitor.class);
+  private final int threadWakeupInterval; //1 minute
+  private final AgentProviderService provider;
+  private volatile boolean shouldRun = true;
+  private Thread monitorThread = null;
+
+  public HeartbeatMonitor(AgentProviderService provider, int threadWakeupInterval) {
+    this.provider = provider;
+    this.threadWakeupInterval = threadWakeupInterval;
+  }
+
+  public void shutdown() {
+    shouldRun = false;
+  }
+
+  public void start() {
+    log.info("Starting heartbeat monitor with interval {}", threadWakeupInterval);
+    monitorThread = new Thread(this);
+    monitorThread.start();
+  }
+
+  void join(long millis) throws InterruptedException {
+    if (isAlive()) {
+      monitorThread.join(millis);
+    }
+  }
+
+  public boolean isAlive() {
+    if (monitorThread != null) {
+      return monitorThread.isAlive();
+    }
+    return false;
+  }
+
+  @Override
+  public void run() {
+    while (shouldRun) {
+      try {
+        log.debug("Putting monitor to sleep for " + threadWakeupInterval + " " +
+                  "milliseconds");
+        Thread.sleep(threadWakeupInterval);
+        doWork();
+      } catch (InterruptedException ex) {
+        log.warn("Scheduler thread is interrupted going to stop", ex);
+        shouldRun = false;
+      } catch (Exception ex) {
+        log.warn("Exception received", ex);
+      } catch (Throwable t) {
+        log.warn("ERROR", t);
+      }
+    }
+  }
+
+  /**
+   * Every interval the current state of the container are checked. If the state is INIT or HEALTHY and no HB are
+   * received in last check interval they are marked as UNHEALTHY. INIT is when the agent is started but it did not
+   * communicate at all. HEALTHY being the AM has received heartbeats. After an interval as UNHEALTHY the container is
+   * declared unavailable
+   */
+  private void doWork() {
+    Map<String, ComponentInstanceState> componentStatuses = provider.getComponentStatuses();
+    if (componentStatuses != null) {
+      for (String containerLabel : componentStatuses.keySet()) {
+        ComponentInstanceState componentInstanceState = componentStatuses.get(containerLabel);
+        long timeSinceLastHeartbeat = System.currentTimeMillis() - componentInstanceState.getLastHeartbeat();
+
+        if (timeSinceLastHeartbeat > threadWakeupInterval) {
+          if (componentInstanceState.getContainerState() == ContainerState.HEALTHY ||
+              componentInstanceState.getContainerState() == ContainerState.INIT) {
+            componentInstanceState.setContainerState(ContainerState.UNHEALTHY);
+            log.warn("Component {} marked UNHEALTHY. Last heartbeat received at {} approx. {} ms. back.",
+                     containerLabel, componentInstanceState.getLastHeartbeat(),
+                     timeSinceLastHeartbeat);
+            continue;
+          }
+          if (componentInstanceState.getContainerState() == ContainerState.UNHEALTHY
+              && timeSinceLastHeartbeat > threadWakeupInterval * 2) {
+            componentInstanceState.setContainerState(ContainerState.HEARTBEAT_LOST);
+            log.warn("Component {} marked HEARTBEAT_LOST. Last heartbeat received at {} approx. {} ms. back.",
+                     containerLabel, componentInstanceState.getLastHeartbeat(),
+                     timeSinceLastHeartbeat);
+            this.provider.releaseContainer(containerLabel);
+            continue;
+          }
+        }
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/server/appmaster/AMViewForProviders.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/AMViewForProviders.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/AMViewForProviders.java
new file mode 100644
index 0000000..287035f
--- /dev/null
+++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/AMViewForProviders.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     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.slider.server.appmaster;
+
+import org.apache.slider.core.exceptions.SliderException;
+
+/** Operations available to a provider from AppMaster */
+public interface AMViewForProviders {
+  /** Provider can ask AppMaster to release a specific container */
+  void refreshContainer(String containerId, boolean newHostIfPossible) throws SliderException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
index 605c826..0142028 100644
--- a/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
+++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java
@@ -150,7 +150,8 @@ public class SliderAppMaster extends AbstractSliderLaunchedService
     ServiceStateChangeListener,
     RoleKeys,
     ProviderCompleted,
-    ContainerStartOperation {
+    ContainerStartOperation,
+    AMViewForProviders {
   protected static final Logger log =
     LoggerFactory.getLogger(SliderAppMaster.class);
 
@@ -675,8 +676,8 @@ public class SliderAppMaster extends AbstractSliderLaunchedService
 
 
     //Give the provider restricted access to the state, registry
-    providerService.bind(stateForProviders, registry);
-    sliderAMProvider.bind(stateForProviders, registry);
+    providerService.bind(stateForProviders, registry, this);
+    sliderAMProvider.bind(stateForProviders, registry, null);
 
     // now do the registration
     registerServiceInstance(clustername, appid);
@@ -1345,6 +1346,30 @@ public class SliderAppMaster extends AbstractSliderLaunchedService
     }
   }
 
+
+  /* =================================================================== */
+  /* ProviderAMOperations */
+  /* =================================================================== */
+
+  /**
+   * Refreshes the container by releasing it and having it reallocated
+   *
+   * @param containerId       id of the container to release
+   * @param newHostIfPossible allocate the replacement container on a new host
+   *
+   * @throws SliderException
+   */
+  public void refreshContainer(String containerId, boolean newHostIfPossible)
+      throws SliderException {
+    log.info(
+        "Refreshing container {} per provider request.",
+        containerId);
+    rmOperationHandler.execute(appState.releaseContainer(containerId));
+
+    // ask for more containers if needed
+    reviewRequestAndReleaseNodes();
+  }
+
   /* =================================================================== */
   /* ServiceStateChangeListener */
   /* =================================================================== */
@@ -1515,5 +1540,4 @@ public class SliderAppMaster extends AbstractSliderLaunchedService
     //now have the service launcher do its work
     ServiceLauncher.serviceMain(extendedArgs);
   }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java
index b5e67f5..9981f68 100644
--- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java
+++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java
@@ -1476,6 +1476,26 @@ public class AppState {
     return operations;
   }
 
+  /**
+   * Releases a container based on container id
+   * @param containerId
+   * @return
+   * @throws SliderInternalStateException
+   */
+  public List<AbstractRMOperation> releaseContainer(String containerId)
+      throws SliderInternalStateException {
+    List<AbstractRMOperation> operations = new ArrayList<>();
+    List<RoleInstance> activeRoleInstances = cloneActiveContainerList();
+    for (RoleInstance role : activeRoleInstances) {
+      if (role.container.getId().toString().equals(containerId)) {
+        containerReleaseSubmitted(role.container);
+        operations.add(new ContainerReleaseOperation(role.getId()));
+      }
+    }
+
+    return operations;
+  }
+
 
   /**
    * Find a container running on a specific host -looking

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/test/app_packages/test_command_log/appConfig_fast_no_reg.json
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/appConfig_fast_no_reg.json b/slider-core/src/test/app_packages/test_command_log/appConfig_fast_no_reg.json
new file mode 100644
index 0000000..1f495c6
--- /dev/null
+++ b/slider-core/src/test/app_packages/test_command_log/appConfig_fast_no_reg.json
@@ -0,0 +1,29 @@
+{
+    "schema": "http://example.org/specification/v2.0.0",
+    "metadata": {
+    },
+    "global": {
+        "heartbeat.monitor.interval": "20000",
+        "agent.instance.debug.data": "ANY:DO_NOT_REGISTER:NONE",
+        "agent.conf": "agent.ini",
+        "application.def": "cmd_log_app_pkg.zip",
+        "config_types": "cl-site",
+        "java_home": "/usr/jdk64/jdk1.7.0_45",
+        "package_list": "files/command_log_10.tar",
+        "site.global.app_user": "yarn",
+        "site.global.application_id": "CommandLogger",
+        "site.global.app_log_dir": "${AGENT_LOG_ROOT}/app/log",
+        "site.global.app_pid_dir": "${AGENT_WORK_ROOT}/app/run",
+        "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/hbase-0.96.1-hadoop2",
+        "site.global.app_install_dir": "${AGENT_WORK_ROOT}/app/install",
+        "site.cl-site.logfile.location": "${AGENT_LOG_ROOT}/app/log/operations.log",
+        "site.cl-site.datetime.format": "%A, %d. %B %Y %I:%M%p"
+    },
+    "components": {
+        "COMMAND_LOGGER": {
+        },
+        "slider-appmaster": {
+            "jvm.heapsize": "256M"
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/test/app_packages/test_command_log/appConfig_no_hb.json
----------------------------------------------------------------------
diff --git a/slider-core/src/test/app_packages/test_command_log/appConfig_no_hb.json b/slider-core/src/test/app_packages/test_command_log/appConfig_no_hb.json
new file mode 100644
index 0000000..c824e03
--- /dev/null
+++ b/slider-core/src/test/app_packages/test_command_log/appConfig_no_hb.json
@@ -0,0 +1,29 @@
+{
+    "schema": "http://example.org/specification/v2.0.0",
+    "metadata": {
+    },
+    "global": {
+        "heartbeat.monitor.interval": "20000",
+        "agent.instance.debug.data": "ANY:DO_NOT_HEARTBEAT:DO_NOT_HEARTBEAT:NONE",
+        "agent.conf": "agent.ini",
+        "application.def": "cmd_log_app_pkg.zip",
+        "config_types": "cl-site",
+        "java_home": "/usr/jdk64/jdk1.7.0_45",
+        "package_list": "files/command_log_10.tar",
+        "site.global.app_user": "yarn",
+        "site.global.application_id": "CommandLogger",
+        "site.global.app_log_dir": "${AGENT_LOG_ROOT}/app/log",
+        "site.global.app_pid_dir": "${AGENT_WORK_ROOT}/app/run",
+        "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/hbase-0.96.1-hadoop2",
+        "site.global.app_install_dir": "${AGENT_WORK_ROOT}/app/install",
+        "site.cl-site.logfile.location": "${AGENT_LOG_ROOT}/app/log/operations.log",
+        "site.cl-site.datetime.format": "%A, %d. %B %Y %I:%M%p"
+    },
+    "components": {
+        "COMMAND_LOGGER": {
+        },
+        "slider-appmaster": {
+            "jvm.heapsize": "256M"
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockProviderService.groovy
----------------------------------------------------------------------
diff --git a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockProviderService.groovy b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockProviderService.groovy
index 361fc2e..873bc93 100644
--- a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockProviderService.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/mock/MockProviderService.groovy
@@ -34,6 +34,7 @@ import org.apache.slider.core.launch.ContainerLauncher
 import org.apache.slider.core.registry.info.ServiceInstanceData
 import org.apache.slider.providers.ProviderRole
 import org.apache.slider.providers.ProviderService
+import org.apache.slider.server.appmaster.AMViewForProviders
 import org.apache.slider.server.appmaster.state.StateAccessForProviders
 import org.apache.slider.server.appmaster.web.rest.agent.AgentRestOperations
 import org.apache.slider.server.appmaster.web.rest.agent.HeartBeat
@@ -194,7 +195,8 @@ class MockProviderService implements ProviderService {
   @Override
   void bind(
       StateAccessForProviders stateAccessor,
-      RegistryViewForProviders registry) {
+      RegistryViewForProviders registry,
+      AMViewForProviders amView) {
 
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/test/java/org/apache/slider/providers/agent/TestAgentLaunchParameter.java
----------------------------------------------------------------------
diff --git a/slider-core/src/test/java/org/apache/slider/providers/agent/TestAgentLaunchParameter.java b/slider-core/src/test/java/org/apache/slider/providers/agent/TestAgentLaunchParameter.java
new file mode 100644
index 0000000..ec62b54
--- /dev/null
+++ b/slider-core/src/test/java/org/apache/slider/providers/agent/TestAgentLaunchParameter.java
@@ -0,0 +1,76 @@
+/*
+ * 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.slider.providers.agent;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ *
+ */
+public class TestAgentLaunchParameter {
+  protected static final Logger log =
+      LoggerFactory.getLogger(TestAgentLaunchParameter.class);
+
+  @Test
+  public void testTestAgentLaunchParameter() throws Exception {
+    AgentLaunchParameter alp = new AgentLaunchParameter("");
+    Assert.assertEquals("", alp.getNextLaunchParameter("abc"));
+    Assert.assertEquals("", alp.getNextLaunchParameter("HBASE_MASTER"));
+
+    alp = new AgentLaunchParameter("a:1:2:3|b:5:6:NONE");
+    Assert.assertEquals("1", alp.getNextLaunchParameter("a"));
+    Assert.assertEquals("2", alp.getNextLaunchParameter("a"));
+    Assert.assertEquals("3", alp.getNextLaunchParameter("a"));
+    Assert.assertEquals("3", alp.getNextLaunchParameter("a"));
+
+    Assert.assertEquals("5", alp.getNextLaunchParameter("b"));
+    Assert.assertEquals("6", alp.getNextLaunchParameter("b"));
+    Assert.assertEquals("", alp.getNextLaunchParameter("b"));
+    Assert.assertEquals("", alp.getNextLaunchParameter("b"));
+    Assert.assertEquals("", alp.getNextLaunchParameter("c"));
+
+    alp = new AgentLaunchParameter("|a:1:3|b::5:NONE:");
+    Assert.assertEquals("1", alp.getNextLaunchParameter("a"));
+    Assert.assertEquals("3", alp.getNextLaunchParameter("a"));
+    Assert.assertEquals("3", alp.getNextLaunchParameter("a"));
+
+    Assert.assertEquals("", alp.getNextLaunchParameter("b"));
+    Assert.assertEquals("5", alp.getNextLaunchParameter("b"));
+    Assert.assertEquals("", alp.getNextLaunchParameter("b"));
+    Assert.assertEquals("", alp.getNextLaunchParameter("b"));
+
+    alp = new AgentLaunchParameter("|:");
+    Assert.assertEquals("", alp.getNextLaunchParameter("b"));
+    Assert.assertEquals("", alp.getNextLaunchParameter("a"));
+
+    alp = new AgentLaunchParameter("HBASE_MASTER:a,b:DO_NOT_REGISTER:");
+    Assert.assertEquals("a,b", alp.getNextLaunchParameter("HBASE_MASTER"));
+    Assert.assertEquals("DO_NOT_REGISTER", alp.getNextLaunchParameter("HBASE_MASTER"));
+    Assert.assertEquals("DO_NOT_REGISTER", alp.getNextLaunchParameter("HBASE_MASTER"));
+
+    alp = new AgentLaunchParameter("HBASE_MASTER:a,b:DO_NOT_REGISTER::c:::");
+    Assert.assertEquals("a,b", alp.getNextLaunchParameter("HBASE_MASTER"));
+    Assert.assertEquals("DO_NOT_REGISTER", alp.getNextLaunchParameter("HBASE_MASTER"));
+    Assert.assertEquals("", alp.getNextLaunchParameter("HBASE_MASTER"));
+    Assert.assertEquals("c", alp.getNextLaunchParameter("HBASE_MASTER"));
+    Assert.assertEquals("c", alp.getNextLaunchParameter("HBASE_MASTER"));
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/test/java/org/apache/slider/providers/agent/TestHeartbeatMonitor.java
----------------------------------------------------------------------
diff --git a/slider-core/src/test/java/org/apache/slider/providers/agent/TestHeartbeatMonitor.java b/slider-core/src/test/java/org/apache/slider/providers/agent/TestHeartbeatMonitor.java
new file mode 100644
index 0000000..c2cfafd
--- /dev/null
+++ b/slider-core/src/test/java/org/apache/slider/providers/agent/TestHeartbeatMonitor.java
@@ -0,0 +1,136 @@
+/*
+ * 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.slider.providers.agent;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+
+/**
+ *
+ */
+public class TestHeartbeatMonitor {
+  protected static final Logger log =
+      LoggerFactory.getLogger(TestHeartbeatMonitor.class);
+
+  @Test
+  public void testRegularHeartbeat() throws Exception {
+    AgentProviderService provider = createNiceMock(AgentProviderService.class);
+    HeartbeatMonitor hbm = new HeartbeatMonitor(provider, 1 * 1000);
+    Assert.assertFalse(hbm.isAlive());
+    expect(provider.getComponentStatuses()).andReturn(null).anyTimes();
+    replay(provider);
+    hbm.start();
+    Assert.assertTrue(hbm.isAlive());
+    hbm.shutdown();
+    Thread.sleep(1 * 1000);
+    Assert.assertFalse(hbm.isAlive());
+  }
+
+  @Test
+  public void testHeartbeatMonitorWithHealthy() throws Exception {
+    AgentProviderService provider = createNiceMock(AgentProviderService.class);
+    HeartbeatMonitor hbm = new HeartbeatMonitor(provider, 500);
+    Assert.assertFalse(hbm.isAlive());
+    Map<String, ComponentInstanceState> statuses = new HashMap<>();
+    ComponentInstanceState state = new ComponentInstanceState("HBASE_MASTER", "Cid", "Aid");
+    state.setState(State.STARTED);
+    state.setLastHeartbeat(System.currentTimeMillis());
+    statuses.put("label_1", state);
+    expect(provider.getComponentStatuses()).andReturn(statuses).anyTimes();
+    replay(provider);
+    hbm.start();
+    Assert.assertTrue(hbm.isAlive());
+    Thread.sleep(1 * 1000);
+    hbm.shutdown();
+    Thread.sleep(1 * 1000);
+    Assert.assertFalse(hbm.isAlive());
+  }
+
+  @Test
+  public void testHeartbeatMonitorWithUnhealthyAndThenLost() throws Exception {
+    AgentProviderService provider = createNiceMock(AgentProviderService.class);
+    HeartbeatMonitor hbm = new HeartbeatMonitor(provider, 2 * 1000);
+    Assert.assertFalse(hbm.isAlive());
+    Map<String, ComponentInstanceState> statuses = new HashMap<>();
+    ComponentInstanceState masterState = new ComponentInstanceState("HBASE_MASTER", "Cid1", "Aid1");
+    masterState.setState(State.STARTED);
+    masterState.setLastHeartbeat(System.currentTimeMillis());
+    statuses.put("Aid1_Cid1_HBASE_MASTER", masterState);
+
+    ComponentInstanceState slaveState = new ComponentInstanceState("HBASE_REGIONSERVER", "Cid2", "Aid1");
+    slaveState.setState(State.STARTED);
+    slaveState.setLastHeartbeat(System.currentTimeMillis());
+    statuses.put("Aid1_Cid2_HBASE_REGIONSERVER", slaveState);
+
+    expect(provider.getComponentStatuses()).andReturn(statuses).anyTimes();
+    expect(provider.releaseContainer("Aid1_Cid2_HBASE_REGIONSERVER")).andReturn(true).once();
+    replay(provider);
+    hbm.start();
+
+    Thread.sleep(1 * 1000);
+    // just dial back by at least 2 sec but no more than 4
+    slaveState.setLastHeartbeat(System.currentTimeMillis() - (2 * 1000 + 100));
+    masterState.setLastHeartbeat(System.currentTimeMillis());
+
+    Thread.sleep(1 * 1000 + 500);
+    masterState.setLastHeartbeat(System.currentTimeMillis());
+
+    log.info("Slave container state {}", slaveState.getContainerState());
+    Assert.assertEquals(ContainerState.HEALTHY, masterState.getContainerState());
+    Assert.assertEquals(ContainerState.UNHEALTHY, slaveState.getContainerState());
+
+    Thread.sleep(1 * 1000);
+    // some lost heartbeats are ignored (e.g. ~ 1 sec)
+    masterState.setLastHeartbeat(System.currentTimeMillis() - 1 * 1000);
+
+    Thread.sleep(1 * 1000 + 500);
+
+    log.info("Slave container state {}", slaveState.getContainerState());
+    Assert.assertEquals(ContainerState.HEALTHY, masterState.getContainerState());
+    Assert.assertEquals(ContainerState.HEARTBEAT_LOST, slaveState.getContainerState());
+    hbm.shutdown();
+  }
+
+  @Test
+  public void testHeartbeatTransitions() {
+    ComponentInstanceState slaveState = new ComponentInstanceState("HBASE_REGIONSERVER", "Cid2", "Aid1");
+    slaveState.setState(State.STARTED);
+
+    Assert.assertEquals(ContainerState.INIT, slaveState.getContainerState());
+    slaveState.setLastHeartbeat(System.currentTimeMillis());
+    Assert.assertEquals(ContainerState.HEALTHY, slaveState.getContainerState());
+
+    slaveState.setContainerState(ContainerState.UNHEALTHY);
+    Assert.assertEquals(ContainerState.UNHEALTHY, slaveState.getContainerState());
+    slaveState.setLastHeartbeat(System.currentTimeMillis());
+    Assert.assertEquals(ContainerState.HEALTHY, slaveState.getContainerState());
+
+    slaveState.setContainerState(ContainerState.HEARTBEAT_LOST);
+    Assert.assertEquals(ContainerState.HEARTBEAT_LOST, slaveState.getContainerState());
+    slaveState.setLastHeartbeat(System.currentTimeMillis());
+    Assert.assertEquals(ContainerState.HEARTBEAT_LOST, slaveState.getContainerState());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-core/src/test/java/org/apache/slider/server/appmaster/web/rest/publisher/TestAgentProviderService.java
----------------------------------------------------------------------
diff --git a/slider-core/src/test/java/org/apache/slider/server/appmaster/web/rest/publisher/TestAgentProviderService.java b/slider-core/src/test/java/org/apache/slider/server/appmaster/web/rest/publisher/TestAgentProviderService.java
index 97199f4..2427009 100644
--- a/slider-core/src/test/java/org/apache/slider/server/appmaster/web/rest/publisher/TestAgentProviderService.java
+++ b/slider-core/src/test/java/org/apache/slider/server/appmaster/web/rest/publisher/TestAgentProviderService.java
@@ -17,6 +17,7 @@
 package org.apache.slider.server.appmaster.web.rest.publisher;
 
 import org.apache.slider.providers.agent.AgentProviderService;
+import org.apache.slider.server.appmaster.AMViewForProviders;
 import org.apache.slider.server.appmaster.state.StateAccessForProviders;
 import org.apache.slider.server.services.registry.RegistryViewForProviders;
 import org.slf4j.Logger;
@@ -39,8 +40,8 @@ public class TestAgentProviderService extends AgentProviderService{
 
   @Override
   public void bind(StateAccessForProviders stateAccessor,
-                   RegistryViewForProviders reg) {
-    super.bind(stateAccessor, reg);
+                   RegistryViewForProviders reg, AMViewForProviders amView) {
+    super.bind(stateAccessor, reg, amView);
     Map<String,String> dummyProps = new HashMap<>();
     dummyProps.put("prop1", "val1");
     dummyProps.put("prop2", "val2");

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
index d5a91f0..6333fad 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/AgentCommandTestBase.groovy
@@ -20,6 +20,7 @@ package org.apache.slider.funtest.lifecycle
 
 import groovy.util.logging.Slf4j
 import org.apache.hadoop.fs.Path
+import org.apache.hadoop.security.AccessControlException
 import org.apache.slider.common.SliderExitCodes
 import org.apache.slider.common.params.Arguments
 import org.apache.slider.common.params.SliderActions
@@ -28,22 +29,17 @@ import org.apache.slider.funtest.framework.FuntestProperties
 import org.apache.slider.funtest.framework.SliderShell
 import org.apache.tools.zip.ZipEntry
 import org.apache.tools.zip.ZipOutputStream
-import org.junit.Assert
-import org.junit.Assume
 import org.junit.Before
 import org.junit.BeforeClass
-import org.junit.rules.TemporaryFolder
 import org.junit.Rule
-
-import org.apache.hadoop.security.AccessControlException
-
+import org.junit.rules.TemporaryFolder
 
 @Slf4j
 class AgentCommandTestBase extends CommandTestBase
-    implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
+implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
 
   public static final boolean AGENTTESTS_ENABLED
-  
+
   protected static String APP_RESOURCE = "../slider-core/src/test/app_packages/test_command_log/resources.json"
   protected static String APP_TEMPLATE = "../slider-core/src/test/app_packages/test_command_log/appConfig.json"
   protected static String APP_PKG_DIR = "../slider-core/src/test/app_packages/test_command_log/"
@@ -85,7 +81,7 @@ class AgentCommandTestBase extends CommandTestBase
     } catch (AccessControlException ace) {
       log.info "No write access to test user home directory. " +
                "Ensure home directory exists and has correct permissions." + ace.getMessage()
-      Assume.assumeTrue("Ensure home directory exists and has correct permissions for test user.", false)
+      fail("Ensure home directory exists and has correct permissions for test user.")
     }
   }
 
@@ -135,11 +131,11 @@ class AgentCommandTestBase extends CommandTestBase
     assert instanceCount == count, 'Instance count for component did not match expected. Parsed: ' + entry
   }
 
-  public static String findLineEntry(SliderShell shell, String[] locators) {
+  public static String findLineEntry(SliderShell shell, String[] locaters) {
     int index = 0;
     for (String str in shell.out) {
-      if (str.contains("\"" + locators[index] + "\"")) {
-        if (locators.size() == index + 1) {
+      if (str.contains("\"" + locaters[index] + "\"")) {
+        if (locaters.size() == index + 1) {
           return str;
         } else {
           index++;
@@ -150,8 +146,29 @@ class AgentCommandTestBase extends CommandTestBase
     return null;
   }
 
-  public static boolean isAppRunning(String text, SliderShell shell) {
+  public static String findLineEntryValue(SliderShell shell, String[] locaters) {
+    String line = findLineEntry(shell, locaters);
+
+    if (line != null) {
+      log.info("Parsing {} for value.", line)
+      int dividerIndex = line.indexOf(":");
+      if (dividerIndex > 0) {
+        String value = line.substring(dividerIndex + 1).trim()
+        if (value.endsWith(",")) {
+          value = value.subSequence(0, value.length() - 1)
+        }
+        return value;
+      }
+    }
+    return null;
+  }
+
+  public static boolean isApplicationInState(String text, String applicationName) {
     boolean exists = false
+    SliderShell shell = slider(EXIT_SUCCESS,
+        [
+            ACTION_LIST,
+            applicationName])
     for (String str in shell.out) {
       if (str.contains(text)) {
         exists = true
@@ -161,23 +178,14 @@ class AgentCommandTestBase extends CommandTestBase
     return exists
   }
 
-  protected static void ensureApplicationIsUp(String clusterName, int maxAttemptCount = 15) {
-    SliderShell shell
-    int attemptCount = 0
-    while (attemptCount < maxAttemptCount) {
-      shell = slider(EXIT_SUCCESS, [
-          ACTION_LIST,
-          clusterName])
-
-      if (isAppRunning("RUNNING", shell)) {
-        break
-      }
-
-      attemptCount++
-      assert attemptCount != maxAttemptCount, 'Application did not start, aborting test.'
+  protected void ensureApplicationIsUp(String clusterName) {
+    repeatUntilTrue(this.&isApplicationUp, 15, 1000 * 3, ['arg1': clusterName],
+        true, 'Application did not start, aborting test.')
+  }
 
-      sleep(1000 * 3)
-    }
+  boolean isApplicationUp(Map<String, String> args) {
+    String applicationName = args['arg1'];
+    return isApplicationInState("RUNNING", applicationName);
   }
 
   public static void addDir(File dirObj, ZipOutputStream zipFile, String prefix) {
@@ -204,4 +212,38 @@ class AgentCommandTestBase extends CommandTestBase
       out.close();
     }
   }
+
+  protected void repeatUntilTrue(Closure c, int maxAttempts, int sleepDur, Map args,
+                                 boolean failIfUnsuccessful = false, String message = "") {
+    int attemptCount = 0
+    while (attemptCount < maxAttempts) {
+      if (c(args)) {
+        break
+      };
+      attemptCount++;
+
+      if (failIfUnsuccessful) {
+        assert attemptCount != maxAttempts, message
+      }
+
+      sleep(sleepDur)
+    }
+  }
+
+  protected void cleanup(String applicationName) throws Throwable {
+    log.info "Cleaning app instance, if exists, by name " + applicationName
+    teardown(applicationName)
+
+    // sleep till the instance is frozen
+    sleep(1000 * 3)
+
+    SliderShell shell = slider([
+        ACTION_DESTROY,
+        applicationName])
+
+    if (shell.ret != 0 && shell.ret != EXIT_UNKNOWN_INSTANCE) {
+      logShell(shell)
+      assert fail("Old cluster either should not exist or should get destroyed.")
+    }
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy
index 3d0b270..06809cc 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentClusterLifecycle.groovy
@@ -51,7 +51,7 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
 
   @After
   public void destroyCluster() {
-    teardown(CLUSTER)
+    cleanup(CLUSTER)
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures.groovy
new file mode 100644
index 0000000..96a99ad
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures.groovy
@@ -0,0 +1,103 @@
+/*
+ * 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.slider.funtest.lifecycle
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+import org.apache.slider.funtest.framework.FuntestProperties
+import org.apache.slider.funtest.framework.SliderShell
+import org.junit.After
+import org.junit.Test
+
+@CompileStatic
+@Slf4j
+public class TestAgentFailures extends AgentCommandTestBase
+implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
+
+  private static String COMMAND_LOGGER = "COMMAND_LOGGER"
+  private static String APPLICATION_NAME = "one-container-fail-register"
+  private static String APP_TEMPLATE2 =
+    "../slider-core/src/test/app_packages/test_command_log/appConfig_fast_no_reg.json"
+
+
+  @After
+  public void destroyCluster() {
+    cleanup(APPLICATION_NAME)
+  }
+
+  @Test
+  public void testAgentFailRegistrationOnce() throws Throwable {
+    if (!AGENTTESTS_ENABLED) {
+      log.info "TESTS are not run."
+      return
+    }
+
+    cleanup(APPLICATION_NAME)
+    SliderShell shell = slider(EXIT_SUCCESS,
+        [
+            ACTION_CREATE, APPLICATION_NAME,
+            ARG_IMAGE, agentTarballPath.toString(),
+            ARG_TEMPLATE, APP_TEMPLATE2,
+            ARG_RESOURCES, APP_RESOURCE
+        ])
+
+    logShell(shell)
+
+    ensureApplicationIsUp(APPLICATION_NAME)
+
+    repeatUntilTrue(this.&hasContainerCountExceeded, 15, 1000 * 10, ['arg1': '2']);
+
+    sleep(1000 * 20)
+
+    shell = slider(EXIT_SUCCESS,
+        [
+            ACTION_STATUS,
+            APPLICATION_NAME])
+
+    assertComponentCount(COMMAND_LOGGER, 1, shell)
+    String requested = findLineEntryValue(shell, ["statistics", COMMAND_LOGGER, "containers.requested"] as String[])
+    assert requested != null && requested.isInteger() && requested.toInteger() >= 2,
+        'At least 2 containers must be requested'
+
+    assert isApplicationInState("RUNNING", APPLICATION_NAME), 'App is not running.'
+
+    assertSuccess(shell)
+  }
+
+
+  boolean hasContainerCountExceeded(Map<String, String> args) {
+    int expectedCount = args['arg1'].toInteger();
+    SliderShell shell = slider(EXIT_SUCCESS,
+        [
+            ACTION_STATUS,
+            APPLICATION_NAME])
+
+    //logShell(shell)
+    String requested = findLineEntryValue(
+        shell, ["statistics", COMMAND_LOGGER, "containers.requested"] as String[])
+    if (requested != null && requested.isInteger() && requested.toInteger() >= expectedCount) {
+      return true
+    }
+
+    return false
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures2.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures2.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures2.groovy
new file mode 100644
index 0000000..644fa4f
--- /dev/null
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAgentFailures2.groovy
@@ -0,0 +1,103 @@
+/*
+ * 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.slider.funtest.lifecycle
+
+import groovy.transform.CompileStatic
+import groovy.util.logging.Slf4j
+import org.apache.slider.common.SliderExitCodes
+import org.apache.slider.common.params.Arguments
+import org.apache.slider.common.params.SliderActions
+import org.apache.slider.funtest.framework.FuntestProperties
+import org.apache.slider.funtest.framework.SliderShell
+import org.junit.After
+import org.junit.Test
+
+@CompileStatic
+@Slf4j
+public class TestAgentFailures2 extends AgentCommandTestBase
+implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
+
+  private static String COMMAND_LOGGER = "COMMAND_LOGGER"
+  private static String APPLICATION_NAME = "two-container-fail-heartbeat"
+  private static String APP_TEMPLATE3 =
+    "../slider-core/src/test/app_packages/test_command_log/appConfig_no_hb.json"
+
+
+  @After
+  public void destroyCluster() {
+    cleanup(APPLICATION_NAME)
+  }
+
+  @Test
+  public void testAgentFailHeartbeatingTwiceOnce() throws Throwable {
+    if (!AGENTTESTS_ENABLED) {
+      log.info "TESTS are not run."
+      return
+    }
+
+    cleanup(APPLICATION_NAME)
+    SliderShell shell = slider(EXIT_SUCCESS,
+        [
+            ACTION_CREATE, APPLICATION_NAME,
+            ARG_IMAGE, agentTarballPath.toString(),
+            ARG_TEMPLATE, APP_TEMPLATE3,
+            ARG_RESOURCES, APP_RESOURCE
+        ])
+
+    logShell(shell)
+
+    ensureApplicationIsUp(APPLICATION_NAME)
+
+    repeatUntilTrue(this.&hasContainerCountExceeded, 20, 1000 * 10, ['arg1': '3']);
+
+    sleep(1000 * 20)
+
+    shell = slider(EXIT_SUCCESS,
+        [
+            ACTION_STATUS,
+            APPLICATION_NAME])
+
+    assertComponentCount(COMMAND_LOGGER, 1, shell)
+    String requested = findLineEntryValue(shell, ["statistics", COMMAND_LOGGER, "containers.requested"] as String[])
+    assert requested != null && requested.isInteger() && requested.toInteger() >= 3,
+        'At least 2 containers must be requested'
+
+    assert isApplicationInState("RUNNING", APPLICATION_NAME), 'App is not running.'
+
+    assertSuccess(shell)
+  }
+
+
+  boolean hasContainerCountExceeded(Map<String, String> args) {
+    int expectedCount = args['arg1'].toInteger();
+    SliderShell shell = slider(EXIT_SUCCESS,
+        [
+            ACTION_STATUS,
+            APPLICATION_NAME])
+
+    //logShell(shell)
+    String requested = findLineEntryValue(
+        shell, ["statistics", COMMAND_LOGGER, "containers.requested"] as String[])
+    if (requested != null && requested.isInteger() && requested.toInteger() >= expectedCount) {
+      return true
+    }
+
+    return false
+  }
+}


[02/13] SLIDER-126. Slider-Agent and Agent Provider need to handle component instance install/start failure gracefully

Posted by st...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy
----------------------------------------------------------------------
diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy
index aef9aa1..e3422ee 100644
--- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy
+++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy
@@ -31,14 +31,14 @@ import org.junit.Test
 @CompileStatic
 @Slf4j
 public class TestAppsThroughAgent extends AgentCommandTestBase
-    implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
+implements FuntestProperties, Arguments, SliderExitCodes, SliderActions {
 
   private static String COMMAND_LOGGER = "COMMAND_LOGGER"
-  private static String APPLICATION_NAME = "agenttst"
+  private static String APPLICATION_NAME = "happy-path-with-flex"
 
   @After
   public void destroyCluster() {
-    cleanup()
+    cleanup(APPLICATION_NAME)
   }
 
   @Test
@@ -48,69 +48,39 @@ public class TestAppsThroughAgent extends AgentCommandTestBase
       return
     }
 
-    cleanup()
-    try {
-      SliderShell shell = slider(EXIT_SUCCESS,
-          [
-              ACTION_CREATE, APPLICATION_NAME,
-              ARG_IMAGE, agentTarballPath.toString(),
-              ARG_TEMPLATE, APP_TEMPLATE,
-              ARG_RESOURCES, APP_RESOURCE
-          ])
+    cleanup(APPLICATION_NAME)
+    SliderShell shell = slider(EXIT_SUCCESS,
+        [
+            ACTION_CREATE, APPLICATION_NAME,
+            ARG_IMAGE, agentTarballPath.toString(),
+            ARG_TEMPLATE, APP_TEMPLATE,
+            ARG_RESOURCES, APP_RESOURCE
+        ])
 
-      logShell(shell)
+    logShell(shell)
 
-      ensureApplicationIsUp(APPLICATION_NAME)
+    ensureApplicationIsUp(APPLICATION_NAME)
 
-      //flex
-      slider(EXIT_SUCCESS,
-          [
-              ACTION_FLEX,
-              APPLICATION_NAME,
-              ARG_COMPONENT,
-              COMMAND_LOGGER,
-              "2"])
+    //flex
+    slider(EXIT_SUCCESS,
+        [
+            ACTION_FLEX,
+            APPLICATION_NAME,
+            ARG_COMPONENT,
+            COMMAND_LOGGER,
+            "2"])
 
-      // sleep till the new instance starts
-      sleep(1000 * 10)
+    // sleep till the new instance starts
+    sleep(1000 * 10)
 
-      shell = slider(EXIT_SUCCESS,
-          [
-              ACTION_STATUS,
-              APPLICATION_NAME])
+    shell = slider(EXIT_SUCCESS,
+        [
+            ACTION_STATUS,
+            APPLICATION_NAME])
 
-      assertComponentCount(COMMAND_LOGGER, 2, shell)
+    assertComponentCount(COMMAND_LOGGER, 2, shell)
 
-      shell = slider(EXIT_SUCCESS,
-          [
-              ACTION_LIST,
-              APPLICATION_NAME])
-
-      assert isAppRunning("RUNNING", shell), 'App is not running.'
-
-      assertSuccess(shell)
-    } finally {
-      cleanup()
-    }
-  }
-
-
-  public void cleanup() throws Throwable {
-    log.info "Cleaning app instance, if exists, by name " + APPLICATION_NAME
-    teardown(APPLICATION_NAME)
-
-    // sleep till the instance is frozen
-    sleep(1000 * 3)
-
-    SliderShell shell = slider([
-        ACTION_DESTROY,
-        APPLICATION_NAME])
-
-    if (shell.ret != 0 && shell.ret != EXIT_UNKNOWN_INSTANCE) {
-      logShell(shell)
-      assert fail("Old cluster either should not exist or should get destroyed.")
-    }
+    assertSuccess(shell)
+    assert isApplicationInState("RUNNING", APPLICATION_NAME), 'App is not running.'
   }
-
-
 }