ambari git commit: AMBARI-15021. Set AMBARI_METRICS as the default datasource. (Prajwal Rao via yusaku)

2016-02-11 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 4d61fa1b1 -> bf8ecffed


AMBARI-15021. Set AMBARI_METRICS as the default datasource. (Prajwal Rao via 
yusaku)


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

Branch: refs/heads/branch-2.2
Commit: bf8ecffedb07d59cf2ed10c0d57fd26fc2a68e4d
Parents: 4d61fa1
Author: Yusaku Sako 
Authored: Thu Feb 11 19:12:39 2016 -0800
Committer: Yusaku Sako 
Committed: Thu Feb 11 19:13:10 2016 -0800

--
 .../0.1.0/package/templates/metrics_grafana_datasource.json.j2   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/bf8ecffe/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
index a803da5..da04668 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
@@ -28,6 +28,6 @@
   "basicAuthUser": "",
   "basicAuthPassword": "",
   "withCredentials": false,
-  "isDefault": false,
+  "isDefault": true,
   "jsonData": {}
-}
\ No newline at end of file
+}



ambari git commit: AMBARI-15021. Set AMBARI_METRICS as the default datasource. (Prajwal Rao via yusaku)

2016-02-11 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk 6eed33322 -> c47fff357


AMBARI-15021. Set AMBARI_METRICS as the default datasource. (Prajwal Rao via 
yusaku)


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

Branch: refs/heads/trunk
Commit: c47fff3576382e0e4efcd9f8b952b7362cec4390
Parents: 6eed333
Author: Yusaku Sako 
Authored: Thu Feb 11 19:12:39 2016 -0800
Committer: Yusaku Sako 
Committed: Thu Feb 11 19:12:39 2016 -0800

--
 .../0.1.0/package/templates/metrics_grafana_datasource.json.j2   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c47fff35/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
index a803da5..da04668 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
@@ -28,6 +28,6 @@
   "basicAuthUser": "",
   "basicAuthPassword": "",
   "withCredentials": false,
-  "isDefault": false,
+  "isDefault": true,
   "jsonData": {}
-}
\ No newline at end of file
+}



ambari git commit: AMBARI-14715. TimelineServer configuration is missing in yarn-env.xml. (Akira Ajisaka via yusaku)

2016-02-11 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 575ed11e2 -> 4d61fa1b1


AMBARI-14715. TimelineServer configuration is missing in yarn-env.xml. (Akira 
Ajisaka via yusaku)


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

Branch: refs/heads/branch-2.2
Commit: 4d61fa1b1a004ed34c06209fa5fd1ba69b6b78c9
Parents: 575ed11
Author: Yusaku Sako 
Authored: Thu Feb 11 19:10:13 2016 -0800
Committer: Yusaku Sako 
Committed: Thu Feb 11 19:10:52 2016 -0800

--
 .../stacks/HDP/2.3/services/YARN/configuration/yarn-env.xml| 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4d61fa1b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-env.xml
index 699463b..74fd4f6 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-env.xml
@@ -102,14 +102,14 @@
   # or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
   export YARN_NODEMANAGER_HEAPSIZE={{nodemanager_heapsize}}
 
-  # Specify the max Heapsize for the HistoryManager using a numerical value
+  # Specify the max Heapsize for the timeline server using a numerical 
value
   # in the scale of MB. For example, to specify an jvm option of 
-Xmx1000m, set
   # the value to 1024.
   # This value will be overridden by an Xmx setting specified in either 
YARN_OPTS
-  # and/or YARN_HISTORYSERVER_OPTS.
+  # and/or YARN_TIMELINESERVER_OPTS.
   # If not specified, the default value will be picked from either 
YARN_HEAPMAX
   # or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
-  export YARN_HISTORYSERVER_HEAPSIZE={{apptimelineserver_heapsize}}
+  export YARN_TIMELINESERVER_HEAPSIZE={{apptimelineserver_heapsize}}
 
   # Specify the JVM options to be used when starting the NodeManager.
   # These options will be appended to the options specified as YARN_OPTS



ambari git commit: AMBARI-14715. TimelineServer configuration is missing in yarn-env.xml. (Akira Ajisaka via yusaku)

2016-02-11 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk 6ffe51450 -> 6eed33322


AMBARI-14715. TimelineServer configuration is missing in yarn-env.xml. (Akira 
Ajisaka via yusaku)


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

Branch: refs/heads/trunk
Commit: 6eed33322291c90c03386b72806fc3be461df5ec
Parents: 6ffe514
Author: Yusaku Sako 
Authored: Thu Feb 11 19:10:13 2016 -0800
Committer: Yusaku Sako 
Committed: Thu Feb 11 19:10:13 2016 -0800

--
 .../stacks/HDP/2.3/services/YARN/configuration/yarn-env.xml| 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6eed3332/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-env.xml
index e802b24..6bc283d 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/yarn-env.xml
@@ -102,14 +102,14 @@
   # or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
   export YARN_NODEMANAGER_HEAPSIZE={{nodemanager_heapsize}}
 
-  # Specify the max Heapsize for the HistoryManager using a numerical value
+  # Specify the max Heapsize for the timeline server using a numerical 
value
   # in the scale of MB. For example, to specify an jvm option of 
-Xmx1000m, set
   # the value to 1024.
   # This value will be overridden by an Xmx setting specified in either 
YARN_OPTS
-  # and/or YARN_HISTORYSERVER_OPTS.
+  # and/or YARN_TIMELINESERVER_OPTS.
   # If not specified, the default value will be picked from either 
YARN_HEAPMAX
   # or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
-  export YARN_HISTORYSERVER_HEAPSIZE={{apptimelineserver_heapsize}}
+  export YARN_TIMELINESERVER_HEAPSIZE={{apptimelineserver_heapsize}}
 
   # Specify the JVM options to be used when starting the NodeManager.
   # These options will be appended to the options specified as YARN_OPTS



ambari git commit: AMBARI-14945. Some options have not been applied on Ambari Metrics Collector. (Masahiro TANAKA via swagle)

2016-02-11 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/trunk 1ead25056 -> 6ffe51450


AMBARI-14945. Some options have not been applied on Ambari Metrics Collector. 
(Masahiro TANAKA via swagle)


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

Branch: refs/heads/trunk
Commit: 6ffe51450d359a9ad076083a0db8976d6d95c74f
Parents: 1ead250
Author: Siddharth Wagle 
Authored: Thu Feb 11 17:17:36 2016 -0800
Committer: Siddharth Wagle 
Committed: Thu Feb 11 17:17:36 2016 -0800

--
 .../conf/unix/ambari-metrics-collector | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6ffe5145/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
index bf2fc47..f83af50 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
@@ -261,7 +261,7 @@ function start()
 rm -f "${PIDFILE}" >/dev/null 2>&1
   fi
 
-  nohup "${JAVA}" "-Xms$AMS_COLLECTOR_HEAPSIZE" "-Xmx$AMS_COLLECTOR_HEAPSIZE" 
"${AMS_COLLECTOR_OPTS}" "-cp" 
"/usr/lib/ambari-metrics-collector/*:${COLLECTOR_CONF_DIR}" 
"-Djava.net.preferIPv4Stack=true" "-Dams.log.dir=${AMS_COLLECTOR_LOG_DIR}" 
"-Dproc_${DAEMON_NAME}" "${CLASS}" "$@" > $OUTFILE 2>&1 &
+  nohup "${JAVA}" "-Xms$AMS_COLLECTOR_HEAPSIZE" "-Xmx$AMS_COLLECTOR_HEAPSIZE" 
${AMS_COLLECTOR_OPTS} "-cp" 
"/usr/lib/ambari-metrics-collector/*:${COLLECTOR_CONF_DIR}" 
"-Djava.net.preferIPv4Stack=true" "-Dams.log.dir=${AMS_COLLECTOR_LOG_DIR}" 
"-Dproc_${DAEMON_NAME}" "${CLASS}" "$@" > $OUTFILE 2>&1 &
   PID=$!
   write_pidfile "${PIDFILE}"
   sleep 2



ambari git commit: AMBARI-14945. Some options have not been applied on Ambari Metrics Collector. (Masahiro TANAKA via swagle)

2016-02-11 Thread swagle
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 371d3c975 -> 575ed11e2


AMBARI-14945. Some options have not been applied on Ambari Metrics Collector. 
(Masahiro TANAKA via swagle)


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

Branch: refs/heads/branch-2.2
Commit: 575ed11e2f000360226bb455ca4b4e73ec04415e
Parents: 371d3c9
Author: Siddharth Wagle 
Authored: Thu Feb 11 17:16:56 2016 -0800
Committer: Siddharth Wagle 
Committed: Thu Feb 11 17:16:56 2016 -0800

--
 .../conf/unix/ambari-metrics-collector | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/575ed11e/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
index bf2fc47..f83af50 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
@@ -261,7 +261,7 @@ function start()
 rm -f "${PIDFILE}" >/dev/null 2>&1
   fi
 
-  nohup "${JAVA}" "-Xms$AMS_COLLECTOR_HEAPSIZE" "-Xmx$AMS_COLLECTOR_HEAPSIZE" 
"${AMS_COLLECTOR_OPTS}" "-cp" 
"/usr/lib/ambari-metrics-collector/*:${COLLECTOR_CONF_DIR}" 
"-Djava.net.preferIPv4Stack=true" "-Dams.log.dir=${AMS_COLLECTOR_LOG_DIR}" 
"-Dproc_${DAEMON_NAME}" "${CLASS}" "$@" > $OUTFILE 2>&1 &
+  nohup "${JAVA}" "-Xms$AMS_COLLECTOR_HEAPSIZE" "-Xmx$AMS_COLLECTOR_HEAPSIZE" 
${AMS_COLLECTOR_OPTS} "-cp" 
"/usr/lib/ambari-metrics-collector/*:${COLLECTOR_CONF_DIR}" 
"-Djava.net.preferIPv4Stack=true" "-Dams.log.dir=${AMS_COLLECTOR_LOG_DIR}" 
"-Dproc_${DAEMON_NAME}" "${CLASS}" "$@" > $OUTFILE 2>&1 &
   PID=$!
   write_pidfile "${PIDFILE}"
   sleep 2



ambari git commit: AMBARI-15004. RU/EU: Upgrading Oozie database fails since new configs are not yet written to /usr/hdp/current/oozie-server/conf (alejandro)

2016-02-11 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 56403ce9a -> 371d3c975


AMBARI-15004. RU/EU: Upgrading Oozie database fails since new configs are not 
yet written to /usr/hdp/current/oozie-server/conf (alejandro)


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

Branch: refs/heads/branch-2.2
Commit: 371d3c97513ce80ccd4a8dd482afcf33b9ec81e0
Parents: 56403ce
Author: Alejandro Fernandez 
Authored: Wed Feb 10 11:25:50 2016 -0800
Committer: Alejandro Fernandez 
Committed: Thu Feb 11 17:10:40 2016 -0800

--
 .../state/stack/upgrade/ClusterGrouping.java|  7 
 .../state/stack/upgrade/ExecuteHostType.java|  7 
 .../state/stack/upgrade/TaskWrapperBuilder.java | 15 +++-
 .../4.0.0.2.0/package/scripts/oozie_server.py   | 36 ++--
 .../package/scripts/oozie_server_upgrade.py |  4 ++-
 .../4.0.0.2.0/package/scripts/params_linux.py   |  3 ++
 .../HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml |  3 +-
 .../HDP/2.2/upgrades/nonrolling-upgrade-2.2.xml |  5 ++-
 .../HDP/2.2/upgrades/nonrolling-upgrade-2.3.xml |  5 ++-
 .../HDP/2.2/upgrades/nonrolling-upgrade-2.4.xml |  5 ++-
 .../stacks/HDP/2.2/upgrades/upgrade-2.2.xml |  5 ++-
 .../stacks/HDP/2.2/upgrades/upgrade-2.3.xml |  5 ++-
 .../stacks/HDP/2.2/upgrades/upgrade-2.4.xml |  5 ++-
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml |  5 ++-
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml |  5 ++-
 .../stacks/HDP/2.3/upgrades/upgrade-2.3.xml |  5 ++-
 .../stacks/HDP/2.3/upgrades/upgrade-2.4.xml |  5 ++-
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml |  5 ++-
 .../stacks/HDP/2.4/upgrades/upgrade-2.4.xml |  5 ++-
 19 files changed, 109 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/371d3c97/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
index 5e21da5..8fb6ef5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
@@ -232,6 +232,13 @@ public class ClusterGrouping extends Grouping {
   realHosts = Collections.singleton(hosts.hosts.iterator().next());
 }
 
