ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject [29/29] ambari git commit: AMBARI-8269. Merge branch-windows-dev changes to trunk. (Jayush Luniya via yusaku)
Date Fri, 14 Nov 2014 02:20:11 GMT
AMBARI-8269. Merge branch-windows-dev changes to trunk. (Jayush Luniya via yusaku)


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

Branch: refs/heads/trunk
Commit: 8de3425f3fe106edddd54261927b44481685b1cc
Parents: 0d5224e
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Thu Nov 13 17:39:49 2014 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Thu Nov 13 17:40:55 2014 -0800

----------------------------------------------------------------------
 ambari-admin/pom.xml                            |    34 +-
 ambari-agent/conf/windows/ambari-agent.cmd      |    18 +
 ambari-agent/conf/windows/ambari-agent.ini      |    54 +
 ambari-agent/conf/windows/ambari-agent.ps1      |   245 +
 ambari-agent/conf/windows/ambari-env.cmd        |    22 +
 ambari-agent/conf/windows/createservice.ps1     |   195 +
 ambari-agent/conf/windows/service_wrapper.py    |   227 +
 ambari-agent/pom.xml                            |   173 +-
 .../src/main/package/msi/ambari-agent.wxs       |    38 +
 .../src/main/python/ambari_agent/ActionQueue.py |    35 +-
 .../python/ambari_agent/AgentConfig_linux.py    |   229 +
 .../python/ambari_agent/AgentConfig_windows.py  |   232 +
 .../src/main/python/ambari_agent/AmbariAgent.py |    10 +-
 .../main/python/ambari_agent/AmbariConfig.py    |   240 +-
 .../src/main/python/ambari_agent/Controller.py  |    44 +-
 .../ambari_agent/CustomServiceOrchestrator.py   |    14 +-
 .../src/main/python/ambari_agent/Facter.py      |   329 +-
 .../src/main/python/ambari_agent/FileCache.py   |     3 +-
 .../src/main/python/ambari_agent/Hardware.py    |    33 +-
 .../ambari_agent/HeartbeatHandlers_windows.py   |    58 +
 .../ambari_agent/HeartbeatStopHandler_linux.py  |    91 +
 .../ambari_agent/HostCheckReportFileHandler.py  |     5 +-
 .../src/main/python/ambari_agent/HostInfo.py    |   395 +-
 .../main/python/ambari_agent/HostInfo_linux.py  |   411 +
 .../main/python/ambari_agent/HostInfo_win.py    |   231 +
 .../src/main/python/ambari_agent/LiveStatus.py  |     2 +-
 .../src/main/python/ambari_agent/NetUtil.py     |    30 +-
 .../python/ambari_agent/PackagesAnalyzer.py     |    14 +-
 .../main/python/ambari_agent/PythonExecutor.py  |    37 +-
 .../src/main/python/ambari_agent/StatusCheck.py |     6 +-
 .../src/main/python/ambari_agent/hostname.py    |     8 +-
 .../src/main/python/ambari_agent/main.py        |   107 +-
 .../src/main/python/ambari_agent/security.py    |    28 +-
 .../src/main/python/ambari_agent/shell.py       |   113 +-
 ambari-agent/src/packages/windows.xml           |    82 +
 .../src/test/python/ambari_agent/TestAlerts.py  |    34 +-
 .../python/ambari_agent/TestCertGeneration.py   |     1 -
 .../test/python/ambari_agent/TestController.py  |     6 +-
 .../TestCustomServiceOrchestrator.py            |    41 +-
 .../test/python/ambari_agent/TestHostname.py    |     2 +-
 .../src/test/python/ambari_agent/TestMain.py    |    23 +-
 .../src/test/python/ambari_agent/TestNetUtil.py |    13 +-
 .../test/python/ambari_agent/TestStatusCheck.py |    16 +-
 .../resource_management/TestContentSources.py   |     2 +-
 .../TestDirectoryResource.py                    |     2 +-
 .../TestExecuteHadoopResource.py                |     2 +
 .../resource_management/TestExecuteResource.py  |     1 +
 .../TestMonitorWebserverResource.py             |     1 +
 .../resource_management/TestSubstituteVars.py   |     2 +
 ambari-agent/src/test/python/unitTests.py       |     6 +-
 ambari-client/groovy-client/pom.xml             |     1 +
 ambari-client/python-client/pom.xml             |     6 +-
 .../python/ambari_commons/ambari_service.py     |    79 +
 .../main/python/ambari_commons/exceptions.py    |    35 +
 .../main/python/ambari_commons/inet_utils.py    |   148 +
 .../main/python/ambari_commons/logging_utils.py |    49 +
 .../src/main/python/ambari_commons/os_check.py  |   126 +-
 .../src/main/python/ambari_commons/os_linux.py  |    81 +
 .../src/main/python/ambari_commons/os_utils.py  |   102 +
 .../main/python/ambari_commons/os_windows.py    |   563 +
 .../ambari_commons/resources/os_family.json     |    11 +
 .../src/main/python/ambari_commons/str_utils.py |    30 +
 .../python/resource_management/core/logger.py   |    41 +-
 .../core/providers/__init__.py                  |     6 +
 .../core/providers/windows/__init__.py          |    20 +
 .../core/providers/windows/service.py           |    65 +
 .../core/providers/windows/system.py            |   382 +
 .../libraries/functions/__init__.py             |     9 +
 .../libraries/functions/default.py              |     8 +-
 .../functions/get_unique_id_and_date.py         |    15 +-
 .../libraries/functions/install_hdp_msi.py      |   182 +
 .../libraries/functions/reload_windows_env.py   |    48 +
 .../libraries/functions/tar_archive.py          |    30 +
 .../functions/windows_service_utils.py          |    42 +
 .../libraries/functions/zip_archive.py          |    40 +
 .../libraries/providers/__init__.py             |     3 +
 .../libraries/providers/xml_config.py           |    13 +-
 .../libraries/script/script.py                  |   183 +-
 ambari-server/conf/unix/ambari.properties       |     1 +
 ambari-server/conf/windows/ambari-env.cmd       |    19 +
 ambari-server/conf/windows/ambari.properties    |    82 +
 ambari-server/conf/windows/ca.config            |    29 +
 ambari-server/conf/windows/install-helper.cmd   |    61 +
 ambari-server/conf/windows/krb5JAASLogin.conf   |    12 +
 ambari-server/conf/windows/log4j.properties     |    68 +
 ambari-server/docs/api/v1/clusters-cluster.md   |   372 +-
 ambari-server/pom.xml                           |   194 +-
 .../src/main/assemblies/server-windows.xml      |   183 +
 .../ambari/server/DBConnectionVerification.java |     8 +-
 .../server/api/services/ComponentService.java   |     6 +-
 .../stackadvisor/StackAdvisorRunner.java        |    13 +-
 .../server/configuration/Configuration.java     |    53 +-
 .../internal/AbstractPropertyProvider.java      |    12 +
 .../internal/AbstractProviderModule.java        |   349 +-
 .../internal/ClientConfigResourceProvider.java  |     5 +-
 .../internal/ComponentResourceProvider.java     |     2 +-
 .../server/controller/sql/HostInfoProvider.java |    63 +
 .../controller/sql/SQLPropertyProvider.java     |   572 +
 .../controller/sql/SinkConnectionFactory.java   |   132 +
 .../controller/utilities/PropertyHelper.java    |     6 +
 .../server/resources/ResourceManager.java       |     2 +-
 .../server/security/CertificateManager.java     |    37 +-
 .../src/main/package/msi/ambari-server.wxs      |    60 +
 .../src/main/python/ambari-server-windows.py    |   601 +
 ambari-server/src/main/python/ambari-server.py  |    12 +-
 .../python/ambari_server/dbConfiguration.py     |   213 +
 .../ambari_server/dbConfiguration_linux.py      |   740 +
 .../ambari_server/dbConfiguration_windows.py    |   461 +
 .../src/main/python/ambari_server/properties.py |   223 +
 .../python/ambari_server/serverConfiguration.py |   589 +
 .../ambari_server/serverConfiguration_linux.py  |    67 +
 .../serverConfiguration_windows.py              |    98 +
 .../main/python/ambari_server/serverSetup.py    |   533 +
 .../python/ambari_server/serverSetup_linux.py   |   795 +
 .../python/ambari_server/serverSetup_windows.py |   313 +
 .../main/python/ambari_server/setupActions.py   |    39 +
 .../main/python/ambari_server/setupSecurity.py  |  1216 +
 .../src/main/python/ambari_server/userInput.py  |   110 +
 .../src/main/python/ambari_server/utils.py      |    40 +
 .../resources/Ambari-DDL-SQLServer-CREATE.sql   |   694 +
 .../Ambari-DDL-SQLServer-CREATELOCAL.sql        |   128 +
 .../resources/Ambari-DDL-SQLServer-DROP.sql     |   203 +
 .../main/resources/custom_actions/check_host.py |    81 +-
 .../main/resources/sqlserver_properties.json    | 23463 +++++++++++++++++
 .../HDPWIN/2.1/configuration/cluster-env.xml    |   111 +
 .../2.1/hooks/after-INSTALL/scripts/hook.py     |    66 +
 .../2.1/hooks/after-INSTALL/scripts/params.py   |   101 +
 .../templates/cluster.properties.j2             |    38 +
 .../HDPWIN/2.1/hooks/before-ANY/scripts/hook.py |    30 +
 .../2.1/hooks/before-ANY/scripts/params.py      |    27 +
 .../2.1/hooks/before-ANY/scripts/setup_jdk.py   |    49 +
 .../2.1/hooks/before-INSTALL/scripts/hook.py    |    32 +
 .../2.1/hooks/before-INSTALL/scripts/params.py  |    22 +
 .../2.1/hooks/before-RESTART/scripts/hook.py    |    28 +
 .../2.1/hooks/before-START/scripts/hook.py      |    33 +
 .../2.1/hooks/before-START/scripts/params.py    |    22 +
 .../resources/stacks/HDPWIN/2.1/metainfo.xml    |    22 +
 .../stacks/HDPWIN/2.1/repos/repoinfo.xml        |    26 +
 .../stacks/HDPWIN/2.1/role_command_order.json   |   101 +
 .../FALCON/configuration/falcon-env.xml         |   109 +
 .../configuration/falcon-runtime.properties.xml |    47 +
 .../configuration/falcon-startup.properties.xml |   207 +
 .../FALCON/configuration/oozie-site.xml         |   167 +
 .../HDPWIN/2.1/services/FALCON/metainfo.xml     |   106 +
 .../services/FALCON/package/scripts/falcon.py   |    41 +
 .../FALCON/package/scripts/falcon_client.py     |    37 +
 .../FALCON/package/scripts/falcon_server.py     |    44 +
 .../services/FALCON/package/scripts/params.py   |    45 +
 .../FALCON/package/scripts/service_check.py     |    33 +
 .../FALCON/package/scripts/service_mapping.py   |    20 +
 .../package/templates/client.properties.j2      |    42 +
 .../services/HBASE/configuration/hbase-env.xml  |   127 +
 .../HBASE/configuration/hbase-policy.xml        |    53 +
 .../services/HBASE/configuration/hbase-site.xml |   318 +
 .../HDPWIN/2.1/services/HBASE/metainfo.xml      |   128 +
 .../HDPWIN/2.1/services/HBASE/metrics.json      |  4659 ++++
 .../HBASE/package/files/draining_servers.rb     |   164 +
 .../2.1/services/HBASE/package/scripts/hbase.py |    29 +
 .../HBASE/package/scripts/hbase_client.py       |    36 +
 .../HBASE/package/scripts/hbase_decommission.py |    66 +
 .../HBASE/package/scripts/hbase_master.py       |    52 +
 .../HBASE/package/scripts/hbase_regionserver.py |    48 +
 .../services/HBASE/package/scripts/params.py    |    36 +
 .../HBASE/package/scripts/service_check.py      |    34 +
 .../HBASE/package/scripts/service_mapping.py    |    21 +
 .../services/HDFS/configuration/core-site.xml   |   202 +
 .../services/HDFS/configuration/hadoop-env.xml  |    41 +
 .../HDFS/configuration/hadoop-policy.xml        |   219 +
 .../services/HDFS/configuration/hdfs-site.xml   |   272 +
 .../HDPWIN/2.1/services/HDFS/metainfo.xml       |   162 +
 .../HDPWIN/2.1/services/HDFS/metrics.json       |  2126 ++
 .../services/HDFS/package/scripts/datanode.py   |    49 +
 .../2.1/services/HDFS/package/scripts/hdfs.py   |    60 +
 .../HDFS/package/scripts/hdfs_client.py         |    41 +
 .../HDFS/package/scripts/hdfs_rebalance.py      |   130 +
 .../HDFS/package/scripts/journalnode.py         |    48 +
 .../services/HDFS/package/scripts/namenode.py   |   128 +
 .../2.1/services/HDFS/package/scripts/params.py |    65 +
 .../HDFS/package/scripts/service_check.py       |    55 +
 .../HDFS/package/scripts/service_mapping.py     |    24 +
 .../services/HDFS/package/scripts/snamenode.py  |    48 +
 .../services/HDFS/package/scripts/zkfc_slave.py |    51 +
 .../package/templates/exclude_hosts_list.j2     |    21 +
 .../templates/hadoop-metrics2.properties.j2     |    53 +
 .../services/HIVE/configuration/hive-env.xml    |   105 +
 .../services/HIVE/configuration/hive-site.xml   |   291 +
 .../HIVE/configuration/webhcat-site.xml         |   109 +
 .../HIVE/etc/hive-schema-0.12.0.mysql.sql       |   777 +
 .../HIVE/etc/hive-schema-0.12.0.oracle.sql      |   717 +
 .../HIVE/etc/hive-schema-0.12.0.postgres.sql    |  1405 +
 .../HDPWIN/2.1/services/HIVE/metainfo.xml       |   210 +
 .../HIVE/package/files/templetonSmoke.sh        |    96 +
 .../HIVE/package/scripts/hcat_client.py         |    40 +
 .../HIVE/package/scripts/hcat_service_check.py  |    25 +
 .../2.1/services/HIVE/package/scripts/hive.py   |    33 +
 .../HIVE/package/scripts/hive_client.py         |    40 +
 .../HIVE/package/scripts/hive_metastore.py      |    53 +
 .../HIVE/package/scripts/hive_server.py         |    52 +
 .../HIVE/package/scripts/mysql_server.py        |    46 +
 .../2.1/services/HIVE/package/scripts/params.py |    39 +
 .../HIVE/package/scripts/service_check.py       |    39 +
 .../HIVE/package/scripts/service_mapping.py     |    23 +
 .../services/HIVE/package/scripts/webhcat.py    |    30 +
 .../HIVE/package/scripts/webhcat_server.py      |    48 +
 .../package/scripts/webhcat_service_check.py    |    27 +
 .../HIVE/package/templates/webhcat-env.sh.j2    |    62 +
 .../services/OOZIE/configuration/oozie-env.xml  |   140 +
 .../OOZIE/configuration/oozie-log4j.xml         |    96 +
 .../services/OOZIE/configuration/oozie-site.xml |   502 +
 .../HDPWIN/2.1/services/OOZIE/metainfo.xml      |   126 +
 .../2.1/services/OOZIE/package/scripts/oozie.py |    36 +
 .../OOZIE/package/scripts/oozie_client.py       |    40 +
 .../OOZIE/package/scripts/oozie_server.py       |    66 +
 .../services/OOZIE/package/scripts/params.py    |    33 +
 .../OOZIE/package/scripts/service_check.py      |    32 +
 .../OOZIE/package/scripts/service_mapping.py    |    21 +
 .../services/PIG/configuration/pig-log4j.xml    |    61 +
 .../PIG/configuration/pig-properties.xml        |   262 +
 .../stacks/HDPWIN/2.1/services/PIG/metainfo.xml |    75 +
 .../2.1/services/PIG/package/scripts/params.py  |    37 +
 .../2.1/services/PIG/package/scripts/pig.py     |    49 +
 .../services/PIG/package/scripts/pig_client.py  |    41 +
 .../PIG/package/scripts/service_check.py        |    34 +
 .../services/SQOOP/configuration/sqoop-site.xml |   156 +
 .../HDPWIN/2.1/services/SQOOP/metainfo.xml      |    80 +
 .../services/SQOOP/package/scripts/params.py    |    32 +
 .../SQOOP/package/scripts/service_check.py      |    34 +
 .../2.1/services/SQOOP/package/scripts/sqoop.py |    30 +
 .../SQOOP/package/scripts/sqoop_client.py       |    41 +
 .../services/STORM/configuration/storm-site.xml |   651 +
 .../HDPWIN/2.1/services/STORM/metainfo.xml      |    92 +
 .../HDPWIN/2.1/services/STORM/metrics.json      |    99 +
 .../services/STORM/package/scripts/nimbus.py    |    50 +
 .../services/STORM/package/scripts/params.py    |    30 +
 .../STORM/package/scripts/service_check.py      |    32 +
 .../STORM/package/scripts/service_mapping.py    |    22 +
 .../STORM/package/scripts/status_params.py      |    22 +
 .../2.1/services/STORM/package/scripts/storm.py |    33 +
 .../STORM/package/scripts/supervisor.py         |    50 +
 .../services/STORM/package/scripts/ui_server.py |    51 +
 .../STORM/package/scripts/yaml_config.py        |    67 +
 .../2.1/services/TEZ/configuration/tez-site.xml |   218 +
 .../stacks/HDPWIN/2.1/services/TEZ/metainfo.xml |    63 +
 .../2.1/services/TEZ/package/scripts/params.py  |    30 +
 .../2.1/services/TEZ/package/scripts/tez.py     |    30 +
 .../services/TEZ/package/scripts/tez_client.py  |    41 +
 .../YARN/configuration-mapred/mapred-site.xml   |   239 +
 .../YARN/configuration/capacity-scheduler.xml   |   114 +
 .../services/YARN/configuration/yarn-site.xml   |   214 +
 .../HDPWIN/2.1/services/YARN/metainfo.xml       |   224 +
 .../HDPWIN/2.1/services/YARN/metrics.json       |  3138 +++
 .../files/validateYarnComponentStatus.py        |   161 +
 .../scripts/application_timeline_server.py      |    54 +
 .../YARN/package/scripts/historyserver.py       |    53 +
 .../package/scripts/mapred_service_check.py     |   105 +
 .../YARN/package/scripts/mapreduce2_client.py   |    43 +
 .../YARN/package/scripts/nodemanager.py         |    53 +
 .../2.1/services/YARN/package/scripts/params.py |    57 +
 .../YARN/package/scripts/resourcemanager.py     |    77 +
 .../YARN/package/scripts/service_check.py       |    68 +
 .../YARN/package/scripts/service_mapping.py     |    26 +
 .../2.1/services/YARN/package/scripts/yarn.py   |    44 +
 .../YARN/package/scripts/yarn_client.py         |    44 +
 .../package/templates/container-executor.cfg.j2 |    40 +
 .../package/templates/exclude_hosts_list.j2     |    21 +
 .../YARN/package/templates/mapreduce.conf.j2    |    35 +
 .../package/templates/taskcontroller.cfg.j2     |    38 +
 .../YARN/package/templates/yarn.conf.j2         |    35 +
 .../ZOOKEEPER/configuration/zookeeper-env.xml   |    73 +
 .../ZOOKEEPER/configuration/zookeeper-log4j.xml |   100 +
 .../HDPWIN/2.1/services/ZOOKEEPER/metainfo.xml  |    78 +
 .../ZOOKEEPER/package/scripts/params.py         |    59 +
 .../ZOOKEEPER/package/scripts/service_check.py  |    34 +
 .../package/scripts/service_mapping.py          |    22 +
 .../ZOOKEEPER/package/scripts/zookeeper.py      |    63 +
 .../package/scripts/zookeeper_client.py         |    42 +
 .../package/scripts/zookeeper_server.py         |    51 +
 .../package/templates/configuration.xsl.j2      |    42 +
 .../ZOOKEEPER/package/templates/zoo.cfg.j2      |    69 +
 .../stacks/HDPWIN/2.1/services/stack_advisor.py |   414 +
 .../src/main/windows/ambari-server.cmd          |     2 +
 .../src/main/windows/ambari-server.ps1          |   303 +
 .../server/api/services/AmbariMetaInfoTest.java |     5 +-
 .../ClientConfigResourceProviderTest.java       |     3 +-
 .../src/test/python/TestAmbariServer.py         |     2 +
 ambari-server/src/test/python/TestBootstrap.py  |     1 +
 ambari-server/src/test/python/TestCheckHost.py  |    53 +-
 ambari-server/src/test/python/TestOSCheck.py    |    22 +
 .../python/stacks/1.3.2/HDFS/test_datanode.py   |     2 -
 .../1.3.2/hooks/before-ANY/test_before_any.py   |     4 +-
 .../hooks/before-INSTALL/test_before_install.py |     2 +-
 .../hooks/before-START/test_before_start.py     |     4 +-
 .../python/stacks/2.0.6/HDFS/test_datanode.py   |     2 +-
 .../python/stacks/2.0.6/HDFS/test_namenode.py   |     8 +-
 .../stacks/2.0.6/common/test_stack_advisor.py   |     2 -
 .../2.0.6/hooks/before-ANY/test_before_any.py   |     4 +-
 .../hooks/before-INSTALL/test_before_install.py |     2 +-
 .../hooks/before-START/test_before_start.py     |     4 +-
 .../stacks/2.1/configs/default-storm-start.json |   516 +-
 .../2.1/configs/secured-storm-start.json.orig   |   374 +
 .../2.1/configs/secured-storm-start.json.rej    |   527 +
 ambari-server/src/test/python/unitTests.py      |     6 +-
 ambari-shell/ambari-python-shell/pom.xml        |    28 +-
 ambari-shell/pom.xml                            |    17 +
 ambari-views/pom.xml                            |     3 +
 ambari-web/app/app.js                           |    20 +-
 .../data/configuration/cluster_env_site.json    |    14 +
 ambari-web/app/config.js                        |     2 +
 .../controllers/global/cluster_controller.js    |     1 +
 ambari-web/app/controllers/installer.js         |     4 -
 .../main/admin/serviceAccounts_controller.js    |     4 +-
 .../app/controllers/main/charts/heatmap.js      |    33 +-
 .../app/controllers/main/host/add_controller.js |     8 -
 .../controllers/main/service/info/configs.js    |   276 +-
 ambari-web/app/controllers/wizard.js            |    17 +-
 .../app/controllers/wizard/step2_controller.js  |     6 +-
 .../app/controllers/wizard/step4_controller.js  |    12 +-
 .../app/controllers/wizard/step5_controller.js  |     4 +-
 .../app/controllers/wizard/step7_controller.js  |    24 +-
 .../app/controllers/wizard/step8_controller.js  |   164 +-
 .../app/controllers/wizard/step9_controller.js  |     2 +-
 ambari-web/app/data/HDP2/site_properties.js     |   442 +-
 ambari-web/app/messages.js                      |     2 +-
 ambari-web/app/models/quick_links.js            |     5 +-
 ambari-web/app/models/service_config.js         |    53 +-
 ambari-web/app/models/stack_service.js          |    42 +-
 .../app/templates/main/dashboard/widgets.hbs    |    12 +-
 ambari-web/app/templates/main/host/summary.hbs  |    36 +-
 .../app/templates/main/service/info/summary.hbs |    21 +-
 ambari-web/app/templates/wizard/step2.hbs       |    70 +-
 ambari-web/app/utils/ajax/ajax.js               |    12 +-
 ambari-web/app/utils/config.js                  |     5 +-
 ambari-web/app/utils/validator.js               |     6 +-
 .../app/views/common/quick_view_link_view.js    |     2 +-
 ambari-web/app/views/main/admin.js              |    12 +-
 ambari-web/app/views/main/dashboard/widgets.js  |    36 +-
 ambari-web/app/views/main/host/summary.js       |     7 +
 ambari-web/app/views/main/menu.js               |    12 +-
 .../app/views/main/service/info/summary.js      |    17 +-
 ambari-web/app/views/wizard/controls_view.js    |   102 +-
 ambari-web/app/views/wizard/step1_view.js       |    12 +-
 ambari-web/pom.xml                              |    88 +-
 .../main/host/add_controller_test.js            |     2 +-
 .../test/views/main/dashboard/widgets_test.js   |    23 +-
 .../db/Hadoop-Metrics-SQLServer-CREATE.ddl      |   793 -
 .../db/Hadoop-Metrics-SQLServer-CREATE.sql      |   784 +
 .../db/Hadoop-Metrics-SQLServer-CREATELOCAL.sql |   140 +
 .../db/Hadoop-Metrics-SQLServer-DROP.sql        |   161 +
 contrib/views/jobs/pom.xml                      |    34 +-
 contrib/views/slider/pom.xml                    |    91 +-
 pom.xml                                         |    48 +-
 351 files changed, 66918 insertions(+), 2836 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-admin/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-admin/pom.xml b/ambari-admin/pom.xml
