You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2016/04/26 19:27:05 UTC

[2/2] ambari git commit: AMBARI-16056. Ambari support for bucket caching parameter - hbase.bucketcache.ioengine (smohanty)

AMBARI-16056. Ambari support for bucket caching parameter - hbase.bucketcache.ioengine (smohanty)


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

Branch: refs/heads/trunk
Commit: e6fc15dfcdab59d306ac7aef9b60770cf147f832
Parents: af9654f
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Tue Apr 26 10:25:21 2016 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Tue Apr 26 10:25:27 2016 -0700

----------------------------------------------------------------------
 .../HBASE/0.96.0.2.0/package/scripts/hbase.py   |   16 +
 .../0.96.0.2.0/package/scripts/params_linux.py  |    1 +
 .../stacks/2.0.6/HBASE/test_hbase_master.py     |   28 +-
 .../2.0.6/configs/default_with_bucket.json      | 1207 ++++++++++++++++++
 4 files changed, 1251 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e6fc15df/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py
index ee19ee4..d2f28f5 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/hbase.py
@@ -60,6 +60,22 @@ def hbase(name=None):
       create_parents = True,
       mode=0777
   )
+
+  # If a file location is specified in ioengine parameter,
+  # ensure that directory exists. Otherwise create the
+  # directory with permissions assigned to hbase:hadoop.
+  ioengine_input = params.ioengine_param
+  if ioengine_input != None:
+    if ioengine_input.startswith("file:/"):
+      ioengine_fullpath = ioengine_input[5:]
+      ioengine_dir = os.path.dirname(ioengine_fullpath)
+      Directory(ioengine_dir,
+          owner = params.hbase_user,
+          group = params.user_group,
+          create_parents = True,
+          mode = 0755
+      )
+  
   parent_dir = os.path.dirname(params.tmp_dir)
   # In case if we have several placeholders in path
   while ("${" in parent_dir):

http://git-wip-us.apache.org/repos/asf/ambari/blob/e6fc15df/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
index 2c466ea..d8a89e7 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
@@ -130,6 +130,7 @@ elif OSCheck.is_ubuntu_family():
 pid_dir = status_params.pid_dir
 tmp_dir = config['configurations']['hbase-site']['hbase.tmp.dir']
 local_dir = config['configurations']['hbase-site']['hbase.local.dir']
+ioengine_param = default('/configurations/hbase-site/hbase.bucketcache.ioengine', None)
 
 client_jaas_config_file = format("{hbase_conf_dir}/hbase_client_jaas.conf")
 master_jaas_config_file = format("{hbase_conf_dir}/hbase_master_jaas.conf")

http://git-wip-us.apache.org/repos/asf/ambari/blob/e6fc15df/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py
index e042fc1..f5ed727 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HBASE/test_hbase_master.py
@@ -96,6 +96,24 @@ class TestHBaseMaster(RMFTestCase):
       user = 'hbase'
     )
     self.assertNoMoreResources()
+    pass
+
+  def test_start_default_bucketcache(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hbase_master.py",
+                       classname = "HbaseMaster",
+                       command = "start",
+                       config_file="default_with_bucket.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+
+    self.assert_configure_default(bucketcache_ioengine_as_file=True)
+    self.assertResourceCalled('Execute', '/usr/lib/hbase/bin/hbase-daemon.sh --config /etc/hbase/conf start master',
+                              not_if = 'ambari-sudo.sh [RMF_ENV_PLACEHOLDER] -H -E test -f /var/run/hbase/hbase-hbase-master.pid && ps -p `ambari-sudo.sh [RMF_ENV_PLACEHOLDER] -H -E cat /var/run/hbase/hbase-hbase-master.pid` >/dev/null 2>&1',
+                              user = 'hbase'
+    )
+    self.assertNoMoreResources()
+    pass
     
   def test_stop_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hbase_master.py",
@@ -240,7 +258,7 @@ class TestHBaseMaster(RMFTestCase):
                               )
     self.assertNoMoreResources()
 
-  def assert_configure_default(self):
+  def assert_configure_default(self, bucketcache_ioengine_as_file=False):
     self.assertResourceCalled('Directory', '/etc/hbase',
       mode = 0755
     )
@@ -253,6 +271,14 @@ class TestHBaseMaster(RMFTestCase):
       create_parents = True,
       mode = 0777
     )
+    if bucketcache_ioengine_as_file:
+      self.assertResourceCalled('Directory', '/mnt/bucket',
+                                create_parents = True,
+                                owner = 'hbase',
+                                group = 'hadoop',
+                                mode = 0755
+      )
+      pass
     self.assertResourceCalled('Directory', '/hadoop',
                               create_parents = True,
                               cd_access = 'a',