You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sw...@apache.org on 2014/12/02 18:28:35 UTC
[19/30] ambari git commit: AMBARI-5707. Replace Ganglia with high
performant and pluggable Metrics System. (swagle)
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil/setup.py
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil/setup.py b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil/setup.py
new file mode 100644
index 0000000..98b24a1
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/psutil/setup.py
@@ -0,0 +1,198 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""psutil is a cross-platform library for retrieving information on
+running processes and system utilization (CPU, memory, disks, network)
+in Python.
+"""
+
+import os
+import sys
+try:
+ from setuptools import setup, Extension
+except ImportError:
+ from distutils.core import setup, Extension
+
+
+HERE = os.path.abspath(os.path.dirname(__file__))
+
+
+def get_version():
+ INIT = os.path.join(HERE, 'psutil/__init__.py')
+ f = open(INIT, 'r')
+ try:
+ for line in f:
+ if line.startswith('__version__'):
+ ret = eval(line.strip().split(' = ')[1])
+ assert ret.count('.') == 2, ret
+ for num in ret.split('.'):
+ assert num.isdigit(), ret
+ return ret
+ else:
+ raise ValueError("couldn't find version string")
+ finally:
+ f.close()
+
+
+def get_description():
+ README = os.path.join(HERE, 'README')
+ f = open(README, 'r')
+ try:
+ return f.read()
+ finally:
+ f.close()
+
+
+# POSIX
+if os.name == 'posix':
+ posix_extension = Extension(
+ '_psutil_posix',
+ sources=['psutil/_psutil_posix.c'],
+ )
+# Windows
+if sys.platform.startswith("win32"):
+
+ def get_winver():
+ maj, min = sys.getwindowsversion()[0:2]
+ return '0x0%s' % ((maj * 100) + min)
+
+ extensions = [Extension(
+ '_psutil_windows',
+ sources=[
+ 'psutil/_psutil_windows.c',
+ 'psutil/_psutil_common.c',
+ 'psutil/arch/windows/process_info.c',
+ 'psutil/arch/windows/process_handles.c',
+ 'psutil/arch/windows/security.c',
+ ],
+ define_macros=[
+ # be nice to mingw, see:
+ # http://www.mingw.org/wiki/Use_more_recent_defined_functions
+ ('_WIN32_WINNT', get_winver()),
+ ('_AVAIL_WINVER_', get_winver()),
+ # see: https://code.google.com/p/psutil/issues/detail?id=348
+ ('PSAPI_VERSION', 1),
+ ],
+ libraries=[
+ "psapi", "kernel32", "advapi32", "shell32", "netapi32", "iphlpapi",
+ "wtsapi32",
+ ],
+ # extra_compile_args=["/Z7"],
+ # extra_link_args=["/DEBUG"]
+ )]
+# OS X
+elif sys.platform.startswith("darwin"):
+ extensions = [Extension(
+ '_psutil_osx',
+ sources=[
+ 'psutil/_psutil_osx.c',
+ 'psutil/_psutil_common.c',
+ 'psutil/arch/osx/process_info.c'
+ ],
+ extra_link_args=[
+ '-framework', 'CoreFoundation', '-framework', 'IOKit'
+ ],
+ ),
+ posix_extension,
+ ]
+# FreeBSD
+elif sys.platform.startswith("freebsd"):
+ extensions = [Extension(
+ '_psutil_bsd',
+ sources=[
+ 'psutil/_psutil_bsd.c',
+ 'psutil/_psutil_common.c',
+ 'psutil/arch/bsd/process_info.c'
+ ],
+ libraries=["devstat"]),
+ posix_extension,
+ ]
+# Linux
+elif sys.platform.startswith("linux"):
+ extensions = [Extension(
+ '_psutil_linux',
+ sources=['psutil/_psutil_linux.c']),
+ posix_extension,
+ ]
+# Solaris
+elif sys.platform.lower().startswith('sunos'):
+ extensions = [Extension(
+ '_psutil_sunos',
+ sources=['psutil/_psutil_sunos.c'],
+ libraries=['kstat', 'nsl'],),
+ posix_extension,
+ ]
+else:
+ sys.exit('platform %s is not supported' % sys.platform)
+
+
+def main():
+ setup_args = dict(
+ name='psutil',
+ version=get_version(),
+ description=__doc__,
+ long_description=get_description(),
+ keywords=[
+ 'ps', 'top', 'kill', 'free', 'lsof', 'netstat', 'nice',
+ 'tty', 'ionice', 'uptime', 'taskmgr', 'process', 'df',
+ 'iotop', 'iostat', 'ifconfig', 'taskset', 'who', 'pidof',
+ 'pmap', 'smem', 'monitoring', 'ulimit', 'prlimit',
+ ],
+ author='Giampaolo Rodola',
+ author_email='g.rodola <at> gmail <dot> com',
+ url='http://code.google.com/p/psutil/',
+ platforms='Platform Independent',
+ license='BSD',
+ packages=['psutil'],
+ # see: python setup.py register --list-classifiers
+ classifiers=[
+ 'Development Status :: 5 - Production/Stable',
+ 'Environment :: Console',
+ 'Environment :: Win32 (MS Windows)',
+ 'Intended Audience :: Developers',
+ 'Intended Audience :: Information Technology',
+ 'Intended Audience :: System Administrators',
+ 'License :: OSI Approved :: BSD License',
+ 'Operating System :: MacOS :: MacOS X',
+ 'Operating System :: Microsoft :: Windows :: Windows NT/2000',
+ 'Operating System :: Microsoft',
+ 'Operating System :: OS Independent',
+ 'Operating System :: POSIX :: BSD :: FreeBSD',
+ 'Operating System :: POSIX :: Linux',
+ 'Operating System :: POSIX :: SunOS/Solaris',
+ 'Operating System :: POSIX',
+ 'Programming Language :: C',
+ 'Programming Language :: Python :: 2',
+ 'Programming Language :: Python :: 2.4',
+ 'Programming Language :: Python :: 2.5',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.0',
+ 'Programming Language :: Python :: 3.1',
+ 'Programming Language :: Python :: 3.2',
+ 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: Implementation :: CPython',
+ 'Programming Language :: Python :: Implementation :: PyPy',
+ 'Programming Language :: Python',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
+ 'Topic :: Software Development :: Libraries',
+ 'Topic :: System :: Benchmark',
+ 'Topic :: System :: Hardware',
+ 'Topic :: System :: Monitoring',
+ 'Topic :: System :: Networking :: Monitoring',
+ 'Topic :: System :: Networking',
+ 'Topic :: System :: Systems Administration',
+ 'Topic :: Utilities',
+ ],
+ )
+ if extensions is not None:
+ setup_args["ext_modules"] = extensions
+ setup(**setup_args)
+
+if __name__ == '__main__':
+ main()
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestApplicationMetricMap.py
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestApplicationMetricMap.py b/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestApplicationMetricMap.py
new file mode 100644
index 0000000..e653c48
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestApplicationMetricMap.py
@@ -0,0 +1,67 @@
+#!/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 json
+import logging
+from unittest import TestCase
+from application_metric_map import ApplicationMetricMap
+
+logger = logging.getLogger()
+
+class TestApplicationMetricMap(TestCase):
+
+ def testApplicationMetricMap(self):
+ application_metric_map = ApplicationMetricMap("host1", "10.10.10.10")
+
+ application_id = application_metric_map.format_app_id("A","1")
+ timestamp = int(round(1415390657.3806491 * 1000))
+
+ metrics = {}
+ metrics.update({"b" : 'bv'})
+
+ application_metric_map.put_metric(application_id, metrics, timestamp)
+ application_metric_map.put_metric(application_id, metrics, timestamp + 1)
+ application_metric_map.put_metric(application_id, metrics, timestamp + 2)
+ application_metric_map.put_metric(application_id, metrics, timestamp + 3)
+
+ p = json.loads(application_metric_map.flatten(application_id))
+ self.assertEqual(len(p['metrics']), 1)
+ self.assertEqual(p['metrics'][0]['metricname'], "b")
+# self.assertEqual(p['metrics'][0]['appid'], application_id)
+ self.assertEqual(p['metrics'][0]['hostname'], "host1")
+ self.assertEqual(len(p['metrics'][0]['metrics']), 4)
+ self.assertEqual(p['metrics'][0]['metrics'][str(timestamp)], 'bv')
+
+ self.assertEqual(application_metric_map.get_start_time(application_id, "b"), timestamp)
+
+ metrics = {}
+ metrics.update({"b" : 'bv'})
+ metrics.update({"a" : 'av'})
+ application_metric_map.put_metric(application_id, metrics, timestamp)
+ p = json.loads(application_metric_map.flatten(application_id))
+ self.assertEqual(len(p['metrics']), 2)
+ self.assertTrue((p['metrics'][0]['metricname'] == 'a' and p['metrics'][1]['metricname'] == 'b') or
+ (p['metrics'][1]['metricname'] == 'a' and p['metrics'][0]['metricname'] == 'b'))
+
+
+ def testEmptyMapReturnNone(self):
+ application_metric_map = ApplicationMetricMap("host","10.10.10.10")
+ self.assertTrue(application_metric_map.flatten() == None)
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestEmitter.py
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestEmitter.py b/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestEmitter.py
new file mode 100644
index 0000000..05362bf
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestEmitter.py
@@ -0,0 +1,78 @@
+#!/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 logging
+from unittest import TestCase
+
+from application_metric_map import ApplicationMetricMap
+from config_reader import Configuration
+from emitter import Emitter
+
+from mock.mock import patch, MagicMock
+
+import json
+import urllib2
+
+logger = logging.getLogger()
+
+class TestEmitter(TestCase):
+
+ @patch("urllib2.urlopen")
+ def testJavaHomeAvailableCheck(self, url_open_mock):
+ url_open_mock.return_value = MagicMock()
+ url_open_mock.return_value.getcode.return_value = 200
+ self.assertEqual(urllib2.urlopen(None, None).getcode(), 200)
+ url_open_mock.reset_mock()
+
+ config = Configuration()
+ application_metric_map = ApplicationMetricMap("host","10.10.10.10")
+ application_metric_map.clear()
+ application_metric_map.put_metric("APP1", {"metric1":1}, 1)
+ emitter = Emitter(config, application_metric_map)
+ emitter.submit_metrics()
+
+ self.assertEqual(url_open_mock.call_count, 1)
+ self.assertUrlData(url_open_mock)
+
+
+ @patch("urllib2.urlopen")
+ def testRetryFetch(self, url_open_mock):
+
+ config = Configuration()
+ application_metric_map = ApplicationMetricMap("host","10.10.10.10")
+ application_metric_map.clear()
+ application_metric_map.put_metric("APP1", {"metric1":1}, 1)
+ emitter = Emitter(config, application_metric_map)
+ emitter.RETRY_SLEEP_INTERVAL = .001
+ emitter.submit_metrics()
+
+ self.assertEqual(url_open_mock.call_count, 3)
+ self.assertUrlData(url_open_mock)
+
+
+ def assertUrlData(self, url_open_mock):
+ self.assertEqual(len(url_open_mock.call_args), 2)
+ data = url_open_mock.call_args[0][0].data
+ self.assertTrue(data is not None)
+
+ metrics = json.loads(data)
+ self.assertEqual(len(metrics['metrics']), 1)
+ self.assertEqual(metrics['metrics'][0]['metricname'],'metric1')
+ self.assertEqual(metrics['metrics'][0]['starttime'],1)
+ pass
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestHostInfo.py
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestHostInfo.py b/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestHostInfo.py
new file mode 100644
index 0000000..e1baabf
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestHostInfo.py
@@ -0,0 +1,97 @@
+#!/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 logging
+from host_info import HostInfo
+
+from unittest import TestCase
+from mock.mock import patch
+
+logger = logging.getLogger()
+
+class TestHostInfo(TestCase):
+
+ @patch("os.getloadavg")
+ @patch("psutil.cpu_times")
+ def testCpuTimes(self, cp_mock, avg_mock):
+
+ cp = cp_mock.return_value
+ cp.user = "user"
+ cp.system = "system"
+ cp.idle = "idle"
+ cp.nice = "nice"
+ cp.iowait = "iowait"
+ cp.irq = "irq"
+ cp.softirq = "softirq"
+ avg_mock.return_value = [13, 13, 13]
+
+ hostinfo = HostInfo()
+
+ cpu = hostinfo.get_cpu_times()
+
+ self.assertEqual(cpu['cpu_user'], 'user')
+ self.assertEqual(cpu['cpu_system'], 'system')
+ self.assertEqual(cpu['cpu_idle'], 'idle')
+ self.assertEqual(cpu['cpu_nice'], 'nice')
+ self.assertEqual(cpu['cpu_wio'], 'iowait')
+ self.assertEqual(cpu['cpu_intr'], 'irq')
+ self.assertEqual(cpu['cpu_sintr'], 'softirq')
+ self.assertEqual(cpu['load_one'], 13)
+ self.assertEqual(cpu['load_five'], 13)
+ self.assertEqual(cpu['load_fifteen'], 13)
+
+ @patch("psutil.disk_usage")
+ @patch("psutil.disk_partitions")
+ @patch("psutil.swap_memory")
+ @patch("psutil.virtual_memory")
+ def testMemInfo(self, vm_mock, sw_mock, dm_mock, du_mock):
+
+ vm = vm_mock.return_value
+ vm.free = "free"
+ vm.shared = "shared"
+ vm.buffers = "buffers"
+ vm.cached = "cached"
+
+ sw = sw_mock.return_value
+ sw.free = "free"
+
+ hostinfo = HostInfo()
+
+ cpu = hostinfo.get_mem_info()
+
+ self.assertEqual(cpu['mem_free'], 'free')
+ self.assertEqual(cpu['mem_shared'], 'shared')
+ self.assertEqual(cpu['mem_buffered'], 'buffers')
+ self.assertEqual(cpu['mem_cached'], 'cached')
+ self.assertEqual(cpu['swap_free'], 'free')
+
+ @patch("psutil.disk_usage")
+ @patch("psutil.disk_partitions")
+ def testCombinedDiskUsage(self, dp_mock, du_mock):
+
+ dp_mock.__iter__.return_value = ['a', 'b', 'c']
+
+ hostinfo = HostInfo()
+
+ cdu = hostinfo.get_combined_disk_usage()
+ self.assertEqual(cdu['disk_total'], "0.00")
+ self.assertEqual(cdu['disk_used'], "0.00")
+ self.assertEqual(cdu['disk_free'], "0.00")
+ self.assertEqual(cdu['disk_percent'], "0.00")
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestMetricCollector.py
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestMetricCollector.py b/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestMetricCollector.py
new file mode 100644
index 0000000..bc4fba7
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/core/TestMetricCollector.py
@@ -0,0 +1,49 @@
+#!/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 logging
+from unittest import TestCase
+
+from application_metric_map import ApplicationMetricMap
+from metric_collector import MetricsCollector
+from event_definition import HostMetricCollectEvent
+from mock.mock import patch
+from host_info import HostInfo
+
+logger = logging.getLogger()
+
+class TestMetricCollector(TestCase):
+
+ @patch("os.getloadavg")
+ @patch.object(HostInfo, "get_cpu_times")
+ @patch.object(ApplicationMetricMap, "__init__")
+ def testCollectEvent(self, amm_mock, host_info_mock, avg_mock):
+ amm_mock.return_value = None
+ host_info_mock.return_value = {'metric_name' : 'metric_value'}
+ avg_mock.return_value.__getitem__.return_value = 13
+
+ metric_collector = MetricsCollector(None, amm_mock)
+
+ group_config = {'collect_every' : 1, 'metrics' : 'cpu'}
+
+ e = HostMetricCollectEvent(group_config, 'cpu')
+
+ metric_collector.process_event(e)
+
+ self.assertEqual(amm_mock.put_metric.call_count, 1)
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/unitTests.py
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/unitTests.py b/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/unitTests.py
new file mode 100644
index 0000000..73798cb
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-host-monitoring/src/test/python/unitTests.py
@@ -0,0 +1,133 @@
+'''
+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 unittest
+import os
+import sys
+from random import shuffle
+import fnmatch
+
+#excluded directories with non-test staff from stack and service scanning,
+#also we can add service or stack to skip here
+STACK_EXCLUDE = ["utils"]
+SERVICE_EXCLUDE = ["configs"]
+
+TEST_MASK = '[Tt]est*.py'
+CUSTOM_TEST_MASK = '_[Tt]est*.py'
+def get_parent_path(base, directory_name):
+ """
+ Returns absolute path for directory_name, if directory_name present in base.
+ For example, base=/home/user/test2, directory_name=user - will return /home/user
+ """
+ done = False
+ while not done:
+ base = os.path.dirname(base)
+ if base == "/":
+ return None
+ done = True if os.path.split(base)[-1] == directory_name else False
+ return base
+
+def get_test_files(path, mask = None, recursive=True):
+ """
+ Returns test files for path recursively
+ """
+ current = []
+ directory_items = os.listdir(path)
+
+ for item in directory_items:
+ add_to_pythonpath = False
+ if os.path.isfile(path + "/" + item):
+ if fnmatch.fnmatch(item, mask):
+ add_to_pythonpath = True
+ current.append(item)
+ elif os.path.isdir(path + "/" + item):
+ if recursive:
+ current.extend(get_test_files(path + "/" + item, mask = mask))
+ if add_to_pythonpath:
+ sys.path.append(path)
+ return current
+
+
+def main():
+ custom_tests = False
+ if len(sys.argv) > 1:
+ if sys.argv[1] == "true":
+ custom_tests = True
+ pwd = os.path.abspath(os.path.dirname(__file__))
+
+ project_folder = get_parent_path(pwd,'ambari-metrics-host-monitoring')
+ ambari_common_folder = os.path.join(project_folder,"../../ambari-common")
+ sys.path.append(ambari_common_folder + "/src/main/python")
+ sys.path.append(ambari_common_folder + "/src/main/python/ambari_jinja2")
+ sys.path.append(ambari_common_folder + "/src/main/python")
+ sys.path.append(ambari_common_folder + "/src/test/python")
+ sys.path.append(project_folder + "/src/test/python")
+ sys.path.append(project_folder + "/src/main/python")
+ sys.path.append(project_folder + "/src/main/python/core")
+ sys.path.append(project_folder + "/src/main/resources/scripts")
+ sys.path.append(project_folder + "/src/main/resources/custom_actions")
+ sys.path.append(project_folder + "/target/psutil_build")
+
+ has_failures = False
+ test_runs = 0
+ test_failures = []
+ test_errors = []
+ #run base ambari-server tests
+ sys.stderr.write("Running tests\n")
+ if custom_tests:
+ test_mask = CUSTOM_TEST_MASK
+ else:
+ test_mask = TEST_MASK
+
+ tests = get_test_files(pwd, mask=test_mask, recursive=True)
+ shuffle(tests)
+ modules = [os.path.basename(s)[:-3] for s in tests]
+ suites = [unittest.defaultTestLoader.loadTestsFromName(name) for name in
+ modules]
+ testSuite = unittest.TestSuite(suites)
+ textRunner = unittest.TextTestRunner(verbosity=2).run(testSuite)
+ test_runs += textRunner.testsRun
+ test_errors.extend([(str(item[0]),str(item[1]),"ERROR") for item in textRunner.errors])
+ test_failures.extend([(str(item[0]),str(item[1]),"FAIL") for item in textRunner.failures])
+ tests_status = textRunner.wasSuccessful() and not has_failures
+
+ if not tests_status:
+ sys.stderr.write("----------------------------------------------------------------------\n")
+ sys.stderr.write("Failed tests:\n")
+ for failed_tests in [test_errors,test_failures]:
+ for err in failed_tests:
+ sys.stderr.write("{0}: {1}\n".format(err[2],err[0]))
+ sys.stderr.write("----------------------------------------------------------------------\n")
+ sys.stderr.write("{0}\n".format(err[1]))
+ sys.stderr.write("----------------------------------------------------------------------\n")
+ sys.stderr.write("Total run:{0}\n".format(test_runs))
+ sys.stderr.write("Total errors:{0}\n".format(len(test_errors)))
+ sys.stderr.write("Total failures:{0}\n".format(len(test_failures)))
+
+ if tests_status:
+ sys.stderr.write("OK\n")
+ exit_code = 0
+ else:
+ sys.stderr.write("ERROR\n")
+ exit_code = 1
+ return exit_code
+
+
+if __name__ == "__main__":
+ sys.exit(main())
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
new file mode 100644
index 0000000..9aabbdc
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
@@ -0,0 +1,269 @@
+#!/usr/bin/env bash
+
+# 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
+
+#JAVA_HOME=/usr/jdk64/jdk1.7.0_45
+PIDFILE=/var/run/ambari-metrics-collector/ambari-metrics-collector.pid
+OUTFILE=/var/log/ambari-metrics-collector/ambari-metrics-collector.out
+
+HBASE_ZK_PID=/var/run/ams-hbase/hbase-hbase-zookeeper.pid
+HBASE_MASTER_PID=/var/run/ams-hbase/hbase-hbase-master.pid
+HBASE_RS_PID=/var/run/ams-hbase/hbase-hbase-regionserver.pid
+
+HBASE_DIR=/usr/lib/ams-hbase
+
+DAEMON_NAME=timelineserver
+
+COLLECTOR_CONF_DIR=/etc/ambari-metrics-collector/conf
+HBASE_CONF_DIR=/etc/ams-hbase/conf
+
+METRIC_COLLECTOR=ambari-metrics-collector
+
+STOP_TIMEOUT=5
+
+function hbase_daemon
+{
+ local daemon=$1
+ local cmd=$2
+ local pid
+
+ case "${daemon}" in
+ "master")
+ pid=${HBASE_MASTER_PID}
+ ;;
+ "zookeeper")
+ pid=${HBASE_ZK_PID}
+ ;;
+ "regionserver")
+ pid=${HBASE_RS_PID}
+ ;;
+ esac
+
+ daemon_status "${pid}"
+ if [[ $? == 0 ]]; then
+ echo "${daemon} is running as process $(cat "${pid}"). Continuing"
+ else
+ # stale pid file, so just remove it and continue on
+ rm -f "${pid}" >/dev/null 2>&1
+ fi
+
+ ${HBASE_DIR}/bin/hbase-daemon.sh --config ${HBASE_CONF_DIR} ${cmd} ${daemon}
+
+
+
+}
+
+function write_pidfile
+{
+ local pidfile="$1"
+ echo $! > "${pidfile}" 2>/dev/null
+ if [[ $? -gt 0 ]]; then
+ echo "ERROR: Cannot write pid ${pidfile}."
+ exit 1;
+ fi
+}
+
+function hadoop_java_setup
+{
+ # Bail if we did not detect it
+ if [[ -z "${JAVA_HOME}" ]]; then
+ echo "ERROR: JAVA_HOME is not set and could not be found."
+ exit 1
+ fi
+
+ if [[ ! -d "${JAVA_HOME}" ]]; then
+ echo "ERROR: JAVA_HOME ${JAVA_HOME} does not exist."
+ exit 1
+ fi
+
+ JAVA="${JAVA_HOME}/bin/java"
+
+ if [[ ! -x "$JAVA" ]]; then
+ echo "ERROR: $JAVA is not executable."
+ exit 1
+ fi
+ # shellcheck disable=SC2034
+ JAVA_HEAP_MAX=-Xmx1g
+ HADOOP_HEAPSIZE=${HADOOP_HEAPSIZE:-1024}
+
+ # check envvars which might override default args
+ if [[ -n "$HADOOP_HEAPSIZE" ]]; then
+ # shellcheck disable=SC2034
+ JAVA_HEAP_MAX="-Xmx${HADOOP_HEAPSIZE}m"
+ fi
+}
+
+function daemon_status()
+{
+ #
+ # LSB 4.1.0 compatible status command (1)
+ #
+ # 0 = program is running
+ # 1 = dead, but still a pid (2)
+ # 2 = (not used by us)
+ # 3 = not running
+ #
+ # 1 - this is not an endorsement of the LSB
+ #
+ # 2 - technically, the specification says /var/run/pid, so
+ # we should never return this value, but we're giving
+ # them the benefit of a doubt and returning 1 even if
+ # our pid is not in in /var/run .
+ #
+
+ local pidfile="$1"
+ shift
+
+ local pid
+
+ if [[ -f "${pidfile}" ]]; then
+ pid=$(cat "${pidfile}")
+ if ps -p "${pid}" > /dev/null 2>&1; then
+ return 0
+ fi
+ return 1
+ fi
+ return 3
+}
+
+while [[ -z "${_ams_configs_done}" ]]; do
+ case $1 in
+ --config)
+ shift
+ confdir=$1
+ shift
+ if [[ -d "${confdir}" ]]; then
+ COLLECTOR_CONF_DIR="${confdir}"
+ elif [[ -z "${confdir}" ]]; then
+ echo "ERROR: No parameter provided for --config "
+ exit 1
+ else
+ echo "ERROR: Cannot find configuration directory \"${confdir}\""
+ exit 1
+ fi
+ ;;
+ *)
+ _ams_configs_done=true
+ ;;
+ esac
+done
+
+#execute ams-env.sh
+if [[ -f "${COLLECTOR_CONF_DIR}/ams-env.sh" ]]; then
+ . "${COLLECTOR_CONF_DIR}/ams-env.sh"
+else
+ echo "ERROR: Cannot execute ${COLLECTOR_CONF_DIR}/ams-env.sh." 2>&1
+ exit 1
+fi
+
+#TODO manage 3 hbase daemons for start/stop/status
+case "$1" in
+
+ start)
+ hadoop_java_setup
+
+ #hbase_daemon "zookeeper" "start"
+
+ hbase_daemon "master" "start"
+ #hbase_daemon "regionserver" "start"
+
+ sleep 30
+
+ CLASS='org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer'
+ # YARN_OPTS="${YARN_OPTS} ${YARN_TIMELINESERVER_OPTS}"
+ # if [[ -n "${YARN_TIMELINESERVER_HEAPSIZE}" ]]; then
+ # JAVA_HEAP_MAX="-Xmx${YARN_TIMELINESERVER_HEAPSIZE}m"
+ # fi
+
+ # check if this is needed?
+ # export PHOENIX_JAR_PATH=/usr/lib/ambari-metrics/timelineservice/phoenix-client.jar
+ # export HBASE_CONF_DIR=${HBASE_DIR}/conf
+
+ daemon_status "${PIDFILE}"
+ if [[ $? == 0 ]]; then
+ echo "AMS is running as process $(cat "${PIDFILE}"). Exiting"
+ exit 1
+ else
+ # stale pid file, so just remove it and continue on
+ rm -f "${PIDFILE}" >/dev/null 2>&1
+ fi
+
+ nohup "${JAVA}" "-cp" "/usr/lib/ambari-metrics-collector/*:${COLLECTOR_CONF_DIR}" "-Djava.net.preferIPv4Stack=true" "-Dproc_${DAEMON_NAME}" "${CLASS}" "$@" > $OUTFILE 2>&1 &
+ PID=$!
+ write_pidfile "${PIDFILE}"
+ sleep 2
+
+ echo "Verifying ${METRIC_COLLECTOR} process status..."
+ if [ -z "`ps ax -o pid | grep ${PID}`" ]; then
+ if [ -s ${OUTFILE} ]; then
+ echo "ERROR: ${METRIC_COLLECTOR} start failed. For more details, see ${OUTFILE}:"
+ echo "===================="
+ tail -n 10 ${OUTFILE}
+ echo "===================="
+ else
+ echo "ERROR: ${METRIC_COLLECTOR} start failed"
+ rm -f ${PIDFILE}
+ fi
+ echo "Collector out at: ${OUTFILE}"
+ exit -1
+ fi
+
+ echo "Collector successfully started."
+
+ ;;
+ stop)
+ pidfile=${PIDFILE}
+
+ if [[ -f "${pidfile}" ]]; then
+ pid=$(cat "$pidfile")
+
+ kill "${pid}" >/dev/null 2>&1
+ sleep "${STOP_TIMEOUT}"
+
+ if kill -0 "${pid}" > /dev/null 2>&1; then
+ echo "WARNING: ${METRIC_COLLECTOR} did not stop gracefully after ${STOP_TIMEOUT} seconds: Trying to kill with kill -9"
+ kill -9 "${pid}" >/dev/null 2>&1
+ fi
+
+ if ps -p "${pid}" > /dev/null 2>&1; then
+ echo "ERROR: Unable to kill ${pid}"
+ else
+ rm -f "${pidfile}" >/dev/null 2>&1
+ fi
+ fi
+
+ #stop hbase daemons
+ #hbase_daemon "zookeeper" "stop"
+ hbase_daemon "master" "stop"
+ #hbase_daemon "regionserver" "stop"
+
+
+ ;;
+ status)
+ daemon_status "${PIDFILE}"
+ if [[ $? == 0 ]]; then
+ echo "AMS is running as process $(cat "${PIDFILE}")."
+ else
+ echo "AMS is not running."
+ fi
+ #print embedded hbase daemons statuses?
+ ;;
+ restart)
+ ;;
+
+esac
+
+
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ams-env.sh
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ams-env.sh b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ams-env.sh
new file mode 100644
index 0000000..9928093
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ams-env.sh
@@ -0,0 +1,16 @@
+# 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.
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ams-site.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ams-site.xml b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ams-site.xml
new file mode 100644
index 0000000..c2dd100
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ams-site.xml
@@ -0,0 +1,25 @@
+<?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.
+ -->
+
+<configuration>
+
+ <!-- Site specific AMS configuration properties -->
+
+</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/conf/unix/log4j.properties
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/log4j.properties b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/log4j.properties
new file mode 100644
index 0000000..8a9e2c8
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/log4j.properties
@@ -0,0 +1,31 @@
+#
+# 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
+# Root logger option
+log4j.rootLogger=INFO,file
+
+# Direct log messages to a log file
+log4j.appender.file=org.apache.log4j.RollingFileAppender
+log4j.appender.file.File=/var/log/ambari-metrics-collector/ambari-metrics-collector.log
+log4j.appender.file.MaxFileSize=80MB
+log4j.appender.file.MaxBackupIndex=60
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p [%t] %c{1}:%L - %m%n
+
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/pom.xml b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
new file mode 100644
index 0000000..d0a72ae
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/pom.xml
@@ -0,0 +1,593 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>ambari-metrics</artifactId>
+ <groupId>org.apache.ambari</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>ambari-metrics-timelineservice</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <name>ambari-metrics-timelineservice</name>
+ <packaging>jar</packaging>
+
+ <properties>
+ <!-- Needed for generating FindBugs warnings using parent pom -->
+ <!--<yarn.basedir>${project.parent.parent.basedir}</yarn.basedir>-->
+ <protobuf.version>2.5.0</protobuf.version>
+ <hadoop.version>2.4.0</hadoop.version>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>phoenix-core-tests</id>
+ <name>Phoenix Unit tests</name>
+ <url>file://${project.basedir}/src/test/resources/lib</url>
+ </repository>
+ </repositories>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
+ <includeScope>compile</includeScope>
+ <excludeScope>test</excludeScope>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assemblies/ats.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ </configuration>
+ <id>build-tarball</id>
+ <phase>none</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.github.goldin</groupId>
+ <artifactId>copy-maven-plugin</artifactId>
+ <version>0.2.5</version>
+ <executions>
+ <execution>
+ <id>create-archive</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <resources>
+ <resource>
+ <targetPath>${project.build.directory}/embedded</targetPath>
+ <file>${hbase.tar}</file>
+ <unpack>true</unpack>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>rpm-maven-plugin</artifactId>
+ <version>2.0.1</version>
+ <executions>
+ <execution>
+ <!-- unbinds rpm creation from maven lifecycle -->
+ <phase>none</phase>
+ <goals>
+ <goal>rpm</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <name>ambari-metrics-collector</name>
+ <copyright>2012, Apache Software Foundation</copyright>
+ <group>Development</group>
+ <description>Maven Recipe: RPM Package.</description>
+ <autoRequires>false</autoRequires>
+ <requires>
+ <require>${python.ver}</require>
+ </requires>
+
+ <defaultFilemode>644</defaultFilemode>
+ <defaultDirmode>755</defaultDirmode>
+ <defaultUsername>root</defaultUsername>
+ <defaultGroupname>root</defaultGroupname>
+
+ <mappings>
+ <mapping>
+ <!--jars-->
+ <directory>/usr/lib/ambari-metrics-collector/</directory>
+ <sources>
+ <source>
+ <location>target/lib</location>
+ </source>
+ <source>
+ <location>${project.build.directory}/${project.artifactId}-${project.version}.jar</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <!--embedded applications-->
+ <directory>/usr/lib/ams-hbase/</directory>
+ <sources>
+ <source>
+ <location>target/embedded/${hbase.folder}</location>
+ <excludes>
+ <exclude>bin/**</exclude>
+ <exclude>bin/*</exclude>
+ </excludes>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/usr/lib/ams-hbase/bin</directory>
+ <filemode>755</filemode>
+ <sources>
+ <source>
+ <location>target/embedded/${hbase.folder}/bin</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/usr/lib/ams-hbase/lib/</directory>
+ <sources>
+ <source>
+ <location>target/lib</location>
+ <includes>
+ <include>phoenix*.jar</include>
+ <include>antlr*.jar</include>
+ </includes>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/usr/sbin</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <directoryIncluded>false</directoryIncluded>
+ <sources>
+ <source>
+ <location>conf/unix/ambari-metrics-collector</location>
+ <filter>false</filter>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/etc/ambari-metrics-collector/conf</directory>
+ <configuration>true</configuration>
+ <sources>
+ <source>
+ <location>conf/unix/ams-env.sh</location>
+ </source>
+ <source>
+ <location>conf/unix/ams-site.xml</location>
+ </source>
+ <source>
+ <location>conf/unix/log4j.properties</location>
+ </source>
+ <source>
+ <location>target/embedded/${hbase.folder}/conf/hbase-site.xml</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/etc/ams-hbase/conf</directory>
+ <configuration>true</configuration>
+ <sources>
+ <source>
+ <location>target/embedded/${hbase.folder}/conf</location>
+ <includes>
+ <include>*.*</include>
+ </includes>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/var/run/ams-hbase</directory>
+ </mapping>
+ <mapping>
+ <directory>/var/run/ambari-metrics-collector</directory>
+ </mapping>
+ <mapping>
+ <directory>/var/log/ambari-metrics-collector</directory>
+ </mapping>
+ <mapping>
+ <directory>/var/lib/ambari-metrics-collector</directory>
+ </mapping>
+ </mappings>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <forkMode>always</forkMode>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.phoenix</groupId>
+ <artifactId>phoenix-core</artifactId>
+ <version>4.2.0.2.2.0.0-2041</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-common</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-annotations</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.5</version>
+ </dependency>
+
+ <dependency>
+ <artifactId>ambari-metrics-hadoop-sink</artifactId>
+ <groupId>org.apache.ambari</groupId>
+ <version>0.1.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
+ <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-common</artifactId>
+ <version>${hadoop.version}</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-el</groupId>
+ <artifactId>commons-el</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-runtime</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-compiler</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jsp-2.1-jetty</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-annotations</artifactId>
+ <version>${hadoop.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.8.5</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-common</artifactId>
+ <version>${hadoop.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-servlet</artifactId>
+ <version>3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <version>${protobuf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ <version>4.10</version>
+ </dependency>
+ <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
+ <dependency>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
+ <version>3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.jersey-test-framework</groupId>
+ <artifactId>jersey-test-framework-core</artifactId>
+ <version>1.11</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-json</artifactId>
+ <version>1.11</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey.contribs</groupId>
+ <artifactId>jersey-guice</artifactId>
+ <version>1.11</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-server</artifactId>
+ <version>1.11</version>
+ </dependency>
+ <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-yarn-common</artifactId>
+ <version>${hadoop.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-yarn-common</artifactId>
+ <version>${hadoop.version}</version>
+ </dependency>
+ <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-yarn-api</artifactId>
+ <version>${hadoop.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jettison</groupId>
+ <artifactId>jettison</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-core</artifactId>
+ <version>1.11</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-client</artifactId>
+ <version>1.11</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>14.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+
+ <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-yarn-server-common</artifactId>
+ <version>${hadoop.version}</version>
+ </dependency>
+
+ <!-- 'mvn dependency:analyze' fails to detect use of this dependency -->
+ <dependency>
+ <groupId>com.sun.jersey.jersey-test-framework</groupId>
+ <artifactId>jersey-test-framework-grizzly2</artifactId>
+ <scope>test</scope>
+ <version>1.11</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ <version>1.9.9</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.7.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.9.13</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.fusesource.leveldbjni</groupId>
+ <artifactId>leveldbjni-all</artifactId>
+ <version>1.8</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <version>1.7.0</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymock</artifactId>
+ <version>3.2</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- for unit tests only -->
+ <dependency>
+ <groupId>org.apache.phoenix</groupId>
+ <artifactId>phoenix-core-tests</artifactId>
+ <version>4.2.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hbase</groupId>
+ <artifactId>hbase-it</artifactId>
+ <version>0.98.4-hadoop2</version>
+ <scope>test</scope>
+ <classifier>tests</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hbase</groupId>
+ <artifactId>hbase-testing-util</artifactId>
+ <version>0.98.4-hadoop2</version>
+ <scope>test</scope>
+ <optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jruby</groupId>
+ <artifactId>jruby-complete</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-module-junit4</artifactId>
+ <version>1.4.9</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ <version>1.4.9</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-api-easymock</artifactId>
+ <version>1.4.9</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>sim</id>
+ <build>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assemblies/simulator.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ </configuration>
+ <executions>
+ <execution>
+ <id>build-tarball</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.3.1</version>
+ <!-- The configuration of the plugin -->
+ <configuration>
+ <!-- Configuration of the archiver -->
+ <finalName>${pom.artifactId}-simulator-${pom.version}</finalName>
+ <archive>
+ <!-- Manifest specific configuration -->
+ <manifest>
+ <!-- Classpath is added to the manifest of the created jar file. -->
+ <addClasspath>true</addClasspath>
+ <!--
+ Configures the classpath prefix. This configuration option is
+ used to specify that all needed libraries are found under lib/
+ directory.
+ -->
+ <classpathPrefix></classpathPrefix>
+ <!-- Specifies the main class of the application -->
+ <mainClass>
+ org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.loadsimulator.MetricsLoadSimulator
+ </mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ </build>
+
+ </profile>
+ </profiles>
+</project>
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/ats.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/ats.xml b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/ats.xml
new file mode 100644
index 0000000..21a6b36
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/ats.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+<assembly>
+ <!--This 'all' id is not appended to the produced bundle because we do this:
+ http://maven.apache.org/plugins/maven-assembly-plugin/faq.html#required-classifiers
+ -->
+ <id>dist</id>
+ <formats>
+ <format>dir</format>
+ <format>tar.gz</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <files>
+ <file>
+ <source>${project.build.directory}/${artifact.artifactId}-${artifact.version}.jar</source>
+ <outputDirectory>ambari-metrics-${project.version}/lib/ambari-metrics</outputDirectory>
+ </file>
+ </files>
+</assembly>
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/empty.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/empty.xml b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/empty.xml
new file mode 100644
index 0000000..35738b1
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/empty.xml
@@ -0,0 +1,21 @@
+<!--
+ 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.
+-->
+<assembly>
+ <id>empty</id>
+ <formats/>
+</assembly>
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-client.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-client.xml b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-client.xml
new file mode 100644
index 0000000..beca5bd
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-client.xml
@@ -0,0 +1,62 @@
+<?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.
+ -->
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ <id>client</id>
+ <!-- All the dependencies (unpacked) necessary to run phoenix from a single, stand-alone jar -->
+ <formats>
+ <format>jar</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <componentDescriptors>
+ <componentDescriptor>src/main/assemblies/phoenix-components-minimal.xml</componentDescriptor>
+ <componentDescriptor>src/main/assemblies/phoenix-components-major-client.xml</componentDescriptor>
+ </componentDescriptors>
+
+ <dependencySets>
+ <dependencySet>
+ <!-- Unpack all the dependencies to class files, since java doesn't support
+ jar of jars for running -->
+ <unpack>true</unpack>
+ <!-- save these dependencies to the top-level -->
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>jline:jline</include>
+ <include>sqlline:sqlline</include>
+ <include>org.apache.hbase:hbase*</include>
+ <include>org.cloudera.htrace:htrace-core</include>
+ <include>io.netty:netty</include>
+ <include>commons-codec:commons-codec</include>
+ </includes>
+ </dependencySet>
+
+ <!-- Make sure we get all the components, not just the minimal client ones (e.g.
+ phoenix-flume, phoenix-pig, etc) -->
+ <dependencySet>
+ <outputDirectory>/</outputDirectory>
+ <unpack>true</unpack>
+ <includes>
+ <include>org.apache.phoenix:phoenix-*</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-components-major-client.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-components-major-client.xml b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-components-major-client.xml
new file mode 100644
index 0000000..13692fe
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-components-major-client.xml
@@ -0,0 +1,53 @@
+<?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.
+ -->
+
+<component>
+ <!-- Components that the client needs (except for HBase) -->
+ <dependencySets>
+ <dependencySet>
+ <!-- Unpack all the dependencies to class files, since java doesn't support
+ jar of jars for running -->
+ <unpack>true</unpack>
+ <!-- save these dependencies to the top-level -->
+ <outputDirectory>/</outputDirectory>
+ <!-- Maybe a blacklist is easier? -->
+ <includes>
+ <!-- We use a newer version of guava than HBase - this might be an issue? -->
+ <include>com.google.guava:guava</include>
+ <!-- HBase also pulls in these dependencies on its own, should we include-them? -->
+ <include>com.google.protobuf:protobuf-java</include>
+ <include>org.slf4j:slf4j-api</include>
+ <include>org.slf4j:slf4j-log4j12</include>
+ <include>org.apache.zookeeper:zookeeper</include>
+ <include>log4j:log4j</include>
+ <include>org.apache.hadoop:hadoop*</include>
+ <include>commons-configuration:commons-configuration</include>
+ <include>commons-io:commons-io</include>
+ <include>commons-logging:commons-logging</include>
+ <include>commons-lang:commons-lang</include>
+ <include>commons-cli:commons-cli</include>
+ <include>org.apache.commons:commons-csv</include>
+ <include>org.codehaus.jackson:jackson-mapper-asl</include>
+ <include>org.codehaus.jackson:jackson-core-asl</include>
+ <include>org.xerial.snappy:snappy-java</include>
+ <include>commons-collections:commons-collections</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</component>
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-components-minimal.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-components-minimal.xml b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-components-minimal.xml
new file mode 100644
index 0000000..bf7de85
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-components-minimal.xml
@@ -0,0 +1,71 @@
+<?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.
+ -->
+
+<component>
+ <!-- Just the basic components that Phoenix pulls in, that is not a transitive dependency from Hadoop/HBase/Pig -->
+ <dependencySets>
+ <dependencySet>
+ <!-- Unpack all the dependencies to class files, since java doesn't support
+ jar of jars for running -->
+ <unpack>true</unpack>
+ <!-- save these dependencies to the top-level -->
+ <outputDirectory>/</outputDirectory>
+ <!-- Just include the extra things that phoenix needs -->
+ <includes>
+ <include>org.antlr:antlr*</include>
+ </includes>
+ </dependencySet>
+
+ <dependencySet>
+ <outputDirectory>/</outputDirectory>
+ <unpack>true</unpack>
+ <includes>
+ <include>org.apache.phoenix:phoenix-*</include>
+ </includes>
+ <excludes>
+ <exclude>org.apache.phoenix:phoenix-flume</exclude>
+ <exclude>org.apache.phoenix:phoenix-pig</exclude>
+ </excludes>
+ </dependencySet>
+ </dependencySets>
+
+ <fileSets>
+ <fileSet>
+ <!--Get misc project files -->
+ <directory>${project.basedir}/..</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>*.txt*</include>
+ <include>*.md</include>
+ <include>NOTICE*</include>
+ </includes>
+ <excludes>
+ <exclude>build.txt</exclude>
+ </excludes>
+ </fileSet>
+ <fileSet>
+ <!--Get map-red-config properties files -->
+ <directory>${project.basedir}/../config</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>csv-bulk-load-config.properties</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</component>
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-server.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-server.xml b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-server.xml
new file mode 100644
index 0000000..be8a516
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/phoenix-server.xml
@@ -0,0 +1,46 @@
+<?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.
+ -->
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ <!-- build the phoenix server side jar, that includes phoenix-hadoopX-compat, phoenix-hadoop-compat and antlr -->
+ <id>server</id>
+ <formats>
+ <format>jar</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/</outputDirectory>
+ <unpack>true</unpack>
+ <includes>
+ <include>org.apache.phoenix:phoenix-core</include>
+ <include>org.apache.phoenix:phoenix-hadoop*</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <unpack>true</unpack>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>org.antlr:antlr*</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/simulator.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/simulator.xml b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/simulator.xml
new file mode 100644
index 0000000..0f77976
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/assemblies/simulator.xml
@@ -0,0 +1,68 @@
+<?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.
+-->
+<assembly>
+ <id>dist</id>
+ <formats>
+ <format>dir</format>
+ <format>tar.gz</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <files>
+ <file>
+ <source>${project.build.directory}/${artifact.artifactId}-simulator-${artifact.version}.jar</source>
+ <outputDirectory>ambari-metrics-${project.version}/lib/ambari-metrics</outputDirectory>
+ </file>
+ </files>
+ <fileSets>
+ <!--
+ Adds startup scripts to the root directory of zip package. The startup
+ scripts are located to src/main/scripts directory as stated by Maven
+ conventions.
+ -->
+ <fileSet>
+ <directory>${basedir}/src/main/resources/scripts</directory>
+ <outputDirectory>ambari-metrics-${project.version}/bin</outputDirectory>
+ <includes>
+ <include>*.sh</include>
+ </includes>
+ <fileMode>0755</fileMode>
+ </fileSet>
+ <!-- adds jar package to the root directory of zip package -->
+<!-- <fileSet>
+ <directory>${project.build.directory}</directory>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ </fileSet>-->
+ </fileSets>
+
+
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>ambari-metrics-${project.version}/lib/ambari-metrics</outputDirectory>
+<!--
+ <useProjectArtifact>false</useProjectArtifact>
+-->
+ <unpack>false</unpack>
+ <scope>compile</scope>
+
+ </dependencySet>
+ </dependencySets>
+
+</assembly>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/src/main/conf/hbase-site-metrics-service.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/conf/hbase-site-metrics-service.xml b/ambari-metrics/ambari-metrics-timelineservice/src/main/conf/hbase-site-metrics-service.xml
new file mode 100644
index 0000000..dabef50
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/conf/hbase-site-metrics-service.xml
@@ -0,0 +1,80 @@
+<?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>file:///grid/0/hbase</value>
+ </property>
+ <property>
+ <name>hbase.tmp.dir</name>
+ <value>/grid/0/hbase-tmp</value>
+ </property>
+ <property>
+ <name>hbase.cluster.distributed</name>
+ <value>true</value>
+ </property>
+ <property>
+ <name>hbase.master.wait.on.regionservers.mintostart</name>
+ <value>1</value>
+ </property>
+ <property>
+ <name>hbase.zookeeper.quorum</name>
+ <value>localhost</value>
+ </property>
+ <property>
+ <name>phoenix.query.spoolThresholdBytes</name>
+ <value>12582912</value>
+ </property>
+ <property>
+ <name>hbase.zookeeper.property.dataDir</name>
+ <value>/grid/0/zookeeper</value>
+ </property>
+ <property>
+ <name>hbase.client.scanner.caching</name>
+ <value>10000</value>
+ </property>
+ <property>
+ <name>hfile.block.cache.size</name>
+ <value>0.3</value>
+ </property>
+ <property>
+ <name>hbase.regionserver.global.memstore.upperLimit</name>
+ <value>0.5</value>
+ </property>
+ <property>
+ <name>hbase.regionserver.global.memstore.lowerLimit</name>
+ <value>0.4</value>
+ </property>
+ <property>
+ <name>phoenix.groupby.maxCacheSize</name>
+ <value>307200000</value>
+ </property>
+ <property>
+ <name>hbase.hregion.memstore.block.multiplier</name>
+ <value>4</value>
+ </property>
+ <property>
+ <name>hbase.hstore.flusher.count</name>
+ <value>2</value>
+ </property>
+</configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/a52f8a55/ambari-metrics/ambari-metrics-timelineservice/src/main/conf/simulator-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/conf/simulator-log4j.xml b/ambari-metrics/ambari-metrics-timelineservice/src/main/conf/simulator-log4j.xml
new file mode 100644
index 0000000..ac505f6
--- /dev/null
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/conf/simulator-log4j.xml
@@ -0,0 +1,45 @@
+<?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.
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration debug="false">
+
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="target" value="System.out" />
+ <param name="threshold" value="debug" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{1}] - %m%n" />
+ </layout>
+ </appender>
+
+ <appender name="fileAppender" class="org.apache.log4j.RollingFileAppender">
+ <param name="Threshold" value="INFO" />
+ <param name="File" value="loadsimulator.log"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%c{1}] %m %n" />
+ </layout>
+ </appender>
+
+ <root>
+ <priority value ="info" />
+ <!-- we may want async appender-->
+ <appender-ref ref="fileAppender" />
+ </root>
+
+</log4j:configuration>
\ No newline at end of file