index 3228c25..8251860 100644
--- a/ambari-admin/pom.xml
+++ b/ambari-admin/pom.xml
@@ -99,9 +99,9 @@
             </goals>
             <configuration>
               <workingDirectory>${basedir}/src/main/resources/ui/admin-web</workingDirectory>
-              <executable>node/node</executable>
+              <executable>${basedir}/src/main/resources/ui/admin-web/node/${executable.node}</executable>
               <arguments>
-                <argument>node_modules/bower/bin/bower</argument>
+                <argument>${basedir}/src/main/resources/ui/admin-web/node_modules/bower/bin/bower</argument>
                 <argument>install</argument>
                 <argument>--allow-root</argument>
               </arguments>
@@ -115,9 +115,9 @@
             </goals>
             <configuration>
               <workingDirectory>${basedir}/src/main/resources/ui/admin-web</workingDirectory>
-              <executable>node/node</executable>
+              <executable>${basedir}/src/main/resources/ui/admin-web/node/${executable.node}</executable>
               <arguments>
-                <argument>node_modules/gulp/bin/gulp</argument>
+                <argument>${basedir}/src/main/resources/ui/admin-web/node_modules/gulp/bin/gulp</argument>
                 <argument>build</argument>
               </arguments>
             </configuration>
@@ -215,4 +215,30 @@
       </resource>
     </resources>
   </build>