+// Pick the first host sorted alphabetically (case insensitive)
+if (ExecuteHostType.FIRST == et.hosts && !hosts.hosts.isEmpty()) {
+  List sortedHosts = new ArrayList<>(hosts.hosts);
+  Collections.sort(sortedHosts, String.CASE_INSENSITIVE_ORDER);
+  realHosts = Collections.singleton(sortedHosts.get(0));
+}
+
 // !!! cannot execute against empty hosts (safety net)
 if (realHosts.isEmpty()) {
   return null;

http://git-wip-us.apache.org/repos/asf/ambari/blob/371d3c97/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ExecuteHostType.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ExecuteHostType.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ExecuteHostType.java
index b36dca4..80deb60 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ExecuteHostType.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ExecuteHostType.java
@@ -42,6 +42,13 @@ public enum ExecuteHostType {
   ANY,
 
   /**
+   * Run on a single host that is picked by alphabetically sorting all hosts 
that satisfy the condition of the {@link ExecuteTask}
+   * .
+   */
+  @XmlEnumValue("first")
+  FIRST,
+
+  /**
* Run on all of the hosts.
*/
   @XmlEnumValue("all")

http://git-wip-us.apache.org/repos/asf/ambari/blob/371d3c97/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java
index 81a3a4d..f2ef8f0 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgra

ambari git commit: AMBARI-15004. RU/EU: Upgrading Oozie database fails since new configs are not yet written to /usr/hdp/current/oozie-server/conf (alejandro)

2016-02-11 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/trunk 8aab63270 -> 1ead25056


AMBARI-15004. RU/EU: Upgrading Oozie database fails since new configs are not 
yet written to /usr/hdp/current/oozie-server/conf (alejandro)


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

Branch: refs/heads/trunk
Commit: 1ead250562513b38e7f2eb57df7cd4bb1d68f06e
Parents: 8aab632
Author: Alejandro Fernandez 
Authored: Thu Feb 11 13:50:47 2016 -0800
Committer: Alejandro Fernandez 
Committed: Thu Feb 11 17:09:45 2016 -0800

--
 .../state/stack/upgrade/ClusterGrouping.java|  7 
 .../state/stack/upgrade/ExecuteHostType.java|  7 
 .../state/stack/upgrade/TaskWrapperBuilder.java | 15 +++-
 .../4.0.0.2.0/package/scripts/oozie_server.py   | 36 ++--
 .../package/scripts/oozie_server_upgrade.py |  4 ++-
 .../4.0.0.2.0/package/scripts/params_linux.py   |  3 ++
 .../HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml |  3 +-
 .../HDP/2.2/upgrades/nonrolling-upgrade-2.2.xml |  5 ++-
 .../HDP/2.2/upgrades/nonrolling-upgrade-2.3.xml |  5 ++-
 .../HDP/2.2/upgrades/nonrolling-upgrade-2.4.xml |  5 ++-
 .../stacks/HDP/2.2/upgrades/upgrade-2.2.xml |  5 ++-
 .../stacks/HDP/2.2/upgrades/upgrade-2.3.xml |  5 ++-
 .../stacks/HDP/2.2/upgrades/upgrade-2.4.xml |  5 ++-
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml |  5 ++-
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml |  5 ++-
 .../stacks/HDP/2.3/upgrades/upgrade-2.3.xml |  5 ++-
 .../stacks/HDP/2.3/upgrades/upgrade-2.4.xml |  5 ++-
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml |  5 ++-
 .../stacks/HDP/2.4/upgrades/upgrade-2.4.xml |  5 ++-
 19 files changed, 109 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1ead2505/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
index 5e21da5..8fb6ef5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ClusterGrouping.java
@@ -232,6 +232,13 @@ public class ClusterGrouping extends Grouping {
   realHosts = Collections.singleton(hosts.hosts.iterator().next());
 }
 
+// Pick the first host sorted alphabetically (case insensitive)
+if (ExecuteHostType.FIRST == et.hosts && !hosts.hosts.isEmpty()) {
+  List sortedHosts = new ArrayList<>(hosts.hosts);
+  Collections.sort(sortedHosts, String.CASE_INSENSITIVE_ORDER);
+  realHosts = Collections.singleton(sortedHosts.get(0));
+}
+
 // !!! cannot execute against empty hosts (safety net)
 if (realHosts.isEmpty()) {
   return null;

http://git-wip-us.apache.org/repos/asf/ambari/blob/1ead2505/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ExecuteHostType.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ExecuteHostType.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ExecuteHostType.java
index b36dca4..80deb60 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ExecuteHostType.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/ExecuteHostType.java
@@ -42,6 +42,13 @@ public enum ExecuteHostType {
   ANY,
 
   /**
+   * Run on a single host that is picked by alphabetically sorting all hosts 
that satisfy the condition of the {@link ExecuteTask}
+   * .
+   */
+  @XmlEnumValue("first")
+  FIRST,
+
+  /**
* Run on all of the hosts.
*/
   @XmlEnumValue("all")

http://git-wip-us.apache.org/repos/asf/ambari/blob/1ead2505/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java
index 81a3a4d..f2ef8f0 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWrapperBuilder.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/TaskWra

ambari git commit: AMBARI-14966: Stack Advisor incorrectly recommends Slave component on a host which does not have it installed during Add service wizard (bhuvnesh2703 via jaoki)

2016-02-11 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/trunk 6c6ec6304 -> 8aab63270


AMBARI-14966: Stack Advisor incorrectly recommends Slave component on a host 
which does not have it installed during Add service wizard (bhuvnesh2703 via 
jaoki)


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

Branch: refs/heads/trunk
Commit: 8aab63270ebfe34aa75c47a150fbb4a1838d0ec1
Parents: 6c6ec63
Author: Jun Aoki 
Authored: Thu Feb 11 17:05:46 2016 -0800
Committer: Jun Aoki 
Committed: Thu Feb 11 17:05:46 2016 -0800

--
 .../src/main/resources/stacks/stack_advisor.py  |  3 +-
 .../stacks/2.0.6/common/test_stack_advisor.py   | 59 
 2 files changed, 61 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8aab6327/ambari-server/src/main/resources/stacks/stack_advisor.py
--
diff --git a/ambari-server/src/main/resources/stacks/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/stack_advisor.py
index d993feb..539bd25 100644
--- a/ambari-server/src/main/resources/stacks/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/stack_advisor.py
@@ -409,7 +409,8 @@ class DefaultStackAdvisor(StackAdvisor):
 hostsMin = int(cardinality)
   if hostsMin > len(hostsForComponent):
 
hostsForComponent.extend(freeHosts[0:hostsMin-len(hostsForComponent)])
-else:
+# Components which are already installed, keep the recommendation 
as the existing layout
+elif not componentIsPopulated:
   hostsForComponent.extend(freeHosts)
   if not hostsForComponent:  # hostsForComponent is empty
 hostsForComponent = hostsList[-1:]

http://git-wip-us.apache.org/repos/asf/ambari/blob/8aab6327/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py 
b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index 22b16bb..4f059ba 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -1941,3 +1941,62 @@ class TestHDP206StackAdvisor(TestCase):
 siteProperties = stack_advisor.getServicesSiteProperties(services, 
"ranger-admin-site")
 self.assertEquals(siteProperties, expected)
 
+  def test_createComponentLayoutRecommendations_addService_1freeHost(self):
+"""
+Test that already installed slaves are not added to any free hosts (not 
having any component installed)
+as part of recommendation received during Add service operation.
+For already installed services, recommendation for installed components 
should match the existing layout
+"""
+
+services = {
+  "services" : [
+ {
+"StackServices" : {
+  "service_name" : "HDFS"
+},
+"components" : [ {
+  "StackServiceComponents" : {
+"cardinality" : "1+",
+"component_category" : "SLAVE",
+"component_name" : "DATANODE",
+"hostnames" : [ "c6401.ambari.apache.org" ]
+  }
+} ]
+ } ]
+  }
+
+hosts = self.prepareHosts(["c6401.ambari.apache.org", 
"c6402.ambari.apache.org"])
+recommendations = 
self.stackAdvisor.createComponentLayoutRecommendations(services, hosts)
+"""
+Recommendation received should be as below:
+   {
+  'blueprint': {
+  'host_groups': [{
+  'name': 'host-group-1',
+  'components': []
+  }, {
+  'name': 'host-group-2',
+  'components': [{
+  'name': 'DATANODE'
+  }]
+  }]
+  },
+  'blueprint_cluster_binding': {
+  'host_groups': [{
+  'hosts': [{
+ 

ambari git commit: AMBARI-14966: Stack Advisor incorrectly recommends Slave component on a host which does not have it installed during Add service wizard (bhuvnesh2703 via jaoki)

2016-02-11 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 14f3b3124 -> 56403ce9a


AMBARI-14966: Stack Advisor incorrectly recommends Slave component on a host 
which does not have it installed during Add service wizard (bhuvnesh2703 via 
jaoki)


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

Branch: refs/heads/branch-2.2
Commit: 56403ce9a33b6888e9130728faec6438cac1b545
Parents: 14f3b31
Author: Jun Aoki 
Authored: Thu Feb 11 17:04:33 2016 -0800
Committer: Jun Aoki 
Committed: Thu Feb 11 17:04:33 2016 -0800

--
 .../src/main/resources/stacks/stack_advisor.py  |  3 +-
 .../stacks/2.0.6/common/test_stack_advisor.py   | 59 
 2 files changed, 61 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/56403ce9/ambari-server/src/main/resources/stacks/stack_advisor.py
--
diff --git a/ambari-server/src/main/resources/stacks/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/stack_advisor.py
index d993feb..539bd25 100644
--- a/ambari-server/src/main/resources/stacks/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/stack_advisor.py
@@ -409,7 +409,8 @@ class DefaultStackAdvisor(StackAdvisor):
 hostsMin = int(cardinality)
   if hostsMin > len(hostsForComponent):
 
hostsForComponent.extend(freeHosts[0:hostsMin-len(hostsForComponent)])
-else:
+# Components which are already installed, keep the recommendation 
as the existing layout
+elif not componentIsPopulated:
   hostsForComponent.extend(freeHosts)
   if not hostsForComponent:  # hostsForComponent is empty
 hostsForComponent = hostsList[-1:]

http://git-wip-us.apache.org/repos/asf/ambari/blob/56403ce9/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py 
b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index c41d136..2f1959a 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -1903,3 +1903,62 @@ class TestHDP206StackAdvisor(TestCase):
 siteProperties = stack_advisor.getServicesSiteProperties(services, 
"ranger-admin-site")
 self.assertEquals(siteProperties, expected)
 
+  def test_createComponentLayoutRecommendations_addService_1freeHost(self):
+"""
+Test that already installed slaves are not added to any free hosts (not 
having any component installed)
+as part of recommendation received during Add service operation.
+For already installed services, recommendation for installed components 
should match the existing layout
+"""
+
+services = {
+  "services" : [
+ {
+"StackServices" : {
+  "service_name" : "HDFS"
+},
+"components" : [ {
+  "StackServiceComponents" : {
+"cardinality" : "1+",
+"component_category" : "SLAVE",
+"component_name" : "DATANODE",
+"hostnames" : [ "c6401.ambari.apache.org" ]
+  }
+} ]
+ } ]
+  }
+
+hosts = self.prepareHosts(["c6401.ambari.apache.org", 
"c6402.ambari.apache.org"])
+recommendations = 
self.stackAdvisor.createComponentLayoutRecommendations(services, hosts)
+"""
+Recommendation received should be as below:
+   {
+  'blueprint': {
+  'host_groups': [{
+  'name': 'host-group-1',
+  'components': []
+  }, {
+  'name': 'host-group-2',
+  'components': [{
+  'name': 'DATANODE'
+  }]
+  }]
+  },
+  'blueprint_cluster_binding': {
+  'host_groups': [{
+  'hosts': [{
+   

ambari git commit: AMBARI-15003: Add dependency in RCO for HAWQ and PXF pre-requisites (bhuvnesh2703 via jaoki)

2016-02-11 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/trunk 9fdaf4ed7 -> 6c6ec6304


AMBARI-15003: Add dependency in RCO for HAWQ and PXF pre-requisites 
(bhuvnesh2703 via jaoki)


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

Branch: refs/heads/trunk
Commit: 6c6ec6304a8acf2876113cd4f930922a183aed2d
Parents: 9fdaf4e
Author: Jun Aoki 
Authored: Thu Feb 11 16:07:31 2016 -0800
Committer: Jun Aoki 
Committed: Thu Feb 11 16:07:31 2016 -0800

--
 .../src/main/resources/stacks/HDP/2.3/role_command_order.json | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6c6ec630/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json 
b/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json
index f164ab2..5b3882f 100755
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json
@@ -13,7 +13,8 @@
 "HAWQMASTER-START" : ["NAMENODE-START", "DATANODE-START", 
"NODEMANAGER-START"],
 "HAWQSTANDBY-START" : ["HAWQMASTER-START"],
 "HAWQSEGMENT-START" : ["HAWQMASTER-START", "HAWQSTANDBY-START"],
-"HAWQ_SERVICE_CHECK-SERVICE_CHECK" : ["HAWQSEGMENT-START", 
"HDFS_SERVICE_CHECK-SERVICE_CHECK", "YARN_SERVICE_CHECK-SERVICE_CHECK"],
+"HAWQ_SERVICE_CHECK-SERVICE_CHECK" : ["HAWQSEGMENT-START", 
"HDFS_SERVICE_CHECK-SERVICE_CHECK", "YARN_SERVICE_CHECK-SERVICE_CHECK", 
"PXF_SERVICE_CHECK-SERVICE_CHECK"],
+"PXF_SERVICE_CHECK-SERVICE_CHECK" : ["HDFS_SERVICE_CHECK-SERVICE_CHECK", 
"HBASE_SERVICE_CHECK-SERVICE_CHECK", "HIVE_SERVICE_CHECK-SERVICE_CHECK"],
 "KNOX_GATEWAY-START" : ["RANGER_USERSYNC-START", "NAMENODE-START"],
 "KAFKA_BROKER-START" : ["ZOOKEEPER_SERVER-START", "RANGER_USERSYNC-START", 
"NAMENODE-START"],
 "NIMBUS-START" : ["ZOOKEEPER_SERVER-START", "RANGER_USERSYNC-START", 
"NAMENODE-START"],



ambari git commit: AMBARI-15003: Add dependency in RCO for HAWQ and PXF pre-requisites (bhuvnesh2703 via jaoki)

2016-02-11 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 fbb42cde2 -> 14f3b3124


AMBARI-15003: Add dependency in RCO for HAWQ and PXF pre-requisites 
(bhuvnesh2703 via jaoki)


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

Branch: refs/heads/branch-2.2
Commit: 14f3b3124fba1ef4413a2375295fd7b1d42c3da9
Parents: fbb42cd
Author: Jun Aoki 
Authored: Thu Feb 11 16:08:20 2016 -0800
Committer: Jun Aoki 
Committed: Thu Feb 11 16:08:20 2016 -0800

--
 .../src/main/resources/stacks/HDP/2.3/role_command_order.json | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/14f3b312/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json 
b/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json
index f164ab2..5b3882f 100755
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json
@@ -13,7 +13,8 @@
 "HAWQMASTER-START" : ["NAMENODE-START", "DATANODE-START", 
"NODEMANAGER-START"],
 "HAWQSTANDBY-START" : ["HAWQMASTER-START"],
 "HAWQSEGMENT-START" : ["HAWQMASTER-START", "HAWQSTANDBY-START"],
-"HAWQ_SERVICE_CHECK-SERVICE_CHECK" : ["HAWQSEGMENT-START", 
"HDFS_SERVICE_CHECK-SERVICE_CHECK", "YARN_SERVICE_CHECK-SERVICE_CHECK"],
+"HAWQ_SERVICE_CHECK-SERVICE_CHECK" : ["HAWQSEGMENT-START", 
"HDFS_SERVICE_CHECK-SERVICE_CHECK", "YARN_SERVICE_CHECK-SERVICE_CHECK", 
"PXF_SERVICE_CHECK-SERVICE_CHECK"],
+"PXF_SERVICE_CHECK-SERVICE_CHECK" : ["HDFS_SERVICE_CHECK-SERVICE_CHECK", 
"HBASE_SERVICE_CHECK-SERVICE_CHECK", "HIVE_SERVICE_CHECK-SERVICE_CHECK"],
 "KNOX_GATEWAY-START" : ["RANGER_USERSYNC-START", "NAMENODE-START"],
 "KAFKA_BROKER-START" : ["ZOOKEEPER_SERVER-START", "RANGER_USERSYNC-START", 
"NAMENODE-START"],
 "NIMBUS-START" : ["ZOOKEEPER_SERVER-START", "RANGER_USERSYNC-START", 
"NAMENODE-START"],



ambari git commit: AMBARI-14930. Admin Versions: display all existed stack versions in new format. (xiwang)

2016-02-11 Thread xiwang
Repository: ambari
Updated Branches:
  refs/heads/branch-dev-patch-upgrade 03bc22607 -> 1e89d1d57


AMBARI-14930. Admin Versions: display all existed stack versions in new format. 
(xiwang)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 1e89d1d578d6ae38fe706e7e07eb0cde52429d92
Parents: 03bc226
Author: Xi Wang 
Authored: Thu Feb 4 12:00:30 2016 -0800
Committer: Xi Wang 
Committed: Thu Feb 11 15:37:49 2016 -0800

--
 .../app/mappers/repository_version_mapper.js|  91 +++
 ambari-web/app/messages.js  |   5 +
 ambari-web/app/models.js|   1 +
 .../models/stack_version/repository_version.js  |   6 +-
 .../app/models/stack_version/service_simple.js  |  28 +
 ambari-web/app/styles/stack_versions.less   | 112 ++-
 .../admin/stack_upgrade/upgrade_version_box.hbs |   4 +
 .../stack_upgrade/upgrade_version_column.hbs|  86 ++
 .../main/admin/stack_upgrade/versions.hbs   |  61 ++
 ambari-web/app/utils/host_progress_popup.js |   4 +-
 ambari-web/app/views.js |   1 +
 .../stack_upgrade/upgrade_version_box_view.js   |  17 ++-
 .../upgrade_version_column_view.js  | 106 ++
 .../main/admin/stack_upgrade/versions_view.js   |   5 +
 14 files changed, 495 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1e89d1d5/ambari-web/app/mappers/repository_version_mapper.js
--
diff --git a/ambari-web/app/mappers/repository_version_mapper.js 
b/ambari-web/app/mappers/repository_version_mapper.js
index 0bb094f..c937678 100644
--- a/ambari-web/app/mappers/repository_version_mapper.js
+++ b/ambari-web/app/mappers/repository_version_mapper.js
@@ -21,6 +21,7 @@ App.repoVersionMapper = App.QuickDataMapper.create({
   modelRepoVersions: App.RepositoryVersion,
   modelOperatingSystems: App.OS,
   modelRepositories: App.Repository,
+  modelServices: App.ServiceSimple,
 
   modelRepoVersion: function (isCurrentStackOnly) {
 var repoVersionsKey = isCurrentStackOnly ? 'RepositoryVersions' : 
'CompatibleRepositoryVersions';
@@ -28,10 +29,16 @@ App.repoVersionMapper = App.QuickDataMapper.create({
   id: repoVersionsKey + '.id',
   stack_version_id: repoVersionsKey + '.stackVersionId',
   display_name: repoVersionsKey + '.display_name',
+  type: repoVersionsKey + '.type',
   repository_version: repoVersionsKey + '.repository_version',
   upgrade_pack: repoVersionsKey + '.upgrade_pack',
   stack_version_type: repoVersionsKey + '.stack_name',
   stack_version_number: repoVersionsKey + '.stack_version',
+  services_key: 'services',
+  services_type: 'array',
+  services: {
+item: 'id'
+  },
   operating_systems_key: 'operating_systems',
   operating_systems_type: 'array',
   operating_systems: {
@@ -53,6 +60,13 @@ App.repoVersionMapper = App.QuickDataMapper.create({
 }
   },
 
+  modelService: {
+id: 'id',
+name: 'name',
+display_name: 'display_name',
+latest_version: 'latest_version'
+  },
+
   modelRepository: {
 id: 'id',
 operating_system_id: 'Repositories.operating_system_id',
@@ -71,18 +85,81 @@ App.repoVersionMapper = App.QuickDataMapper.create({
 var modelRepoVersions = this.get('modelRepoVersions');
 var modelOperatingSystems = this.get('modelOperatingSystems');
 var modelRepositories = this.get('modelRepositories');
+var modelServices = this.get('modelServices');
 
 var resultRepoVersion = [];
 var resultOS = [];
 var resultRepo = [];
+var resultService = [];
 
 var repoVersionsKey = isCurrentStackOnly ? 'RepositoryVersions' : 
'CompatibleRepositoryVersions';
 
 if (json && json.items) {
   json.items.forEach(function (item) {
+// to test//
+item[repoVersionsKey].type = "PATCH";
+item[repoVersionsKey].release = {
+  "stack_id": "HDP-2.2",
+  "version": "2.2.4.1",
+  "build": "885",
+  "compatible_with": "", /* regex */
+  "release_notes": "http://someurl";
+};
+item[repoVersionsKey].services = [
+  {
+"name": "HDFS",
+"display_name": "HDFS",
+"versions": [
+  {
+"version": "2.1.1",
+"version_id": "10",
+"components": [ "NAMENODE"]
+  }
+]
+  },
+  {
+"name": "YARN",
+"displa

ambari git commit: AMBARI-15007. Make amazon2015 to be part of redhat6 family (aonishuk)

2016-02-11 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk a98adb7eb -> 9fdaf4ed7


AMBARI-15007. Make amazon2015 to be part of redhat6 family (aonishuk)


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

Branch: refs/heads/trunk
Commit: 9fdaf4ed757974fc74df55ac5f86afaf82125283
Parents: a98adb7
Author: Andrew Onishuk 
Authored: Fri Feb 12 00:56:17 2016 +0200
Committer: Andrew Onishuk 
Committed: Fri Feb 12 01:03:21 2016 +0200

--
 ambari-agent/pom.xml|  36 ++---
 .../src/main/python/ambari_commons/os_check.py  |  73 +++---
 .../ambari_commons/resources/os_family.json | 137 +--
 ambari-server/pom.xml   |  12 +-
 ambari-server/src/main/assemblies/server.xml|   2 +-
 .../server/state/stack/JsonOsFamilyRoot.java|  38 +
 .../ambari/server/state/stack/OsFamily.java |   8 +-
 .../resources/stacks/HDP/2.2/repos/repoinfo.xml |  12 --
 .../resources/stacks/HDP/2.3/repos/repoinfo.xml |  12 --
 .../resources/stacks/HDP/2.4/repos/repoinfo.xml |  12 --
 ambari-server/src/test/python/TestOSCheck.py|  37 +++--
 ambari-server/src/test/resources/os_family.json |  89 ++--
 12 files changed, 260 insertions(+), 208 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9fdaf4ed/ambari-agent/pom.xml
--
diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index 23d2969..bb7cc34 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -86,24 +86,6 @@
 3.0
   
   
-maven-assembly-plugin
-
-  gnu
-  
-src/packages/tarball/all.xml
-  
-
-
-  
-build-tarball
-prepare-package
-
-  single
-
-  
-
-  
-  
 org.apache.maven.plugins
 maven-surefire-plugin
 
@@ -275,6 +257,24 @@
 
   
   
+maven-assembly-plugin
+
+  gnu
+  
+src/packages/tarball/all.xml
+  
+
+
+  
+build-tarball
+package
+
+  single
+
+  
+
+  
+  
 maven-resources-plugin
 2.6
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9fdaf4ed/ambari-common/src/main/python/ambari_commons/os_check.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/os_check.py 
b/ambari-common/src/main/python/ambari_commons/os_check.py
index c5457bb..b430c86 100644
--- a/ambari-common/src/main/python/ambari_commons/os_check.py
+++ b/ambari-common/src/main/python/ambari_commons/os_check.py
@@ -56,6 +56,8 @@ RESOURCES_DIR = 
os.path.join(os.path.dirname(os.path.realpath(__file__)), "resou
 
 # family JSON data
 OSFAMILY_JSON_RESOURCE = "os_family.json"
+JSON_OS_MAPPING = "mapping"
+JSON_OS_ALIASES = "aliases"
 JSON_OS_TYPE = "distro"
 JSON_OS_VERSION = "versions"
 JSON_EXTENDS = "extends"
@@ -76,6 +78,8 @@ VER_NT_SERVER = 3
 _IS_ORACLE_LINUX = os.path.exists('/etc/oracle-release')
 _IS_REDHAT_LINUX = os.path.exists('/etc/redhat-release')
 
+SYSTEM_RELEASE_FILE = "/etc/system-release"
+
 def _is_oracle_linux():
   return _IS_ORACLE_LINUX
 
@@ -84,16 +88,16 @@ def _is_redhat_linux():
 
 def advanced_check(distribution):
   distribution = list(distribution)
-  if os.path.exists("/etc/issue"):
-with open("/etc/issue", "rb") as fp:
+  if os.path.exists(SYSTEM_RELEASE_FILE):
+with open(SYSTEM_RELEASE_FILE, "rb") as fp:
   issue_content = fp.read()
   
 if "Amazon" in issue_content:
   distribution[0] = "amazon"
-  search_groups = re.search('(\d+)\.(\d+)', issue_content)
+  search_groups = re.search('(\d+\.\d+)', issue_content)
   
   if search_groups:
-distribution[1] = search_groups.group(1) # if version is 2015.09 only 
get 2015.
+distribution[1] = search_groups.group(1)
   
   return tuple(distribution)
 
@@ -114,16 +118,24 @@ class OS_CONST_TYPE(type):
   f = open(os.path.join(RESOURCES_DIR, OSFAMILY_JSON_RESOURCE))
   json_data = eval(f.read())
   f.close()
-  for family in json_data:
+  
+  if JSON_OS_MAPPING not in json_data:
+raise Exception("Invalid {0}".format(OSFAMILY_JSON_RESOURCE))
+  
+  json_mapping_data = json_data[JSON_OS_MAPPING]
+  
+  for family in json_mapping_data:
 cls.FAMILY_COLLECTION += [family]
-cls.OS_COLLECTION += json_data[family][JSON_OS_TYPE]
+ 

ambari git commit: AMBARI-15017 RU/EU has to calculate ranger-env config ranger_privelege_user_jdbc_url (dsen)

2016-02-11 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 a3ff272fd -> fbb42cde2


AMBARI-15017 RU/EU has to calculate ranger-env config 
ranger_privelege_user_jdbc_url (dsen)


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

Branch: refs/heads/branch-2.2
Commit: fbb42cde24b0f90a8f2cf7c3b5cb7d1d9e05868d
Parents: a3ff272
Author: Dmytro Sen 
Authored: Fri Feb 12 00:21:51 2016 +0200
Committer: Dmytro Sen 
Committed: Fri Feb 12 00:23:15 2016 +0200

--
 .../upgrades/RangerConfigCalculation.java   | 14 +-
 .../upgrades/RangerConfigCalculationTest.java   | 27 
 2 files changed, 40 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb42cde/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculation.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculation.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculation.java
index ebec177..ff4a20e 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculation.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculation.java
@@ -37,6 +37,8 @@ import com.google.inject.Inject;
  */
 public class RangerConfigCalculation extends AbstractServerAction {
   private static final String SOURCE_CONFIG_TYPE = "admin-properties";
+  private static final String RANGER_ENV_CONFIG_TYPE = "ranger-env";
+  private static final String RANGER_ADMIN_SITE_CONFIG_TYPE = 
"ranger-admin-site";
 
   @Inject
   private Clusters m_clusters;
@@ -101,6 +103,7 @@ public class RangerConfigCalculation extends 
AbstractServerAction {
 String url = null;
 String dialect = null;
 String auditUrl = null;
+String userJDBCUrl = null;
 
 if ("mysql".equals(db)) {
   if (null == dbName) {
@@ -112,19 +115,22 @@ public class RangerConfigCalculation extends 
AbstractServerAction {
   url = MessageFormat.format("jdbc:mysql://{0}/{1}", dbHost, dbName);
   auditUrl = MessageFormat.format("jdbc:mysql://{0}/{1}", dbHost, 
auditDbName);
   dialect = "org.eclipse.persistence.platform.database.MySQLPlatform";
+  userJDBCUrl = MessageFormat.format("jdbc:mysql://{0}", dbHost);
 } else if ("oracle".equals(db)) {
   driver = "oracle.jdbc.OracleDriver";
   url = MessageFormat.format("jdbc:oracle:thin:@//{0}", dbHost);
   auditUrl = MessageFormat.format("jdbc:oracle:thin:@//{0}", dbHost);
   dialect = "org.eclipse.persistence.platform.database.OraclePlatform";
+  userJDBCUrl = MessageFormat.format("jdbc:oracle:thin:@//{0}", dbHost);
 }
 
 stdout.append(MessageFormat.format("Database driver: {0}\n", driver));
 stdout.append(MessageFormat.format("Database url: {0}\n", url));
 stdout.append(MessageFormat.format("Database audit url: {0}\n", auditUrl));
 stdout.append(MessageFormat.format("Database dialect: {0}", dialect));
+stdout.append(MessageFormat.format("Database user jdbc url: {0}", 
userJDBCUrl));
 
-Config config = cluster.getDesiredConfigByType("ranger-admin-site");
+Config config = 
cluster.getDesiredConfigByType(RANGER_ADMIN_SITE_CONFIG_TYPE);
 Map targetValues = config.getProperties();
 targetValues.put("ranger.jpa.jdbc.driver", driver);
 targetValues.put("ranger.jpa.jdbc.url", url);
@@ -137,6 +143,12 @@ public class RangerConfigCalculation extends 
AbstractServerAction {
 config.setProperties(targetValues);
 config.persist(false);
 
+config = cluster.getDesiredConfigByType(RANGER_ENV_CONFIG_TYPE);
+targetValues = config.getProperties();
+targetValues.put("ranger_privelege_user_jdbc_url", userJDBCUrl);
+config.setProperties(targetValues);
+config.persist(false);
+
 return createCommandReport(0, HostRoleStatus.COMPLETED, "{}", 
stdout.toString(), "");
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/fbb42cde/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculationTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculationTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculationTest.java
index 1bd0de4..e673714 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculationTe

ambari git commit: AMBARI-15017 RU/EU has to calculate ranger-env config ranger_privelege_user_jdbc_url (dsen)

2016-02-11 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk 9419400da -> a98adb7eb


AMBARI-15017 RU/EU has to calculate ranger-env config 
ranger_privelege_user_jdbc_url (dsen)


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

Branch: refs/heads/trunk
Commit: a98adb7eb9c61b40a2724f61cc45fc9e70504c2a
Parents: 9419400
Author: Dmytro Sen 
Authored: Fri Feb 12 00:21:51 2016 +0200
Committer: Dmytro Sen 
Committed: Fri Feb 12 00:21:51 2016 +0200

--
 .../upgrades/RangerConfigCalculation.java   | 14 +-
 .../upgrades/RangerConfigCalculationTest.java   | 27 
 2 files changed, 40 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a98adb7e/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculation.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculation.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculation.java
index ebec177..ff4a20e 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculation.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculation.java
@@ -37,6 +37,8 @@ import com.google.inject.Inject;
  */
 public class RangerConfigCalculation extends AbstractServerAction {
   private static final String SOURCE_CONFIG_TYPE = "admin-properties";
+  private static final String RANGER_ENV_CONFIG_TYPE = "ranger-env";
+  private static final String RANGER_ADMIN_SITE_CONFIG_TYPE = 
"ranger-admin-site";
 
   @Inject
   private Clusters m_clusters;
@@ -101,6 +103,7 @@ public class RangerConfigCalculation extends 
AbstractServerAction {
 String url = null;
 String dialect = null;
 String auditUrl = null;
+String userJDBCUrl = null;
 
 if ("mysql".equals(db)) {
   if (null == dbName) {
@@ -112,19 +115,22 @@ public class RangerConfigCalculation extends 
AbstractServerAction {
   url = MessageFormat.format("jdbc:mysql://{0}/{1}", dbHost, dbName);
   auditUrl = MessageFormat.format("jdbc:mysql://{0}/{1}", dbHost, 
auditDbName);
   dialect = "org.eclipse.persistence.platform.database.MySQLPlatform";
+  userJDBCUrl = MessageFormat.format("jdbc:mysql://{0}", dbHost);
 } else if ("oracle".equals(db)) {
   driver = "oracle.jdbc.OracleDriver";
   url = MessageFormat.format("jdbc:oracle:thin:@//{0}", dbHost);
   auditUrl = MessageFormat.format("jdbc:oracle:thin:@//{0}", dbHost);
   dialect = "org.eclipse.persistence.platform.database.OraclePlatform";
+  userJDBCUrl = MessageFormat.format("jdbc:oracle:thin:@//{0}", dbHost);
 }
 
 stdout.append(MessageFormat.format("Database driver: {0}\n", driver));
 stdout.append(MessageFormat.format("Database url: {0}\n", url));
 stdout.append(MessageFormat.format("Database audit url: {0}\n", auditUrl));
 stdout.append(MessageFormat.format("Database dialect: {0}", dialect));
+stdout.append(MessageFormat.format("Database user jdbc url: {0}", 
userJDBCUrl));
 
-Config config = cluster.getDesiredConfigByType("ranger-admin-site");
+Config config = 
cluster.getDesiredConfigByType(RANGER_ADMIN_SITE_CONFIG_TYPE);
 Map targetValues = config.getProperties();
 targetValues.put("ranger.jpa.jdbc.driver", driver);
 targetValues.put("ranger.jpa.jdbc.url", url);
@@ -137,6 +143,12 @@ public class RangerConfigCalculation extends 
AbstractServerAction {
 config.setProperties(targetValues);
 config.persist(false);
 
+config = cluster.getDesiredConfigByType(RANGER_ENV_CONFIG_TYPE);
+targetValues = config.getProperties();
+targetValues.put("ranger_privelege_user_jdbc_url", userJDBCUrl);
+config.setProperties(targetValues);
+config.persist(false);
+
 return createCommandReport(0, HostRoleStatus.COMPLETED, "{}", 
stdout.toString(), "");
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a98adb7e/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculationTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculationTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculationTest.java
index 1bd0de4..e673714 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerConfigCalculationTest.java
++

ambari git commit: AMBARI-15010 YARN metrics not written due to permissions on metrics properties file (dsen)

2016-02-11 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 e43e12f85 -> a3ff272fd


AMBARI-15010 YARN metrics not written due to permissions on metrics properties 
file (dsen)


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

Branch: refs/heads/branch-2.2
Commit: a3ff272fdc1330207b218219a210b8107081d57d
Parents: e43e12f
Author: Dmytro Sen 
Authored: Thu Feb 11 23:29:27 2016 +0200
Committer: Dmytro Sen 
Committed: Thu Feb 11 23:31:34 2016 +0200

--
 .../0.8/hooks/before-START/scripts/shared_initialization.py  | 1 +
 .../2.0.6/hooks/before-START/scripts/shared_initialization.py| 1 +
 .../python/stacks/2.0.6/hooks/before-START/test_before_start.py  | 4 
 3 files changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a3ff272f/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
index f70eee8..154d4ff 100644
--- 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
@@ -85,6 +85,7 @@ def setup_hadoop():
 
 File(os.path.join(params.hadoop_conf_dir, "hadoop-metrics2.properties"),
  owner=params.hdfs_user,
+ group=params.user_group,
  content=Template("hadoop-metrics2.properties.j2")
 )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a3ff272f/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
index 3422f76..3ee2178 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
@@ -97,6 +97,7 @@ def setup_hadoop():
 
   File(os.path.join(params.hadoop_conf_dir, "hadoop-metrics2.properties"),
owner=params.hdfs_user,
+   group=params.user_group,
content=Template("hadoop-metrics2.properties.j2")
   )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a3ff272f/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
 
b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
index 504fd04..443c02e 100644
--- 
a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
+++ 
b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
@@ -73,6 +73,7 @@ class TestHookBeforeStart(RMFTestCase):
   )
 self.assertResourceCalled('File', 
'/etc/hadoop/conf/hadoop-metrics2.properties',
   content = 
Template('hadoop-metrics2.properties.j2'),
+  group='hadoop',
   owner = 'hdfs',
   )
 self.assertResourceCalled('File', '/etc/hadoop/conf/task-log4j.properties',
@@ -146,6 +147,7 @@ class TestHookBeforeStart(RMFTestCase):
   )
 self.assertResourceCalled('File', 
'/etc/hadoop/conf/hadoop-metrics2.properties',
   content = 
Template('hadoop-metrics2.properties.j2'),
+  group='hadoop',
   owner = 'hdfs',
   )
 self.assertResourceCalled('File', '/etc/hadoop/conf/task-log4j.properties',
@@ -224,6 +226,7 @@ class TestHookBeforeStart(RMFTestCase):
 )
 self.assertResourceCalled('File', 
'/etc/hadoop/conf/hadoop-metrics2.properties',
   content = 
Template('hadoop-metrics2.properties.j2'),
+  group='hadoop',
   owner = 'hdfs',
   )
 self.assertResourceCalled('File', '/etc/hadoop/conf/task-log4j.properties',
@@

ambari git commit: AMBARI-15010 YARN metrics not written due to permissions on metrics properties file (dsen)

2016-02-11 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk a638ccb53 -> 9419400da


AMBARI-15010 YARN metrics not written due to permissions on metrics properties 
file (dsen)


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

Branch: refs/heads/trunk
Commit: 9419400da987d1a09c17ce511c1fdc307ad7ff65
Parents: a638ccb
Author: Dmytro Sen 
Authored: Thu Feb 11 23:29:27 2016 +0200
Committer: Dmytro Sen 
Committed: Thu Feb 11 23:29:27 2016 +0200

--
 .../0.8/hooks/before-START/scripts/shared_initialization.py  | 1 +
 .../2.0.6/hooks/before-START/scripts/shared_initialization.py| 1 +
 .../python/stacks/2.0.6/hooks/before-START/test_before_start.py  | 4 
 3 files changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9419400d/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
index 2d2331a..265502f 100644
--- 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/hooks/before-START/scripts/shared_initialization.py
@@ -85,6 +85,7 @@ def setup_hadoop():
 
 File(os.path.join(params.hadoop_conf_dir, "hadoop-metrics2.properties"),
  owner=params.hdfs_user,
+ group=params.user_group,
  content=Template("hadoop-metrics2.properties.j2")
 )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9419400d/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
index 85d8fec..21d3b43 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
@@ -98,6 +98,7 @@ def setup_hadoop():
 
   File(os.path.join(params.hadoop_conf_dir, "hadoop-metrics2.properties"),
owner=params.hdfs_user,
+   group=params.user_group,
content=Template("hadoop-metrics2.properties.j2")
   )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9419400d/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
 
b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
index da2b87f..90bd968 100644
--- 
a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
+++ 
b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
@@ -73,6 +73,7 @@ class TestHookBeforeStart(RMFTestCase):
   )
 self.assertResourceCalled('File', 
'/etc/hadoop/conf/hadoop-metrics2.properties',
   content = 
Template('hadoop-metrics2.properties.j2'),
+  group='hadoop',
   owner = 'hdfs',
   )
 self.assertResourceCalled('File', '/etc/hadoop/conf/task-log4j.properties',
@@ -146,6 +147,7 @@ class TestHookBeforeStart(RMFTestCase):
   )
 self.assertResourceCalled('File', 
'/etc/hadoop/conf/hadoop-metrics2.properties',
   content = 
Template('hadoop-metrics2.properties.j2'),
+  group='hadoop',
   owner = 'hdfs',
   )
 self.assertResourceCalled('File', '/etc/hadoop/conf/task-log4j.properties',
@@ -224,6 +226,7 @@ class TestHookBeforeStart(RMFTestCase):
 )
 self.assertResourceCalled('File', 
'/etc/hadoop/conf/hadoop-metrics2.properties',
   content = 
Template('hadoop-metrics2.properties.j2'),
+  group='hadoop',
   owner = 'hdfs',
   )
 self.assertResourceCalled('File', '/etc/hadoop/conf/task-log4j.properties',
@@ -304,6 +3

ambari git commit: AMBARI-14976 Add Grafana QuickLinks for AMS Service in Ambari Web. (atkach)

2016-02-11 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 5f7166c6e -> e43e12f85


AMBARI-14976 Add Grafana QuickLinks for AMS Service in Ambari Web. (atkach)


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

Branch: refs/heads/branch-2.2
Commit: e43e12f85343db320ff5b5ec2f7942bdeaedbeca
Parents: 5f7166c
Author: Andrii Tkach 
Authored: Tue Feb 9 19:52:40 2016 +0200
Committer: Andrii Tkach 
Committed: Thu Feb 11 21:20:40 2016 +0200

--
 .../app/mappers/service_metrics_mapper.js   |  3 +-
 ambari-web/app/models/quick_links.js| 12 +++
 .../app/views/common/quick_view_link_view.js| 37 +++-
 3 files changed, 43 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e43e12f8/ambari-web/app/mappers/service_metrics_mapper.js
--
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js 
b/ambari-web/app/mappers/service_metrics_mapper.js
index 2deceaf..30a96d6 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -387,7 +387,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
   RANGER: [33],
   SPARK: [34],
   ACCUMULO: [35],
-  ATLAS: [36]
+  ATLAS: [36],
+  AMBARI_METRICS: [37]
 };
 if (quickLinks[item.ServiceInfo.service_name])
   finalJson.quick_links = quickLinks[item.ServiceInfo.service_name];

http://git-wip-us.apache.org/repos/asf/ambari/blob/e43e12f8/ambari-web/app/models/quick_links.js
--
diff --git a/ambari-web/app/models/quick_links.js 
b/ambari-web/app/models/quick_links.js
index 1aac608..94c793d 100644
--- a/ambari-web/app/models/quick_links.js
+++ b/ambari-web/app/models/quick_links.js
@@ -343,6 +343,18 @@ App.QuickLinks.FIXTURES = [
 regex: '^(\\d+)$',
 default_http_port: 21000,
 default_https_port: 21443
+  },
+  {
+id:37,
+label:'Metrics UI Server',
+url:'%@://%@:%@',
+service_id: 'AMBARI_METRICS',
+template:'%@://%@:%@',
+http_config: 'port',
+site: 'ams-grafana-ini',
+regex: '^(\\d+)$',
+default_http_port: 3000,
+default_https_port: 3000
   }
 
 ];

http://git-wip-us.apache.org/repos/asf/ambari/blob/e43e12f8/ambari-web/app/views/common/quick_view_link_view.js
--
diff --git a/ambari-web/app/views/common/quick_view_link_view.js 
b/ambari-web/app/views/common/quick_view_link_view.js
index ece034c..774d87d 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -75,7 +75,29 @@ App.QuickViewLinks = Em.View.extend({
   /**
* list of files that contains properties for enabling/disabling ssl
*/
-  requiredSiteNames: 
['hadoop-env','yarn-env','hbase-env','oozie-env','mapred-env','storm-env', 
'falcon-env', 'core-site', 'hdfs-site', 'hbase-site', 'oozie-site', 
'yarn-site', 'mapred-site', 'storm-site', 'spark-defaults', 'accumulo-site', 
'application-properties', 'ranger-admin-site', 'ranger-site', 
'admin-properties'],
+  requiredSiteNames: [
+'ams-grafana-ini',
+'hadoop-env',
+'yarn-env',
+'hbase-env',
+'oozie-env',
+'mapred-env',
+'storm-env',
+'falcon-env',
+'core-site',
+'hdfs-site',
+'hbase-site',
+'oozie-site',
+'yarn-site',
+'mapred-site',
+'storm-site',
+'spark-defaults',
+'accumulo-site',
+'application-properties',
+'ranger-admin-site',
+'ranger-site',
+'admin-properties'
+  ],
   /**
* Get public host name by its host name.
*
@@ -365,6 +387,9 @@ App.QuickViewLinks = Em.View.extend({
   case "ATLAS":
 hosts[0] = this.findComponentHost(response.items, "ATLAS_SERVER");
 break;
+  case "AMBARI_METRICS":
+hosts[0] = this.findComponentHost(response.items, "METRICS_GRAFANA");
+break;
   case "MAPREDUCE2":
 components = 
this.get('content.hostComponents').filterProperty('componentName', 
'HISTORYSERVER');
 if (components && components.length > 1) {
@@ -412,7 +437,9 @@ App.QuickViewLinks = Em.View.extend({
 switch (service_id) {
   case "GANGLIA":
 return (ambariProperties && ambariProperties['ganglia.https'] == 
"true") ? "https" : "http";
-break;
+  case "AMBARI_METRICS":
+var grafanaProperties = configProperties && 
configProperties.findProperty('type', 'ams-grafana-ini');
+return grafanaProperties.properties['protocol'] ? 
grafanaProperties.properties

ambari git commit: AMBARI-14976 Add Grafana QuickLinks for AMS Service in Ambari Web. (atkach)

2016-02-11 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk 7d1ab29c5 -> a638ccb53


AMBARI-14976 Add Grafana QuickLinks for AMS Service in Ambari Web. (atkach)


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

Branch: refs/heads/trunk
Commit: a638ccb5345cb7f34e2c42b075c33cf3814565db
Parents: 7d1ab29
Author: Andrii Tkach 
Authored: Wed Feb 10 16:19:33 2016 +0200
Committer: Andrii Tkach 
Committed: Thu Feb 11 21:19:13 2016 +0200

--
 .../AMBARI_METRICS/0.1.0/metainfo.xml   |  7 
 .../0.1.0/quickLinks/quicklinks.json| 34 
 .../app/mappers/service_metrics_mapper.js   |  3 +-
 ambari-web/app/models/quick_links.js| 12 +++
 .../app/views/common/quick_view_link_view.js|  3 ++
 .../test/views/common/quick_link_view_test.js   |  5 +++
 6 files changed, 63 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a638ccb5/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
index 3a832eb..67a93a5 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
@@ -161,6 +161,13 @@
 storm-site
   
 
+  
+
+  quicklinks.json
+  true
+
+  
+
 
   
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a638ccb5/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/quickLinks/quicklinks.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/quickLinks/quicklinks.json
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/quickLinks/quicklinks.json
new file mode 100644
index 000..09e7de5
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/quickLinks/quicklinks.json
@@ -0,0 +1,34 @@
+{
+  "name": "default",
+  "description": "default quick links configuration",
+  "configuration": {
+"protocol":
+{
+  "type":"https",
+  "checks":[
+{
+  "property":"protocol",
+  "desired":"https",
+  "site":"ams-grafana-ini"
+}
+  ]
+},
+"links": [
+  {
+"name": "metrics_ui_server",
+"label": "Metrics UI Server",
+"requires_user_name": "false",
+"url":"%@://%@:%@",
+"template":"%@://%@:%@",
+"port":{
+  "http_property": "port",
+  "http_default_port": "3000",
+  "https_property": "port",
+  "https_default_port": "3000",
+  "regex": "^(\\d+)$",
+  "site": "ams-grafana-ini"
+}
+  }
+]
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/a638ccb5/ambari-web/app/mappers/service_metrics_mapper.js
--
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js 
b/ambari-web/app/mappers/service_metrics_mapper.js
index 1ac2b54..80e86c6 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -387,7 +387,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
   RANGER: [33],
   SPARK: [34],
   ACCUMULO: [35],
-  ATLAS: [36]
+  ATLAS: [36],
+  AMBARI_METRICS: [37]
 };
 if (quickLinks[item.ServiceInfo.service_name])
   finalJson.quick_links = quickLinks[item.ServiceInfo.service_name];

http://git-wip-us.apache.org/repos/asf/ambari/blob/a638ccb5/ambari-web/app/models/quick_links.js
--
diff --git a/ambari-web/app/models/quick_links.js 
b/ambari-web/app/models/quick_links.js
index eb9dfd6..f6c1fb5 100644
--- a/ambari-web/app/models/quick_links.js
+++ b/ambari-web/app/models/quick_links.js
@@ -343,6 +343,18 @@ App.QuickLinks.FIXTURES = [
 regex: '^(\\d+)$',
 default_http_port: 21000,
 default_https_port: 21443
+  },
+  {
+id:37,
+label:'Metrics UI Server',
+url:'%@://%@:%@',
+service_id: 'AMBARI_METRICS',
+template:'%@://%@:%@',
+http_config: 'port',
+site: 'ams-grafana-ini',
+regex: '^(\\d+)$',
+default_http_port: 3000,
+default_https_port: 3000
   }
 
 ];

http://git-wip-us.apache.or

ambari git commit: AMBARI-14885: After exporting blueprint from existing cluster knox_master_secret is exported. (arborkar via dili)

2016-02-11 Thread dili
Repository: ambari
Updated Branches:
  refs/heads/trunk 966f3031d -> 7d1ab29c5


AMBARI-14885: After exporting blueprint from existing cluster 
knox_master_secret is exported. (arborkar via dili)


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

Branch: refs/heads/trunk
Commit: 7d1ab29c5860a8cab6f19eb98c0a7bd25529ec5e
Parents: 966f303
Author: Di Li 
Authored: Thu Feb 11 13:54:01 2016 -0500
Committer: Di Li 
Committed: Thu Feb 11 13:54:01 2016 -0500

--
 .../BlueprintConfigurationProcessor.java |  2 +-
 .../BlueprintConfigurationProcessorTest.java | 19 +--
 2 files changed, 18 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7d1ab29c/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index de31a0d..7fb2592 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -2605,7 +2605,7 @@ public class BlueprintConfigurationProcessor {
*/
   private static class PasswordPropertyFilter implements PropertyFilter {
 
-private static final Pattern PASSWORD_NAME_REGEX = 
Pattern.compile("\\S+PASSWORD", Pattern.CASE_INSENSITIVE);
+private static final Pattern PASSWORD_NAME_REGEX = 
Pattern.compile("\\S+(PASSWORD|SECRET)", Pattern.CASE_INSENSITIVE);
 
 /**
  * Query to determine if a given property should be included in a 
collection of

http://git-wip-us.apache.org/repos/asf/ambari/blob/7d1ab29c/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index 7a77a25..9c76e8a 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -689,14 +689,21 @@ public class BlueprintConfigurationProcessorTest {
 typeProps.put("test.ssl.password", "test-password-five");
 typeProps.put("test.password.should.be.included", "test-another-pwd");
 
+//Checking functionality for fields marked as SECRET
+Map secretProps = new HashMap();
+secretProps.put("knox_master_secret", "test-secret-one");
+secretProps.put("test.secret.should.be.included", "test-another-secret");
 // create a custom config type, to verify that the filters can
 // be applied across all config types
 Map customProps = new HashMap();
 customProps.put("my_test_PASSWORD", "should be excluded");
 customProps.put("PASSWORD_mytest", "should be included");
 
+customProps.put("my_test_SECRET", "should be excluded");
+customProps.put("SECRET_mytest", "should be included");
 properties.put("ranger-yarn-plugin-properties", typeProps);
 properties.put("custom-test-properties", customProps);
+properties.put("secret-test-properties", secretProps);
 
 Configuration clusterConfig = new Configuration(properties,
   Collections.>>emptyMap());
@@ -721,10 +728,12 @@ public class BlueprintConfigurationProcessorTest {
 configProcessor.doUpdateForBlueprintExport();
 
 
-assertEquals("Exported properties map was not of the expected size", 1,
+assertEquals("Exported properties map was not of the expected size", 2,
   properties.get("custom-test-properties").size());
 assertEquals("ranger-yarn-plugin-properties config type was not properly 
exported", 1,
   properties.get("ranger-yarn-plugin-properties").size());
+assertEquals("Exported secret properties map was not of the expected 
size", 1,
+  properties.get("secret-test-properties").size());
 
 // verify that the following password properties matching the "*_PASSWORD" 
rule have been excluded
 assertFalse("Password property should have been excluded",
@@ -743,9 +752,15 @@ public class BlueprintConfiguration

ambari git commit: AMBARI-14988: DB consistency - Add consistency check on clusterconfigmapping in ClusterImpl::getDesiredConfigs() for NPE.

2016-02-11 Thread smnaha
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 f99db40c0 -> 5f7166c6e


AMBARI-14988: DB consistency - Add consistency check on clusterconfigmapping in 
ClusterImpl::getDesiredConfigs() for NPE.


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

Branch: refs/heads/branch-2.2
Commit: 5f7166c6e3fafc0104b9ff6fab126d68cb41fc15
Parents: f99db40
Author: Nahappan Somasundaram 
Authored: Wed Feb 10 13:10:28 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Thu Feb 11 10:36:21 2016 -0800

--
 .../apache/ambari/server/state/cluster/ClusterImpl.java | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5f7166c6/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index a1e1919..d3fdc65 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -2233,7 +2233,17 @@ public class ClusterImpl implements Cluster {
 " unknown configType=" + e.getType());
 continue;
   }
-  
c.setVersion(allConfigs.get(e.getType()).get(e.getTag()).getVersion());
+
+  Map configMap = allConfigs.get(e.getType());
+  if(!configMap.containsKey(e.getTag())) {
+LOG.debug("Config inconsistency exists for typeName=" +
+e.getType() +
+", unknown versionTag=" + e.getTag());
+continue;
+  }
+
+  Config config = configMap.get(e.getTag());
+  c.setVersion(config.getVersion());
 
   Set configs = map.get(e.getType());
   if (configs == null) {



[1/2] ambari git commit: AMBARI-14988: DB consistency - Add consistency check on clusterconfigmapping in ClusterImpl::getDesiredConfigs() for NPE.

2016-02-11 Thread smnaha
Repository: ambari
Updated Branches:
  refs/heads/trunk 2871d674f -> 966f3031d


AMBARI-14988: DB consistency - Add consistency check on clusterconfigmapping in 
ClusterImpl::getDesiredConfigs() for NPE.


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

Branch: refs/heads/trunk
Commit: 966f3031d50b0106dfe5d19abbdd1e3b84d1f059
Parents: f247ddc
Author: Nahappan Somasundaram 
Authored: Wed Feb 10 13:10:28 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Thu Feb 11 10:35:00 2016 -0800

--
 .../apache/ambari/server/state/cluster/ClusterImpl.java | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/966f3031/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 50e02a5..57941d0 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -2267,7 +2267,17 @@ public class ClusterImpl implements Cluster {
 " unknown configType=" + e.getType());
 continue;
   }
-  
c.setVersion(allConfigs.get(e.getType()).get(e.getTag()).getVersion());
+
+  Map configMap = allConfigs.get(e.getType());
+  if(!configMap.containsKey(e.getTag())) {
+LOG.debug("Config inconsistency exists for typeName=" +
+e.getType() +
+", unknown versionTag=" + e.getTag());
+continue;
+  }
+
+  Config config = configMap.get(e.getTag());
+  c.setVersion(config.getVersion());
 
   Set configs = map.get(e.getType());
   if (configs == null) {



[2/2] ambari git commit: AMBARI-14998: Server 500 error on trying to extract a blueprint for all clusters

2016-02-11 Thread smnaha
AMBARI-14998: Server 500 error on trying to extract a blueprint for all clusters


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

Branch: refs/heads/trunk
Commit: f247ddcfa6c7cc48508cbcfa1e681169dce3b495
Parents: 2871d67
Author: Nahappan Somasundaram 
Authored: Wed Feb 10 14:41:12 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Thu Feb 11 10:35:00 2016 -0800

--
 .../server/controller/AmbariManagementControllerImpl.java  | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f247ddcf/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 69b3348..0b26f61 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -1018,7 +1018,11 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 //   If the user is authorized to view information about this cluster, add 
it to the response
 //   if (AuthorizationHelper.isAuthorized(ResourceType.CLUSTER, 
c.getResourceId(),
 //RoleAuthorization.AUTHORIZATIONS_VIEW_CLUSTER)) {
-  response.add(c.convertToResponse());
+  ClusterResponse cr = c.convertToResponse();
+  cr.setDesiredConfigs(c.getDesiredConfigs());
+  cr.setDesiredServiceConfigVersions(c.getActiveServiceConfigVersions());
+  
cr.setCredentialStoreServiceProperties(getCredentialStoreServiceProperties());
+  response.add(cr);
 //   }
 }
 StringBuilder builder = new StringBuilder();



ambari git commit: AMBARI-14980. Provide explicit ordering for roles (rlevas)

2016-02-11 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/trunk e0492163d -> 2871d674f


AMBARI-14980. Provide explicit ordering for roles (rlevas)


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

Branch: refs/heads/trunk
Commit: 2871d674f57f46220c2448c6e5dbcb456f04878f
Parents: e049216
Author: Robert Levas 
Authored: Thu Feb 11 12:59:00 2016 -0500
Committer: Robert Levas 
Committed: Thu Feb 11 12:59:04 2016 -0500

--
 .../internal/PermissionResourceProvider.java|  3 ++
 .../server/orm/entities/PermissionEntity.java   | 35 +++-
 .../server/upgrade/UpgradeCatalog240.java   | 32 ++-
 .../main/resources/Ambari-DDL-Derby-CREATE.sql  | 17 +++---
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  | 17 +++---
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql | 19 +++
 .../resources/Ambari-DDL-Postgres-CREATE.sql| 17 +++---
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql | 17 +++---
 .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 17 +++---
 .../resources/Ambari-DDL-SQLServer-CREATE.sql   | 17 +++---
 .../PermissionResourceProviderTest.java |  2 +
 .../server/upgrade/UpgradeCatalog240Test.java   | 57 ++--
 12 files changed, 187 insertions(+), 63 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2871d674/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PermissionResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PermissionResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PermissionResourceProvider.java
index 640123e..86f8321 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PermissionResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PermissionResourceProvider.java
@@ -52,6 +52,7 @@ public class PermissionResourceProvider extends 
AbstractResourceProvider {
   public static final String PERMISSION_NAME_PROPERTY_ID = 
"PermissionInfo/permission_name";
   public static final String PERMISSION_LABEL_PROPERTY_ID = 
"PermissionInfo/permission_label";
   public static final String RESOURCE_NAME_PROPERTY_ID   = 
"PermissionInfo/resource_name";
+  public static final String SORT_ORDER_PROPERTY_ID   = 
"PermissionInfo/sort_order";
 
 
   /**
@@ -71,6 +72,7 @@ public class PermissionResourceProvider extends 
AbstractResourceProvider {
 propertyIds.add(PERMISSION_NAME_PROPERTY_ID);
 propertyIds.add(PERMISSION_LABEL_PROPERTY_ID);
 propertyIds.add(RESOURCE_NAME_PROPERTY_ID);
+propertyIds.add(SORT_ORDER_PROPERTY_ID);
   }
 
 
@@ -156,6 +158,7 @@ public class PermissionResourceProvider extends 
AbstractResourceProvider {
 setResourceProperty(resource, PERMISSION_NAME_PROPERTY_ID, 
entity.getPermissionName(), requestedIds);
 setResourceProperty(resource, PERMISSION_LABEL_PROPERTY_ID, 
entity.getPermissionLabel(), requestedIds);
 setResourceProperty(resource, RESOURCE_NAME_PROPERTY_ID, 
entity.getResourceType().getName(), requestedIds);
+setResourceProperty(resource, SORT_ORDER_PROPERTY_ID, 
entity.getSortOrder(), requestedIds);
 
 return resource;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2871d674/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/PermissionEntity.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/PermissionEntity.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/PermissionEntity.java
index a692730..43fd71b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/PermissionEntity.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/PermissionEntity.java
@@ -57,8 +57,11 @@ public class PermissionEntity {
* Admin permission name constants.
*/
   public static final String AMBARI_ADMINISTRATOR_PERMISSION_NAME = 
"AMBARI.ADMINISTRATOR";
-  public static final String CLUSTER_USER_PERMISSION_NAME = "CLUSTER.USER";
   public static final String CLUSTER_ADMINISTRATOR_PERMISSION_NAME = 
"CLUSTER.ADMINISTRATOR";
+  public static final String CLUSTER_OPERATOR_PERMISSION_NAME = 
"CLUSTER.OPERATOR";
+  public static final String SERVICE_ADMINISTRATOR_PERMISSION_NAME = 
"SERVICE.ADMINISTRATOR";
+  public static final String SERVICE_OPERATOR_PERMISSION_NAME = 
"SERVICE.OPERATOR";
+  public static final String CLUSTER_USER_PERMISSION_NAME = "CLUSTER.USER";
   public static final String V

[2/2] ambari git commit: AMBARI-14800 Alerts: HDFS alerts based on AMS metrics (additional patch) (dsen)

2016-02-11 Thread dsen
AMBARI-14800 Alerts: HDFS alerts based on AMS metrics (additional patch) (dsen)


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

Branch: refs/heads/branch-2.2
Commit: f99db40c09bae674f605505bf85394c9be3d5561
Parents: 749821e
Author: Dmytro Sen 
Authored: Thu Feb 11 19:37:11 2016 +0200
Committer: Dmytro Sen 
Committed: Thu Feb 11 19:44:44 2016 +0200

--
 .../common-services/HDFS/2.1.0.2.0/alerts.json  | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f99db40c/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
index bba6c11..2a6229c 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
@@ -523,7 +523,7 @@
   },
   {
 "name": "increase_nn_heap_usage_hourly",
-"label": "Hourly increase in NN heap usage",
+"label": "NameNode Heap Usage (Hourly)",
 "description": "This service-level alert is triggered if the NN heap 
usage deviation has grown beyond the specified threshold within a given time 
interval.",
 "interval": 5,
 "scope": "ANY",
@@ -581,7 +581,7 @@
   },
   {
 "name": "namenode_service_rpc_latency_hourly",
-"label": "Hourly Service-RPC latency",
+"label": "NameNode RPC Latency (Hourly)",
 "description": "This service-level alert is triggered if the 
Service-RPC latency deviation has grown beyond the specified threshold within a 
given time interval.",
 "interval": 5,
 "scope": "ANY",
@@ -639,7 +639,7 @@
   },
   {
 "name": "namenode_increase_in_storage_capacity_usage_hourly",
-"label": "Hourly increase in storage capacity usage",
+"label": "HDFS Storage Capacity Usage (Hourly)",
 "description": "This service-level alert is triggered if the increase 
in storage capacity usage deviation has grown beyond the specified threshold 
within a given time interval.",
 "interval": 5,
 "scope": "ANY",
@@ -697,7 +697,7 @@
   },
   {
 "name": "increase_nn_heap_usage_daily",
-"label": "Daily increase in NN heap usage",
+"label": "NameNode Heap Usage (Daily)",
 "description": "This service-level alert is triggered if the NN heap 
usage deviation has grown beyond the specified threshold within a given time 
interval.",
 "interval": 480,
 "scope": "ANY",
@@ -755,7 +755,7 @@
   },
   {
 "name": "namenode_service_rpc_latency_daily",
-"label": "Daily Service-RPC latency",
+"label": "NameNode RPC Latency (Daily)",
 "description": "This service-level alert is triggered if the 
Service-RPC latency deviation has grown beyond the specified threshold within a 
given time interval.",
 "interval": 480,
 "scope": "ANY",
@@ -813,7 +813,7 @@
   },
   {
 "name": "namenode_increase_in_storage_capacity_usage_daily",
-"label": "Daily increase in storage capacity usage",
+"label": "HDFS Storage Capacity Usage (Daily)",
 "description": "This service-level alert is triggered if the increase 
in storage capacity usage deviation has grown beyond the specified threshold 
within a given time interval.",
 "interval": 480,
 "scope": "ANY",
@@ -871,7 +871,7 @@
   },
   {
 "name": "increase_nn_heap_usage_weekly",
-"label": "Weekly increase in NN heap usage",
+"label": "NameNode Heap Usage (Weekly)",
 "description": "This service-level alert is triggered if the NN heap 
usage deviation has grown beyond the specified threshold within a given time 
interval.",
 "interval": 1440,
 "scope": "ANY",
@@ -929,7 +929,7 @@
   },
   {
 "name": "namenode_increase_in_storage_capacity_usage_weekly",
-"label": "Weekly increase in storage capacity usage",
+"label": "HDFS Storage Capacity Usage (Weekly)",
 "description": "This service-level alert is triggered if the increase 
in storage capacity usage deviation has grown beyond the specified threshold 
within a given time interval.",
 "interval": 1440,
 "scope": "ANY",



[1/2] ambari git commit: AMBARI-14800 Alerts: HDFS alerts based on AMS metrics (dsen)

2016-02-11 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 644d4a2c3 -> f99db40c0


AMBARI-14800 Alerts: HDFS alerts based on AMS metrics (dsen)


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

Branch: refs/heads/branch-2.2
Commit: 749821e4ea1f88e9b971bc24e81c037bac9bc1c8
Parents: 644d4a2
Author: Dmytro Sen 
Authored: Tue Jan 26 20:03:26 2016 +0200
Committer: Dmytro Sen 
Committed: Thu Feb 11 19:44:28 2016 +0200

--
 .../common-services/HDFS/2.1.0.2.0/alerts.json  | 464 +++
 .../package/alerts/alert_metrics_deviation.py   | 357 ++
 2 files changed, 821 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/749821e4/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
index 1eda00f..bba6c11 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
@@ -520,6 +520,470 @@
 }
   ]
 }
+  },
+  {
+"name": "increase_nn_heap_usage_hourly",
+"label": "Hourly increase in NN heap usage",
+"description": "This service-level alert is triggered if the NN heap 
usage deviation has grown beyond the specified threshold within a given time 
interval.",
+"interval": 5,
+"scope": "ANY",
+"enabled": false,
+"source": {
+  "type": "SCRIPT",
+  "path": "HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py",
+  "parameters": [
+{
+  "name": "mergeHaMetrics",
+  "display_name": "Whether active and stanby NameNodes metrics 
should be merged",
+  "value": "false",
+  "type": "STRING",
+  "description": "Whether active and stanby NameNodes metrics 
should be merged."
+},
+{
+  "name": "interval",
+  "display_name": "Time interval in minutes",
+  "value": 60,
+  "type": "NUMERIC",
+  "description": "Time interval in minutes."
+},
+{
+  "name": "appId",
+  "display_name": "AMS application id",
+  "value": "NAMENODE",
+  "type": "STRING",
+  "description": "The application id used to retrieve the metric."
+},
+{
+  "name": "metricName",
+  "display_name": "Metric Name",
+  "value": "jvm.JvmMetrics.MemHeapUsedM",
+  "type": "STRING",
+  "description": "The metric to monitor."
+},
+{
+  "name": "metric.deviation.warning.threshold",
+  "display_name": "The standard deviation threshold above which a 
warning is produced.",
+  "type": "PERCENT",
+  "units": "%",
+  "value": 100,
+  "threshold": "WARNING"
+},
+{
+  "name": "metric.deviation.critical.threshold",
+  "display_name": "The standard deviation threshold above which a 
critical alert is produced.",
+  "type": "PERCENT",
+  "units": "%",
+  "value": 200,
+  "threshold": "CRITICAL"
+}
+  ]
+}
+  },
+  {
+"name": "namenode_service_rpc_latency_hourly",
+"label": "Hourly Service-RPC latency",
+"description": "This service-level alert is triggered if the 
Service-RPC latency deviation has grown beyond the specified threshold within a 
given time interval.",
+"interval": 5,
+"scope": "ANY",
+"enabled": false,
+"source": {
+  "type": "SCRIPT",
+  "path": "HDFS/2.1.0.2.0/package/alerts/alert_metrics_deviation.py",
+  "parameters": [
+{
+  "name": "mergeHaMetrics",
+  "display_name": "Whether active and stanby NameNodes metrics 
should be merged",
+  "value": "false",
+  "type": "STRING",
+  "description": "Whether active and stanby NameNodes metrics 
should be merged."
+},
+{
+  "name": "interval",
+  "display_name": "Time interval in minutes",
+  "value": 60,
+  "type": "NUMERIC",
+  "description": "Time interval in minutes."
+},

ambari git commit: AMBARI-14800 Alerts: HDFS alerts based on AMS metrics (additional patch) (dsen)

2016-02-11 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk 58fe67c19 -> e0492163d


AMBARI-14800 Alerts: HDFS alerts based on AMS metrics (additional patch) (dsen)


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

Branch: refs/heads/trunk
Commit: e0492163d060e1840eecc1d463a9e5ddebbf81a5
Parents: 58fe67c
Author: Dmytro Sen 
Authored: Thu Feb 11 19:37:11 2016 +0200
Committer: Dmytro Sen 
Committed: Thu Feb 11 19:37:11 2016 +0200

--
 .../common-services/HDFS/2.1.0.2.0/alerts.json  | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e0492163/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
index bba6c11..2a6229c 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
@@ -523,7 +523,7 @@
   },
   {
 "name": "increase_nn_heap_usage_hourly",
-"label": "Hourly increase in NN heap usage",
+"label": "NameNode Heap Usage (Hourly)",
 "description": "This service-level alert is triggered if the NN heap 
usage deviation has grown beyond the specified threshold within a given time 
interval.",
 "interval": 5,
 "scope": "ANY",
@@ -581,7 +581,7 @@
   },
   {
 "name": "namenode_service_rpc_latency_hourly",
-"label": "Hourly Service-RPC latency",
+"label": "NameNode RPC Latency (Hourly)",
 "description": "This service-level alert is triggered if the 
Service-RPC latency deviation has grown beyond the specified threshold within a 
given time interval.",
 "interval": 5,
 "scope": "ANY",
@@ -639,7 +639,7 @@
   },
   {
 "name": "namenode_increase_in_storage_capacity_usage_hourly",
-"label": "Hourly increase in storage capacity usage",
+"label": "HDFS Storage Capacity Usage (Hourly)",
 "description": "This service-level alert is triggered if the increase 
in storage capacity usage deviation has grown beyond the specified threshold 
within a given time interval.",
 "interval": 5,
 "scope": "ANY",
@@ -697,7 +697,7 @@
   },
   {
 "name": "increase_nn_heap_usage_daily",
-"label": "Daily increase in NN heap usage",
+"label": "NameNode Heap Usage (Daily)",
 "description": "This service-level alert is triggered if the NN heap 
usage deviation has grown beyond the specified threshold within a given time 
interval.",
 "interval": 480,
 "scope": "ANY",
@@ -755,7 +755,7 @@
   },
   {
 "name": "namenode_service_rpc_latency_daily",
-"label": "Daily Service-RPC latency",
+"label": "NameNode RPC Latency (Daily)",
 "description": "This service-level alert is triggered if the 
Service-RPC latency deviation has grown beyond the specified threshold within a 
given time interval.",
 "interval": 480,
 "scope": "ANY",
@@ -813,7 +813,7 @@
   },
   {
 "name": "namenode_increase_in_storage_capacity_usage_daily",
-"label": "Daily increase in storage capacity usage",
+"label": "HDFS Storage Capacity Usage (Daily)",
 "description": "This service-level alert is triggered if the increase 
in storage capacity usage deviation has grown beyond the specified threshold 
within a given time interval.",
 "interval": 480,
 "scope": "ANY",
@@ -871,7 +871,7 @@
   },
   {
 "name": "increase_nn_heap_usage_weekly",
-"label": "Weekly increase in NN heap usage",
+"label": "NameNode Heap Usage (Weekly)",
 "description": "This service-level alert is triggered if the NN heap 
usage deviation has grown beyond the specified threshold within a given time 
interval.",
 "interval": 1440,
 "scope": "ANY",
@@ -929,7 +929,7 @@
   },
   {
 "name": "namenode_increase_in_storage_capacity_usage_weekly",
-"label": "Weekly increase in storage capacity usage",
+"label": "HDFS Storage Capacity Usage (Weekly)",
 "description": "This service-level alert is triggered if the increase 
in storage capacity usage deviation has grown beyond the specified threshold 
within a given time interval.",
 "interval": 1440,
 "scope": "ANY",



[1/2] ambari git commit: Revert "AMBARI-14936. Tweaks to reduce build time (aonishuk)"

2016-02-11 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 754d0fad5 -> 58fe67c19


Revert "AMBARI-14936. Tweaks to reduce build time (aonishuk)"

This reverts commit dc8e5c3c68d25e74ab875a87f66959fc86a9631c.


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

Branch: refs/heads/trunk
Commit: 58fe67c199b9dde7cd0963c9567e728db983def0
Parents: fdb101b
Author: Alex Antonenko 
Authored: Thu Feb 11 18:14:51 2016 +0200
Committer: Alex Antonenko 
Committed: Thu Feb 11 18:17:50 2016 +0200

--
 ambari-agent/pom.xml | 40 +++
 ambari-server/pom.xml|  6 ++--
 ambari-server/src/main/assemblies/server.xml |  2 +-
 ambari-web/pom.xml   |  3 +-
 pom.xml  | 18 +-
 5 files changed, 42 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/58fe67c1/ambari-agent/pom.xml
--
diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index c2c993f..23d2969 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -86,6 +86,24 @@
 3.0
   
   
+maven-assembly-plugin
+
+  gnu
+  
+src/packages/tarball/all.xml
+  
+
+
+  
+build-tarball
+prepare-package
+
+  single
+
+  
+
+  
+  
 org.apache.maven.plugins
 maven-surefire-plugin
 
@@ -257,24 +275,6 @@
 
   
   
-maven-assembly-plugin
-
-  gnu
-  
-src/packages/tarball/all.xml
-  
-
-
-  
-build-tarball
-${assemblyPhase}
-
-  single
-
-  
-
-  
-  
 maven-resources-plugin
 2.6
 
@@ -347,7 +347,7 @@
   
   
 copy-repo-resources
-${assemblyPhase}
+package
 
   copy-resources
 
@@ -391,7 +391,7 @@
 
   
 rename-file
-${assemblyPhase}
+package
 
   rename
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/58fe67c1/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 51fd88b..5a95ec4 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -134,7 +134,7 @@
 
   
 build-tarball
-${assemblyPhase}
+package
 
   single
 
@@ -173,7 +173,7 @@
   
   
 copy-repo-resources
-${assemblyPhase}
+package
 
   copy-resources
 
@@ -217,7 +217,7 @@
 
   
 rename-file
-${assemblyPhase}
+package
 
   rename
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/58fe67c1/ambari-server/src/main/assemblies/server.xml
--
diff --git a/ambari-server/src/main/assemblies/server.xml 
b/ambari-server/src/main/assemblies/server.xml
index ca74185..a75de79 100644
--- a/ambari-server/src/main/assemblies/server.xml
+++ b/ambari-server/src/main/assemblies/server.xml
@@ -301,7 +301,7 @@
 
 
   755
-  src/main/resources/stacks/stack_advisor.py
+  target/classes/stacks/stack_advisor.py
   
/var/lib/ambari-server/resources/stacks
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/58fe67c1/ambari-web/pom.xml
--
diff --git a/ambari-web/pom.xml b/ambari-web/pom.xml
index 6304b3d..761a3f0 100644
--- a/ambari-web/pom.xml
+++ b/ambari-web/pom.xml
@@ -32,7 +32,6 @@
   
 ${project.parent.parent.basedir}
 UTF-8
-node_modules 
   
   
 
@@ -101,7 +100,7 @@
 
   ${executable.rmdir}
   ${basedir}
-  ${args.rm.clean} public 
${nodemodules.dir}
+  ${args.rm.clean} public 
node_modules
   
 0
 1

http://git-wip-us.apache.org/repos/asf/ambari/blob/58fe67c1/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 8f321fd..57c6de7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,7 +60,6 @@
   

[2/2] ambari git commit: AMBARI-15009. Log Search: Add link to background operations popup navigate to Host Details Logs tab with pre-set condition (alexantonenko)

2016-02-11 Thread alexantonenko
AMBARI-15009. Log Search: Add link to background operations popup navigate to 
Host Details Logs tab with pre-set condition (alexantonenko)


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

Branch: refs/heads/trunk
Commit: fdb101bdd78a4d6d2626008dc4a146374283e8f3
Parents: 754d0fa
Author: Alex Antonenko 
Authored: Thu Feb 11 12:46:33 2016 +0200
Committer: Alex Antonenko 
Committed: Thu Feb 11 18:17:50 2016 +0200

--
 .../main/admin/kerberos/step7_controller.js | 12 ++--
 ambari-web/app/messages.js  |  1 +
 ambari-web/app/styles/application.less  | 12 ++--
 .../templates/common/host_progress_popup.hbs|  5 ++
 ambari-web/app/utils/ajax/ajax.js   | 15 
 ambari-web/app/views/application.js | 22 ++
 .../common/host_progress_popup_body_view.js | 75 +++-
 .../app/views/common/log_file_search_view.js|  2 +-
 ambari-web/app/views/common/modal_popup.js  | 27 +++
 .../modal_popups/log_file_search_popup.js   | 12 +++-
 .../host_progress_popup_body_view_test.js   | 54 +-
 11 files changed, 204 insertions(+), 33 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fdb101bd/ambari-web/app/controllers/main/admin/kerberos/step7_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step7_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step7_controller.js
index 71e94ca..2a4fb90 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step7_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step7_controller.js
@@ -48,13 +48,13 @@ App.KerberosWizardStep7Controller = 
App.KerberosProgressPageController.extend({
   }
 };
 if (isRetry) {
-  // on retry we have to unkerberize cluster
-  this.unkerberizeCluster().always(function() {
-// clear current request object before start of kerberize process
-self.set('request', kerberizeRequest);
-self.clearStage();
-self.loadStep();
+  // on retry send force update
+  self.set('request', {
+name: 'KERBERIZE_CLUSTER',
+ajaxName: 'admin.kerberize.cluster.force'
   });
+  self.clearStage();
+  self.loadStep();
 } else {
   this.set('request', kerberizeRequest);
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/fdb101bd/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 59877a5..909f55c 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -313,6 +313,7 @@ Em.I18n.translations = {
   'common.keywords': 'Keywods',
   'common.levels': 'Levels',
   'common.extension': 'Extension',
+  'common.logs': 'Logs',
 
   'models.alert_instance.tiggered.verbose': "Occurred on {0}  Checked on 
{1}",
   'models.alert_definition.triggered.verbose': "Occurred on {0}",

http://git-wip-us.apache.org/repos/asf/ambari/blob/fdb101bd/ambari-web/app/styles/application.less
--
diff --git a/ambari-web/app/styles/application.less 
b/ambari-web/app/styles/application.less
index 57b7e76..4e2b5d1 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -1861,13 +1861,13 @@ a:focus {
   float: right;
   a {
 cursor: pointer;
-  }
-  .task-detail-copy {
-margin-right: 12px;
 float: left;
-  }
-  .task-detail-open-dialog {
-float: right;
+margin-right: 12px;
+
+&:last-child {
+  margin-right: 0;
+  float: right;
+}
   }
 }
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/fdb101bd/ambari-web/app/templates/common/host_progress_popup.hbs
--
diff --git a/ambari-web/app/templates/common/host_progress_popup.hbs 
b/ambari-web/app/templates/common/host_progress_popup.hbs
index 00f2e08..fe330f7 100644
--- a/ambari-web/app/templates/common/host_progress_popup.hbs
+++ b/ambari-web/app/templates/common/host_progress_popup.hbs
@@ -195,6 +195,11 @@
 
{{t common.copy}}
+  {{#if App.supports.logSearch}}
+
+   {{t common.logs}}
+
+  {{/if}}
{{t common.open}}
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/fdb101bd/ambari-web/app/utils/ajax/ajax.js
--

ambari git commit: Revert "AMBARI-15007. Make amazon2015 a part of redhat6 family (aonishuk)"

2016-02-11 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 b34606340 -> 644d4a2c3


Revert "AMBARI-15007. Make amazon2015 a part of redhat6 family (aonishuk)"

This reverts commit 9377291daf9617485b63979430d64ffa901468e4 due to UT failures.


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

Branch: refs/heads/branch-2.2
Commit: 644d4a2c3c5047d103f15027ba5726119befad4a
Parents: b346063
Author: Yusaku Sako 
Authored: Thu Feb 11 08:10:27 2016 -0800
Committer: Yusaku Sako 
Committed: Thu Feb 11 08:10:27 2016 -0800

--
 .../src/main/python/ambari_commons/os_check.py  |  73 +++---
 .../ambari_commons/resources/os_family.json | 137 ++-
 .../server/state/stack/JsonOsFamilyRoot.java|  38 -
 .../ambari/server/state/stack/OsFamily.java |   8 +-
 .../resources/stacks/HDP/2.2/repos/repoinfo.xml |  12 ++
 .../resources/stacks/HDP/2.3/repos/repoinfo.xml |  12 ++
 .../resources/stacks/HDP/2.4/repos/repoinfo.xml |  12 ++
 ambari-server/src/test/python/TestOSCheck.py|  37 ++---
 8 files changed, 137 insertions(+), 192 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/644d4a2c/ambari-common/src/main/python/ambari_commons/os_check.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/os_check.py 
b/ambari-common/src/main/python/ambari_commons/os_check.py
index d30b7f9..238c276 100644
--- a/ambari-common/src/main/python/ambari_commons/os_check.py
+++ b/ambari-common/src/main/python/ambari_commons/os_check.py
@@ -56,8 +56,6 @@ RESOURCES_DIR = 
os.path.join(os.path.dirname(os.path.realpath(__file__)), "resou
 
 # family JSON data
 OSFAMILY_JSON_RESOURCE = "os_family.json"
-JSON_OS_MAPPING = "mapping"
-JSON_OS_ALIASES = "aliases"
 JSON_OS_TYPE = "distro"
 JSON_OS_VERSION = "versions"
 JSON_EXTENDS = "extends"
@@ -78,8 +76,6 @@ VER_NT_SERVER = 3
 _IS_ORACLE_LINUX = os.path.exists('/etc/oracle-release')
 _IS_REDHAT_LINUX = os.path.exists('/etc/redhat-release')
 
-SYSTEM_RELEASE_FILE = "/etc/system-release"
-
 def _is_oracle_linux():
   return _IS_ORACLE_LINUX
 
@@ -88,16 +84,16 @@ def _is_redhat_linux():
 
 def advanced_check(distribution):
   distribution = list(distribution)
-  if os.path.exists(SYSTEM_RELEASE_FILE):
-with open(SYSTEM_RELEASE_FILE, "rb") as fp:
+  if os.path.exists("/etc/issue"):
+with open("/etc/issue", "rb") as fp:
   issue_content = fp.read()
   
 if "Amazon" in issue_content:
   distribution[0] = "amazon"
-  search_groups = re.search('(\d+\.\d+)', issue_content)
+  search_groups = re.search('(\d+)\.(\d+)', issue_content)
   
   if search_groups:
-distribution[1] = search_groups.group(1)
+distribution[1] = search_groups.group(1) # if version is 2015.09 only 
get 2015.
   
   return tuple(distribution)
 
@@ -118,24 +114,16 @@ class OS_CONST_TYPE(type):
   f = open(os.path.join(RESOURCES_DIR, OSFAMILY_JSON_RESOURCE))
   json_data = eval(f.read())
   f.close()
-  
-  if JSON_OS_MAPPING not in json_data:
-raise Exception("Invalid {0}".format(OSFAMILY_JSON_RESOURCE))
-  
-  json_mapping_data = json_data[JSON_OS_MAPPING]
-  
-  for family in json_mapping_data:
+  for family in json_data:
 cls.FAMILY_COLLECTION += [family]
-cls.OS_COLLECTION += json_mapping_data[family][JSON_OS_TYPE]
+cls.OS_COLLECTION += json_data[family][JSON_OS_TYPE]
 cls.OS_FAMILY_COLLECTION += [{
   'name': family,
-  'os_list': json_mapping_data[family][JSON_OS_TYPE]
+  'os_list': json_data[family][JSON_OS_TYPE]
 }]
 
-if JSON_EXTENDS in json_mapping_data[family]:
-  cls.OS_FAMILY_COLLECTION[-1][JSON_EXTENDS] = 
json_mapping_data[family][JSON_EXTENDS]
-  
-cls.OS_TYPE_ALIASES = json_data[JSON_OS_ALIASES] if JSON_OS_ALIASES in 
json_data else {}
+if JSON_EXTENDS in json_data[family]:
+  cls.OS_FAMILY_COLLECTION[-1][JSON_EXTENDS] = 
json_data[family][JSON_EXTENDS]
 except:
   raise Exception("Couldn't load '%s' file" % OSFAMILY_JSON_RESOURCE)
 
@@ -206,24 +194,7 @@ class OSCheck:
 distribution = ("Darwin", "TestOnly", "1.1.1", "1.1.1", "1.1")
 
 return distribution
-  
-  @staticmethod
-  def get_alias(os_type, os_version):
-version_parts = os_version.split('.')
-full_os_and_major_version = os_type + version_parts[0]
-
-if full_os_and_major_version in OSConst.OS_TYPE_ALIASES:
-  alias = OSConst.OS_TYPE_ALIASES[full_os_and_major_version]
-  re_groups = re.search('(\D+)(\d+)$', alias).groups()
-  o

ambari git commit: Revert "AMBARI-15007. Make amazon2015 to be part of redhat6 family (aonishuk)"

2016-02-11 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk b144caae1 -> 754d0fad5


Revert "AMBARI-15007. Make amazon2015 to be part of redhat6 family (aonishuk)"

This reverts commit 6270fe39331eb8f8e16a49ad7b8df59edecd2ce5 due to UT failures.


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

Branch: refs/heads/trunk
Commit: 754d0fad592e74bc7e1bdac233ed19e9a5124c7a
Parents: b144caa
Author: Yusaku Sako 
Authored: Thu Feb 11 08:11:06 2016 -0800
Committer: Yusaku Sako 
Committed: Thu Feb 11 08:11:06 2016 -0800

--
 .../src/main/python/ambari_commons/os_check.py  |  73 +++---
 .../ambari_commons/resources/os_family.json | 137 ++-
 .../server/state/stack/JsonOsFamilyRoot.java|  38 -
 .../ambari/server/state/stack/OsFamily.java |   8 +-
 .../resources/stacks/HDP/2.2/repos/repoinfo.xml |  12 ++
 .../resources/stacks/HDP/2.3/repos/repoinfo.xml |  12 ++
 .../resources/stacks/HDP/2.4/repos/repoinfo.xml |  12 ++
 ambari-server/src/test/python/TestOSCheck.py|  37 ++---
 8 files changed, 137 insertions(+), 192 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/754d0fad/ambari-common/src/main/python/ambari_commons/os_check.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/os_check.py 
b/ambari-common/src/main/python/ambari_commons/os_check.py
index b430c86..c5457bb 100644
--- a/ambari-common/src/main/python/ambari_commons/os_check.py
+++ b/ambari-common/src/main/python/ambari_commons/os_check.py
@@ -56,8 +56,6 @@ RESOURCES_DIR = 
os.path.join(os.path.dirname(os.path.realpath(__file__)), "resou
 
 # family JSON data
 OSFAMILY_JSON_RESOURCE = "os_family.json"
-JSON_OS_MAPPING = "mapping"
-JSON_OS_ALIASES = "aliases"
 JSON_OS_TYPE = "distro"
 JSON_OS_VERSION = "versions"
 JSON_EXTENDS = "extends"
@@ -78,8 +76,6 @@ VER_NT_SERVER = 3
 _IS_ORACLE_LINUX = os.path.exists('/etc/oracle-release')
 _IS_REDHAT_LINUX = os.path.exists('/etc/redhat-release')
 
-SYSTEM_RELEASE_FILE = "/etc/system-release"
-
 def _is_oracle_linux():
   return _IS_ORACLE_LINUX
 
@@ -88,16 +84,16 @@ def _is_redhat_linux():
 
 def advanced_check(distribution):
   distribution = list(distribution)
-  if os.path.exists(SYSTEM_RELEASE_FILE):
-with open(SYSTEM_RELEASE_FILE, "rb") as fp:
+  if os.path.exists("/etc/issue"):
+with open("/etc/issue", "rb") as fp:
   issue_content = fp.read()
   
 if "Amazon" in issue_content:
   distribution[0] = "amazon"
-  search_groups = re.search('(\d+\.\d+)', issue_content)
+  search_groups = re.search('(\d+)\.(\d+)', issue_content)
   
   if search_groups:
-distribution[1] = search_groups.group(1)
+distribution[1] = search_groups.group(1) # if version is 2015.09 only 
get 2015.
   
   return tuple(distribution)
 
@@ -118,24 +114,16 @@ class OS_CONST_TYPE(type):
   f = open(os.path.join(RESOURCES_DIR, OSFAMILY_JSON_RESOURCE))
   json_data = eval(f.read())
   f.close()
-  
-  if JSON_OS_MAPPING not in json_data:
-raise Exception("Invalid {0}".format(OSFAMILY_JSON_RESOURCE))
-  
-  json_mapping_data = json_data[JSON_OS_MAPPING]
-  
-  for family in json_mapping_data:
+  for family in json_data:
 cls.FAMILY_COLLECTION += [family]
-cls.OS_COLLECTION += json_mapping_data[family][JSON_OS_TYPE]
+cls.OS_COLLECTION += json_data[family][JSON_OS_TYPE]
 cls.OS_FAMILY_COLLECTION += [{
   'name': family,
-  'os_list': json_mapping_data[family][JSON_OS_TYPE]
+  'os_list': json_data[family][JSON_OS_TYPE]
 }]
 
-if JSON_EXTENDS in json_mapping_data[family]:
-  cls.OS_FAMILY_COLLECTION[-1][JSON_EXTENDS] = 
json_mapping_data[family][JSON_EXTENDS]
-  
-cls.OS_TYPE_ALIASES = json_data[JSON_OS_ALIASES] if JSON_OS_ALIASES in 
json_data else {}
+if JSON_EXTENDS in json_data[family]:
+  cls.OS_FAMILY_COLLECTION[-1][JSON_EXTENDS] = 
json_data[family][JSON_EXTENDS]
 except:
   raise Exception("Couldn't load '%s' file" % OSFAMILY_JSON_RESOURCE)
 
@@ -206,24 +194,7 @@ class OSCheck:
 distribution = ("Darwin", "TestOnly", "1.1.1", "1.1.1", "1.1")
 
 return distribution
-  
-  @staticmethod
-  def get_alias(os_type, os_version):
-version_parts = os_version.split('.')
-full_os_and_major_version = os_type + version_parts[0]
-
-if full_os_and_major_version in OSConst.OS_TYPE_ALIASES:
-  alias = OSConst.OS_TYPE_ALIASES[full_os_and_major_version]
-  re_groups = re.search('(\D+)(\d+)$', alias).groups()
-  os_type

[2/2] ambari git commit: AMBARI-15014 Incorrect #of required properties at Ranger Customize Services page (Next button not enabled). (ababiichuk)

2016-02-11 Thread ababiichuk
AMBARI-15014 Incorrect #of required properties at Ranger Customize Services 
page (Next button not enabled). (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 2ca172d4ce7fa6e025ce512212b07eab25f38bcc
Parents: 6d258d7
Author: ababiichuk 
Authored: Thu Feb 11 15:20:33 2016 +0200
Committer: ababiichuk 
Committed: Thu Feb 11 17:46:11 2016 +0200

--
 .../app/controllers/wizard/step7_controller.js  |  5 +--
 ambari-web/app/mixins/common/serverValidator.js |  2 +-
 .../models/configs/objects/service_config.js|  6 +--
 .../configs/objects/service_config_property.js  |  6 ---
 .../app/models/configs/theme/sub_section.js | 12 ++---
 .../app/models/configs/theme/sub_section_tab.js |  6 +--
 .../config_recommendation_popup.hbs | 46 ++--
 .../configs/widgets/config_widget_view.js   |  5 +--
 .../configs/objects/service_config_test.js  |  7 +--
 9 files changed, 31 insertions(+), 64 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2ca172d4/ambari-web/app/controllers/wizard/step7_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js 
b/ambari-web/app/controllers/wizard/step7_controller.js
index c92e83d..c6f4689 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -676,10 +676,7 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
   themeResource.get('configProperties').forEach(function 
(_configId) {
 configs.forEach(function (item) {
   if (App.config.configId(item.name, item.filename) === 
_configId) {
-// if config has already been hidden by condition with 
"subsection" or "subsectionTab" type
-// then ignore condition of "config" type
-if (configCondition.get('type') === 'config' && 
item.hiddenBySection) return false;
-item.hiddenBySection = !valueAttributes['visible'];
+item.isVisible = valueAttributes['visible'];
   }
 });
   }, this);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2ca172d4/ambari-web/app/mixins/common/serverValidator.js
--
diff --git a/ambari-web/app/mixins/common/serverValidator.js 
b/ambari-web/app/mixins/common/serverValidator.js
index 99a5921..231c376 100644
--- a/ambari-web/app/mixins/common/serverValidator.js
+++ b/ambari-web/app/mixins/common/serverValidator.js
@@ -301,7 +301,7 @@ App.ServerValidatorMixin = Em.Mixin.create({
 : self.get('stepConfigs');
   var configsWithErrors = stepConfigs.some(function (step) {
 return step.get('configs').some(function(c) {
-  return c.get('isVisible') && !c.get('hiddenBySection') && 
(c.get('warn') || c.get('error'));
+  return c.get('isVisible') && (c.get('warn') || c.get('error'));
 })
   });
   if (configsWithErrors) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2ca172d4/ambari-web/app/models/configs/objects/service_config.js
--
diff --git a/ambari-web/app/models/configs/objects/service_config.js 
b/ambari-web/app/models/configs/objects/service_config.js
index 56b8aa4..c75486c 100644
--- a/ambari-web/app/models/configs/objects/service_config.js
+++ b/ambari-web/app/models/configs/objects/service_config.js
@@ -38,11 +38,7 @@ App.ServiceConfig = Ember.Object.extend({
 
   errorCount: Em.computed.alias('configsWithErrors.length'),
 
-  visibleProperties: function() {
-return this.get('configs').filter(function(c) {
-  return c.get('isVisible') && !c.get('hiddenBySection');
-});
-  }.property('configs.@each.isVisible', 'configs.@each.hiddenBySection'),
+  visibleProperties: Em.computed.filterBy('configs', 'isVisible', true),
 
   configsWithErrors: function() {
 return this.get('visibleProperties').filter(function(c) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2ca172d4/ambari-web/app/models/configs/objects/service_config_property.js
--
diff --git a/ambari-web/app/models/configs/objects/service_config_property.js 
b/ambari-web/app/models/configs/objects/service_config_property.js
index 21e3dd3..422dc22 100644
--- a/ambari-web/app/models/configs/objects/service_config_property.js
+++ b/ambari-web/app/models/configs/objects/ser

[1/2] ambari git commit: AMBARI-15015 UI adds config properties that are not necessary. (ababiichuk)

2016-02-11 Thread ababiichuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 6d258d7c0 -> b144caae1


AMBARI-15015 UI adds config properties that are not necessary. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: b144caae1a219fc461edac9fa352660d2747538b
Parents: 2ca172d
Author: ababiichuk 
Authored: Thu Feb 11 16:00:06 2016 +0200
Committer: ababiichuk 
Committed: Thu Feb 11 17:46:11 2016 +0200

--
 .../app/controllers/wizard/step8_controller.js  | 30 +++-
 1 file changed, 17 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b144caae/ambari-web/app/controllers/wizard/step8_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js 
b/ambari-web/app/controllers/wizard/step8_controller.js
index 50629f3..0ac998b 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1621,15 +1621,17 @@ App.WizardStep8Controller = 
Em.Controller.extend(App.AddSecurityConfigs, App.wiz
   isGLUSTERFSSelected = 
installedAndSelectedServices.someProperty('serviceName', 'GLUSTERFS');
 
 coreSiteObj.forEach(function (_coreSiteObj) {
-  if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.default.name") {
-coreSiteProperties[_coreSiteObj.name] =
-  this.get('configs').someProperty('name', 
'fs_glusterfs_default_name') ?
-this.get('configs').findProperty('name', 
'fs_glusterfs_default_name').value : null;
-  }
-  if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.defaultFS") {
-coreSiteProperties[_coreSiteObj.name] =
-  this.get('configs').someProperty('name', 'glusterfs_defaultFS_name') 
?
-this.get('configs').findProperty('name', 
'glusterfs_defaultFS_name').value : null;
+  if (coreSiteObj.isRequiredByAgent !== false) {
+if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.default.name") {
+  coreSiteProperties[_coreSiteObj.name] =
+this.get('configs').someProperty('name', 
'fs_glusterfs_default_name') ?
+  this.get('configs').findProperty('name', 
'fs_glusterfs_default_name').value : null;
+}
+if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.defaultFS") {
+  coreSiteProperties[_coreSiteObj.name] =
+this.get('configs').someProperty('name', 
'glusterfs_defaultFS_name') ?
+  this.get('configs').findProperty('name', 
'glusterfs_defaultFS_name').value : null;
+}
   }
 }, this);
 var attributes = 
App.router.get('mainServiceInfoConfigsController').getConfigAttributes(coreSiteObj);
@@ -1683,10 +1685,12 @@ App.WizardStep8Controller = 
Em.Controller.extend(App.AddSecurityConfigs, App.wiz
 var configs = this.get('configs').filterProperty('filename', 
'storm-site.xml');
 var stormProperties = {};
 configs.forEach(function (_configProperty) {
-  if (["nimbus.seeds", 
"storm.zookeeper.servers"].contains(_configProperty.name)) {
-stormProperties[_configProperty.name] = 
JSON.stringify(_configProperty.value).replace(/"/g, "'");
-  } else {
-stormProperties[_configProperty.name] = _configProperty.value;
+  if (_configProperty.isRequiredByAgent !== false) {
+if (["nimbus.seeds", 
"storm.zookeeper.servers"].contains(_configProperty.name)) {
+  stormProperties[_configProperty.name] = 
JSON.stringify(_configProperty.value).replace(/"/g, "'");
+} else {
+  stormProperties[_configProperty.name] = _configProperty.value;
+}
   }
 }, this);
 return {type: 'storm-site', tag: tag, properties: stormProperties};



[2/2] ambari git commit: AMBARI-15015 UI adds config properties that are not necessary. (ababiichuk)

2016-02-11 Thread ababiichuk
AMBARI-15015 UI adds config properties that are not necessary. (ababiichuk)


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

Branch: refs/heads/branch-2.2
Commit: b3460634012500765dc54317cc1c28b77780c336
Parents: d3d66f2
Author: ababiichuk 
Authored: Thu Feb 11 16:00:06 2016 +0200
Committer: ababiichuk 
Committed: Thu Feb 11 16:01:57 2016 +0200

--
 .../app/controllers/wizard/step8_controller.js  | 30 +++-
 1 file changed, 17 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b3460634/ambari-web/app/controllers/wizard/step8_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js 
b/ambari-web/app/controllers/wizard/step8_controller.js
index aa1d97b..747bf83 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1559,15 +1559,17 @@ App.WizardStep8Controller = 
Em.Controller.extend(App.AddSecurityConfigs, App.wiz
   isGLUSTERFSSelected = 
installedAndSelectedServices.someProperty('serviceName', 'GLUSTERFS');
 
 coreSiteObj.forEach(function (_coreSiteObj) {
-  if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.default.name") {
-coreSiteProperties[_coreSiteObj.name] =
-  this.get('configs').someProperty('name', 
'fs_glusterfs_default_name') ?
-this.get('configs').findProperty('name', 
'fs_glusterfs_default_name').value : null;
-  }
-  if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.defaultFS") {
-coreSiteProperties[_coreSiteObj.name] =
-  this.get('configs').someProperty('name', 'glusterfs_defaultFS_name') 
?
-this.get('configs').findProperty('name', 
'glusterfs_defaultFS_name').value : null;
+  if (coreSiteObj.isRequiredByAgent !== false) {
+if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.default.name") {
+  coreSiteProperties[_coreSiteObj.name] =
+this.get('configs').someProperty('name', 
'fs_glusterfs_default_name') ?
+  this.get('configs').findProperty('name', 
'fs_glusterfs_default_name').value : null;
+}
+if (isGLUSTERFSSelected && _coreSiteObj.name == "fs.defaultFS") {
+  coreSiteProperties[_coreSiteObj.name] =
+this.get('configs').someProperty('name', 
'glusterfs_defaultFS_name') ?
+  this.get('configs').findProperty('name', 
'glusterfs_defaultFS_name').value : null;
+}
   }
 }, this);
 var attributes = 
App.router.get('mainServiceInfoConfigsController').getConfigAttributes(coreSiteObj);
@@ -1621,10 +1623,12 @@ App.WizardStep8Controller = 
Em.Controller.extend(App.AddSecurityConfigs, App.wiz
 var configs = this.get('configs').filterProperty('filename', 
'storm-site.xml');
 var stormProperties = {};
 configs.forEach(function (_configProperty) {
-  if (["nimbus.seeds", 
"storm.zookeeper.servers"].contains(_configProperty.name)) {
-stormProperties[_configProperty.name] = 
JSON.stringify(_configProperty.value).replace(/"/g, "'");
-  } else {
-stormProperties[_configProperty.name] = _configProperty.value;
+  if (_configProperty.isRequiredByAgent !== false) {
+if (["nimbus.seeds", 
"storm.zookeeper.servers"].contains(_configProperty.name)) {
+  stormProperties[_configProperty.name] = 
JSON.stringify(_configProperty.value).replace(/"/g, "'");
+} else {
+  stormProperties[_configProperty.name] = _configProperty.value;
+}
   }
 }, this);
 return {type: 'storm-site', tag: tag, properties: stormProperties};



[1/2] ambari git commit: AMBARI-15014 Incorrect #of required properties at Ranger Customize Services page (Next button not enabled). (ababiichuk)

2016-02-11 Thread ababiichuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 58b0b5014 -> b34606340


AMBARI-15014 Incorrect #of required properties at Ranger Customize Services 
page (Next button not enabled). (ababiichuk)


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

Branch: refs/heads/branch-2.2
Commit: d3d66f2549a16cd1aab17af3e4a7fe033626ca79
Parents: 58b0b50
Author: ababiichuk 
Authored: Thu Feb 11 15:25:06 2016 +0200
Committer: ababiichuk 
Committed: Thu Feb 11 16:01:31 2016 +0200

--
 .../app/controllers/wizard/step7_controller.js  |  5 +--
 ambari-web/app/mixins/common/serverValidator.js |  2 +-
 .../models/configs/objects/service_config.js|  4 +-
 .../configs/objects/service_config_property.js  |  6 ---
 .../app/models/configs/theme/sub_section.js |  4 +-
 .../app/models/configs/theme/sub_section_tab.js |  4 +-
 .../config_recommendation_popup.hbs | 46 ++--
 .../configs/widgets/config_widget_view.js   |  5 +--
 ambari-web/test/models/configs/section_test.js  |  7 ---
 9 files changed, 29 insertions(+), 54 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d3d66f25/ambari-web/app/controllers/wizard/step7_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js 
b/ambari-web/app/controllers/wizard/step7_controller.js
index db6464d..b00669a 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -685,10 +685,7 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
   themeResource.get('configProperties').forEach(function (_config) 
{
 configs.forEach(function (item) {
   if (item.name === _config.get('name') && item.filename === 
_config.get('fileName')) {
-// if config has already been hidden by condition with 
"subsection" or "subsectionTab" type
-// then ignore condition of "config" type
-if (configCondition.get('type') === 'config' && 
item.hiddenBySection) return false;
-item.hiddenBySection = !valueAttributes['visible'];
+item.isVisible = valueAttributes['visible'];
   }
 });
   }, this);

http://git-wip-us.apache.org/repos/asf/ambari/blob/d3d66f25/ambari-web/app/mixins/common/serverValidator.js
--
diff --git a/ambari-web/app/mixins/common/serverValidator.js 
b/ambari-web/app/mixins/common/serverValidator.js
index ebb68ad..1ea9c59 100644
--- a/ambari-web/app/mixins/common/serverValidator.js
+++ b/ambari-web/app/mixins/common/serverValidator.js
@@ -399,7 +399,7 @@ App.ServerValidatorMixin = Em.Mixin.create({
 : self.get('stepConfigs');
   var configsWithErrors = stepConfigs.some(function (step) {
 return step.get('configs').some(function(c) {
-  return c.get('isVisible') && !c.get('hiddenBySection') && 
(c.get('warn') || c.get('error'));
+  return c.get('isVisible') && (c.get('warn') || c.get('error'));
 })
   });
   if (configsWithErrors) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/d3d66f25/ambari-web/app/models/configs/objects/service_config.js
--
diff --git a/ambari-web/app/models/configs/objects/service_config.js 
b/ambari-web/app/models/configs/objects/service_config.js
index 71b05e6..d8677d1 100644
--- a/ambari-web/app/models/configs/objects/service_config.js
+++ b/ambari-web/app/models/configs/objects/service_config.js
@@ -61,7 +61,7 @@ App.ServiceConfig = Ember.Object.extend({
 category.incrementProperty('nonSlaveErrorCount');
 masterErrors++;
   }
-  if (!item.get('isValid') && item.get('widgetType') && 
item.get('isVisible') && !item.get('hiddenBySection')) {
+  if (!item.get('isValid') && item.get('widgetType') && 
item.get('isVisible')) {
 enhancedConfigsErrors++;
   }
   if (item.get('overrides')) {
@@ -76,7 +76,7 @@ App.ServiceConfig = Ember.Object.extend({
   }
 });
 return masterErrors + slaveErrors + overrideErrors + enhancedConfigsErrors;
-  }.property('configs.@each.isValid', 'configs.@each.isVisible', 
'configs.@each.hiddenBySection', 'configCategories.@each.slaveErrorCount', 
'configs.@each.overrideErrorTrigger'),
+  }.property('configs.@each.isValid', 'configs.@each.isVisible', 
'configCategories.@each.slaveErrorCount', 'configs.@each.overrideErrorTrigger'

ambari git commit: AMBARI-14948. Config consistency checker.(vbrodetskyi)

2016-02-11 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/trunk 4fe6f000b -> 6d258d7c0


AMBARI-14948. Config consistency checker.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: 6d258d7c0ddebcc4a9e172e3c473b5ea462d79bf
Parents: 4fe6f00
Author: Vitaly Brodetskyi 
Authored: Thu Feb 11 02:06:10 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Thu Feb 11 02:07:16 2016 +0200

--
 ambari-server/sbin/ambari-server|   6 +-
 .../server/checks/CheckDatabaseHelper.java  | 473 +++
 ambari-server/src/main/python/ambari-server.py  |   7 +-
 .../main/python/ambari_server/checkDatabase.py  |  80 
 .../main/python/ambari_server/setupActions.py   |   1 +
 .../server/checks/CheckDatabaseHelperTest.java  | 292 
 .../src/test/python/TestAmbariServer.py |  36 ++
 7 files changed, 892 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6d258d7c/ambari-server/sbin/ambari-server
--
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index 431ee5f..cdda673 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -138,6 +138,10 @@ case "$1" in
 echo -e "Updating host names"
 $PYTHON /usr/sbin/ambari-server.py $@
 ;;
+  check-database)
+echo -e "Checking database"
+$PYTHON /usr/sbin/ambari-server.py $@
+;;
   enable-stack)
 echo -e "Enabling stack(s)..."
 $PYTHON /usr/sbin/ambari-server.py $@
@@ -148,7 +152,7 @@ case "$1" in
 ;;
   *)
 echo "Usage: /usr/sbin/ambari-server
-
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|enable-stack}
 [options]
+
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|setup-sso|refresh-stack-hash|backup|restore|update-host-names|enable-stack|check-database}
 [options]
 Use usr/sbin/ambari-server  --help to get details on options 
available.
 Or, simply invoke ambari-server.py --help to print the options."
 exit 1

http://git-wip-us.apache.org/repos/asf/ambari/blob/6d258d7c/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java
new file mode 100644
index 000..a078c8a
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java
@@ -0,0 +1,473 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.checks;
+
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.Multimap;
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.persist.PersistService;
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.api.services.AmbariMetaInfo;
+import org.apache.ambari.server.controller.ControllerModule;
+import org.apache.ambari.server.orm.DBAccessor;
+import org.apache.ambari.server.state.ServiceInfo;
+import org.apache.ambari.server.utils.EventBusSynchronizer;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Ha

ambari git commit: AMBARI-14978. Create Upgrade Packs for Patch Upgrades (ncole)

2016-02-11 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/branch-dev-patch-upgrade 1809161eb -> 03bc22607


AMBARI-14978. Create Upgrade Packs for Patch Upgrades (ncole)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 03bc22607d533896f44ee3d60e29aa2a08ffe31e
Parents: 1809161
Author: Nate Cole 
Authored: Wed Feb 10 15:55:25 2016 -0500
Committer: Nate Cole 
Committed: Thu Feb 11 08:47:10 2016 -0500

--
 .../internal/UpgradeResourceProvider.java   |  34 ++-
 .../ambari/server/state/UpgradeContext.java |  11 +
 .../ambari/server/state/UpgradeHelper.java  |   5 +
 .../state/stack/upgrade/ClusterGrouping.java|  19 +-
 .../state/stack/upgrade/ColocatedGrouping.java  |  36 ++-
 .../server/state/stack/upgrade/Grouping.java|  47 ++--
 .../stack/upgrade/StageWrapperBuilder.java  |  41 ++-
 .../ambari/server/state/stack/upgrade/Task.java |   7 +
 .../state/stack/upgrade/UpgradeScope.java   |  60 +
 .../HDP/2.2/upgrades/nonrolling-upgrade-2.2.xml |   1 +
 .../stacks/HDP/2.2/upgrades/upgrade-2.2.xml |   1 +
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.3.xml |   1 +
 .../stacks/HDP/2.3/upgrades/upgrade-2.3.xml |   1 +
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.4.xml |   1 +
 .../stacks/HDP/2.4/upgrades/upgrade-2.4.xml |   1 +
 .../src/main/resources/version_definition.xsd   |   1 +
 .../AmbariManagementControllerTest.java |   8 +-
 .../ambari/server/state/UpgradeHelperTest.java  | 100 ---
 .../HDP/2.1.1/upgrades/upgrade_test_partial.xml | 259 +++
 19 files changed, 535 insertions(+), 99 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/03bc2260/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index db8c079..40565c5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -106,6 +106,7 @@ import 
org.apache.ambari.server.state.stack.upgrade.StageWrapper;
 import org.apache.ambari.server.state.stack.upgrade.Task;
 import org.apache.ambari.server.state.stack.upgrade.TaskWrapper;
 import org.apache.ambari.server.state.stack.upgrade.UpdateStackGrouping;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeScope;
 import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import 
org.apache.ambari.server.state.svccomphost.ServiceComponentHostServerActionEvent;
 import org.apache.commons.collections.CollectionUtils;
@@ -304,9 +305,9 @@ public class UpgradeResourceProvider extends 
AbstractControllerResourceProvider
 String forceDowngrade = 
requestInfoProps.get(UpgradeResourceDefinition.DOWNGRADE_DIRECTIVE);
 String clusterName = (String) requestMap.get(UPGRADE_CLUSTER_NAME);
 
-  if (null == clusterName) {
-  throw new AmbariException(String.format("%s is required", 
UPGRADE_CLUSTER_NAME));
-   }
+if (null == clusterName) {
+  throw new AmbariException(String.format("%s is required", 
UPGRADE_CLUSTER_NAME));
+}
 
 Cluster cluster = 
getManagementController().getClusters().getCluster(clusterName);
 Direction direction = Boolean.parseBoolean(forceDowngrade) ? 
Direction.DOWNGRADE
@@ -315,15 +316,17 @@ public class UpgradeResourceProvider extends 
AbstractControllerResourceProvider
 UpgradePack up = validateRequest(direction, requestMap);
 
 try {
-  return createUpgrade(cluster, direction, up, requestMap);
-} catch (Exception e){
-  LOG.error("Error appears during upgrade task submitting", e);
-
-// Any error caused in the createUpgrade will initiate 
transaction rollback
-  // As we operate inside with cluster data, any cache which 
belongs to cluster need to be flushed
-cluster.invalidateData();
-  throw e;
-}
+  return createUpgrade(cluster, direction, up, requestMap);
+} catch (Exception e) {
+  LOG.error("Error appears during upgrade task submitting", e);
+
+  // Any error caused in the createUpgrade will initiate transaction
+  // rollback
+  // As we operate inside with

ambari git commit: AMBARI-14994. CLUSTER.MANAGE_CONFIG_GROUPS not present in table 'roleauthorization' error during upgrade from 2.2.1 to 2.4.0 (rlevas)

2016-02-11 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/trunk 96bdecf84 -> 4fe6f000b


AMBARI-14994. CLUSTER.MANAGE_CONFIG_GROUPS not present in table 
'roleauthorization' error during upgrade from 2.2.1 to 2.4.0 (rlevas)


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

Branch: refs/heads/trunk
Commit: 4fe6f000b3851cc7c43664e6e4df4738ab019810
Parents: 96bdecf
Author: Robert Levas 
Authored: Thu Feb 11 09:13:27 2016 -0500
Committer: Robert Levas 
Committed: Thu Feb 11 09:13:27 2016 -0500

--
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java| 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4fe6f000/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java
index 2d6fe03..eb5feb7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java
@@ -198,6 +198,7 @@ public class UpgradeCatalog230 extends 
AbstractUpgradeCatalog {
 dbAccessor.insertRow(ROLE_AUTHORIZATION_TABLE, columnNames, new 
String[]{"'CLUSTER.VIEW_ALERTS'", "'View cluster-level alerts'"}, false);
 dbAccessor.insertRow(ROLE_AUTHORIZATION_TABLE, columnNames, new 
String[]{"'CLUSTER.MANAGE_CREDENTIALS'", "'Manage external credentials'"}, 
false);
 dbAccessor.insertRow(ROLE_AUTHORIZATION_TABLE, columnNames, new 
String[]{"'CLUSTER.MODIFY_CONFIGS'", "'Modify cluster configurations'"}, false);
+dbAccessor.insertRow(ROLE_AUTHORIZATION_TABLE, columnNames, new 
String[]{"'CLUSTER.MANAGE_CONFIG_GROUPS'", "'Manage cluster configuration 
groups'"}, false);
 dbAccessor.insertRow(ROLE_AUTHORIZATION_TABLE, columnNames, new 
String[]{"'CLUSTER.MANAGE_ALERTS'", "'Manage cluster-level alerts'"}, false);
 dbAccessor.insertRow(ROLE_AUTHORIZATION_TABLE, columnNames, new 
String[]{"'CLUSTER.TOGGLE_ALERTS'", "'Enable/disable cluster-level alerts'"}, 
false);
 dbAccessor.insertRow(ROLE_AUTHORIZATION_TABLE, columnNames, new 
String[]{"'CLUSTER.TOGGLE_KERBEROS'", "'Enable/disable Kerberos'"}, false);



ambari git commit: AMBARI-14948. Config consistency checker.(vbrodetskyi)

2016-02-11 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 7ce5a0072 -> 58b0b5014


AMBARI-14948. Config consistency checker.(vbrodetskyi)


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

Branch: refs/heads/branch-2.2
Commit: 58b0b5014ee3753230782b9e97c52662c25ceed2
Parents: 7ce5a00
Author: Vitaly Brodetskyi 
Authored: Thu Feb 11 01:10:42 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Thu Feb 11 01:10:42 2016 +0200

--
 ambari-server/sbin/ambari-server|   6 +-
 .../server/checks/CheckDatabaseHelper.java  | 473 +++
 ambari-server/src/main/python/ambari-server.py  |   9 +-
 .../main/python/ambari_server/checkDatabase.py  |  80 
 .../main/python/ambari_server/setupActions.py   |   1 +
 .../server/checks/CheckDatabaseHelperTest.java  | 292 
 .../src/test/python/TestAmbariServer.py |  37 ++
 7 files changed, 894 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/58b0b501/ambari-server/sbin/ambari-server
--
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index 72d94ed..e676cbc 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -138,9 +138,13 @@ case "$1" in
 echo -e "Updating host names"
 $PYTHON /usr/sbin/ambari-server.py $@
 ;;
+  check-database)
+echo -e "Checking database"
+$PYTHON /usr/sbin/ambari-server.py $@
+;;
   *)
 echo "Usage: /usr/sbin/ambari-server
-
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|refresh-stack-hash|backup|restore|update-host-names}
 [options]
+
{start|stop|restart|setup|setup-jce|upgrade|status|upgradestack|setup-ldap|sync-ldap|set-current|setup-security|refresh-stack-hash|backup|restore|update-host-names|check-database}
 [options]
 Use usr/sbin/ambari-server  --help to get details on options 
available.
 Or, simply invoke ambari-server.py --help to print the options."
 exit 1

http://git-wip-us.apache.org/repos/asf/ambari/blob/58b0b501/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java
new file mode 100644
index 000..a078c8a
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDatabaseHelper.java
@@ -0,0 +1,473 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.checks;
+
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.Multimap;
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.persist.PersistService;
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.api.services.AmbariMetaInfo;
+import org.apache.ambari.server.controller.ControllerModule;
+import org.apache.ambari.server.orm.DBAccessor;
+import org.apache.ambari.server.state.ServiceInfo;
+import org.apache.ambari.server.utils.EventBusSynchronizer;
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/*
+* Class for database validation.
+* Here we will check configs, services, componen

[16/17] ambari git commit: AMBARI-14993. Log Search: Add Host Log Metrics to Host Details -> Summary (alexantonenko)

2016-02-11 Thread ncole
AMBARI-14993. Log Search: Add Host Log Metrics to Host Details -> Summary 
(alexantonenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 96bdecf8474064465b2ecc1261152d9ba68730e2
Parents: 209ec33
Author: Alex Antonenko 
Authored: Wed Feb 10 16:31:52 2016 +0200
Committer: Alex Antonenko 
Committed: Thu Feb 11 11:48:18 2016 +0200

--
 ambari-web/app/messages.js  |   1 +
 ambari-web/app/routes/main.js   |   5 +-
 .../app/templates/main/host/log_metrics.hbs |  26 
 ambari-web/app/templates/main/host/summary.hbs  |  24 +++-
 ambari-web/app/utils/ember_reopen.js|  46 ++
 ambari-web/app/views.js |   1 +
 ambari-web/app/views/common/chart/pie.js|  11 +-
 ambari-web/app/views/main/host/log_metrics.js   | 141 +++
 ambari-web/app/views/main/host/logs_view.js |  12 ++
 ambari-web/test/utils/ember_reopen_test.js  |  57 
 10 files changed, 311 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/96bdecf8/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 00fb4b9..59877a5 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2307,6 +2307,7 @@ Em.I18n.translations = {
   'hosts.host.summary.hostname':'Hostname',
   'hosts.host.summary.agentHeartbeat':'Heartbeat',
   'hosts.host.summary.hostMetrics':'Host Metrics',
+  'hosts.host.summary.hostLogMetrics':'Host Log Metrics',
   'hosts.host.summary.addComponent':'Add Component',
   'hosts.host.summary.currentVersion':'Current Version',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/96bdecf8/ambari-web/app/routes/main.js
--
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 891bf34..419f845 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -265,13 +265,16 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
   }),
 
   logs: Em.Route.extend({
-route: '/logs',
+route: '/logs:query',
 connectOutlets: function (router, context) {
   if (App.get('supports.logSearch')) {
 
router.get('mainHostDetailsController').connectOutlet('mainHostLogs')
   } else {
 router.transitionTo('summary');
   }
+},
+serialize: function(router, params) {
+  return this.serializeQueryParams(router, params, 
'mainHostDetailsController');
 }
   }),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/96bdecf8/ambari-web/app/templates/main/host/log_metrics.hbs
--
diff --git a/ambari-web/app/templates/main/host/log_metrics.hbs 
b/ambari-web/app/templates/main/host/log_metrics.hbs
new file mode 100644
index 000..22a39be
--- /dev/null
+++ b/ambari-web/app/templates/main/host/log_metrics.hbs
@@ -0,0 +1,26 @@
+{{!
+* 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.
+}}
+
+
+  {{#each item in view.logsData}}
+
+  {{view view.chartView contentBinding="item"}}
+  {{item.service.displayName}}
+
+  {{/each}}
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/96bdecf8/ambari-web/app/templates/main/host/summary.hbs
--
diff --git a/ambari-web/app/templates/main/host/summary.hbs 
b/ambari-web/app/templates/main/host/summary.hbs
index 6b4c7a5..17a0b69 100644
--- a/ambari-web/app/templates/main/host/summary.hbs
+++ b/ambari-web/app/templates/main/host/summary.hbs
@@ -168,19 +168,31 @@
 
 
 
-  {{!metrics}}
-  {{#unless view.isNoHostMetricsService}}
-  
+

[17/17] ambari git commit: Merge branch 'trunk' into branch-dev-patch-upgrade

2016-02-11 Thread ncole
Merge branch 'trunk' into branch-dev-patch-upgrade


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 1809161eb5914c7905745911cecea4d9da7a3f26
Parents: 2a9f49c 96bdecf
Author: Nate Cole 
Authored: Thu Feb 11 08:46:52 2016 -0500
Committer: Nate Cole 
Committed: Thu Feb 11 08:46:52 2016 -0500

--
 .../main/python/ambari_agent/RecoveryManager.py |  41 ++---
 .../test/python/ambari_agent/TestActionQueue.py |   2 +-
 .../python/ambari_agent/TestRecoveryManager.py  |  88 +-
 .../src/main/python/ambari_commons/os_check.py  |  73 ++---
 .../ambari_commons/resources/os_family.json | 137 
 .../libraries/functions/package_conditions.py   |   7 +-
 ambari-funtest/pom.xml  |   5 -
 .../2.1.1/services/AMBARI_METRICS/metainfo.xml  |   2 +-
 ambari-metrics/ambari-metrics-grafana/README.md |  20 +++
 .../ambari-metrics/datasource.js| 127 +++
 .../ambari-metrics/partials/query.editor.html   |   6 +-
 ambari-metrics/ambari-metrics-grafana/pom.xml   |  16 +-
 .../screenshots/20-templating.png   | Bin 0 -> 694376 bytes
 .../timeline/HBaseTimelineMetricStore.java  |  18 ++-
 .../metrics/timeline/PhoenixHBaseAccessor.java  |  21 ++-
 .../timeline/TimelineMetricConfiguration.java   |  10 ++
 ambari-metrics/pom.xml  |   1 -
 ambari-project/pom.xml  |   2 +-
 ambari-server/pom.xml   |   5 -
 .../ambari/server/agent/HeartBeatHandler.java   |  39 -
 .../ambari/server/agent/RecoveryConfig.java |  18 +--
 .../dispatchers/AlertScriptDispatcher.java  |  18 ++-
 .../services/AlertNoticeDispatchService.java|   2 +-
 .../state/services/CachedAlertFlushService.java |   2 +-
 .../server/state/stack/JsonOsFamilyRoot.java|  38 +
 .../ambari/server/state/stack/OsFamily.java |   8 +-
 .../server/upgrade/UpgradeCatalog222.java   | 116 -
 .../1.6.1.2.2.0/configuration/accumulo-site.xml |   2 +
 .../0.1.0/configuration/ams-site.xml|  37 +++--
 .../AMBARI_METRICS/0.1.0/metainfo.xml   |   2 +
 .../0.1.0/package/scripts/metrics_collector.py  |   4 +-
 .../0.1.0/package/scripts/metrics_grafana.py|   5 +-
 .../package/scripts/metrics_grafana_util.py |   6 +-
 .../0.1.0/package/scripts/metrics_monitor.py|   2 +-
 .../metrics_grafana_datasource.json.j2  |   2 +-
 .../configuration/application-properties.xml|   1 +
 .../configuration/falcon-startup.properties.xml |   1 +
 .../common-services/HAWQ/2.0.0/metainfo.xml |  10 ++
 .../2.0.0/package/scripts/hawq_constants.py |   1 +
 .../HAWQ/2.0.0/package/scripts/hawqstandby.py   |   6 +-
 .../0.96.0.2.0/configuration/hbase-site.xml |   1 +
 .../HDFS/2.1.0.2.0/configuration/core-site.xml  |   1 +
 .../HDFS/2.1.0.2.0/configuration/hdfs-site.xml  |   3 +
 .../HIVE/0.12.0.2.0/configuration/hive-site.xml |   3 +
 .../0.12.0.2.0/configuration/webhcat-site.xml   |   1 +
 .../0.8.1.2.2/configuration/kafka-broker.xml|   2 +
 .../ranger-knox-plugin-properties.xml   |   1 +
 .../4.0.0.2.0/configuration/oozie-site.xml  |   1 +
 .../4.2.0.2.3/configuration/oozie-site.xml  |   1 +
 .../RANGER/0.4.0/configuration/ranger-env.xml   |   1 +
 .../0.5.0.2.3/configuration/kms-site.xml|   1 +
 .../0.9.1.2.1/configuration/storm-site.xml  |   1 +
 .../configuration-mapred/mapred-site.xml|   2 +
 .../YARN/2.1.0.2.0/configuration/yarn-site.xml  |   8 +
 .../stacks/HDP/2.0.6/services/stack_advisor.py  |   5 +-
 .../services/HIVE/configuration/hive-site.xml   |   2 +
 .../services/OOZIE/configuration/oozie-site.xml |   1 +
 .../services/YARN/configuration/yarn-site.xml   |   3 +
 .../resources/stacks/HDP/2.2/repos/repoinfo.xml |  12 --
 .../ranger-hbase-plugin-properties.xml  |   1 +
 .../ranger-hdfs-plugin-properties.xml   |   4 +-
 .../services/HIVE/configuration/hive-env.xml|  20 ---
 .../services/HIVE/configuration/hive-site.xml   |  18 +--
 .../ranger-hive-plugin-properties.xml   |   1 +
 .../ranger-storm-plugin-properties.xml  |   1 +
 .../services/YARN/configuration/yarn-site.xml   |   2 +
 .../stacks/HDP/2.2/services/stack_advisor.py|  13 +-
 .../resources/stacks/HDP/2.3/repos/repoinfo.xml |  12 --
 .../KAFKA/configuration/kafka-broker.xml|   1 +
 .../ranger-kafka-plugin-properties.xml  |   1 +
 .../RANGER/configuration/ranger-env.xml |   2 +
 .../services/STORM/configuration/storm-site.xml |   2 +
 .../resources/stacks/HDP/2.4/repos/repoinfo.xml |  12 --
 .../services/HIVE/configuration/hive-env.xml|  20 ---
 .../services/HIVE/con

[08/17] ambari git commit: AMBARI-14983. Auto-start services: Show list of Services/Component with status indicator (Zhe (Joe) Wang via srimanth)

2016-02-11 Thread ncole
AMBARI-14983. Auto-start services: Show list of Services/Component with status 
indicator (Zhe (Joe) Wang via srimanth)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 364ee0269f1fecfd58e7bdfca846270850db040f
Parents: 0d52ebc
Author: Srimanth Gunturi 
Authored: Wed Feb 10 12:38:42 2016 -0800
Committer: Srimanth Gunturi 
Committed: Wed Feb 10 12:38:48 2016 -0800

--
 .../main/admin/service_auto_start.js| 161 ++-
 ambari-web/app/routes/main.js   |   8 +
 ambari-web/app/styles/application.less  |   5 +
 .../templates/main/admin/service_auto_start.hbs |  46 +-
 .../service_auto_start/component_auto_start.hbs |  19 +++
 ambari-web/app/utils/ajax/ajax.js   |  21 +++
 ambari-web/app/views.js |   1 +
 .../app/views/main/admin/service_auto_start.js  |  14 +-
 .../service_auto_start/component_auto_start.js  |  57 +++
 9 files changed, 319 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/364ee026/ambari-web/app/controllers/main/admin/service_auto_start.js
--
diff --git a/ambari-web/app/controllers/main/admin/service_auto_start.js 
b/ambari-web/app/controllers/main/admin/service_auto_start.js
index fd288ed..4071292 100644
--- a/ambari-web/app/controllers/main/admin/service_auto_start.js
+++ b/ambari-web/app/controllers/main/admin/service_auto_start.js
@@ -21,6 +21,11 @@ var App = require('app');
 App.MainAdminServiceAutoStartController = Em.Controller.extend({
   name: 'mainAdminServiceAutoStartController',
 
+  clusterConfigs: null,
+  componentsConfigs: [],
+  isSaveDisabled: true,
+  valueChanged: false,
+
   loadClusterConfig: function () {
 return App.ajax.send({
   name: 'config.tags.site',
@@ -31,6 +36,161 @@ App.MainAdminServiceAutoStartController = 
Em.Controller.extend({
 });
   },
 
+  loadComponentsConfigs: function () {
+return App.ajax.send({
+  name: 'components.get_category',
+  sender: this,
+  success: 'loadComponentsConfigsSuccess'
+});
+  },
+
+  loadComponentsConfigsSuccess: function (data) {
+this.set('componentsConfigs', data.items);
+  },
+
+  tabs: function() {
+var services = {};
+var tabs = [];
+this.get('componentsConfigs').forEach(function(component) {
+  var serviceComponentInfo = component.ServiceComponentInfo;
+  if (serviceComponentInfo.category === "MASTER" || 
serviceComponentInfo.category === "SLAVE") {
+var componentRecovery = Ember.Object.create({
+  display_name: App.format.role(serviceComponentInfo.component_name),
+  component_name: serviceComponentInfo.component_name,
+  //recovery_enabled: serviceComponentInfo.recovery_enabled === 'true',
+  recovery_enabled: false,
+  valueChanged: false,
+  service_name: serviceComponentInfo.service_name
+});
+if (services[serviceComponentInfo.service_name]) {
+  
services[serviceComponentInfo.service_name].get('componentRecovery').push(componentRecovery);
+  services[serviceComponentInfo.service_name].set('enabledComponents', 
services[serviceComponentInfo.service_name].get('enabledComponents') + 
(componentRecovery.get('recovery_enabled') ? 1 : 0));
+  services[serviceComponentInfo.service_name].set('totalComponents', 
services[serviceComponentInfo.service_name].get('totalComponents') + 1);
+} else {
+  services[serviceComponentInfo.service_name] = Ember.Object.create({
+service_name: serviceComponentInfo.service_name,
+display_name: App.format.role(serviceComponentInfo.service_name),
+headingClass: "." + serviceComponentInfo.service_name,
+isActive: false,
+componentRecovery: [componentRecovery],
+enabledComponents: componentRecovery.recovery_enabled ? 1 : 0,
+totalComponents: 1,
+indicator: function() {
+  var percentage = this.get('enabledComponents') / 
this.get('totalComponents');
+  var indicator = "icon-adjust";
+  if (percentage === 1) {
+indicator = "icon-circle";
+  } else if (percentage === 0) {
+indicator = "icon-circle-blank";
+  }
+  return indicator;
+}.property('enabledComponents', 'totalComponents')
+  });
+}
+  }
+});
+for (var service in services ) {
+  tabs.push(services[service]);
+}
+if (tabs.length) {
+  

[15/17] ambari git commit: AMBARI-14992. Upon changing the time range for displaying graphs, UI does not show feedback (doesn't update and keeps showing the same graph) when data is not available (ale

2016-02-11 Thread ncole
AMBARI-14992. Upon changing the time range for displaying graphs, UI does not 
show feedback (doesn't update and keeps showing the same graph) when data is 
not available (alexantonenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 209ec330def90559aa767211f3b869d21c13b673
Parents: b9a35f1
Author: Alex Antonenko 
Authored: Wed Feb 10 15:47:16 2016 +0200
Committer: Alex Antonenko 
Committed: Thu Feb 11 11:48:18 2016 +0200

--
 .../app/mixins/common/widgets/widget_mixin.js   |  49 +++-
 ambari-web/app/styles/application.less  |   5 +
 .../views/common/widget/graph_widget_view.js|   4 +-
 .../test/mixins/common/widget_mixin_test.js | 124 +++
 4 files changed, 176 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/209ec330/ambari-web/app/mixins/common/widgets/widget_mixin.js
--
diff --git a/ambari-web/app/mixins/common/widgets/widget_mixin.js 
b/ambari-web/app/mixins/common/widgets/widget_mixin.js
index df7ff76..b6fe353 100644
--- a/ambari-web/app/mixins/common/widgets/widget_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/widget_mixin.js
@@ -119,6 +119,7 @@ App.WidgetMixin = Ember.Mixin.create({
   context: this,
   startCallName: 'getHostComponentMetrics',
   successCallback: this.getHostComponentMetricsSuccessCallback,
+  errorCallback: this.getMetricsErrorCallback,
   completeCallback: function () {
 requestCounter--;
 if (requestCounter === 0) this.onMetricsLoaded();
@@ -130,6 +131,7 @@ App.WidgetMixin = Ember.Mixin.create({
   context: this,
   startCallName: 'getServiceComponentMetrics',
   successCallback: this.getMetricsSuccessCallback,
+  errorCallback: this.getMetricsErrorCallback,
   completeCallback: function () {
 requestCounter--;
 if (requestCounter === 0) this.onMetricsLoaded();
@@ -271,12 +273,41 @@ App.WidgetMixin = Ember.Mixin.create({
 if (!Em.isNone(metric_data)) {
   _metric.data = metric_data;
   this.get('metrics').pushObject(_metric);
+} else if (this.get('graphView')) {
+  var graph = this.get('childViews') && 
this.get('childViews').findProperty('_showMessage');
+  if (graph) {
+graph.set('hasData', false);
+this.set('isExportButtonHidden', true);
+graph._showMessage('info', this.t('graphs.noData.title'), 
this.t('graphs.noDataAtTime.message'));
+this.get('metrics').clear();
+  }
 }
   }, this);
 }
   },
 
   /**
+   * error callback on getting aggregated metrics and host component metrics
+   * @param {object} xhr
+   * @param {string} textStatus
+   * @param {string} errorThrown
+   */
+  getMetricsErrorCallback: function (xhr, textStatus, errorThrown) {
+if (this.get('graphView')) {
+  var graph = this.get('childViews') && 
this.get('childViews').findProperty('_showMessage');
+  if (graph) {
+if (xhr.readyState == 4 && xhr.status) {
+  textStatus = xhr.status + " " + textStatus;
+}
+graph.set('hasData', false);
+this.set('isExportButtonHidden', true);
+graph._showMessage('warn', this.t('graphs.error.title'), 
this.t('graphs.error.message').format(textStatus, errorThrown));
+this.get('metrics').clear();
+  }
+}
+  },
+
+  /**
* make GET call to get metrics value for all host components
* @param {object} request
* @return {$.ajax}
@@ -704,6 +735,7 @@ App.WidgetLoadAggregator = Em.Object.create({
 bulks[id].subRequests = [{
   context: request.context,
   successCallback: request.successCallback,
+  errorCallback: request.errorCallback,
   completeCallback: request.completeCallback
 }];
   } else {
@@ -711,6 +743,7 @@ App.WidgetLoadAggregator = Em.Object.create({
 bulks[id].subRequests.push({
   context: request.context,
   successCallback: request.successCallback,
+  errorCallback: request.errorCallback,
   completeCallback: request.completeCallback
 });
   }
@@ -732,11 +765,17 @@ App.WidgetLoadAggregator = Em.Object.create({
   _request.subRequests.forEach(function (subRequest) {
 subRequest.successCallback.call(subRequest.context, response);
   }, this);
-}).complete(function () {
-  _request.subRequests.forEach(function (subRequest) {
-subRequest.comple

[14/17] ambari git commit: AMBARI-14989. Inconsistent HIVE CBO setting presentation. (Jaimin)

2016-02-11 Thread ncole
AMBARI-14989. Inconsistent HIVE CBO setting presentation. (Jaimin)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: b9a35f1ea6201c7f7c45a9f1463c0802504ee4a5
Parents: 6270fe3
Author: Jaimin Jetly 
Authored: Thu Feb 11 15:02:09 2016 +0530
Committer: Jaimin Jetly 
Committed: Thu Feb 11 15:05:22 2016 +0530

--
 .../services/HIVE/configuration/hive-env.xml| 20 -
 .../services/HIVE/configuration/hive-site.xml   | 14 --
 .../stacks/HDP/2.2/services/stack_advisor.py| 13 +++---
 .../services/HIVE/configuration/hive-env.xml| 20 -
 .../services/HIVE/configuration/hive-site.xml   |  8 
 .../stacks/HDPWIN/2.2/services/stack_advisor.py | 13 +++---
 .../2.1/configs/hive-metastore-upgrade.json |  3 +-
 .../stacks/2.2/common/test_stack_advisor.py | 12 +++--
 .../2.3/common/services-sparkts-hive.json   | 47 
 .../stacks/2.3/common/test_stack_advisor.py |  5 +--
 10 files changed, 18 insertions(+), 137 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b9a35f1e/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
index 87adb4b..471af6e 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
@@ -130,26 +130,6 @@ export METASTORE_PORT={{hive_metastore_port}}
   
 
   
-cost_based_optimizer
-Cost Based Optimizer
-Off
-
-  value-list
-  
-
-  On
-  On
-
-
-  Off
-  Off
-
-  
-  1
-
-  
-
-  
 hive_security_authorization
 Choose Authorization
 None

http://git-wip-us.apache.org/repos/asf/ambari/blob/b9a35f1e/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
index 96efea6..25bb468 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
@@ -471,12 +471,6 @@ limitations under the License.
 hive.cbo.enable
 true
 Flag to control enabling Cost Based Optimizations using 
Calcite framework.
-
-  
-hive-env
-cost_based_optimizer
-  
-
   
 
   
@@ -820,10 +814,6 @@ limitations under the License.
 
 
   
-hive-env
-cost_based_optimizer
-  
-  
 hive-site
 hive.cbo.enable
   
@@ -855,10 +845,6 @@ limitations under the License.
 
 
   
-hive-env
-cost_based_optimizer
-  
-  
 hive-site
 hive.cbo.enable
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/b9a35f1e/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
index 9e43865..dc968cc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
@@ -353,14 +353,11 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
 putHiveSiteProperty("hive.exec.reducers.bytes.per.reducer", "67108864")
 
 # CBO
-putHiveEnvProperty("cost_based_optimizer", "On")
-if 
str(configurations["hive-env"]["properties"]["cost_based_optimizer"]).lower() 
== "on":
-  putHiveSiteProperty("hive.cbo.enable", "true")
-else:
-  putHiveSiteProperty("hive.cbo.enable", "false")
-hive_cbo_enable = 
configurations["hive-site"]["properties"]["hive.cbo.enable"]
-putHiveSiteProperty("hive.stats.fetch.partition.stats", hive_cbo_enable)
-putHiveSiteProperty("hive.stats.fetch.column.stats", hive_cbo_enable)
+if "hive-site" in services["configurations"] and "hive.cbo.enable" in 
services["configurations"]["

[13/17] ambari git commit: AMBARI-15007. Make amazon2015 to be part of redhat6 family (aonishuk)

2016-02-11 Thread ncole
AMBARI-15007. Make amazon2015 to be part of redhat6 family (aonishuk)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 6270fe39331eb8f8e16a49ad7b8df59edecd2ce5
Parents: af560ae
Author: Andrew Onishuk 
Authored: Thu Feb 11 11:15:25 2016 +0200
Committer: Andrew Onishuk 
Committed: Thu Feb 11 11:15:25 2016 +0200

--
 .../src/main/python/ambari_commons/os_check.py  |  73 +++---
 .../ambari_commons/resources/os_family.json | 137 +--
 .../server/state/stack/JsonOsFamilyRoot.java|  38 +
 .../ambari/server/state/stack/OsFamily.java |   8 +-
 .../resources/stacks/HDP/2.2/repos/repoinfo.xml |  12 --
 .../resources/stacks/HDP/2.3/repos/repoinfo.xml |  12 --
 .../resources/stacks/HDP/2.4/repos/repoinfo.xml |  12 --
 ambari-server/src/test/python/TestOSCheck.py|  37 +++--
 8 files changed, 192 insertions(+), 137 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6270fe39/ambari-common/src/main/python/ambari_commons/os_check.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/os_check.py 
b/ambari-common/src/main/python/ambari_commons/os_check.py
index c5457bb..b430c86 100644
--- a/ambari-common/src/main/python/ambari_commons/os_check.py
+++ b/ambari-common/src/main/python/ambari_commons/os_check.py
@@ -56,6 +56,8 @@ RESOURCES_DIR = 
os.path.join(os.path.dirname(os.path.realpath(__file__)), "resou
 
 # family JSON data
 OSFAMILY_JSON_RESOURCE = "os_family.json"
+JSON_OS_MAPPING = "mapping"
+JSON_OS_ALIASES = "aliases"
 JSON_OS_TYPE = "distro"
 JSON_OS_VERSION = "versions"
 JSON_EXTENDS = "extends"
@@ -76,6 +78,8 @@ VER_NT_SERVER = 3
 _IS_ORACLE_LINUX = os.path.exists('/etc/oracle-release')
 _IS_REDHAT_LINUX = os.path.exists('/etc/redhat-release')
 
+SYSTEM_RELEASE_FILE = "/etc/system-release"
+
 def _is_oracle_linux():
   return _IS_ORACLE_LINUX
 
@@ -84,16 +88,16 @@ def _is_redhat_linux():
 
 def advanced_check(distribution):
   distribution = list(distribution)
-  if os.path.exists("/etc/issue"):
-with open("/etc/issue", "rb") as fp:
+  if os.path.exists(SYSTEM_RELEASE_FILE):
+with open(SYSTEM_RELEASE_FILE, "rb") as fp:
   issue_content = fp.read()
   
 if "Amazon" in issue_content:
   distribution[0] = "amazon"
-  search_groups = re.search('(\d+)\.(\d+)', issue_content)
+  search_groups = re.search('(\d+\.\d+)', issue_content)
   
   if search_groups:
-distribution[1] = search_groups.group(1) # if version is 2015.09 only 
get 2015.
+distribution[1] = search_groups.group(1)
   
   return tuple(distribution)
 
@@ -114,16 +118,24 @@ class OS_CONST_TYPE(type):
   f = open(os.path.join(RESOURCES_DIR, OSFAMILY_JSON_RESOURCE))
   json_data = eval(f.read())
   f.close()
-  for family in json_data:
+  
+  if JSON_OS_MAPPING not in json_data:
+raise Exception("Invalid {0}".format(OSFAMILY_JSON_RESOURCE))
+  
+  json_mapping_data = json_data[JSON_OS_MAPPING]
+  
+  for family in json_mapping_data:
 cls.FAMILY_COLLECTION += [family]
-cls.OS_COLLECTION += json_data[family][JSON_OS_TYPE]
+cls.OS_COLLECTION += json_mapping_data[family][JSON_OS_TYPE]
 cls.OS_FAMILY_COLLECTION += [{
   'name': family,
-  'os_list': json_data[family][JSON_OS_TYPE]
+  'os_list': json_mapping_data[family][JSON_OS_TYPE]
 }]
 
-if JSON_EXTENDS in json_data[family]:
-  cls.OS_FAMILY_COLLECTION[-1][JSON_EXTENDS] = 
json_data[family][JSON_EXTENDS]
+if JSON_EXTENDS in json_mapping_data[family]:
+  cls.OS_FAMILY_COLLECTION[-1][JSON_EXTENDS] = 
json_mapping_data[family][JSON_EXTENDS]
+  
+cls.OS_TYPE_ALIASES = json_data[JSON_OS_ALIASES] if JSON_OS_ALIASES in 
json_data else {}
 except:
   raise Exception("Couldn't load '%s' file" % OSFAMILY_JSON_RESOURCE)
 
@@ -194,7 +206,24 @@ class OSCheck:
 distribution = ("Darwin", "TestOnly", "1.1.1", "1.1.1", "1.1")
 
 return distribution
-
+  
+  @staticmethod
+  def get_alias(os_type, os_version):
+version_parts = os_version.split('.')
+full_os_and_major_version = os_type + version_parts[0]
+
+if full_os_and_major_version in OSConst.OS_TYPE_ALIASES:
+  alias = OSConst.OS_TYPE_ALIASES[full_os_and_major_version]
+  re_groups = re.search('(\D+)(\d+)$', alias).groups()
+  os_type = re_groups[0]
+  os_major_version = re_groups[1]
+  
+  version_parts[0] = os_major_version
+  os_version = '.'.join(version_pa

[05/17] ambari git commit: AMBARI-14984 - Script Alert Parameters With Shell Characters Are Not Properly Escaped (jonathanhurley)

2016-02-11 Thread ncole
AMBARI-14984 - Script Alert Parameters With Shell Characters Are Not Properly 
Escaped (jonathanhurley)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 5e6a5556b2a40435c6d35d7851e88d896350f53d
Parents: 946ac82
Author: Jonathan Hurley 
Authored: Tue Feb 9 18:38:55 2016 -0500
Committer: Jonathan Hurley 
Committed: Wed Feb 10 15:12:42 2016 -0500

--
 ambari-funtest/pom.xml  |  5 --
 ambari-project/pom.xml  |  2 +-
 ambari-server/pom.xml   |  5 --
 .../dispatchers/AlertScriptDispatcher.java  | 18 +-
 .../services/AlertNoticeDispatchService.java|  2 +-
 .../state/services/CachedAlertFlushService.java |  2 +-
 .../dispatchers/AlertScriptDispatcherTest.java  | 61 
 7 files changed, 80 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5e6a5556/ambari-funtest/pom.xml
--
diff --git a/ambari-funtest/pom.xml b/ambari-funtest/pom.xml
index b9c591f..4fa342f 100644
--- a/ambari-funtest/pom.xml
+++ b/ambari-funtest/pom.xml
@@ -496,11 +496,6 @@
   4.2.5
 
 
-  com.google.guava
-  guava
-  14.0.1
-
-
   com.google.code.findbugs
   jsr305
   1.3.9

http://git-wip-us.apache.org/repos/asf/ambari/blob/5e6a5556/ambari-project/pom.xml
--
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index f19ca14..ed94004 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -220,7 +220,7 @@
   
 com.google.guava
 guava
-14.0.1
+16.0
   
   
 com.google.code.findbugs

http://git-wip-us.apache.org/repos/asf/ambari/blob/5e6a5556/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index b500fb2..51fd88b 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -1179,11 +1179,6 @@
   4.2.5
 
 
-  com.google.guava
-  guava
-  14.0.1
-
-
   com.google.code.findbugs
   jsr305
   1.3.9

http://git-wip-us.apache.org/repos/asf/ambari/blob/5e6a5556/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java
index 092aaf4..907588d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java
@@ -40,6 +40,8 @@ import org.apache.commons.lang.SystemUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.escape.Escaper;
+import com.google.common.escape.Escapers;
 import com.google.inject.Inject;
 
 /**
@@ -82,6 +84,18 @@ public class AlertScriptDispatcher implements 
NotificationDispatcher {
   private static final long DEFAULT_SCRIPT_TIMEOUT = 5000L;
 
   /**
+   * Used to escape text being passed into the shell command.
+   */
+  public static final Escaper SHELL_ESCAPE;
+
+  static {
+final Escapers.Builder builder = Escapers.builder();
+builder.addEscape('\"', "\\\"");
+builder.addEscape('!', "\\!");
+SHELL_ESCAPE = builder.build();
+  }
+
+  /**
* Configuration data from the ambari.properties file.
*/
   @Inject
@@ -242,8 +256,8 @@ public class AlertScriptDispatcher implements 
NotificationDispatcher {
 
 // these could have spaces in them, so quote them so they don't mess up the
 // command line
-String alertLabel = "\"" + definition.getLabel() + "\"";
-String alertText = "\"" + alertInfo.getAlertText() + "\"";
+String alertLabel = "\"" + SHELL_ESCAPE.escape(definition.getLabel()) + 
"\"";
+String alertText = "\"" + SHELL_ESCAPE.escape(alertInfo.getAlertText()) + 
"\"";
 
 Object[] params = new Object[] { script, definitionName, alertLabel, 
serviceName,
 alertState.name(), alertText };

http://git-wip-us.apache.org/repos/asf/ambari/blob/5e6a5556/ambari-server/src/main/java/org/apache/ambari/server/state/services/AlertNoticeDispatchService.java

[11/17] ambari git commit: Revert "AMBARI-14958. Alerts: Create new Alerts Notification type for SNMP to handle Ambari MIB (onechiporenko)"

2016-02-11 Thread ncole
Revert "AMBARI-14958. Alerts: Create new Alerts Notification type for SNMP to 
handle Ambari MIB (onechiporenko)"

This reverts commit e139ef57ce0ec3d705489a36cb2d7cc78f6458c1.


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: ba604ea6be57bcbd5cff2219b0d821e6ff16d695
Parents: 3242a55
Author: Yusaku Sako 
Authored: Wed Feb 10 17:28:20 2016 -0800
Committer: Yusaku Sako 
Committed: Wed Feb 10 17:28:20 2016 -0800

--
 .../manage_alert_notifications_controller.js|  74 +---
 ...anage_alert_notifications_controller_test.js | 121 ---
 .../views/common/log_file_search_view_test.js   |   3 +-
 3 files changed, 82 insertions(+), 116 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ba604ea6/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
 
b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
index 244b8f0..79e524e 100644
--- 
a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
+++ 
b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
@@ -61,7 +61,9 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
   value: '',
   defaultValue: 'custom',
   disabled: false,
-  isAll: Em.computed.equal('value', 'all')
+  isAll: function () {
+return this.get('value') == 'all';
+  }.property('value')
 }),
 method: {
   label: 
Em.I18n.t('alerts.actions.manage_alert_notifications_popup.method'),
@@ -157,7 +159,7 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
* used in Type combobox
* @type {Array}
*/
-  methods: ['EMAIL', 'SNMP', 'Custom SNMP'],
+  methods: ['EMAIL', 'SNMP'],
 
   /**
* List of available value for Severity Filter
@@ -218,8 +220,7 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
 'mail.smtp.from',
 'mail.smtp.host',
 'mail.smtp.port',
-'mail.smtp.starttls.enable',
-'ambari.dispatch-property.script'
+'mail.smtp.starttls.enable'
   ],
 
   validationMap: {
@@ -241,16 +242,6 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
 validator: 'retypePasswordValidation'
   }
 ],
-'Custom SNMP': [
-  {
-errorKey: 'portError',
-validator: 'portValidation'
-  },
-  {
-errorKey: 'hostError',
-validator: 'hostsValidation'
-  }
-],
 SNMP: [
   {
 errorKey: 'portError',
@@ -331,25 +322,24 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
   fillEditCreateInputs: function (addCopyToName) {
 var inputFields = this.get('inputFields');
 var selectedAlertNotification = this.get('selectedAlertNotification');
-var props = selectedAlertNotification.get('properties');
 inputFields.set('name.value', (addCopyToName ? 'Copy of ' : '') + 
selectedAlertNotification.get('name'));
 inputFields.set('groups.value', 
selectedAlertNotification.get('groups').toArray());
-inputFields.set('email.value', props['ambari.dispatch.recipients'] ?
-  props['ambari.dispatch.recipients'].join(', ') : '');
-inputFields.set('SMTPServer.value', props['mail.smtp.host']);
-inputFields.set('SMTPPort.value', props['mail.smtp.port']);
-inputFields.set('SMTPUseAuthentication.value', props['mail.smtp.auth'] !== 
"false");
-inputFields.set('SMTPUsername.value', 
props['ambari.dispatch.credential.username']);
-inputFields.set('SMTPPassword.value', 
props['ambari.dispatch.credential.password']);
-inputFields.set('retypeSMTPPassword.value', 
props['ambari.dispatch.credential.password']);
-inputFields.set('SMTPSTARTTLS.value', props['mail.smtp.starttls.enable'] 
!== "false");
-inputFields.set('emailFrom.value', props['mail.smtp.from']);
-inputFields.set('version.value', props['ambari.dispatch.snmp.version']);
-inputFields.set('OIDs.value', props['ambari.dispatch.snmp.oids.trap']);
-inputFields.set('community.value', 
props['ambari.dispatch.snmp.community']);
-inputFields.set('host.value', props['ambari.dispatch.recipients'] ?
-  props['ambari.dispatch.recipients'].join(', ') : '');
-inputFields.set('port.value', props['ambari.dispatch.snmp.port']);
+inputFields.set('email.value', 
selectedAlertNotification.get('properties')['ambari.dispatch.recipients'] ?
+  
selectedAlertNotification.get('properties')['ambari.di

[10/17] ambari git commit: AMBARI-14964: AMS cannot be installed on trunk (avijayan via jaoki)

2016-02-11 Thread ncole
AMBARI-14964: AMS cannot be installed on trunk (avijayan via jaoki)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 3242a5590a6cf84f9cd664e38c7ae8b1c2fe968a
Parents: c147b27
Author: Jun Aoki 
Authored: Wed Feb 10 17:12:48 2016 -0800
Committer: Jun Aoki 
Committed: Wed Feb 10 17:12:48 2016 -0800

--
 .../libraries/functions/package_conditions.py | 7 ++-
 .../stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml | 2 +-
 .../common-services/AMBARI_METRICS/0.1.0/metainfo.xml | 2 ++
 .../AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py | 4 +++-
 .../AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana.py   | 5 -
 .../AMBARI_METRICS/0.1.0/package/scripts/metrics_monitor.py   | 2 +-
 6 files changed, 17 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3242a559/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
index 0fb0fe4..4ca3b7b 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
@@ -19,7 +19,8 @@ limitations under the License.
 Ambari Agent
 
 """
-__all__ = ["is_lzo_enabled", "should_install_phoenix", 
"should_install_ams_collector", "should_install_mysql", 
"should_install_mysl_connector"]
+__all__ = ["is_lzo_enabled", "should_install_phoenix", 
"should_install_ams_collector", "should_install_ams_grafana",
+   "should_install_mysql", "should_install_mysl_connector"]
 
 import os
 from resource_management.libraries.script import Script
@@ -41,6 +42,10 @@ def should_install_ams_collector():
   config = Script.get_config()
   return 'role' in config and config['role'] == "METRICS_COLLECTOR"
 
+def should_install_ams_grafana():
+  config = Script.get_config()
+  return 'role' in config and config['role'] == "METRICS_GRAFANA"
+
 def should_install_mysql():
   config = Script.get_config()
   hive_database = config['configurations']['hive-env']['hive_database']

http://git-wip-us.apache.org/repos/asf/ambari/blob/3242a559/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml
--
diff --git 
a/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml
 
b/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml
index be99b83..fe3b860 100644
--- 
a/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml
+++ 
b/ambari-funtest/src/test/resources/stacks/HDP/2.1.1/services/AMBARI_METRICS/metainfo.xml
@@ -69,7 +69,7 @@
   
 
   ambari-metrics-collector
-  
package_chooser.should_install_ams_collector()
+  should_install_ams_collector
 
 
   ambari-metrics-monitor

http://git-wip-us.apache.org/repos/asf/ambari/blob/3242a559/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
index c3dbc6b..3a832eb 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/metainfo.xml
@@ -83,6 +83,7 @@
 
   ambari-metrics-collector
   true
+  should_install_ams_collector
 
 
   ambari-metrics-monitor
@@ -95,6 +96,7 @@
 
   ambari-metrics-grafana
   true
+  should_install_ams_grafana
 
 
   gcc

http://git-wip-us.apache.org/repos/asf/ambari/blob/3242a559/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py
 
b/ambari-

[12/17] ambari git commit: AMBARI-14991. use the same colors for cpu metrics between summary and host page (onechiporenko)

2016-02-11 Thread ncole
AMBARI-14991. use the same colors for cpu metrics between summary and host page 
(onechiporenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: af560ae372ba171cf8077a3c827df6fd1b4c0e2c
Parents: ba604ea
Author: Oleg Nechiporenko 
Authored: Wed Feb 10 14:54:53 2016 +0200
Committer: Oleg Nechiporenko 
Committed: Thu Feb 11 10:38:08 2016 +0200

--
 .../app/views/main/dashboard/cluster_metrics/cpu.js   | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/af560ae3/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js
--
diff --git a/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js 
b/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js
index 407487d..eea3040 100644
--- a/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js
+++ b/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js
@@ -43,21 +43,21 @@ App.ChartClusterMetricsCPU = 
App.ChartLinearTimeView.extend({
   idle = null,
   data = Em.get(jsonData, this.get('seriesTemplate.path'));
 if (data) {
-  for (var name in data) {
+  Object.keys(data).forEach(function (name) {
 var seriesData = data[name];
 if (seriesData) {
   var s = {
 name: name,
 data: seriesData
   };
-  if (name.indexOf('Idle') > -1) {
+  if (name.contains('Idle')) {
 //CPU idle metric should be the last in series array
 idle = s;
-continue;
+return;
   }
   dataArray.push(s);
 }
-  }
+  });
   if (idle) {
 dataArray.push(idle);
   }
@@ -66,7 +66,7 @@ App.ChartClusterMetricsCPU = App.ChartLinearTimeView.extend({
   },
 
   colorForSeries: function (series) {
-if (Em.I18n.t('dashboard.clusterMetrics.cpu.displayNames.idle') == 
series.name){
+if (series.name && 
series.name.contains(Em.I18n.t('dashboard.clusterMetrics.cpu.displayNames.idle')))
 {
   return '#CFECEC';
 }
 return null;



[03/17] ambari git commit: AMBARI-14995 AMS Grafana component should package plugin from source code. (dsen)

2016-02-11 Thread ncole
AMBARI-14995 AMS Grafana component should package plugin from source code. 
(dsen)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 4870e1f89b155521713d63d8feef18f610f44f58
Parents: 8f3b9c4
Author: Dmytro Sen 
Authored: Wed Feb 10 20:34:26 2016 +0200
Committer: Dmytro Sen 
Committed: Wed Feb 10 20:34:26 2016 +0200

--
 ambari-metrics/ambari-metrics-grafana/pom.xml | 16 ++--
 ambari-metrics/pom.xml|  1 -
 2 files changed, 6 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4870e1f8/ambari-metrics/ambari-metrics-grafana/pom.xml
--
diff --git a/ambari-metrics/ambari-metrics-grafana/pom.xml 
b/ambari-metrics/ambari-metrics-grafana/pom.xml
index 8304416..c737b2b 100644
--- a/ambari-metrics/ambari-metrics-grafana/pom.xml
+++ b/ambari-metrics/ambari-metrics-grafana/pom.xml
@@ -103,16 +103,12 @@
   dest="${project.build.directory}/grafana"
   compression="gzip"
   />
-
-
+
+  
+
+  
+
   
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/4870e1f8/ambari-metrics/pom.xml
--
diff --git a/ambari-metrics/pom.xml b/ambari-metrics/pom.xml
index 9a39122..1f87683 100644
--- a/ambari-metrics/pom.xml
+++ b/ambari-metrics/pom.xml
@@ -52,7 +52,6 @@
 hadoop-2.6.0.2.2.4.2-0002
 grafana-2.6.0
 
https://grafanarel.s3.amazonaws.com/builds/grafana-2.6.0.linux-x64.tar.gz
-
https://github.com/u39kun/ambari-grafana/raw/master/dist/ambari-grafana.tgz
 
   /usr/lib/python2.6/site-packages/resource_monitoring
 



[06/17] ambari git commit: AMBARI-14982 : Change AMS configs to deal with slow writes to WASB (avijayan)

2016-02-11 Thread ncole
AMBARI-14982 : Change AMS configs to deal with slow writes to WASB (avijayan)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 49e33511c4306e2c4f43916405ff223cdd901d97
Parents: 5e6a555
Author: Aravindan Vijayan 
Authored: Wed Feb 10 12:28:26 2016 -0800
Committer: Aravindan Vijayan 
Committed: Wed Feb 10 12:28:26 2016 -0800

--
 .../timeline/HBaseTimelineMetricStore.java  |  18 +--
 .../metrics/timeline/PhoenixHBaseAccessor.java  |  21 ++--
 .../timeline/TimelineMetricConfiguration.java   |  10 ++
 .../server/upgrade/UpgradeCatalog222.java   | 116 ++-
 .../0.1.0/configuration/ams-site.xml|  37 --
 .../stacks/HDP/2.0.6/services/stack_advisor.py  |   5 +-
 .../server/upgrade/UpgradeCatalog222Test.java   |  21 +++-
 .../stacks/2.2/common/test_stack_advisor.py |   5 +-
 8 files changed, 203 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/49e33511/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
index 5ee8b44..b5ec6e8 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java
@@ -143,14 +143,16 @@ public class HBaseTimelineMetricStore extends 
AbstractService implements Timelin
 aggregatorDailyThread.start();
   }
 
-  int initDelay = 
configuration.getTimelineMetricsServiceWatcherInitDelay();
-  int delay = configuration.getTimelineMetricsServiceWatcherDelay();
-  // Start the watchdog
-  executorService.scheduleWithFixedDelay(
-new TimelineMetricStoreWatcher(this, configuration), initDelay, delay,
-TimeUnit.SECONDS);
-  LOG.info("Started watchdog for timeline metrics store with initial " +
-"delay = " + initDelay + ", delay = " + delay);
+  if (!configuration.isTimelineMetricsServiceWatcherDisabled()) {
+int initDelay = 
configuration.getTimelineMetricsServiceWatcherInitDelay();
+int delay = configuration.getTimelineMetricsServiceWatcherDelay();
+// Start the watchdog
+executorService.scheduleWithFixedDelay(
+  new TimelineMetricStoreWatcher(this, configuration), initDelay, 
delay,
+  TimeUnit.SECONDS);
+LOG.info("Started watchdog for timeline metrics store with initial " +
+  "delay = " + initDelay + ", delay = " + delay);
+  }
 
   isInitialized = true;
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/49e33511/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
index 7fa1d2d..1c86ebb 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
@@ -221,14 +221,14 @@ public class PhoenixHBaseAccessor {
 
 String encoding = metricsConf.get(HBASE_ENCODING_SCHEME, DEFAULT_ENCODING);
 String compression = metricsConf.get(HBASE_COMPRESSION_SCHEME, 
DEFAULT_TABLE_COMPRESSION);
-String precisionTtl = metricsConf.get(PRECISION_TABLE_TTL, "86400");   
//1 day
-String hostMinTtl = metricsConf.get(HOST_MINUTE_TABLE_TTL, "604800");  
//7 days
-String hostHourTtl = metricsConf.get(HOST_HOUR_TA

[09/17] ambari git commit: AMBARI-14820: Implement Activate HAWQ Standby wizard to allow doing failover in HA mode (missing part) (bhuvnesh2703 via jaoki)

2016-02-11 Thread ncole
AMBARI-14820: Implement Activate HAWQ Standby wizard to allow doing failover in 
HA mode (missing part) (bhuvnesh2703 via jaoki)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: c147b27e9bb886ba0380e2b926903343a568ad9d
Parents: 364ee02
Author: Jun Aoki 
Authored: Wed Feb 10 16:45:15 2016 -0800
Committer: Jun Aoki 
Committed: Wed Feb 10 16:45:15 2016 -0800

--
 .../resources/common-services/HAWQ/2.0.0/metainfo.xml | 10 ++
 .../HAWQ/2.0.0/package/scripts/hawq_constants.py  |  1 +
 .../HAWQ/2.0.0/package/scripts/hawqstandby.py |  6 --
 3 files changed, 15 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c147b27e/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
index 21ab445..ce625eb 100644
--- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
+++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/metainfo.xml
@@ -76,6 +76,16 @@
   PYTHON
   600
   
+  
+
+  ACTIVATE_STANDBY
+  
+scripts/hawqstandby.py
+PYTHON
+1200
+  
+
+  
   
 
 HDFS/HDFS_CLIENT

http://git-wip-us.apache.org/repos/asf/ambari/blob/c147b27e/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
index 01de99a..6a2d9ba 100644
--- 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
+++ 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawq_constants.py
@@ -27,6 +27,7 @@ YARN = "yarn"
 CLUSTER = "cluster"
 IMMEDIATE = "immediate"
 FAST = "fast"
+ACTIVATE = "activate"
 
 # Users
 root_user = "root"

http://git-wip-us.apache.org/repos/asf/ambari/blob/c147b27e/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
index 7f5bab4..7da7f6d 100644
--- 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
+++ 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
@@ -51,8 +51,10 @@ class HawqStandby(Script):
 from hawqstatus import get_pid_file
 check_process_status(get_pid_file())
 
-  def activatestandby(self, env):
-pass
+  def activate_standby(self, env):
+import utils
+utils.exec_hawq_operation(hawq_constants.ACTIVATE, "{0} -a -M {1} 
-v".format(hawq_constants.STANDBY, hawq_constants.FAST))
+
 
 if __name__ == "__main__":
 HawqStandby().execute()



[07/17] ambari git commit: AMBARI-14962 Auto configure AMS UI to use AMS Datasource - Commit 3 (avijayan)

2016-02-11 Thread ncole
AMBARI-14962 Auto configure AMS UI to use AMS Datasource - Commit 3 (avijayan)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0d52ebc05593ebce6e3ab37535bf1345df8f8492
Parents: 49e3351
Author: Aravindan Vijayan 
Authored: Wed Feb 10 12:29:23 2016 -0800
Committer: Aravindan Vijayan 
Committed: Wed Feb 10 12:29:23 2016 -0800

--
 .../0.1.0/package/scripts/metrics_grafana_util.py  | 6 --
 .../0.1.0/package/templates/metrics_grafana_datasource.json.j2 | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0d52ebc0/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
index c4a91e1..5ab40b0 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_grafana_util.py
@@ -58,8 +58,9 @@ def create_ams_datasource():
 Logger.info("Ambari Metrics Grafana datasource already present. 
Checking Metrics Collector URL")
 datasource_url = datasources_json[i]["url"]
 
-if datasource_url == (params.metric_collector_host + ":" + 
params.metric_collector_port
- + "/ws/v1/timeline/metrics") :
+if datasource_url == (params.ams_grafana_protocol + "://"
++ params.metric_collector_host + ":"
++ params.metric_collector_port):
   Logger.info("Metrics Collector URL validation succeeded. Skipping 
datasource creation")
   GRAFANA_CONNECT_TRIES = 0 # No need to create datasource again
 
@@ -84,6 +85,7 @@ def create_ams_datasource():
 try:
   ams_datasource_json = Template('metrics_grafana_datasource.json.j2',
  
ams_datasource_name=METRICS_GRAFANA_DATASOURCE_NAME,
+ ams_grafana_protocol=params.ams_grafana_protocol,
  ams_collector_host=params.metric_collector_host,
  
ams_collector_port=params.metric_collector_port).get_content()
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0d52ebc0/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
index 1b03a2d..a803da5 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/templates/metrics_grafana_datasource.json.j2
@@ -20,7 +20,7 @@
   "name": "{{ams_datasource_name}}",
   "type": "ambarimetrics",
   "access": "proxy",
-  "url": 
"{{ams_collector_host}}:{{ams_collector_port}}/ws/v1/timeline/metrics",
+  "url": 
"{{ams_grafana_protocol}}://{{ams_collector_host}}:{{ams_collector_port}}",
   "password": "",
   "user": "",
   "database": "",



[02/17] ambari git commit: AMBARI-14985. Templated Dashboard for Ambari-Metrics-Grafana. (Prajwal Rao via yusaku)

2016-02-11 Thread ncole
AMBARI-14985. Templated Dashboard for Ambari-Metrics-Grafana. (Prajwal Rao via 
yusaku)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 8f3b9c49d3fecf7db43b16ef8c06571fd2f79ed9
Parents: ac5ca8f
Author: Yusaku Sako 
Authored: Wed Feb 10 10:05:27 2016 -0800
Committer: Yusaku Sako 
Committed: Wed Feb 10 10:05:27 2016 -0800

--
 ambari-metrics/ambari-metrics-grafana/README.md |  20 +++
 .../ambari-metrics/datasource.js| 127 +--
 .../ambari-metrics/partials/query.editor.html   |   6 +-
 .../screenshots/20-templating.png   | Bin 0 -> 694376 bytes
 4 files changed, 82 insertions(+), 71 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8f3b9c49/ambari-metrics/ambari-metrics-grafana/README.md
--
diff --git a/ambari-metrics/ambari-metrics-grafana/README.md 
b/ambari-metrics/ambari-metrics-grafana/README.md
index 0a138e8..7eb84a7 100644
--- a/ambari-metrics/ambari-metrics-grafana/README.md
+++ b/ambari-metrics/ambari-metrics-grafana/README.md
@@ -240,4 +240,24 @@ http://GRAFANA_HOST:3000
 
 ---
 
+
+### Templating
 
+**Templating allows you to dynamically change graphs by selecting your host 
from dropdown. To created a templated dashboard, you can follow these steps.**
+
+> 1. Click on the "cog" on the top, select "Templating"
+> 2. Click on "+ New"
+> 3. Enter a name for your variable. Ex: "hosts".
+> 4. Type: query
+> 5. Datasource: This should be set to the name you had chosen for your 
Datasource. Default is "AMBARI_METRICS"
+> 6. Query: This needs to be "hosts". It is case sensitive as well.
+> 7. Once you've entered the query and you focus your cursor anywhere else, 
you should see the "Preview of values" updated with the hostnames in your 
cluster.
+> 8. You can close the Templating Variables section.
+> 9. You should now have a dropdown on your dashboard with hosts from your 
cluster.
+> 10. When you now add a graph, and select your component and metric, the 
plotted graph will show you metrics for the selected hostname from the dropdown.
+> 11. The legend on the graph will also now update with the selected host.
+
+**Templalted dashboards do support multiple metrics in a single graph.** 
+
+
+![Templating](screenshots/20-templating.png)

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f3b9c49/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
--
diff --git a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js 
b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
index 374501c..e89ad0e 100644
--- a/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
+++ b/ambari-metrics/ambari-metrics-grafana/ambari-metrics/datasource.js
@@ -27,7 +27,7 @@ define([
 
   var module = angular.module('grafana.services');
 
-  module.factory('AmbariMetricsDatasource', function ($q, backendSrv) {
+  module.factory('AmbariMetricsDatasource', function ($q, backendSrv, 
templateSrv) {
 /**
  * AMS Datasource Constructor
  */
@@ -43,7 +43,9 @@ define([
 .then(function (items) {
   allMetrics = [];
   appIds = [];
-  var fake = "timeline_metric_store_watcher"; delete items[fake];
+  //We remove a couple of components from the list that do not 
contain any
+  //pertinent metrics.
+  delete items.timeline_metric_store_watcher; delete 
items.amssmoketestfake;
   for (var key in items) {
 if (items.hasOwnProperty(key)) {
   items[key].forEach(function (_item) {
@@ -97,10 +99,11 @@ define([
   }
   var series = [];
   var metricData = res.metrics[0].metrics;
+  var hostLegend = res.metrics[0].hostname ? ' on ' + 
res.metrics[0].hostname : '';
   var timeSeries = {};
   if (target.hosts === undefined || target.hosts.trim() === "") {
 timeSeries = {
-  target: target.metric,
+  target: target.metric + hostLegend,
   datapoints: []
 };
   } else {
@@ -119,81 +122,42 @@ define([
 };
 
   };
-  var precisionSetting = '';
+
   var getHostAppIdData = function(target) {
-if (target.shouldAddPrecision) {
-  precisionSetting = '&precision=' + target.precision;
-} else {
-  precisionSetting

[04/17] ambari git commit: AMBARI-14979. Ambari Upgrade should not automatically add stack properties that reference localhost like dfs.namenode.secondary.http-address, mark with DONT_ADD_ON_UPGRADE (

2016-02-11 Thread ncole
AMBARI-14979. Ambari Upgrade should not automatically add stack properties that 
reference localhost like dfs.namenode.secondary.http-address, mark with 
DONT_ADD_ON_UPGRADE (alejandro)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 946ac82e7aeabc926ce33a7a6b277a6be1f72f5f
Parents: 4870e1f
Author: Alejandro Fernandez 
Authored: Tue Feb 9 13:45:14 2016 -0800
Committer: Alejandro Fernandez 
Committed: Wed Feb 10 11:27:55 2016 -0800

--
 .../ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml | 2 ++
 .../ATLAS/0.1.0.2.3/configuration/application-properties.xml | 1 +
 .../0.5.0.2.1/configuration/falcon-startup.properties.xml| 1 +
 .../HBASE/0.96.0.2.0/configuration/hbase-site.xml| 1 +
 .../HDFS/2.1.0.2.0/configuration/core-site.xml   | 1 +
 .../HDFS/2.1.0.2.0/configuration/hdfs-site.xml   | 3 +++
 .../HIVE/0.12.0.2.0/configuration/hive-site.xml  | 3 +++
 .../HIVE/0.12.0.2.0/configuration/webhcat-site.xml   | 1 +
 .../KAFKA/0.8.1.2.2/configuration/kafka-broker.xml   | 2 ++
 .../configuration/ranger-knox-plugin-properties.xml  | 1 +
 .../OOZIE/4.0.0.2.0/configuration/oozie-site.xml | 1 +
 .../OOZIE/4.2.0.2.3/configuration/oozie-site.xml | 1 +
 .../RANGER/0.4.0/configuration/ranger-env.xml| 1 +
 .../RANGER_KMS/0.5.0.2.3/configuration/kms-site.xml  | 1 +
 .../STORM/0.9.1.2.1/configuration/storm-site.xml | 1 +
 .../YARN/2.1.0.2.0/configuration-mapred/mapred-site.xml  | 2 ++
 .../YARN/2.1.0.2.0/configuration/yarn-site.xml   | 8 
 .../stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml | 2 ++
 .../HDP/2.1/services/OOZIE/configuration/oozie-site.xml  | 1 +
 .../stacks/HDP/2.1/services/YARN/configuration/yarn-site.xml | 3 +++
 .../HBASE/configuration/ranger-hbase-plugin-properties.xml   | 1 +
 .../HDFS/configuration/ranger-hdfs-plugin-properties.xml | 4 ++--
 .../stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml | 4 
 .../HIVE/configuration/ranger-hive-plugin-properties.xml | 1 +
 .../STORM/configuration/ranger-storm-plugin-properties.xml   | 1 +
 .../stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml | 2 ++
 .../HDP/2.3/services/KAFKA/configuration/kafka-broker.xml| 1 +
 .../KAFKA/configuration/ranger-kafka-plugin-properties.xml   | 1 +
 .../HDP/2.3/services/RANGER/configuration/ranger-env.xml | 2 ++
 .../HDP/2.3/services/STORM/configuration/storm-site.xml  | 2 ++
 30 files changed, 54 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/946ac82e/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml
 
b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml
index 2e75768..c2e0200 100644
--- 
a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml
+++ 
b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/configuration/accumulo-site.xml
@@ -24,6 +24,7 @@
   
 instance.volumes
 hdfs://localhost:8020/apps/accumulo/data
+DONT_ADD_ON_UPGRADE
 Location of Accumulo data files in HDFS.
 
   false
@@ -33,6 +34,7 @@
   
 instance.zookeeper.host
 localhost:2181
+DONT_ADD_ON_UPGRADE
 Comma-separated list of ZooKeeper server:port
   pairs.
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/946ac82e/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
index 74b1537..ed9f1bc 100644
--- 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
+++ 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/configuration/application-properties.xml
@@ -102,6 +102,7 @@
   
 atlas.server.bind.address
 localhost
+DONT_ADD_ON_UPGRADE
 
   
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/946ac82e/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/configuration/falcon-s

[01/17] ambari git commit: AMBARI-14865: Auto start - Maintenance mode of components should be respected when handling agent registration.

2016-02-11 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/branch-dev-patch-upgrade 2a9f49c0e -> 1809161eb


AMBARI-14865: Auto start - Maintenance mode of components should be respected 
when handling agent registration.


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: ac5ca8fd1cd51360f7394c1fd85f8a062a4fb8e2
Parents: 46bbbf9
Author: Nahappan Somasundaram 
Authored: Mon Feb 1 14:22:15 2016 -0800
Committer: Nahappan Somasundaram 
Committed: Wed Feb 10 09:27:47 2016 -0800

--
 .../main/python/ambari_agent/RecoveryManager.py | 41 +++--
 .../test/python/ambari_agent/TestActionQueue.py |  2 +-
 .../python/ambari_agent/TestRecoveryManager.py  | 88 +---
 .../ambari/server/agent/HeartBeatHandler.java   | 39 -
 .../ambari/server/agent/RecoveryConfig.java | 18 +---
 .../server/agent/TestHeartbeatHandler.java  | 78 -
 6 files changed, 167 insertions(+), 99 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ac5ca8fd/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py 
b/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py
index b5795b2..ed537ca 100644
--- a/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py
+++ b/ambari-agent/src/main/python/ambari_agent/RecoveryManager.py
@@ -88,7 +88,6 @@ class RecoveryManager:
 self.allowed_desired_states = [self.STARTED, self.INSTALLED]
 self.allowed_current_states = [self.INIT, self.INSTALLED]
 self.enabled_components = []
-self.disabled_components = []
 self.statuses = {}
 self.__status_lock = threading.RLock()
 self.__command_lock = threading.RLock()
@@ -107,7 +106,7 @@ class RecoveryManager:
 
 self.actions = {}
 
-self.update_config(6, 60, 5, 12, recovery_enabled, auto_start_only, "", "")
+self.update_config(6, 60, 5, 12, recovery_enabled, auto_start_only, "")
 
 pass
 
@@ -213,19 +212,12 @@ class RecoveryManager:
 pass
 
   """
-  Whether specific components are enabled/disabled for recovery. Being enabled 
takes
-  precedence over being disabled. When specific components are enabled then 
only
-  those components are enabled. When specific components are disabled then all 
of
-  the other components are enabled.
+  Whether specific components are enabled for recovery.
   """
   def configured_for_recovery(self, component):
-if len(self.disabled_components) == 0 and len(self.enabled_components) == 
0:
-  return True
-if len(self.disabled_components) > 0 and component not in 
self.disabled_components \
-and len(self.enabled_components) == 0:
-  return True
 if len(self.enabled_components) > 0 and component in 
self.enabled_components:
   return True
+
 return False
 
   def requires_recovery(self, component):
@@ -547,8 +539,8 @@ class RecoveryManager:
   "maxCount" : 10,
   "windowInMinutes" : 60,
   "retryGap" : 0,
-  "disabledComponents" : "a,b",
-  "enabledComponents" : "c,d"}
+  "components" : "a,b"
+  }
 """
 
 recovery_enabled = False
@@ -558,7 +550,6 @@ class RecoveryManager:
 retry_gap = 5
 max_lifetime_count = 12
 enabled_components = ""
-disabled_components = ""
 
 
 if reg_resp and "recoveryConfig" in reg_resp:
@@ -578,17 +569,16 @@ class RecoveryManager:
   if 'maxLifetimeCount' in config:
 max_lifetime_count = self._read_int_(config['maxLifetimeCount'], 
max_lifetime_count)
 
-  if 'enabledComponents' in config:
-enabled_components = config['enabledComponents']
-  if 'disabledComponents' in config:
-disabled_components = config['disabledComponents']
+  if 'components' in config:
+enabled_components = config['components']
+
 self.update_config(max_count, window_in_min, retry_gap, 
max_lifetime_count, recovery_enabled, auto_start_only,
-   enabled_components, disabled_components)
+   enabled_components)
 pass
 
 
   def update_config(self, max_count, window_in_min, retry_gap, 
max_lifetime_count, recovery_enabled,
-auto_start_only, enabled_components, disabled_components):
+auto_start_only, enabled_components):
 """
 Update recovery configuration, recovery is disabled if configuration values
 are not correct
@@ -619,7 +609,6 @@ class RecoveryManager:
 self.retry_gap_in_sec = retry_gap * 60
 self.auto_start_only = auto_start_only
 self.max_lifeti

[1/2] ambari git commit: AMBARI-14993. Log Search: Add Host Log Metrics to Host Details -> Summary (alexantonenko)

2016-02-11 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk b9a35f1ea -> 96bdecf84


AMBARI-14993. Log Search: Add Host Log Metrics to Host Details -> Summary 
(alexantonenko)


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

Branch: refs/heads/trunk
Commit: 96bdecf8474064465b2ecc1261152d9ba68730e2
Parents: 209ec33
Author: Alex Antonenko 
Authored: Wed Feb 10 16:31:52 2016 +0200
Committer: Alex Antonenko 
Committed: Thu Feb 11 11:48:18 2016 +0200

--
 ambari-web/app/messages.js  |   1 +
 ambari-web/app/routes/main.js   |   5 +-
 .../app/templates/main/host/log_metrics.hbs |  26 
 ambari-web/app/templates/main/host/summary.hbs  |  24 +++-
 ambari-web/app/utils/ember_reopen.js|  46 ++
 ambari-web/app/views.js |   1 +
 ambari-web/app/views/common/chart/pie.js|  11 +-
 ambari-web/app/views/main/host/log_metrics.js   | 141 +++
 ambari-web/app/views/main/host/logs_view.js |  12 ++
 ambari-web/test/utils/ember_reopen_test.js  |  57 
 10 files changed, 311 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/96bdecf8/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 00fb4b9..59877a5 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2307,6 +2307,7 @@ Em.I18n.translations = {
   'hosts.host.summary.hostname':'Hostname',
   'hosts.host.summary.agentHeartbeat':'Heartbeat',
   'hosts.host.summary.hostMetrics':'Host Metrics',
+  'hosts.host.summary.hostLogMetrics':'Host Log Metrics',
   'hosts.host.summary.addComponent':'Add Component',
   'hosts.host.summary.currentVersion':'Current Version',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/96bdecf8/ambari-web/app/routes/main.js
--
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 891bf34..419f845 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -265,13 +265,16 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
   }),
 
   logs: Em.Route.extend({
-route: '/logs',
+route: '/logs:query',
 connectOutlets: function (router, context) {
   if (App.get('supports.logSearch')) {
 
router.get('mainHostDetailsController').connectOutlet('mainHostLogs')
   } else {
 router.transitionTo('summary');
   }
+},
+serialize: function(router, params) {
+  return this.serializeQueryParams(router, params, 
'mainHostDetailsController');
 }
   }),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/96bdecf8/ambari-web/app/templates/main/host/log_metrics.hbs
--
diff --git a/ambari-web/app/templates/main/host/log_metrics.hbs 
b/ambari-web/app/templates/main/host/log_metrics.hbs
new file mode 100644
index 000..22a39be
--- /dev/null
+++ b/ambari-web/app/templates/main/host/log_metrics.hbs
@@ -0,0 +1,26 @@
+{{!
+* 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.
+}}
+
+
+  {{#each item in view.logsData}}
+
+  {{view view.chartView contentBinding="item"}}
+  {{item.service.displayName}}
+
+  {{/each}}
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/96bdecf8/ambari-web/app/templates/main/host/summary.hbs
--
diff --git a/ambari-web/app/templates/main/host/summary.hbs 
b/ambari-web/app/templates/main/host/summary.hbs
index 6b4c7a5..17a0b69 100644
--- a/ambari-web/app/templates/main/host/summary.hbs
+++ b/ambari-web/app/templates/main/host/summary.hbs
@@ -168,19 +168,31 @@
 
 
 
-  {{!

[2/2] ambari git commit: AMBARI-14992. Upon changing the time range for displaying graphs, UI does not show feedback (doesn't update and keeps showing the same graph) when data is not available (alexa

2016-02-11 Thread alexantonenko
AMBARI-14992. Upon changing the time range for displaying graphs, UI does not 
show feedback (doesn't update and keeps showing the same graph) when data is 
not available (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 209ec330def90559aa767211f3b869d21c13b673
Parents: b9a35f1
Author: Alex Antonenko 
Authored: Wed Feb 10 15:47:16 2016 +0200
Committer: Alex Antonenko 
Committed: Thu Feb 11 11:48:18 2016 +0200

--
 .../app/mixins/common/widgets/widget_mixin.js   |  49 +++-
 ambari-web/app/styles/application.less  |   5 +
 .../views/common/widget/graph_widget_view.js|   4 +-
 .../test/mixins/common/widget_mixin_test.js | 124 +++
 4 files changed, 176 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/209ec330/ambari-web/app/mixins/common/widgets/widget_mixin.js
--
diff --git a/ambari-web/app/mixins/common/widgets/widget_mixin.js 
b/ambari-web/app/mixins/common/widgets/widget_mixin.js
index df7ff76..b6fe353 100644
--- a/ambari-web/app/mixins/common/widgets/widget_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/widget_mixin.js
@@ -119,6 +119,7 @@ App.WidgetMixin = Ember.Mixin.create({
   context: this,
   startCallName: 'getHostComponentMetrics',
   successCallback: this.getHostComponentMetricsSuccessCallback,
+  errorCallback: this.getMetricsErrorCallback,
   completeCallback: function () {
 requestCounter--;
 if (requestCounter === 0) this.onMetricsLoaded();
@@ -130,6 +131,7 @@ App.WidgetMixin = Ember.Mixin.create({
   context: this,
   startCallName: 'getServiceComponentMetrics',
   successCallback: this.getMetricsSuccessCallback,
+  errorCallback: this.getMetricsErrorCallback,
   completeCallback: function () {
 requestCounter--;
 if (requestCounter === 0) this.onMetricsLoaded();
@@ -271,12 +273,41 @@ App.WidgetMixin = Ember.Mixin.create({
 if (!Em.isNone(metric_data)) {
   _metric.data = metric_data;
   this.get('metrics').pushObject(_metric);
+} else if (this.get('graphView')) {
+  var graph = this.get('childViews') && 
this.get('childViews').findProperty('_showMessage');
+  if (graph) {
+graph.set('hasData', false);
+this.set('isExportButtonHidden', true);
+graph._showMessage('info', this.t('graphs.noData.title'), 
this.t('graphs.noDataAtTime.message'));
+this.get('metrics').clear();
+  }
 }
   }, this);
 }
   },
 
   /**
+   * error callback on getting aggregated metrics and host component metrics
+   * @param {object} xhr
+   * @param {string} textStatus
+   * @param {string} errorThrown
+   */
+  getMetricsErrorCallback: function (xhr, textStatus, errorThrown) {
+if (this.get('graphView')) {
+  var graph = this.get('childViews') && 
this.get('childViews').findProperty('_showMessage');
+  if (graph) {
+if (xhr.readyState == 4 && xhr.status) {
+  textStatus = xhr.status + " " + textStatus;
+}
+graph.set('hasData', false);
+this.set('isExportButtonHidden', true);
+graph._showMessage('warn', this.t('graphs.error.title'), 
this.t('graphs.error.message').format(textStatus, errorThrown));
+this.get('metrics').clear();
+  }
+}
+  },
+
+  /**
* make GET call to get metrics value for all host components
* @param {object} request
* @return {$.ajax}
@@ -704,6 +735,7 @@ App.WidgetLoadAggregator = Em.Object.create({
 bulks[id].subRequests = [{
   context: request.context,
   successCallback: request.successCallback,
+  errorCallback: request.errorCallback,
   completeCallback: request.completeCallback
 }];
   } else {
@@ -711,6 +743,7 @@ App.WidgetLoadAggregator = Em.Object.create({
 bulks[id].subRequests.push({
   context: request.context,
   successCallback: request.successCallback,
+  errorCallback: request.errorCallback,
   completeCallback: request.completeCallback
 });
   }
@@ -732,11 +765,17 @@ App.WidgetLoadAggregator = Em.Object.create({
   _request.subRequests.forEach(function (subRequest) {
 subRequest.successCallback.call(subRequest.context, response);
   }, this);
-}).complete(function () {
-  _request.subRequests.forEach(function (subRequest) {
-subRequest.completeCallback.call(sub

ambari git commit: AMBARI-14992. Upon changing the time range for displaying graphs, UI does not show feedback (doesn't update and keeps showing the same graph) when data is not available (alexantonen

2016-02-11 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 e8f3ee9d9 -> 7ce5a0072


AMBARI-14992. Upon changing the time range for displaying graphs, UI does not 
show feedback (doesn't update and keeps showing the same graph) when data is 
not available (alexantonenko)


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

Branch: refs/heads/branch-2.2
Commit: 7ce5a0072259d8aa85258df5e9e1da0865a00692
Parents: e8f3ee9
Author: Alex Antonenko 
Authored: Wed Feb 10 15:45:50 2016 +0200
Committer: Alex Antonenko 
Committed: Thu Feb 11 11:47:54 2016 +0200

--
 .../app/mixins/common/widgets/widget_mixin.js   |  49 +++-
 ambari-web/app/styles/application.less  |   5 +
 .../views/common/widget/graph_widget_view.js|   4 +-
 .../test/mixins/common/widget_mixin_test.js | 124 +++
 4 files changed, 176 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7ce5a007/ambari-web/app/mixins/common/widgets/widget_mixin.js
--
diff --git a/ambari-web/app/mixins/common/widgets/widget_mixin.js 
b/ambari-web/app/mixins/common/widgets/widget_mixin.js
index a6b13f2..6a2d287 100644
--- a/ambari-web/app/mixins/common/widgets/widget_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/widget_mixin.js
@@ -121,6 +121,7 @@ App.WidgetMixin = Ember.Mixin.create({
   context: this,
   startCallName: 'getHostComponentMetrics',
   successCallback: this.getHostComponentMetricsSuccessCallback,
+  errorCallback: this.getMetricsErrorCallback,
   completeCallback: function () {
 requestCounter--;
 if (requestCounter === 0) this.onMetricsLoaded();
@@ -132,6 +133,7 @@ App.WidgetMixin = Ember.Mixin.create({
   context: this,
   startCallName: 'getServiceComponentMetrics',
   successCallback: this.getMetricsSuccessCallback,
+  errorCallback: this.getMetricsErrorCallback,
   completeCallback: function () {
 requestCounter--;
 if (requestCounter === 0) this.onMetricsLoaded();
@@ -273,12 +275,41 @@ App.WidgetMixin = Ember.Mixin.create({
 if (!Em.isNone(metric_data)) {
   _metric.data = metric_data;
   this.get('metrics').pushObject(_metric);
+} else if (this.get('graphView')) {
+  var graph = this.get('childViews') && 
this.get('childViews').findProperty('_showMessage');
+  if (graph) {
+graph.set('hasData', false);
+this.set('isExportButtonHidden', true);
+graph._showMessage('info', this.t('graphs.noData.title'), 
this.t('graphs.noDataAtTime.message'));
+this.get('metrics').clear();
+  }
 }
   }, this);
 }
   },
 
   /**
+   * error callback on getting aggregated metrics and host component metrics
+   * @param {object} xhr
+   * @param {string} textStatus
+   * @param {string} errorThrown
+   */
+  getMetricsErrorCallback: function (xhr, textStatus, errorThrown) {
+if (this.get('graphView')) {
+  var graph = this.get('childViews') && 
this.get('childViews').findProperty('_showMessage');
+  if (graph) {
+if (xhr.readyState == 4 && xhr.status) {
+  textStatus = xhr.status + " " + textStatus;
+}
+graph.set('hasData', false);
+this.set('isExportButtonHidden', true);
+graph._showMessage('warn', this.t('graphs.error.title'), 
this.t('graphs.error.message').format(textStatus, errorThrown));
+this.get('metrics').clear();
+  }
+}
+  },
+
+  /**
* make GET call to get metrics value for all host components
* @param {object} request
* @return {$.ajax}
@@ -708,6 +739,7 @@ App.WidgetLoadAggregator = Em.Object.create({
 bulks[id].subRequests = [{
   context: request.context,
   successCallback: request.successCallback,
+  errorCallback: request.errorCallback,
   completeCallback: request.completeCallback
 }];
   } else {
@@ -715,6 +747,7 @@ App.WidgetLoadAggregator = Em.Object.create({
 bulks[id].subRequests.push({
   context: request.context,
   successCallback: request.successCallback,
+  errorCallback: request.errorCallback,
   completeCallback: request.completeCallback
 });
   }
@@ -736,11 +769,17 @@ App.WidgetLoadAggregator = Em.Object.create({
   _request.subRequests.forEach(function (subRequest) {
 subRequest.successCallback.call(subRequest.context, response);
   }, this);
-}).complete(function () {
-  _request.su

ambari git commit: AMBARI-14989. Inconsistent HIVE CBO setting presentation. (Jaimin)

2016-02-11 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/trunk 6270fe393 -> b9a35f1ea


AMBARI-14989. Inconsistent HIVE CBO setting presentation. (Jaimin)


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

Branch: refs/heads/trunk
Commit: b9a35f1ea6201c7f7c45a9f1463c0802504ee4a5
Parents: 6270fe3
Author: Jaimin Jetly 
Authored: Thu Feb 11 15:02:09 2016 +0530
Committer: Jaimin Jetly 
Committed: Thu Feb 11 15:05:22 2016 +0530

--
 .../services/HIVE/configuration/hive-env.xml| 20 -
 .../services/HIVE/configuration/hive-site.xml   | 14 --
 .../stacks/HDP/2.2/services/stack_advisor.py| 13 +++---
 .../services/HIVE/configuration/hive-env.xml| 20 -
 .../services/HIVE/configuration/hive-site.xml   |  8 
 .../stacks/HDPWIN/2.2/services/stack_advisor.py | 13 +++---
 .../2.1/configs/hive-metastore-upgrade.json |  3 +-
 .../stacks/2.2/common/test_stack_advisor.py | 12 +++--
 .../2.3/common/services-sparkts-hive.json   | 47 
 .../stacks/2.3/common/test_stack_advisor.py |  5 +--
 10 files changed, 18 insertions(+), 137 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b9a35f1e/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
index 87adb4b..471af6e 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
@@ -130,26 +130,6 @@ export METASTORE_PORT={{hive_metastore_port}}
   
 
   
-cost_based_optimizer
-Cost Based Optimizer
-Off
-
-  value-list
-  
-
-  On
-  On
-
-
-  Off
-  Off
-
-  
-  1
-
-  
-
-  
 hive_security_authorization
 Choose Authorization
 None

http://git-wip-us.apache.org/repos/asf/ambari/blob/b9a35f1e/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
index 96efea6..25bb468 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
@@ -471,12 +471,6 @@ limitations under the License.
 hive.cbo.enable
 true
 Flag to control enabling Cost Based Optimizations using 
Calcite framework.
-
-  
-hive-env
-cost_based_optimizer
-  
-
   
 
   
@@ -820,10 +814,6 @@ limitations under the License.
 
 
   
-hive-env
-cost_based_optimizer
-  
-  
 hive-site
 hive.cbo.enable
   
@@ -855,10 +845,6 @@ limitations under the License.
 
 
   
-hive-env
-cost_based_optimizer
-  
-  
 hive-site
 hive.cbo.enable
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/b9a35f1e/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
index 9e43865..dc968cc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
@@ -353,14 +353,11 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
 putHiveSiteProperty("hive.exec.reducers.bytes.per.reducer", "67108864")
 
 # CBO
-putHiveEnvProperty("cost_based_optimizer", "On")
-if 
str(configurations["hive-env"]["properties"]["cost_based_optimizer"]).lower() 
== "on":
-  putHiveSiteProperty("hive.cbo.enable", "true")
-else:
-  putHiveSiteProperty("hive.cbo.enable", "false")
-hive_cbo_enable = 
configurations["hive-site"]["properties"]["hive.cbo.enable"]
-putHiveSiteProperty("hive.stats.fetch.partition.stats", hive_cbo_enable)
-putHiveSiteProperty("hive.stats.fetch.column.stats", hive_cbo_enable)
+if "hive-site" in services["configura

ambari git commit: AMBARI-14989. Inconsistent HIVE CBO setting presentation. (Jaimin)

2016-02-11 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 9377291da -> e8f3ee9d9


AMBARI-14989. Inconsistent HIVE CBO setting presentation. (Jaimin)


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

Branch: refs/heads/branch-2.2
Commit: e8f3ee9d95675b20fea41eea7081fd72f092ef75
Parents: 9377291
Author: Jaimin Jetly 
Authored: Thu Feb 11 15:02:09 2016 +0530
Committer: Jaimin Jetly 
Committed: Thu Feb 11 15:02:09 2016 +0530

--
 .../services/HIVE/configuration/hive-env.xml| 20 -
 .../services/HIVE/configuration/hive-site.xml   | 14 --
 .../stacks/HDP/2.2/services/stack_advisor.py| 13 +++---
 .../services/HIVE/configuration/hive-env.xml| 20 -
 .../services/HIVE/configuration/hive-site.xml   |  8 
 .../stacks/HDPWIN/2.2/services/stack_advisor.py | 13 +++---
 .../2.1/configs/hive-metastore-upgrade.json |  3 +-
 .../stacks/2.2/common/test_stack_advisor.py | 12 +++--
 .../2.3/common/services-sparkts-hive.json   | 47 
 .../stacks/2.3/common/test_stack_advisor.py |  5 +--
 10 files changed, 18 insertions(+), 137 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e8f3ee9d/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
index f84bc01..77eace4 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-env.xml
@@ -127,26 +127,6 @@ export METASTORE_PORT={{hive_metastore_port}}
   
 
   
-cost_based_optimizer
-Cost Based Optimizer
-Off
-
-  value-list
-  
-
-  On
-  On
-
-
-  Off
-  Off
-
-  
-  1
-
-  
-
-  
 hive_security_authorization
 Choose Authorization
 None

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8f3ee9d/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
index 2076049..64094c0 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
@@ -454,12 +454,6 @@ limitations under the License.
 hive.cbo.enable
 true
 Flag to control enabling Cost Based Optimizations using 
Calcite framework.
-
-  
-hive-env
-cost_based_optimizer
-  
-
   
 
   
@@ -803,10 +797,6 @@ limitations under the License.
 
 
   
-hive-env
-cost_based_optimizer
-  
-  
 hive-site
 hive.cbo.enable
   
@@ -838,10 +828,6 @@ limitations under the License.
 
 
   
-hive-env
-cost_based_optimizer
-  
-  
 hive-site
 hive.cbo.enable
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/e8f3ee9d/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
index 9be6410..3ebb25f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
@@ -347,14 +347,11 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
 putHiveSiteProperty("hive.exec.reducers.bytes.per.reducer", "67108864")
 
 # CBO
-putHiveEnvProperty("cost_based_optimizer", "On")
-if 
str(configurations["hive-env"]["properties"]["cost_based_optimizer"]).lower() 
== "on":
-  putHiveSiteProperty("hive.cbo.enable", "true")
-else:
-  putHiveSiteProperty("hive.cbo.enable", "false")
-hive_cbo_enable = 
configurations["hive-site"]["properties"]["hive.cbo.enable"]
-putHiveSiteProperty("hive.stats.fetch.partition.stats", hive_cbo_enable)
-putHiveSiteProperty("hive.stats.fetch.column.stats", hive_cbo_enable)
+if "hive-site" in services[

ambari git commit: AMBARI-15007. Make amazon2015 to be part of redhat6 family (aonishuk)

2016-02-11 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk af560ae37 -> 6270fe393


AMBARI-15007. Make amazon2015 to be part of redhat6 family (aonishuk)


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

Branch: refs/heads/trunk
Commit: 6270fe39331eb8f8e16a49ad7b8df59edecd2ce5
Parents: af560ae
Author: Andrew Onishuk 
Authored: Thu Feb 11 11:15:25 2016 +0200
Committer: Andrew Onishuk 
Committed: Thu Feb 11 11:15:25 2016 +0200

--
 .../src/main/python/ambari_commons/os_check.py  |  73 +++---
 .../ambari_commons/resources/os_family.json | 137 +--
 .../server/state/stack/JsonOsFamilyRoot.java|  38 +
 .../ambari/server/state/stack/OsFamily.java |   8 +-
 .../resources/stacks/HDP/2.2/repos/repoinfo.xml |  12 --
 .../resources/stacks/HDP/2.3/repos/repoinfo.xml |  12 --
 .../resources/stacks/HDP/2.4/repos/repoinfo.xml |  12 --
 ambari-server/src/test/python/TestOSCheck.py|  37 +++--
 8 files changed, 192 insertions(+), 137 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6270fe39/ambari-common/src/main/python/ambari_commons/os_check.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/os_check.py 
b/ambari-common/src/main/python/ambari_commons/os_check.py
index c5457bb..b430c86 100644
--- a/ambari-common/src/main/python/ambari_commons/os_check.py
+++ b/ambari-common/src/main/python/ambari_commons/os_check.py
@@ -56,6 +56,8 @@ RESOURCES_DIR = 
os.path.join(os.path.dirname(os.path.realpath(__file__)), "resou
 
 # family JSON data
 OSFAMILY_JSON_RESOURCE = "os_family.json"
+JSON_OS_MAPPING = "mapping"
+JSON_OS_ALIASES = "aliases"
 JSON_OS_TYPE = "distro"
 JSON_OS_VERSION = "versions"
 JSON_EXTENDS = "extends"
@@ -76,6 +78,8 @@ VER_NT_SERVER = 3
 _IS_ORACLE_LINUX = os.path.exists('/etc/oracle-release')
 _IS_REDHAT_LINUX = os.path.exists('/etc/redhat-release')
 
+SYSTEM_RELEASE_FILE = "/etc/system-release"
+
 def _is_oracle_linux():
   return _IS_ORACLE_LINUX
 
@@ -84,16 +88,16 @@ def _is_redhat_linux():
 
 def advanced_check(distribution):
   distribution = list(distribution)
-  if os.path.exists("/etc/issue"):
-with open("/etc/issue", "rb") as fp:
+  if os.path.exists(SYSTEM_RELEASE_FILE):
+with open(SYSTEM_RELEASE_FILE, "rb") as fp:
   issue_content = fp.read()
   
 if "Amazon" in issue_content:
   distribution[0] = "amazon"
-  search_groups = re.search('(\d+)\.(\d+)', issue_content)
+  search_groups = re.search('(\d+\.\d+)', issue_content)
   
   if search_groups:
-distribution[1] = search_groups.group(1) # if version is 2015.09 only 
get 2015.
+distribution[1] = search_groups.group(1)
   
   return tuple(distribution)
 
@@ -114,16 +118,24 @@ class OS_CONST_TYPE(type):
   f = open(os.path.join(RESOURCES_DIR, OSFAMILY_JSON_RESOURCE))
   json_data = eval(f.read())
   f.close()
-  for family in json_data:
+  
+  if JSON_OS_MAPPING not in json_data:
+raise Exception("Invalid {0}".format(OSFAMILY_JSON_RESOURCE))
+  
+  json_mapping_data = json_data[JSON_OS_MAPPING]
+  
+  for family in json_mapping_data:
 cls.FAMILY_COLLECTION += [family]
-cls.OS_COLLECTION += json_data[family][JSON_OS_TYPE]
+cls.OS_COLLECTION += json_mapping_data[family][JSON_OS_TYPE]
 cls.OS_FAMILY_COLLECTION += [{
   'name': family,
-  'os_list': json_data[family][JSON_OS_TYPE]
+  'os_list': json_mapping_data[family][JSON_OS_TYPE]
 }]
 
-if JSON_EXTENDS in json_data[family]:
-  cls.OS_FAMILY_COLLECTION[-1][JSON_EXTENDS] = 
json_data[family][JSON_EXTENDS]
+if JSON_EXTENDS in json_mapping_data[family]:
+  cls.OS_FAMILY_COLLECTION[-1][JSON_EXTENDS] = 
json_mapping_data[family][JSON_EXTENDS]
+  
+cls.OS_TYPE_ALIASES = json_data[JSON_OS_ALIASES] if JSON_OS_ALIASES in 
json_data else {}
 except:
   raise Exception("Couldn't load '%s' file" % OSFAMILY_JSON_RESOURCE)
 
@@ -194,7 +206,24 @@ class OSCheck:
 distribution = ("Darwin", "TestOnly", "1.1.1", "1.1.1", "1.1")
 
 return distribution
-
+  
+  @staticmethod
+  def get_alias(os_type, os_version):
+version_parts = os_version.split('.')
+full_os_and_major_version = os_type + version_parts[0]
+
+if full_os_and_major_version in OSConst.OS_TYPE_ALIASES:
+  alias = OSConst.OS_TYPE_ALIASES[full_os_and_major_version]
+  re_groups = re.search('(\D+)(\d+)$', alias).groups()
+  os_type = re_groups[0]
+  os_major_version = re_groups[1]
+  
+  version_parts

ambari git commit: AMBARI-15007. Make amazon2015 a part of redhat6 family (aonishuk)

2016-02-11 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 44373cbcd -> 9377291da


AMBARI-15007. Make amazon2015 a part of redhat6 family (aonishuk)


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

Branch: refs/heads/branch-2.2
Commit: 9377291daf9617485b63979430d64ffa901468e4
Parents: 44373cb
Author: Andrew Onishuk 
Authored: Thu Feb 11 11:16:25 2016 +0200
Committer: Andrew Onishuk 
Committed: Thu Feb 11 11:16:25 2016 +0200

--
 .../src/main/python/ambari_commons/os_check.py  |  73 +++---
 .../ambari_commons/resources/os_family.json | 137 +--
 .../server/state/stack/JsonOsFamilyRoot.java|  38 +
 .../ambari/server/state/stack/OsFamily.java |   8 +-
 .../resources/stacks/HDP/2.2/repos/repoinfo.xml |  12 --
 .../resources/stacks/HDP/2.3/repos/repoinfo.xml |  12 --
 .../resources/stacks/HDP/2.4/repos/repoinfo.xml |  12 --
 ambari-server/src/test/python/TestOSCheck.py|  37 +++--
 8 files changed, 192 insertions(+), 137 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9377291d/ambari-common/src/main/python/ambari_commons/os_check.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/os_check.py 
b/ambari-common/src/main/python/ambari_commons/os_check.py
index 238c276..d30b7f9 100644
--- a/ambari-common/src/main/python/ambari_commons/os_check.py
+++ b/ambari-common/src/main/python/ambari_commons/os_check.py
@@ -56,6 +56,8 @@ RESOURCES_DIR = 
os.path.join(os.path.dirname(os.path.realpath(__file__)), "resou
 
 # family JSON data
 OSFAMILY_JSON_RESOURCE = "os_family.json"
+JSON_OS_MAPPING = "mapping"
+JSON_OS_ALIASES = "aliases"
 JSON_OS_TYPE = "distro"
 JSON_OS_VERSION = "versions"
 JSON_EXTENDS = "extends"
@@ -76,6 +78,8 @@ VER_NT_SERVER = 3
 _IS_ORACLE_LINUX = os.path.exists('/etc/oracle-release')
 _IS_REDHAT_LINUX = os.path.exists('/etc/redhat-release')
 
+SYSTEM_RELEASE_FILE = "/etc/system-release"
+
 def _is_oracle_linux():
   return _IS_ORACLE_LINUX
 
@@ -84,16 +88,16 @@ def _is_redhat_linux():
 
 def advanced_check(distribution):
   distribution = list(distribution)
-  if os.path.exists("/etc/issue"):
-with open("/etc/issue", "rb") as fp:
+  if os.path.exists(SYSTEM_RELEASE_FILE):
+with open(SYSTEM_RELEASE_FILE, "rb") as fp:
   issue_content = fp.read()
   
 if "Amazon" in issue_content:
   distribution[0] = "amazon"
-  search_groups = re.search('(\d+)\.(\d+)', issue_content)
+  search_groups = re.search('(\d+\.\d+)', issue_content)
   
   if search_groups:
-distribution[1] = search_groups.group(1) # if version is 2015.09 only 
get 2015.
+distribution[1] = search_groups.group(1)
   
   return tuple(distribution)
 
@@ -114,16 +118,24 @@ class OS_CONST_TYPE(type):
   f = open(os.path.join(RESOURCES_DIR, OSFAMILY_JSON_RESOURCE))
   json_data = eval(f.read())
   f.close()
-  for family in json_data:
+  
+  if JSON_OS_MAPPING not in json_data:
+raise Exception("Invalid {0}".format(OSFAMILY_JSON_RESOURCE))
+  
+  json_mapping_data = json_data[JSON_OS_MAPPING]
+  
+  for family in json_mapping_data:
 cls.FAMILY_COLLECTION += [family]
-cls.OS_COLLECTION += json_data[family][JSON_OS_TYPE]
+cls.OS_COLLECTION += json_mapping_data[family][JSON_OS_TYPE]
 cls.OS_FAMILY_COLLECTION += [{
   'name': family,
-  'os_list': json_data[family][JSON_OS_TYPE]
+  'os_list': json_mapping_data[family][JSON_OS_TYPE]
 }]
 
-if JSON_EXTENDS in json_data[family]:
-  cls.OS_FAMILY_COLLECTION[-1][JSON_EXTENDS] = 
json_data[family][JSON_EXTENDS]
+if JSON_EXTENDS in json_mapping_data[family]:
+  cls.OS_FAMILY_COLLECTION[-1][JSON_EXTENDS] = 
json_mapping_data[family][JSON_EXTENDS]
+  
+cls.OS_TYPE_ALIASES = json_data[JSON_OS_ALIASES] if JSON_OS_ALIASES in 
json_data else {}
 except:
   raise Exception("Couldn't load '%s' file" % OSFAMILY_JSON_RESOURCE)
 
@@ -194,7 +206,24 @@ class OSCheck:
 distribution = ("Darwin", "TestOnly", "1.1.1", "1.1.1", "1.1")
 
 return distribution
-
+  
+  @staticmethod
+  def get_alias(os_type, os_version):
+version_parts = os_version.split('.')
+full_os_and_major_version = os_type + version_parts[0]
+
+if full_os_and_major_version in OSConst.OS_TYPE_ALIASES:
+  alias = OSConst.OS_TYPE_ALIASES[full_os_and_major_version]
+  re_groups = re.search('(\D+)(\d+)$', alias).groups()
+  os_type = re_groups[0]
+  os_major_version = re_groups[1]
+  
+  version

ambari git commit: AMBARI-14991. use the same colors for cpu metrics between summary and host page (onechiporenko)

2016-02-11 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk ba604ea6b -> af560ae37


AMBARI-14991. use the same colors for cpu metrics between summary and host page 
(onechiporenko)


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

Branch: refs/heads/trunk
Commit: af560ae372ba171cf8077a3c827df6fd1b4c0e2c
Parents: ba604ea
Author: Oleg Nechiporenko 
Authored: Wed Feb 10 14:54:53 2016 +0200
Committer: Oleg Nechiporenko 
Committed: Thu Feb 11 10:38:08 2016 +0200

--
 .../app/views/main/dashboard/cluster_metrics/cpu.js   | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/af560ae3/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js
--
diff --git a/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js 
b/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js
index 407487d..eea3040 100644
--- a/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js
+++ b/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js
@@ -43,21 +43,21 @@ App.ChartClusterMetricsCPU = 
App.ChartLinearTimeView.extend({
   idle = null,
   data = Em.get(jsonData, this.get('seriesTemplate.path'));
 if (data) {
-  for (var name in data) {
+  Object.keys(data).forEach(function (name) {
 var seriesData = data[name];
 if (seriesData) {
   var s = {
 name: name,
 data: seriesData
   };
-  if (name.indexOf('Idle') > -1) {
+  if (name.contains('Idle')) {
 //CPU idle metric should be the last in series array
 idle = s;
-continue;
+return;
   }
   dataArray.push(s);
 }
-  }
+  });
   if (idle) {
 dataArray.push(idle);
   }
@@ -66,7 +66,7 @@ App.ChartClusterMetricsCPU = App.ChartLinearTimeView.extend({
   },
 
   colorForSeries: function (series) {
-if (Em.I18n.t('dashboard.clusterMetrics.cpu.displayNames.idle') == 
series.name){
+if (series.name && 
series.name.contains(Em.I18n.t('dashboard.clusterMetrics.cpu.displayNames.idle')))
 {
   return '#CFECEC';
 }
 return null;