+    <profiles>
+    <profile>
+        <id>windows</id>
+        <activation>
+            <os>
+                <family>win</family>
+            </os>
+        </activation>
+        <properties>
+            <envClassifier>win</envClassifier>
+            <executable.node>node.exe</executable.node>
+        </properties>
+    </profile>
+    <profile>
+        <id>linux</id>
+        <activation>
+            <os>
+                <family>unix</family>
+            </os>
+        </activation>
+        <properties>
+            <envClassifier>linux</envClassifier>
+            <executable.node>node</executable.node>
+        </properties>
+    </profile>
+  </profiles>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-agent/conf/windows/ambari-agent.cmd
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/windows/ambari-agent.cmd b/ambari-agent/conf/windows/ambari-agent.cmd
new file mode 100644
index 0000000..e159be4
--- /dev/null
+++ b/ambari-agent/conf/windows/ambari-agent.cmd
@@ -0,0 +1,18 @@
+@echo off
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements.  See the NOTICE file distributed with
+REM this work for additional information rega4rding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License.  You may obtain a copy of the License at
+REM
+REM     http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+
+call ambari-env.cmd
+powershell -ExecutionPolicy unrestricted -File ambari-agent.ps1 %*

http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-agent/conf/windows/ambari-agent.ini
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/windows/ambari-agent.ini b/ambari-agent/conf/windows/ambari-agent.ini
new file mode 100644
index 0000000..377dbf4
--- /dev/null
+++ b/ambari-agent/conf/windows/ambari-agent.ini
@@ -0,0 +1,54 @@
+# 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
+
+[server]
+hostname=localhost
+url_port=8440
+secured_url_port=8441
+
+[agent]
+prefix=data
+tmp_dir=\\var\\lib\\ambari-agent\\data\\tmp
+;loglevel=(DEBUG/INFO)
+loglevel=INFO
+data_cleanup_interval=86400
+data_cleanup_max_age=2592000
+data_cleanup_max_size_MB = 100
+ping_port=8670
+cache_dir=cache
+tolerate_download_failures=true
+
+[command]
+maxretries=2
+sleepBetweenRetries=1
+
+[security]
+keysdir=keys
+server_crt=ca.crt
+passphrase_env_var_name=AMBARI_PASSPHRASE
+
+[services]
+pidLookupPath=\\var\\run\\ambari-agent
+
+[heartbeat]
+state_interval=6
+dirs=/etc/hadoop,/etc/hadoop/conf,/etc/hbase,/etc/hcatalog,/etc/hive,/etc/oozie,
+  /etc/sqoop,/etc/ganglia,/etc/nagios,
+  /var/run/hadoop,/var/run/zookeeper,/var/run/hbase,/var/run/templeton,/var/run/oozie,
+  /var/log/hadoop,/var/log/zookeeper,/var/log/hbase,/var/run/templeton,/var/log/hive,
+  /var/log/nagios
+rpms=nagios,ganglia,
+  hadoop,hadoop-lzo,hbase,oozie,sqoop,pig,zookeeper,hive,libconfuse,ambari-log4j
+; 0 - unlimited
+log_lines_count=300

http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-agent/conf/windows/ambari-agent.ps1
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/windows/ambari-agent.ps1 b/ambari-agent/conf/windows/ambari-agent.ps1
new file mode 100644
index 0000000..6958523
--- /dev/null
+++ b/ambari-agent/conf/windows/ambari-agent.ps1
@@ -0,0 +1,245 @@
+# 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
+
+# description: ambari-agent service
+# processname: ambari-agent
+
+$VERSION="1.3.0-SNAPSHOT"
+$HASH="testhash"
+
+switch ($($args[0])){
+  "--version" {
+    echo "$VERSION"
+    exit 0
+  }
+  "--hash" {
+    echo "$HASH"
+    exit 0
+  }
+}
+
+$AMBARI_AGENT="ambari-agent"
+$AMBARI_SVC_NAME = "Ambari Agent"
+$current_directory = (Get-Item -Path ".\" -Verbose).FullName
+#environment variables used in python, check if they exists, otherwise set them to $current_directory
+#and pass to child python process
+$Env:PYTHONPATH="$current_directory\sbin;$($Env:PYTHONPATH)"
+$Env:PYTHON = "python.exe"
+
+$AMBARI_LOG_DIR="\var\log\ambari-agent"
+$OUTFILE_STDOUT=Join-Path -path $AMBARI_LOG_DIR -childpath "ambari-agent.stdout"
+$OUTFILE_STDERR=Join-Path -path $AMBARI_LOG_DIR -childpath "ambari-agent.stderr"
+$LOGFILE=Join-Path -path $AMBARI_LOG_DIR -childpath "ambari-agent.log"
+$AMBARI_AGENT_PY_SCRIPT=Join-Path -path $PSScriptRoot -childpath "sbin\service_wrapper.py"
+if($AMBARI_AGENT_PY_SCRIPT.Contains(' '))
+{
+  $AMBARI_AGENT_PY_SCRIPT = """" + $AMBARI_AGENT_PY_SCRIPT + """"
+}
+
+$OK=1
+$NOTOK=0
+
+$retcode=0
+
+function _exit($code)
+{
+  $host.SetShouldExit($code)
+  exit $code
+}
+
+function _detect_python()
+{
+  if(![boolean]$(Get-Command $Env:PYTHON -ErrorAction SilentlyContinue))
+  {
+    echo "ERROR: Can not find python.exe in PATH. Add python executable to PATH and try again."
+    _exit(1)
+  }
+}
+
+function _echo([switch]$off)
+{
+  if($off)
+  {
+    try
+    {
+      stop-transcript|out-null
+    }
+    catch [System.InvalidOperationException]
+    {}
+  }
+  else
+  {
+    try
+    {
+      start-transcript|out-null
+    }
+    catch [System.InvalidOperationException]
+    {}
+  }
+}
+
+Function _pstart_brief($cmd_args)
+{
+  #start python with -u to make stdout and stderr unbuffered
+  $arguments = @("-u",$AMBARI_AGENT_PY_SCRIPT) + $cmd_args
+
+  $psi = New-Object System.Diagnostics.ProcessStartInfo
+
+  $psi.RedirectStandardError = $True
+  $psi.RedirectStandardOutput = $True
+
+  $psi.UseShellExecute = $False
+
+  $psi.FileName = $Env:PYTHON
+  $psi.Arguments = $arguments
+  #$psi.WindowStyle = WindowStyle.Hidden
+
+  $process = [Diagnostics.Process]::Start($psi)
+
+  $process.WaitForExit()
+
+  Write-Output $process.StandardOutput.ReadToEnd()
+}
+
+Function _start($cmd_args)
+{
+  echo "Starting $AMBARI_SVC_NAME..."
+  _echo -off
+
+  _pstart_brief($cmd_args)
+
+  $cnt = 0
+  do
+  {
+    Start-Sleep -Milliseconds 250
+    $svc = Get-Service -Name $AMBARI_SVC_NAME
+    $cnt += 1
+    if ($cnt -eq 120)
+    {
+      echo "$AMBARI_SVC_NAME still starting...".
+      return
+    }
+  }
+  until($svc.status -eq "Running")
+
+  echo "$AMBARI_SVC_NAME is running"
+}
+
+Function _pstart($cmd_args)
+{
+  New-Item -ItemType Directory -Force -Path $AMBARI_LOG_DIR | Out-Null
+  $arguments = @($AMBARI_AGENT_PY_SCRIPT) + $cmd_args
+  $p = New-Object System.Diagnostics.Process
+  $p.StartInfo.UseShellExecute = $false
+  $p.StartInfo.FileName = $Env:PYTHON
+  $p.StartInfo.Arguments = $arguments
+  [void]$p.Start();
+
+  echo "Verifying $AMBARI_AGENT process status..."
+  if (!$p){
+    echo "ERROR: $AMBARI_AGENT start failed"
+    $host.SetShouldExit(-1)
+    exit
+  }
+  echo "Agent log at: $LOGFILE"
+
+  $p.WaitForExit()
+}
+
+Function _pstart_ioredir($cmd_args)
+{
+  New-Item -ItemType Directory -Force -Path $AMBARI_LOG_DIR | Out-Null
+
+  #start python with -u to make stdout and stderr unbuffered
+  $arguments = @("-u",$AMBARI_AGENT_PY_SCRIPT) + $cmd_args
+  $process = Start-Process -FilePath $Env:PYTHON -ArgumentList $arguments -WindowStyle Hidden -RedirectStandardError $OUTFILE_STDERR -RedirectStandardOutput $OUTFILE_STDOUT -PassThru
+  echo "Verifying $AMBARI_AGENT process status..."
+  if (!$process){
+    echo "ERROR: $AMBARI_AGENT start failed"
+    $host.SetShouldExit(-1)
+    exit
+  }
+  echo "Agent stdout at: $OUTFILE_STDOUT"
+  echo "Agent stderr at: $OUTFILE_STDERR"
+  echo "Agent log at: $LOGFILE"
+
+  $process.WaitForExit()
+}
+
+Function _stop($cmd_args){
+  echo "Stopping $AMBARI_SVC_NAME..."
+
+  _pstart_brief($cmd_args)
+
+  $cnt = 0
+  do
+  {
+    Start-Sleep -Milliseconds 250
+    $svc = Get-Service -Name $AMBARI_SVC_NAME
+    $cnt += 1
+    if ($cnt -eq 40)
+    {
+      echo "$AMBARI_SVC_NAME still stopping...".
+      return
+    }
+  }
+  until($svc.status -eq "Stopped")
+
+  echo "$AMBARI_SVC_NAME is stopped"
+}
+
+Function _status($cmd_args){
+  echo "Getting $AMBARI_SVC_NAME status..."
+
+  _pstart_brief($cmd_args)
+}
+
+# check for python before any action
+_detect_python
+switch ($($args[0])){
+  "start"
+  {
+    _start $args
+  }
+  "debug"
+  {
+    echo "Starting ambari-agent"
+    _pstart_ioredir $args
+    echo "Ambari Agent finished"
+  }
+  "stop" {_stop $args}
+  "restart"
+  {
+    _stop @("stop")
+    _start @("start")
+  }
+  "status" {_status $args}
+  "setup"
+  {
+    echo "Installing ambari-agent"
+    _pstart $args
+    echo "Ambari Agent installation finished"
+  }
+  default
+  {
+    echo "Usage: ambari-agent {start|stop|restart|setup|status} [options]"
+    echo "Use ambari-agent <action> --help to get details on options available."
+    echo "Or, simply invoke ambari-agent.py --help to print the options."
+    $retcode=1
+  }
+}
+
+$host.SetShouldExit($retcode)
+exit

http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-agent/conf/windows/ambari-env.cmd
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/windows/ambari-env.cmd b/ambari-agent/conf/windows/ambari-env.cmd
new file mode 100644
index 0000000..6e0c317
--- /dev/null
+++ b/ambari-agent/conf/windows/ambari-env.cmd
@@ -0,0 +1,22 @@
+@echo off
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements.  See the NOTICE file distributed with
+REM this work for additional information rega4rding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License.  You may obtain a copy of the License at
+REM
+REM     http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+
+set SERVICE_NAME=Ambari Agent
+REM REM set AMBARI_AGENT_CONF_DIR=C:\work\test\agent
+REM set AMBARI_AGENT_LOG_DIR=logs
+set AGENT_SERVICE_WRAPPER=sbin\service_wrapper.py
+REM python exe that will be used for command execution(must have access to pywin32 and agent python code)
+set PYTHON_EXE=C:\Python27\python.exe

http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-agent/conf/windows/createservice.ps1
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/windows/createservice.ps1 b/ambari-agent/conf/windows/createservice.ps1
new file mode 100644
index 0000000..f3936e2
--- /dev/null
+++ b/ambari-agent/conf/windows/createservice.ps1
@@ -0,0 +1,195 @@
+# 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
+
+param(
+  [String]
+  [Parameter(Mandatory=$true )]
+  $username,
+  [String]
+  [Parameter(Mandatory=$true )]
+  $password,
+  [String]
+  [Parameter(Mandatory=$true )]
+  $servicename,
+  [String]
+  [Parameter(Mandatory=$true )]
+  $hdpResourcesDir,
+  [String]
+  [Parameter(Mandatory=$true )]
+  $servicecmdpath
+  )
+
+function Invoke-Cmd ($command)
+{
+  Write-Output $command
+  $out = cmd.exe /C "$command" 2>&1
+  Write-Output $out
+  return $out
+}
+
+function Invoke-CmdChk ($command)
+{
+  Write-Output $command
+  $out = cmd.exe /C "$command" 2>&1
+  Write-Output $out
+  if (-not ($LastExitCode  -eq 0))
+  {
+    throw "Command `"$out`" failed with exit code $LastExitCode "
+  }
+  return $out
+}
+
+### Stops and deletes the Hadoop service.
+function StopAndDeleteHadoopService(
+  [String]
+  [Parameter( Position=0, Mandatory=$true )]
+  $service
+)
+{
+  Write-Output "Stopping $service"
+  $s = Get-Service $service -ErrorAction SilentlyContinue
+
+  if( $s -ne $null )
+  {
+    Stop-Service $service
+    $cmd = "sc.exe delete $service"
+    Invoke-Cmd $cmd
+  }
+}
+
+# Convenience method for processing command-line credential objects
+# Assumes $credentialsHash is a hash with one of the following being true:
+#  - keys "username" and "password"/"passwordBase64" are set to strings
+#  - key "credentialFilePath" is set to the path of a serialized PSCredential object
+function Get-HadoopUserCredentials($credentialsHash)
+{
+  Write-Output "Using provided credentials for username $($credentialsHash["username"])" | Out-Null
+  $username = $credentialsHash["username"]
+  if($username -notlike "*\*")
+  {
+    $username = "$ENV:COMPUTERNAME\$username"
+  }
+  $securePassword = $credentialsHash["password"] | ConvertTo-SecureString -AsPlainText -Force
+  $creds = New-Object System.Management.Automation.PSCredential $username, $securePassword
+  return $creds
+}
+
+### Creates and configures the service.
+function CreateAndConfigureHadoopService(
+  [String]
+  [Parameter( Position=0, Mandatory=$true )]
+  $service,
+  [String]
+  [Parameter( Position=1, Mandatory=$true )]
+  $hdpResourcesDir,
+  [String]
+  [Parameter( Position=2, Mandatory=$true )]
+  $serviceBinDir,
+  [String]
+  [Parameter( Position=3, Mandatory=$true )]
+  $servicecmdpath,
+  [System.Management.Automation.PSCredential]
+  [Parameter( Position=4, Mandatory=$true )]
+  $serviceCredential
+)
+{
+  if ( -not ( Get-Service "$service" -ErrorAction SilentlyContinue ) )
+  {
+    Write-Output "Creating service `"$service`" as $serviceBinDir\$service.exe"
+    $xcopyServiceHost_cmd = "copy /Y `"$hdpResourcesDir\namenode.exe`" `"$serviceBinDir\$service.exe`""
+    Invoke-CmdChk $xcopyServiceHost_cmd
+
+    #HadoopServiceHost.exe will write to this log but does not create it
+    #Creating the event log needs to be done from an elevated process, so we do it here
+    if( -not ([Diagnostics.EventLog]::SourceExists( "$service" )))
+    {
+      [Diagnostics.EventLog]::CreateEventSource( "$service", "" )
+    }
+    Write-Output "Adding service $service"
+    if ($serviceCredential.Password.get_Length() -ne 0)
+    {
+      $s = New-Service -Name "$service" -BinaryPathName "$serviceBinDir\$service.exe" -Credential $serviceCredential -DisplayName "Apache Hadoop $service"
+      if ( $s -eq $null )
+      {
+        throw "CreateAndConfigureHadoopService: Service `"$service`" creation failed"
+      }
+    }
+    else
+    {
+      # Separately handle case when password is not provided
+      # this path is used for creating services that run under (AD) Managed Service Account
+      # for them password is not provided and in that case service cannot be created using New-Service commandlet
+      $serviceUserName = $serviceCredential.UserName
+      $cred = $serviceCredential.UserName.Split("\")
+
+      # Throw exception if domain is not specified
+      if (($cred.Length -lt 2) -or ($cred[0] -eq "."))
+      {
+        throw "Environment is not AD or domain is not specified"
+      }
+
+      $cmd="$ENV:WINDIR\system32\sc.exe create `"$service`" binPath= `"$serviceBinDir\$service.exe`" obj= $serviceUserName DisplayName= `"Apache Hadoop $service`" "
+      try
+      {
+        Invoke-CmdChk $cmd
+      }
+      catch
+      {
+        throw "CreateAndConfigureHadoopService: Service `"$service`" creation failed"
+      }
+    }
+
+    $cmd="$ENV:WINDIR\system32\sc.exe failure $service reset= 30 actions= restart/5000"
+    Invoke-CmdChk $cmd
+
+    $cmd="$ENV:WINDIR\system32\sc.exe config $service start= demand"
+    Invoke-CmdChk $cmd
+
+
+    Write-Output "Creating service config ${serviceBinDir}\$service.xml"
+    $cmd = "$servicecmdpath --service $service > `"$serviceBinDir\$service.xml`""
+    Invoke-CmdChk $cmd
+  }
+  else
+  {
+    Write-Output "Service `"$service`" already exists, Removing `"$service`""
+    StopAndDeleteHadoopService $service
+    CreateAndConfigureHadoopService $service $hdpResourcesDir $serviceBinDir $servicecmdpath $serviceCredential
+  }
+}
+
+
+try
+{
+  Write-Output "Creating credential object"
+  ###
+  ### Create the Credential object from the given username and password or the provided credentials file
+  ###
+  $serviceCredential = Get-HadoopUserCredentials -credentialsHash @{"username" = $username; "password" = $password}
+  $username = $serviceCredential.UserName
+  Write-Output "Username: $username"
+
+  Write-Output "Creating service $service"
+  ###
+  ### Create Service
+  ###
+  CreateAndConfigureHadoopService $servicename $hdpResourcesDir $hdpResourcesDir $servicecmdpath $serviceCredential
+  Write-Output "Done"
+}
+catch
+{
+  Write-Output "Failure"
+  exit 1
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-agent/conf/windows/service_wrapper.py
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/windows/service_wrapper.py b/ambari-agent/conf/windows/service_wrapper.py
new file mode 100644
index 0000000..aaf32ca
--- /dev/null
+++ b/ambari-agent/conf/windows/service_wrapper.py
@@ -0,0 +1,227 @@
+'''
+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 optparse
+import sys
+
+import win32serviceutil
+import win32api
+import win32event
+import win32service
+
+from ambari_commons.ambari_service import AmbariService
+from ambari_commons.exceptions import *
+from ambari_commons.logging_utils import *
+from ambari_commons.os_windows import WinServiceController
+from ambari_agent.AmbariConfig import *
+from ambari_agent.HeartbeatHandlers_windows import HeartbeatStopHandler
+
+AMBARI_VERSION_VAR = "AMBARI_VERSION_VAR"
+
+ENV_PYTHONPATH = "PYTHONPATH"
+
+
+def parse_options():
+  # parse env cmd
+  with open(os.path.join(os.getcwd(), "ambari-env.cmd"), "r") as env_cmd:
+    content = env_cmd.readlines()
+  for line in content:
+    if line.startswith("set"):
+      name, value = line[4:].split("=")
+      os.environ[name] = value.rstrip()
+  # checking env variables, and fallback to working dir if no env var was founded
+  if not os.environ.has_key("AMBARI_AGENT_CONF_DIR"):
+    os.environ["AMBARI_AGENT_CONF_DIR"] = os.getcwd()
+  if not os.environ.has_key("AMBARI_AGENT_LOG_DIR"):
+    os.environ["AMBARI_AGENT_LOG_DIR"] = os.path.join("\\", "var", "log", "ambari-agent")
+  if not os.path.exists(os.environ["AMBARI_AGENT_LOG_DIR"]):
+    os.makedirs(os.environ["AMBARI_AGENT_LOG_DIR"])
+
+
+class AmbariAgentService(AmbariService):
+  AmbariService._svc_name_ = "Ambari Agent"
+  AmbariService._svc_display_name_ = "Ambari Agent"
+  AmbariService._svc_description_ = "Ambari Agent"
+
+  AmbariService._AdjustServiceVersion()
+
+  heartbeat_stop_handler = None
+
+  def SvcDoRun(self):
+    parse_options()
+    self.redirect_output_streams()
+
+    # Soft dependency on the Windows Time service
+    ensure_time_service_is_started()
+
+    self.heartbeat_stop_handler = HeartbeatStopHandler(self._heventSvcStop)
+
+    self.ReportServiceStatus(win32service.SERVICE_RUNNING)
+
+    from ambari_agent import main
+
+    main.main(self.heartbeat_stop_handler)
+
+  def _InitOptionsParser(self):
+    return init_options_parser()
+
+  def redirect_output_streams(self):
+    self._RedirectOutputStreamsToFile(AmbariConfig.getOutFile())
+    pass
+
+
+def ensure_time_service_is_started():
+  ret = WinServiceController.EnsureServiceIsStarted("W32Time")
+  if 0 != ret:
+    raise FatalException(-1, "Error starting Windows Time service: " + string(ret))
+  pass
+
+
+def ctrlHandler(ctrlType):
+  AmbariAgentService.DefCtrlCHandler()
+  return True
+
+
+def svcsetup():
+  AmbariAgentService.set_ctrl_c_handler(ctrlHandler)
+  AmbariAgentService.Install()
+  pass
+
+
+#
+# Starts the Ambari Agent as a service.
+# Start the Agent in normal mode, as a Windows service. If the Ambari Agent is
+# not registered as a service, the function fails. By default, only one instance of the service can
+#     possibly run.
+#
+def svcstart(options):
+  if 0 != AmbariAgentService.Start(15):
+    options.exit_message = None
+  pass
+
+
+#
+# Stops the Ambari Agent.
+#
+def svcstop(options):
+  if 0 != AmbariAgentService.Stop():
+    options.exit_message = None
+
+
+#
+# The Ambari Agent status.
+#
+def svcstatus(options):
+  options.exit_message = None
+
+  statusStr = AmbariAgentService.QueryStatus()
+  print "Ambari Agent is " + statusStr
+
+
+def svcdebug(options):
+  sys.frozen = 'windows_exe'  # Fake py2exe so we can debug
+
+  AmbariAgentService.set_ctrl_c_handler(ctrlHandler)
+  win32serviceutil.HandleCommandLine(AmbariAgentService, options)
+
+
+def init_options_parser():
+  parser = optparse.OptionParser(usage="usage: %prog action [options]", )
+  parser.add_option('-r', '--hostname', dest="host_name", default="localhost",
+    help="Use specified Ambari server host for registration.")
+  parser.add_option('-j', '--java-home', dest="java_home", default=None,
+    help="Use specified java_home.  Must be valid on all hosts")
+  parser.add_option("-v", "--verbose",
+    action="store_true", dest="verbose", default=False,
+    help="Print verbose status messages")
+  parser.add_option("-s", "--silent",
+    action="store_true", dest="silent", default=False,
+    help="Silently accepts default prompt values")
+  parser.add_option('--jdbc-driver', default=None,
+    help="Specifies the path to the JDBC driver JAR file for the " \
+         "database type specified with the --jdbc-db option. Used only with --jdbc-db option.",
+    dest="jdbc_driver")
+  return parser
+
+
+#
+# Main.
+#
+def agent_main():
+  parser = init_options_parser()
+  (options, args) = parser.parse_args()
+
+  options.warnings = []
+
+  if len(args) == 0:
+    print parser.print_help()
+    parser.error("No action entered")
+
+  action = args[0]
+  possible_args_numbers = [1]
+
+  matches = 0
+  for args_number_required in possible_args_numbers:
+    matches += int(len(args) == args_number_required)
+
+  if matches == 0:
+    print parser.print_help()
+    possible_args = ' or '.join(str(x) for x in possible_args_numbers)
+    parser.error("Invalid number of arguments. Entered: " + str(len(args)) + ", required: " + possible_args)
+
+  options.exit_message = "Ambari Agent '%s' completed successfully." % action
+  try:
+    if action == SETUP_ACTION:
+      #TODO Insert setup(options) here upon need
+      svcsetup()
+    elif action == START_ACTION:
+      svcstart(options)
+    elif action == DEBUG_ACTION:
+      svcdebug(options)
+    elif action == STOP_ACTION:
+      svcstop(options)
+    elif action == STATUS_ACTION:
+      svcstatus(options)
+    else:
+      parser.error("Invalid action")
+
+    if options.warnings:
+      for warning in options.warnings:
+        print_warning_msg(warning)
+        pass
+      options.exit_message = "Ambari Agent '%s' completed with warnings." % action
+      pass
+  except FatalException as e:
+    if e.reason is not None:
+      print_error_msg("Exiting with exit code {0}. \nREASON: {1}".format(e.code, e.reason))
+    sys.exit(e.code)
+  except NonFatalException as e:
+    options.exit_message = "Ambari Agent '%s' completed with warnings." % action
+    if e.reason is not None:
+      print_warning_msg(e.reason)
+
+  if options.exit_message is not None:
+    print options.exit_message
+
+
+if __name__ == '__main__':
+  try:
+    agent_main()
+  except (KeyboardInterrupt, EOFError):
+    print("\nAborting ... Keyboard Interrupt.")
+    sys.exit(1)

http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-agent/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index 9db343b..c7e0b9d 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -103,19 +103,26 @@
         </executions>
       </plugin>
       <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <skip>${skipSurefireTests}</skip>
+        </configuration>
+      </plugin>
+      <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>exec-maven-plugin</artifactId>
         <version>1.2</version>
         <executions>
           <execution>
             <configuration>
-              <executable>${project.basedir}/../ambari-common/src/main/unix/ambari-python-wrap</executable>
+              <executable>${executable.python}</executable>
               <workingDirectory>src/test/python</workingDirectory>
               <arguments>
                 <argument>unitTests.py</argument>
               </arguments>
               <environmentVariables>
-                <PYTHONPATH>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2:${project.basedir}/../ambari-common/src/main/python/ambari_commons:${project.basedir}/../ambari-common/src/main/python/resource_management:${project.basedir}/../ambari-common/src/test/python:${project.basedir}/../ambari-common/src/main/python:${project.basedir}/src/main/python/ambari_agent:${project.basedir}/src/test/python/ambari_agent:${project.basedir}/src/test/python/resource_management:${project.basedir}/src/main/python:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/files:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/files:$PYTHONPATH</PYTHONPATH>
+                <PYTHONPATH>${path.python.1}${pathsep}$PYTHONPATH</PYTHONPATH>
               </environmentVariables>
               <skip>${skipTests}</skip>
             </configuration>
@@ -128,15 +135,15 @@
           <execution>
             <!-- TODO: Looks like section is unused, maybe remove? -->
             <configuration>
-              <executable>${project.basedir}/../ambari-common/src/main/unix/ambari-python-wrap</executable>
-              <workingDirectory>target/ambari-agent-${project.version}</workingDirectory>
+              <executable>${executable.python}</executable>
+              <workingDirectory>target${dirsep}ambari-agent-${project.version}</workingDirectory>
               <arguments>
-                <argument>${project.basedir}/src/main/python/setup.py</argument>
+                <argument>${project.basedir}${dirsep}src${dirsep}main${dirsep}python${dirsep}setup.py</argument>
                 <argument>clean</argument>
                 <argument>bdist_dumb</argument>
               </arguments>
               <environmentVariables>
-                <PYTHONPATH>target/ambari-agent-${project.version}:$PYTHONPATH</PYTHONPATH>
+                <PYTHONPATH>target${dirsep}ambari-agent-${project.version}${pathsep}$PYTHONPATH</PYTHONPATH>
               </environmentVariables>
             </configuration>
             <id>python-package</id>
@@ -147,14 +154,14 @@
           </execution>
           <execution>
             <configuration>
-              <executable>${project.basedir}/../ambari-common/src/main/unix/ambari-python-wrap</executable>
+              <executable>${executable.python}</executable>
               <workingDirectory>${basedir}</workingDirectory>
               <arguments>
                 <argument>${resource.keeper.script}</argument>
                 <argument>${target.cache.dir}</argument>
               </arguments>
               <environmentVariables>
-                <PYTHONPATH>target/ambari-agent-${project.version}:$PYTHONPATH</PYTHONPATH>
+                <PYTHONPATH>target${dirsep}ambari-agent-${project.version}${pathsep}$PYTHONPATH</PYTHONPATH>
               </environmentVariables>
             </configuration>
             <id>generate-hash-files</id>
@@ -213,7 +220,7 @@
               <groupname>root</groupname>
               <sources>
                 <source>
-                  <location>${project.build.directory}/${project.artifactId}-${project.version}/ambari_agent</location>
+                  <location>${project.build.directory}${dirsep}${project.artifactId}-${project.version}${dirsep}ambari_agent</location>
                 </source>
               </sources>
             </mapping>
@@ -637,6 +644,7 @@
             <exclude>**/*.erb</exclude>
             <exclude>**/*.json</exclude>
             <exclude>**/*.pydevproject</exclude>
+            <exclude>**/*.wxs</exclude>
           </excludes>
         </configuration>
         <executions>
@@ -674,6 +682,153 @@
   </build>
   <profiles>
     <profile>
+     <id>windows</id>
+     <activation>
+      <os>
+        <family>win</family>
+      </os>
+     </activation>
+     <properties>
+      <envClassifier>win</envClassifier>
+      <dirsep>\</dirsep>
+      <pathsep>;</pathsep>
+      <stack.distribution>HDPWIN</stack.distribution>
+      <executable.python>python</executable.python>
+      <executable.shell>cmd</executable.shell>
+      <fileextension.shell>cmd</fileextension.shell>
+      <fileextension.dot.shell-default>.cmd</fileextension.dot.shell-default>
+      <path.python.1>${project.basedir}\..\ambari-common\src\main\python;${project.basedir}\..\ambari-agent\src\main\python;${project.basedir}\..\ambari-common\src\main\python\ambari_jinja2;${project.basedir}\..\ambari-common\src\main\python\ambari_commons;${project.basedir}\..\ambari-common\src\test\python;${project.basedir}\src\main\python;${project.basedir}\src\main\python\ambari_agent;${project.basedir}\src\main\python\resource_management;${project.basedir}\src\test\python;${project.basedir}\src\test\python\ambari_agent;${project.basedir}\src\test\python\resource_management;${project.basedir}\..\ambari-server\src\test\python;${project.basedir}\..\ambari-server\src\main\resources\stacks\HDP\2.0.6\services\HDFS\package\files;${project.basedir}\..\ambari-server\src\main\resources\stacks\HDP\1.3.2\services\HDFS\package\files</path.python.1>
+     </properties>
+    </profile>
+    <profile>
+     <id>linux</id>
+     <activation>
+      <os>
+        <family>unix</family>
+      </os>
+     </activation>
+     <properties>
+      <envClassifier>linux</envClassifier>
+      <dirsep>/</dirsep>
+      <pathsep>:</pathsep>
+      <stack.distribution>HDP</stack.distribution>
+      <executable.python>${project.basedir}/../ambari-common/src/main/unix/ambari-python-wrap</executable.python>
+      <executable.shell>sh</executable.shell>
+      <fileextension.shell>sh</fileextension.shell>
+      <fileextension.dot.shell-default></fileextension.dot.shell-default>
+      <path.python.1>${project.basedir}/../ambari-common/src/main/python:${project.basedir}/../ambari-agent/src/main/python:${project.basedir}/../ambari-common/src/main/python/ambari_jinja2:${project.basedir}/../ambari-common/src/main/python/ambari_commons:${project.basedir}/../ambari-common/src/test/python:${project.basedir}/src/main/python:${project.basedir}/src/main/python/ambari_agent:${project.basedir}/src/main/python/resource_management:${project.basedir}/src/test/python:${project.basedir}/src/test/python/ambari_agent:${project.basedir}/src/test/python/resource_management:${project.basedir}/../ambari-server/src/test/python:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/files:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/files</path.python.1>
+     </properties>
+    </profile>
+    <profile>
+      <id>windows-distro</id>
+      <activation>
+        <os>
+          <family>Windows</family>
+        </os>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-assembly-plugin</artifactId>
+            <configuration>
+              <tarLongFileMode>gnu</tarLongFileMode>
+              <descriptors>
+                <descriptor>src/packages/tarball/all.xml</descriptor>
+                <descriptor>src/packages/windows.xml</descriptor>
+              </descriptors>
+            </configuration>
+            <executions>
+              <execution>
+                <id>build-windows-zip</id>
+                <phase>prepare-package</phase>
+                <goals>
+                  <goal>single</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- msi creation -->
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>1.2</version>
+            <executions>
+              <execution>
+                <id>run-heat</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>exec</goal>
+                </goals>
+                <configuration>
+                  <executable>heat.exe</executable>
+                  <arguments>
+                    <argument>dir</argument>
+                    <argument>"."</argument>
+                    <argument>-dr</argument>
+                    <argument>"AMBARI_AGENT_1.3.0_SNAPSHOT"</argument>
+                    <argument>-platform</argument>
+                    <argument>Win64</argument>
+                    <argument>-cg</argument>
+                    <argument>"AmbariAgentGroup"</argument>
+                    <argument>-gg</argument>
+                    <argument>-ke</argument>
+                    <argument>-srd</argument>
+                    <argument>-o</argument>
+                    <argument>".\..\ambari-agent-files.wxs"</argument>
+                  </arguments>
+                  <workingDirectory>${basedir}/target/${final.name}-windows-dist</workingDirectory>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.npanday.plugins</groupId>
+            <artifactId>wix-maven-plugin</artifactId>
+            <version>1.4.0-incubating</version>
+            <extensions>true</extensions>
+            <configuration>
+              <sourceFiles>
+                <sourceFile>src/main/package/msi/ambari-agent.wxs</sourceFile>
+                <sourceFile>target/ambari-agent-files.wxs</sourceFile>
+              </sourceFiles>
+              <outputDirectory>target</outputDirectory>
+              <objectFiles>
+                <objectFile>target/ambari-agent.wixobj</objectFile>
+                <objectFile>target/ambari-agent-files.wixobj</objectFile>
+              </objectFiles>
+              <outputFile>target/ambari-agent-${project.version}.msi</outputFile>
+              <extensions>
+                <extension>WixUIExtension</extension>
+              </extensions>
+            </configuration>
+            <executions>
+              <execution>
+                <id>wix-candle</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>candle</goal>
+                </goals>
+                <configuration>
+                  <arguments>-arch x64</arguments>
+                </configuration>
+              </execution>
+              <execution>
+                <id>wix-light</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>light</goal>
+                </goals>
+                <configuration>
+                  <arguments>-b ${basedir}/target/${final.name}-windows-dist</arguments>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+            <!-- end msi creation -->
+        </plugins>
+      </build>
+    </profile>
+    <profile>
       <id>suse11</id>
       <properties>
         <init.d.dir>/etc/init.d</init.d.dir>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-agent/src/main/package/msi/ambari-agent.wxs
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/package/msi/ambari-agent.wxs b/ambari-agent/src/main/package/msi/ambari-agent.wxs
new file mode 100644
index 0000000..cc2b8d8
--- /dev/null
+++ b/ambari-agent/src/main/package/msi/ambari-agent.wxs
@@ -0,0 +1,38 @@
+<?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.
+-->
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+  <Product Id="BA555A14-081D-4521-9B35-BC37C50CF5A9" Name="Ambari Agent 1.3.0-SNAPSHOT" Language="1033"
+           Version="1.3.0.0" Manufacturer="Apache Software Foundation"
+           UpgradeCode="6A5C01ED-C9B3-45C0-8A69-4512AC9F65F7">
+    <Package Description="Ambari Agent for Windows" Comments="Ambari Agent for Windows" InstallerVersion="200"
+             Compressed="yes" Platform="x64"/>
+    <Media Id="1" Cabinet="simple.cab" EmbedCab="yes"/>
+    <Directory Id="TARGETDIR" Name="SourceDir">
+      <Directory Id="ProgramFiles64Folder">
+        <Directory Id="AMBARI_AGENT_1.3.0_SNAPSHOT" Name="ambari-agent-1.3.0-SNAPSHOT">
+        </Directory>
+      </Directory>
+    </Directory>
+    <Feature Id="DefaultFeature" Title="Main Feature" Level="1">
+      <ComponentGroupRef Id="AmbariAgentGroup"/>
+    </Feature>
+    <Property Id="WIXUI_INSTALLDIR" Value="AMBARI_AGENT_1.3.0_SNAPSHOT"/>
+    <UI/>
+    <UIRef Id="WixUI_InstallDir"/>
+  </Product>
+</Wix>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index 094975d..4ecb822 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -153,11 +153,11 @@ class ActionQueue(threading.Thread):
     while not self.backgroundCommandQueue.empty():
       try:
         command = self.backgroundCommandQueue.get(False)
-        if(command.has_key('__handle') and command['__handle'].status == None): 
+        if(command.has_key('__handle') and command['__handle'].status == None):
           self.process_command(command)
       except (Queue.Empty):
         pass
-  
+
   def processStatusCommandQueueSafeEmpty(self):
     while not self.statusCommandQueue.empty():
       try:
@@ -215,17 +215,17 @@ class ActionQueue(threading.Thread):
       'status': self.IN_PROGRESS_STATUS
     })
     self.commandStatuses.put_command_status(command, in_progress_status)
-    
+
     # running command
     commandresult = self.customServiceOrchestrator.runCommand(command,
       in_progress_status['tmpout'], in_progress_status['tmperr'])
-   
-    
+
+
     # dumping results
     if isCommandBackground:
       return
     else:
-      status = self.COMPLETED_STATUS if commandresult['exitcode'] == 0 else self.FAILED_STATUS  
+      status = self.COMPLETED_STATUS if commandresult['exitcode'] == 0 else self.FAILED_STATUS
     roleResult = self.commandStatuses.generate_report_template(command)
     roleResult.update({
       'stdout': commandresult['stdout'],
@@ -250,18 +250,18 @@ class ActionQueue(threading.Thread):
     # let ambari know that configuration tags were applied
     if status == self.COMPLETED_STATUS:
       configHandler = ActualConfigHandler(self.config, self.configTags)
-      #update 
+      #update
       if command.has_key('forceRefreshConfigTags') and len(command['forceRefreshConfigTags']) > 0  :
-        
+
         forceRefreshConfigTags = command['forceRefreshConfigTags']
         logger.info("Got refresh additional component tags command")
-        
+
         for configTag in forceRefreshConfigTags :
           configHandler.update_component_tag(command['role'], configTag, command['configurationTags'][configTag])
-        
+
         roleResult['customCommand'] = self.CUSTOM_COMMAND_RESTART # force restart for component to evict stale_config on server side
         command['configurationTags'] = configHandler.read_actual_component(command['role'])
-        
+
       if command.has_key('configurationTags'):
         configHandler.write_actual(command['configurationTags'])
         roleResult['configurationTags'] = command['configurationTags']
@@ -288,17 +288,17 @@ class ActionQueue(threading.Thread):
     logger.debug('Start callback: %s' % process_condenced_result)
     logger.debug('The handle is: %s' % handle)
     status = self.COMPLETED_STATUS if handle.exitCode == 0 else self.FAILED_STATUS
-    
+
     aborted_postfix = self.customServiceOrchestrator.command_canceled_reason(handle.command['taskId'])
     if aborted_postfix:
       status = self.FAILED_STATUS
       logger.debug('Set status to: %s , reason = %s' % (status, aborted_postfix))
     else:
       aborted_postfix = ''
-      
-    
+
+
     roleResult = self.commandStatuses.generate_report_template(handle.command)
-    
+
     roleResult.update({
       'stdout': process_condenced_result['stdout'] + aborted_postfix,
       'stderr': process_condenced_result['stderr'] + aborted_postfix,
@@ -306,7 +306,7 @@ class ActionQueue(threading.Thread):
       'structuredOut': str(json.dumps(process_condenced_result['structuredOut'])) if 'structuredOut' in process_condenced_result else '',
       'status': status,
     })
-    
+
     self.commandStatuses.put_command_status(handle.command, roleResult)
 
   def execute_status_command(self, command):
@@ -371,11 +371,10 @@ class ActionQueue(threading.Thread):
     """
     Actions that are executed every time when command status changes
     """
-    self.controller.heartbeat_wait_event.set()
+    self.controller.trigger_heartbeat()
 
   # Removes all commands from the queue
   def reset(self):
     queue = self.commandQueue
     with queue.mutex:
       queue.queue.clear()
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-agent/src/main/python/ambari_agent/AgentConfig_linux.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/AgentConfig_linux.py b/ambari-agent/src/main/python/ambari_agent/AgentConfig_linux.py
new file mode 100644
index 0000000..a90b8ba
--- /dev/null
+++ b/ambari-agent/src/main/python/ambari_agent/AgentConfig_linux.py
@@ -0,0 +1,229 @@
+#!/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
+
+content = """
+
+[server]
+hostname=localhost
+url_port=8440
+secured_url_port=8441
+
+[agent]
+prefix=/tmp/ambari-agent
+tmp_dir=/tmp/ambari-agent/tmp
+data_cleanup_interval=86400
+data_cleanup_max_age=2592000
+data_cleanup_max_size_MB = 100
+ping_port=8670
+cache_dir=/var/lib/ambari-agent/cache
+
+[services]
+
+[python]
+custom_actions_dir = /var/lib/ambari-agent/resources/custom_actions
+
+[command]
+maxretries=2
+sleepBetweenRetries=1
+
+[security]
+keysdir=/tmp/ambari-agent
+server_crt=ca.crt
+passphrase_env_var_name=AMBARI_PASSPHRASE
+
+[heartbeat]
+state_interval = 6
+dirs=/etc/hadoop,/etc/hadoop/conf,/var/run/hadoop,/var/log/hadoop
+log_lines_count=300
+
+"""
+
+imports = [
+  "hdp/manifests/*.pp",
+  "hdp-hadoop/manifests/*.pp",
+  "hdp-hbase/manifests/*.pp",
+  "hdp-zookeeper/manifests/*.pp",
+  "hdp-oozie/manifests/*.pp",
+  "hdp-pig/manifests/*.pp",
+  "hdp-sqoop/manifests/*.pp",
+  "hdp-templeton/manifests/*.pp",
+  "hdp-hive/manifests/*.pp",
+  "hdp-hcat/manifests/*.pp",
+  "hdp-mysql/manifests/*.pp",
+  "hdp-monitor-webserver/manifests/*.pp",
+  "hdp-repos/manifests/*.pp"
+]
+
+rolesToClass = {
+  'GLUSTERFS': 'hdp-hadoop::glusterfs',
+  'GLUSTERFS_CLIENT': 'hdp-hadoop::glusterfs_client',
+  'GLUSTERFS_SERVICE_CHECK': 'hdp-hadoop::glusterfs_service_check',
+  'NAMENODE': 'hdp-hadoop::namenode',
+  'DATANODE': 'hdp-hadoop::datanode',
+  'SECONDARY_NAMENODE': 'hdp-hadoop::snamenode',
+  'JOBTRACKER': 'hdp-hadoop::jobtracker',
+  'TASKTRACKER': 'hdp-hadoop::tasktracker',
+  'RESOURCEMANAGER': 'hdp-yarn::resourcemanager',
+  'NODEMANAGER': 'hdp-yarn::nodemanager',
+  'HISTORYSERVER': 'hdp-yarn::historyserver',
+  'YARN_CLIENT': 'hdp-yarn::yarn_client',
+  'HDFS_CLIENT': 'hdp-hadoop::client',
+  'MAPREDUCE_CLIENT': 'hdp-hadoop::client',
+  'MAPREDUCE2_CLIENT': 'hdp-yarn::mapreducev2_client',
+  'ZOOKEEPER_SERVER': 'hdp-zookeeper',
+  'ZOOKEEPER_CLIENT': 'hdp-zookeeper::client',
+  'HBASE_MASTER': 'hdp-hbase::master',
+  'HBASE_REGIONSERVER': 'hdp-hbase::regionserver',
+  'HBASE_CLIENT': 'hdp-hbase::client',
+  'PIG': 'hdp-pig',
+  'SQOOP': 'hdp-sqoop',
+  'OOZIE_SERVER': 'hdp-oozie::server',
+  'OOZIE_CLIENT': 'hdp-oozie::client',
+  'HIVE_CLIENT': 'hdp-hive::client',
+  'HCAT': 'hdp-hcat',
+  'HIVE_SERVER': 'hdp-hive::server',
+  'HIVE_METASTORE': 'hdp-hive::metastore',
+  'MYSQL_SERVER': 'hdp-mysql::server',
+  'WEBHCAT_SERVER': 'hdp-templeton::server',
+  'DASHBOARD': 'hdp-dashboard',
+  'GANGLIA_SERVER': 'hdp-ganglia::server',
+  'GANGLIA_MONITOR': 'hdp-ganglia::monitor',
+  'HTTPD': 'hdp-monitor-webserver',
+  'HUE_SERVER': 'hdp-hue::server',
+  'HDFS_SERVICE_CHECK': 'hdp-hadoop::hdfs::service_check',
+  'MAPREDUCE_SERVICE_CHECK': 'hdp-hadoop::mapred::service_check',
+  'MAPREDUCE2_SERVICE_CHECK': 'hdp-yarn::mapred2::service_check',
+  'ZOOKEEPER_SERVICE_CHECK': 'hdp-zookeeper::zookeeper::service_check',
+  'ZOOKEEPER_QUORUM_SERVICE_CHECK': 'hdp-zookeeper::quorum::service_check',
+  'HBASE_SERVICE_CHECK': 'hdp-hbase::hbase::service_check',
+  'HIVE_SERVICE_CHECK': 'hdp-hive::hive::service_check',
+  'HCAT_SERVICE_CHECK': 'hdp-hcat::hcat::service_check',
+  'OOZIE_SERVICE_CHECK': 'hdp-oozie::oozie::service_check',
+  'PIG_SERVICE_CHECK': 'hdp-pig::pig::service_check',
+  'SQOOP_SERVICE_CHECK': 'hdp-sqoop::sqoop::service_check',
+  'WEBHCAT_SERVICE_CHECK': 'hdp-templeton::templeton::service_check',
+  'DASHBOARD_SERVICE_CHECK': 'hdp-dashboard::dashboard::service_check',
+  'DECOMMISSION_DATANODE': 'hdp-hadoop::hdfs::decommission',
+  'HUE_SERVICE_CHECK': 'hdp-hue::service_check',
+  'RESOURCEMANAGER_SERVICE_CHECK': 'hdp-yarn::resourcemanager::service_check',
+  'HISTORYSERVER_SERVICE_CHECK': 'hdp-yarn::historyserver::service_check',
+  'TEZ_CLIENT': 'hdp-tez::tez_client',
+  'YARN_SERVICE_CHECK': 'hdp-yarn::yarn::service_check',
+  'FLUME_SERVER': 'hdp-flume',
+  'JOURNALNODE': 'hdp-hadoop::journalnode',
+  'ZKFC': 'hdp-hadoop::zkfc'
+}
+
+serviceStates = {
+  'START': 'running',
+  'INSTALL': 'installed_and_configured',
+  'STOP': 'stopped'
+}
+
+servicesToPidNames = {
+  'GLUSTERFS' : 'glusterd.pid$',
+  'NAMENODE': 'hadoop-{USER}-namenode.pid$',
+  'SECONDARY_NAMENODE': 'hadoop-{USER}-secondarynamenode.pid$',
+  'DATANODE': 'hadoop-{USER}-datanode.pid$',
+  'JOBTRACKER': 'hadoop-{USER}-jobtracker.pid$',
+  'TASKTRACKER': 'hadoop-{USER}-tasktracker.pid$',
+  'RESOURCEMANAGER': 'yarn-{USER}-resourcemanager.pid$',
+  'NODEMANAGER': 'yarn-{USER}-nodemanager.pid$',
+  'HISTORYSERVER': 'mapred-{USER}-historyserver.pid$',
+  'JOURNALNODE': 'hadoop-{USER}-journalnode.pid$',
+  'ZKFC': 'hadoop-{USER}-zkfc.pid$',
+  'OOZIE_SERVER': 'oozie.pid',
+  'ZOOKEEPER_SERVER': 'zookeeper_server.pid',
+  'FLUME_SERVER': 'flume-node.pid',
+  'TEMPLETON_SERVER': 'templeton.pid',
+  'GANGLIA_SERVER': 'gmetad.pid',
+  'GANGLIA_MONITOR': 'gmond.pid',
+  'HBASE_MASTER': 'hbase-{USER}-master.pid',
+  'HBASE_REGIONSERVER': 'hbase-{USER}-regionserver.pid',
+  'HCATALOG_SERVER': 'webhcat.pid',
+  'KERBEROS_SERVER': 'kadmind.pid',
+  'HIVE_SERVER': 'hive-server.pid',
+  'HIVE_METASTORE': 'hive.pid',
+  'MYSQL_SERVER': 'mysqld.pid',
+  'HUE_SERVER': '/var/run/hue/supervisor.pid',
+  'WEBHCAT_SERVER': 'webhcat.pid',
+}
+
+#Each service, which's pid depends on user should provide user mapping
+servicesToLinuxUser = {
+  'NAMENODE': 'hdfs_user',
+  'SECONDARY_NAMENODE': 'hdfs_user',
+  'DATANODE': 'hdfs_user',
+  'JOURNALNODE': 'hdfs_user',
+  'ZKFC': 'hdfs_user',
+  'JOBTRACKER': 'mapred_user',
+  'TASKTRACKER': 'mapred_user',
+  'RESOURCEMANAGER': 'yarn_user',
+  'NODEMANAGER': 'yarn_user',
+  'HISTORYSERVER': 'mapred_user',
+  'HBASE_MASTER': 'hbase_user',
+  'HBASE_REGIONSERVER': 'hbase_user',
+}
+
+pidPathVars = [
+  {'var' : 'glusterfs_pid_dir_prefix',
+    'defaultValue' : '/var/run'},
+  {'var' : 'hadoop_pid_dir_prefix',
+    'defaultValue' : '/var/run/hadoop'},
+  {'var' : 'hadoop_pid_dir_prefix',
+    'defaultValue' : '/var/run/hadoop'},
+  {'var' : 'ganglia_runtime_dir',
+    'defaultValue' : '/var/run/ganglia/hdp'},
+  {'var' : 'hbase_pid_dir',
+    'defaultValue' : '/var/run/hbase'},
+  {'var' : 'zk_pid_dir',
+    'defaultValue' : '/var/run/zookeeper'},
+  {'var' : 'oozie_pid_dir',
+    'defaultValue' : '/var/run/oozie'},
+  {'var' : 'hcat_pid_dir',
+    'defaultValue' : '/var/run/webhcat'},
+  {'var' : 'hive_pid_dir',
+    'defaultValue' : '/var/run/hive'},
+  {'var' : 'mysqld_pid_dir',
+    'defaultValue' : '/var/run/mysqld'},
+  {'var' : 'hcat_pid_dir',
+    'defaultValue' : '/var/run/webhcat'},
+  {'var' : 'yarn_pid_dir_prefix',
+    'defaultValue' : '/var/run/hadoop-yarn'},
+  {'var' : 'mapred_pid_dir_prefix',
+    'defaultValue' : '/var/run/hadoop-mapreduce'},
+]
+
+if 'AMBARI_AGENT_CONF_DIR' in os.environ:
+  configFile = os.path.join(os.environ['AMBARI_AGENT_CONF_DIR'], "ambari-agent.ini")
+else:
+  configFile = "/etc/ambari-agent/conf/ambari-agent.ini"
+
+if 'AMBARI_AGENT_LOG_DIR' in os.environ:
+  logfile = os.path.join(os.environ['AMBARI_AGENT_LOG_DIR'], "ambari-agent.log")
+else:
+  logfile = "/var/log/ambari-agent/ambari-agent.log"
+
+if 'AMBARI_AGENT_OUT_DIR' in os.environ:
+  outfile = os.path.join(os.environ['AMBARI_AGENT_OUT_DIR'], "ambari-agent.out")
+else:
+  outfile = "/var/log/ambari-agent/ambari-agent.out"

http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-agent/src/main/python/ambari_agent/AgentConfig_windows.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/AgentConfig_windows.py b/ambari-agent/src/main/python/ambari_agent/AgentConfig_windows.py
new file mode 100644
index 0000000..e5e1b22
--- /dev/null
+++ b/ambari-agent/src/main/python/ambari_agent/AgentConfig_windows.py
@@ -0,0 +1,232 @@
+#!/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
+
+content = """
+
+[server]
+hostname=localhost
+url_port=8440
+secured_url_port=8441
+
+[agent]
+prefix=\\tmp\\ambari-agent
+data_cleanup_interval=86400
+data_cleanup_max_age=2592000
+ping_port=8670
+cache_dir=\\var\\lib\\ambari-agent\\cache
+
+[services]
+
+[python]
+custom_actions_dir = \\var\\lib\\ambari-agent\\resources\\custom_actions
+
+[command]
+maxretries=2
+sleepBetweenRetries=1
+
+[security]
+keysdir=\\tmp\\ambari-agent
+server_crt=ca.crt
+passphrase_env_var_name=AMBARI_PASSPHRASE
+
+[heartbeat]
+state_interval = 6
+dirs=\\etc\\hadoop,\\etc\\hadoop\\conf,\\var\\run\\hadoop,\\var\\log\\hadoop
+rpms=glusterfs,openssl,wget,net-snmp,ntpd,ganglia,nagios,glusterfs
+log_lines_count=300
+
+"""
+
+imports = [
+  "hdp\\manifests\\*.pp",
+  "hdp-hadoop\\manifests\\*.pp",
+  "hdp-hbase\\manifests\\*.pp",
+  "hdp-zookeeper\\manifests\\*.pp",
+  "hdp-oozie\\manifests\\*.pp",
+  "hdp-pig\\manifests\\*.pp",
+  "hdp-sqoop\\manifests\\*.pp",
+  "hdp-templeton\\manifests\\*.pp",
+  "hdp-hive\\manifests\\*.pp",
+  "hdp-hcat\\manifests\\*.pp",
+  "hdp-mysql\\manifests\\*.pp",
+  "hdp-monitor-webserver\\manifests\\*.pp",
+  "hdp-repos\\manifests\\*.pp"
+]
+
+rolesToClass = {
+  'GLUSTERFS': 'hdp-hadoop::glusterfs',
+  'GLUSTERFS_CLIENT': 'hdp-hadoop::glusterfs_client',
+  'GLUSTERFS_SERVICE_CHECK': 'hdp-hadoop::glusterfs_service_check',
+  'NAMENODE': 'hdp-hadoop::namenode',
+  'DATANODE': 'hdp-hadoop::datanode',
+  'SECONDARY_NAMENODE': 'hdp-hadoop::snamenode',
+  'JOBTRACKER': 'hdp-hadoop::jobtracker',
+  'TASKTRACKER': 'hdp-hadoop::tasktracker',
+  'RESOURCEMANAGER': 'hdp-yarn::resourcemanager',
+  'NODEMANAGER': 'hdp-yarn::nodemanager',
+  'HISTORYSERVER': 'hdp-yarn::historyserver',
+  'YARN_CLIENT': 'hdp-yarn::yarn_client',
+  'HDFS_CLIENT': 'hdp-hadoop::client',
+  'MAPREDUCE_CLIENT': 'hdp-hadoop::client',
+  'MAPREDUCE2_CLIENT': 'hdp-yarn::mapreducev2_client',
+  'ZOOKEEPER_SERVER': 'hdp-zookeeper',
+  'ZOOKEEPER_CLIENT': 'hdp-zookeeper::client',
+  'HBASE_MASTER': 'hdp-hbase::master',
+  'HBASE_REGIONSERVER': 'hdp-hbase::regionserver',
+  'HBASE_CLIENT': 'hdp-hbase::client',
+  'PIG': 'hdp-pig',
+  'SQOOP': 'hdp-sqoop',
+  'OOZIE_SERVER': 'hdp-oozie::server',
+  'OOZIE_CLIENT': 'hdp-oozie::client',
+  'HIVE_CLIENT': 'hdp-hive::client',
+  'HCAT': 'hdp-hcat',
+  'HIVE_SERVER': 'hdp-hive::server',
+  'HIVE_METASTORE': 'hdp-hive::metastore',
+  'MYSQL_SERVER': 'hdp-mysql::server',
+  'WEBHCAT_SERVER': 'hdp-templeton::server',
+  'DASHBOARD': 'hdp-dashboard',
+  'NAGIOS_SERVER': 'hdp-nagios::server',
+  'GANGLIA_SERVER': 'hdp-ganglia::server',
+  'GANGLIA_MONITOR': 'hdp-ganglia::monitor',
+  'HTTPD': 'hdp-monitor-webserver',
+  'HUE_SERVER': 'hdp-hue::server',
+  'HDFS_SERVICE_CHECK': 'hdp-hadoop::hdfs::service_check',
+  'MAPREDUCE_SERVICE_CHECK': 'hdp-hadoop::mapred::service_check',
+  'MAPREDUCE2_SERVICE_CHECK': 'hdp-yarn::mapred2::service_check',
+  'ZOOKEEPER_SERVICE_CHECK': 'hdp-zookeeper::zookeeper::service_check',
+  'ZOOKEEPER_QUORUM_SERVICE_CHECK': 'hdp-zookeeper::quorum::service_check',
+  'HBASE_SERVICE_CHECK': 'hdp-hbase::hbase::service_check',
+  'HIVE_SERVICE_CHECK': 'hdp-hive::hive::service_check',
+  'HCAT_SERVICE_CHECK': 'hdp-hcat::hcat::service_check',
+  'OOZIE_SERVICE_CHECK': 'hdp-oozie::oozie::service_check',
+  'PIG_SERVICE_CHECK': 'hdp-pig::pig::service_check',
+  'SQOOP_SERVICE_CHECK': 'hdp-sqoop::sqoop::service_check',
+  'WEBHCAT_SERVICE_CHECK': 'hdp-templeton::templeton::service_check',
+  'DASHBOARD_SERVICE_CHECK': 'hdp-dashboard::dashboard::service_check',
+  'DECOMMISSION_DATANODE': 'hdp-hadoop::hdfs::decommission',
+  'HUE_SERVICE_CHECK': 'hdp-hue::service_check',
+  'RESOURCEMANAGER_SERVICE_CHECK': 'hdp-yarn::resourcemanager::service_check',
+  'HISTORYSERVER_SERVICE_CHECK': 'hdp-yarn::historyserver::service_check',
+  'TEZ_CLIENT': 'hdp-tez::tez_client',
+  'YARN_SERVICE_CHECK': 'hdp-yarn::yarn::service_check',
+  'FLUME_SERVER': 'hdp-flume',
+  'JOURNALNODE': 'hdp-hadoop::journalnode',
+  'ZKFC': 'hdp-hadoop::zkfc'
+}
+
+serviceStates = {
+  'START': 'running',
+  'INSTALL': 'installed_and_configured',
+  'STOP': 'stopped'
+}
+
+servicesToPidNames = {
+  'GLUSTERFS' : 'glusterd.pid$',
+  'NAMENODE': 'hadoop-{USER}-namenode.pid$',
+  'SECONDARY_NAMENODE': 'hadoop-{USER}-secondarynamenode.pid$',
+  'DATANODE': 'hadoop-{USER}-datanode.pid$',
+  'JOBTRACKER': 'hadoop-{USER}-jobtracker.pid$',
+  'TASKTRACKER': 'hadoop-{USER}-tasktracker.pid$',
+  'RESOURCEMANAGER': 'yarn-{USER}-resourcemanager.pid$',
+  'NODEMANAGER': 'yarn-{USER}-nodemanager.pid$',
+  'HISTORYSERVER': 'mapred-{USER}-historyserver.pid$',
+  'JOURNALNODE': 'hadoop-{USER}-journalnode.pid$',
+  'ZKFC': 'hadoop-{USER}-zkfc.pid$',
+  'OOZIE_SERVER': 'oozie.pid',
+  'ZOOKEEPER_SERVER': 'zookeeper_server.pid',
+  'FLUME_SERVER': 'flume-node.pid',
+  'TEMPLETON_SERVER': 'templeton.pid',
+  'NAGIOS_SERVER': 'nagios.pid',
+  'GANGLIA_SERVER': 'gmetad.pid',
+  'GANGLIA_MONITOR': 'gmond.pid',
+  'HBASE_MASTER': 'hbase-{USER}-master.pid',
+  'HBASE_REGIONSERVER': 'hbase-{USER}-regionserver.pid',
+  'HCATALOG_SERVER': 'webhcat.pid',
+  'KERBEROS_SERVER': 'kadmind.pid',
+  'HIVE_SERVER': 'hive-server.pid',
+  'HIVE_METASTORE': 'hive.pid',
+  'MYSQL_SERVER': 'mysqld.pid',
+  'HUE_SERVER': '\\var\\run\\hue\\supervisor.pid',
+  'WEBHCAT_SERVER': 'webhcat.pid',
+}
+
+#Each service, which's pid depends on user should provide user mapping
+servicesToLinuxUser = {
+  'NAMENODE': 'hdfs_user',
+  'SECONDARY_NAMENODE': 'hdfs_user',
+  'DATANODE': 'hdfs_user',
+  'JOURNALNODE': 'hdfs_user',
+  'ZKFC': 'hdfs_user',
+  'JOBTRACKER': 'mapred_user',
+  'TASKTRACKER': 'mapred_user',
+  'RESOURCEMANAGER': 'yarn_user',
+  'NODEMANAGER': 'yarn_user',
+  'HISTORYSERVER': 'mapred_user',
+  'HBASE_MASTER': 'hbase_user',
+  'HBASE_REGIONSERVER': 'hbase_user',
+}
+
+pidPathVars = [
+  {'var' : 'glusterfs_pid_dir_prefix',
+   'defaultValue' : '\\var\\run'},
+  {'var' : 'hadoop_pid_dir_prefix',
+   'defaultValue' : '\\var\\run\\hadoop'},
+  {'var' : 'hadoop_pid_dir_prefix',
+   'defaultValue' : '\\var\\run\\hadoop'},
+  {'var' : 'ganglia_runtime_dir',
+   'defaultValue' : '\\var\\run\\ganglia\\hdp'},
+  {'var' : 'hbase_pid_dir',
+   'defaultValue' : '\\var\\run\\hbase'},
+  {'var' : '',
+   'defaultValue' : '\\var\\run\\nagios'},
+  {'var' : 'zk_pid_dir',
+   'defaultValue' : '\\var\\run\\zookeeper'},
+  {'var' : 'oozie_pid_dir',
+   'defaultValue' : '\\var\\run\\oozie'},
+  {'var' : 'hcat_pid_dir',
+   'defaultValue' : '\\var\\run\\webhcat'},
+  {'var' : 'hive_pid_dir',
+   'defaultValue' : '\\var\\run\\hive'},
+  {'var' : 'mysqld_pid_dir',
+   'defaultValue' : '\\var\\run\\mysqld'},
+  {'var' : 'hcat_pid_dir',
+   'defaultValue' : '\\var\\run\\webhcat'},
+  {'var' : 'yarn_pid_dir_prefix',
+   'defaultValue' : '\\var\\run\\hadoop-yarn'},
+  {'var' : 'mapred_pid_dir_prefix',
+   'defaultValue' : '\\var\\run\\hadoop-mapreduce'},
+]
+
+if 'AMBARI_AGENT_CONF_DIR' in os.environ:
+  configFile = os.path.join(os.environ['AMBARI_AGENT_CONF_DIR'], "ambari-agent.ini")
+else:
+  configFile = "ambari-agent.ini"
+
+if 'AMBARI_AGENT_LOG_DIR' in os.environ:
+  logfile = os.path.join(os.environ['AMBARI_AGENT_LOG_DIR'], "ambari-agent.log")
+else:
+  logfile = "\\var\\log\\ambari-agent-1.3.0-SNAPSHOT\\ambari-agent.log"
+
+if 'AMBARI_AGENT_OUT_DIR' in os.environ:
+  outfile = os.path.join(os.environ['AMBARI_AGENT_OUT_DIR'], "ambari-agent.out")
+else:
+  outfile = "\\var\\log\\ambari-agent-1.3.0-SNAPSHOT\\ambari-agent.out"

http://git-wip-us.apache.org/repos/asf/ambari/blob/8de3425f/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py b/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
index 79433b7..e029620 100644
--- a/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
+++ b/ambari-agent/src/main/python/ambari_agent/AmbariAgent.py
@@ -23,8 +23,14 @@ import sys
 import subprocess
 from Controller import AGENT_AUTO_RESTART_EXIT_CODE
 
-AGENT_SCRIPT = "/usr/lib/python2.6/site-packages/ambari_agent/main.py"
-AGENT_PID_FILE = "/var/run/ambari-agent/ambari-agent.pid"
+if os.environ.has_key("PYTHON_BIN"):
+  AGENT_SCRIPT = os.path.join(os.environ["PYTHON_BIN"],"site-packages/ambari_agent/main.py")
+else:
+  AGENT_SCRIPT = "/usr/lib/python2.6/site-packages/ambari_agent/main.py"
+if os.environ.has_key("AMBARI_PID_DIR"):
+  AGENT_SCRIPT = os.path.join(os.environ["AMBARI_PID_DIR"],"ambari-agent.pid")
+else:
+  AGENT_PID_FILE = "/var/run/ambari-agent/ambari-agent.pid"
 # AGENT_AUTO_RESTART_EXIT_CODE = 77 is exit code which we return when restart_agent() is called
 status = AGENT_AUTO_RESTART_EXIT_CODE
 


Mime
View raw message