You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2015/10/07 15:51:42 UTC
[01/31] ambari git commit: AMBARI-12777. Develop ECS/VIPRFS stack
based on HDP 2.3 (Vijay Srinivasaraghavan via smohanty)
Repository: ambari
Updated Branches:
refs/heads/branch-dev-patch-upgrade ccd64811d -> 15ac28364
AMBARI-12777. Develop ECS/VIPRFS stack based on HDP 2.3 (Vijay Srinivasaraghavan via smohanty)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c9f8d1a8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c9f8d1a8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c9f8d1a8
Branch: refs/heads/branch-dev-patch-upgrade
Commit: c9f8d1a84acb5275ca184e6a42b4553c3f03e0f8
Parents: ccd6481
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Fri Oct 2 15:20:02 2015 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Fri Oct 2 15:20:02 2015 -0700
----------------------------------------------------------------------
.../AmbariCustomCommandExecutionHelper.java | 13 +-
.../resources/stacks/HDP/2.3.ECS/metainfo.xml | 23 ++++
.../stacks/HDP/2.3.ECS/repos/repoinfo.xml | 100 ++++++++++++++
.../stacks/HDP/2.3.ECS/role_command_order.json | 9 ++
.../HDP/2.3.ECS/services/ACCUMULO/metainfo.xml | 28 ++++
.../HDP/2.3.ECS/services/ATLAS/metainfo.xml | 28 ++++
.../services/ECS/configuration/core-site.xml | 114 ++++++++++++++++
.../services/ECS/configuration/hadoop-env.xml | 130 +++++++++++++++++++
.../services/ECS/configuration/hdfs-site.xml | 17 +++
.../HDP/2.3.ECS/services/ECS/metainfo.xml | 83 ++++++++++++
.../services/ECS/package/scripts/ecs_client.py | 110 ++++++++++++++++
.../services/ECS/package/scripts/params.py | 85 ++++++++++++
.../ECS/package/scripts/service_check.py | 36 +++++
.../HDP/2.3.ECS/services/FALCON/metainfo.xml | 27 ++++
.../HDP/2.3.ECS/services/FLUME/metainfo.xml | 27 ++++
.../services/HBASE/configuration/hbase-env.xml | 107 +++++++++++++++
.../services/HBASE/configuration/hbase-site.xml | 27 ++++
.../HDP/2.3.ECS/services/HBASE/metainfo.xml | 58 +++++++++
.../HDP/2.3.ECS/services/HDFS/metainfo.xml | 27 ++++
.../HDP/2.3.ECS/services/HIVE/metainfo.xml | 91 +++++++++++++
.../HDP/2.3.ECS/services/KAFKA/metainfo.xml | 27 ++++
.../HDP/2.3.ECS/services/KERBEROS/metainfo.xml | 26 ++++
.../HDP/2.3.ECS/services/KNOX/metainfo.xml | 27 ++++
.../HDP/2.3.ECS/services/MAHOUT/metainfo.xml | 28 ++++
.../HDP/2.3.ECS/services/OOZIE/metainfo.xml | 27 ++++
.../HDP/2.3.ECS/services/RANGER/metainfo.xml | 32 +++++
.../2.3.ECS/services/RANGER_KMS/metainfo.xml | 30 +++++
.../HDP/2.3.ECS/services/SLIDER/metainfo.xml | 27 ++++
.../HDP/2.3.ECS/services/SPARK/metainfo.xml | 30 +++++
.../HDP/2.3.ECS/services/SQOOP/metainfo.xml | 27 ++++
.../HDP/2.3.ECS/services/STORM/metainfo.xml | 28 ++++
.../services/TEZ/configuration/tez-site.xml | 27 ++++
.../HDP/2.3.ECS/services/TEZ/metainfo.xml | 59 +++++++++
.../YARN/configuration-mapred/mapred-site.xml | 34 +++++
.../HDP/2.3.ECS/services/YARN/metainfo.xml | 81 ++++++++++++
.../HDP/2.3.ECS/services/ZOOKEEPER/metainfo.xml | 51 ++++++++
36 files changed, 1700 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index c869956..d80b497 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -552,8 +552,19 @@ public class AmbariCustomCommandExecutionHelper {
Map<String, String> commandParams = new TreeMap<String, String>();
- String commandTimeout = configs.getDefaultAgentTaskTimeout(false);
+ //Propagate HCFS service type info
+ Iterator<Service> it = cluster.getServices().values().iterator();
+ while(it.hasNext()) {
+ ServiceInfo serviceInfoInstance = ambariMetaInfo.getService(stackId.getStackName(),stackId.getStackVersion(), it.next().getName());
+ LOG.info("Iterating service type Instance in addServiceCheckAction:: " + serviceInfoInstance.getName());
+ if(serviceInfoInstance.getServiceType() != null) {
+ LOG.info("Adding service type info in addServiceCheckAction:: " + serviceInfoInstance.getServiceType());
+ commandParams.put("dfs_type",serviceInfoInstance.getServiceType());
+ break;
+ }
+ }
+ String commandTimeout = configs.getDefaultAgentTaskTimeout(false);
if (serviceInfo.getSchemaVersion().equals(AmbariMetaInfo.SCHEMA_VERSION_2)) {
// Service check command is not custom command
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/metainfo.xml
new file mode 100644
index 0000000..fbc1079
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/metainfo.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <versions>
+ <active>true</active>
+ </versions>
+ <extends>2.3</extends>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/repos/repoinfo.xml
new file mode 100644
index 0000000..80f95e1
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/repos/repoinfo.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<reposinfo>
+ <latest>http://s3.amazonaws.com/dev.hortonworks.com/HDP/hdp_urlinfo.json</latest>
+ <os family="redhat6">
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.3.0.0</baseurl>
+ <repoid>HDP-2.3</repoid>
+ <reponame>HDP</reponame>
+ </repo>
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos6</baseurl>
+ <repoid>HDP-UTILS-1.1.0.20</repoid>
+ <reponame>HDP-UTILS</reponame>
+ </repo>
+ </os>
+ <os family="redhat7">
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.3.0.0</baseurl>
+ <repoid>HDP-2.3</repoid>
+ <reponame>HDP</reponame>
+ </repo>
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7</baseurl>
+ <repoid>HDP-UTILS-1.1.0.20</repoid>
+ <reponame>HDP-UTILS</reponame>
+ </repo>
+ </os>
+ <os family="suse11">
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP/suse11sp3/2.x/updates/2.3.0.0</baseurl>
+ <repoid>HDP-2.3</repoid>
+ <reponame>HDP</reponame>
+ </repo>
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/suse11sp3</baseurl>
+ <repoid>HDP-UTILS-1.1.0.20</repoid>
+ <reponame>HDP-UTILS</reponame>
+ </repo>
+ </os>
+ <os family="ubuntu12">
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP/ubuntu12/2.x/updates/2.3.0.0</baseurl>
+ <repoid>HDP-2.3</repoid>
+ <reponame>HDP</reponame>
+ </repo>
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/ubuntu12</baseurl>
+ <repoid>HDP-UTILS-1.1.0.20</repoid>
+ <reponame>HDP-UTILS</reponame>
+ </repo>
+ </os>
+ <os family="debian7">
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP/debian7/2.x/updates/2.3.0.0</baseurl>
+ <repoid>HDP-2.3</repoid>
+ <reponame>HDP</reponame>
+ </repo>
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/debian6</baseurl>
+ <repoid>HDP-UTILS-1.1.0.20</repoid>
+ <reponame>HDP-UTILS</reponame>
+ </repo>
+ </os>
+ <os family="ubuntu14">
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.3.0.0</baseurl>
+ <repoid>HDP-2.3</repoid>
+ <reponame>HDP</reponame>
+ </repo>
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/ubuntu12</baseurl>
+ <repoid>HDP-UTILS-1.1.0.20</repoid>
+ <reponame>HDP-UTILS</reponame>
+ </repo>
+ </os>
+ <!-- ECS CLIENT REPO -->
+ <os family="any">
+ <repo>
+ <baseurl>http://ECS_CLIENT_REPO/</baseurl>
+ <repoid>ECS-2.2.0.0</repoid>
+ <reponame>ECS</reponame>
+ </repo>
+ </os>
+</reposinfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/role_command_order.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/role_command_order.json b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/role_command_order.json
new file mode 100644
index 0000000..91c267b
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/role_command_order.json
@@ -0,0 +1,9 @@
+{
+ "_comment" : "Record format:",
+ "_comment" : "blockedRole-blockedCommand: [blockerRole1-blockerCommand1, blockerRole2-blockerCommand2, ...]",
+ "general_deps" : {
+ "_comment" : "dependencies for all cases",
+ "ECS-SERVICE_CHECK": ["ECS-INSTALL"]
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ACCUMULO/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ACCUMULO/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ACCUMULO/metainfo.xml
new file mode 100644
index 0000000..79d2d02
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ACCUMULO/metainfo.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>ACCUMULO</name>
+ <extends>common-services/ACCUMULO/1.6.1.2.2.0</extends>
+ <version>1.7.0.2.3</version>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ATLAS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ATLAS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ATLAS/metainfo.xml
new file mode 100644
index 0000000..1b4c570
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ATLAS/metainfo.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>ATLAS</name>
+ <extends>common-services/ATLAS/0.1.0.2.3</extends>
+ <version>0.5.0.2.3</version>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/core-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/core-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/core-site.xml
new file mode 100644
index 0000000..bdfe8dc
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/core-site.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+
+ <!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<configuration supports_final="true" xmlns:xi="http://www.w3.org/2001/XInclude">
+
+<!-- file system properties -->
+
+ <property>
+ <name>fs.viprfs.impl</name>
+ <value>com.emc.hadoop.fs.vipr.ViPRFileSystem</value>
+ </property>
+
+ <property>
+ <name>fs.AbstractFileSystem.viprfs.impl</name>
+ <value>com.emc.hadoop.fs.vipr.ViPRAbstractFileSystem</value>
+ </property>
+
+ <property>
+ <name>fs.vipr.installations</name>
+ <value>Site1</value>
+ </property>
+
+ <property>
+ <name>fs.vipr.installation.Site1.hosts</name>
+ <value></value>
+ </property>
+
+ <property>
+ <name>fs.vipr.installation.Site1.hosts.resolution</name>
+ <value>dynamic</value>
+ </property>
+
+ <property>
+ <name>fs.vipr.installation.Site1.resolution.dynamic.time_to_live_ms</name>
+ <value>900000</value>
+ </property>
+
+ <property>
+ <name>fs.permissions.umask-mode</name>
+ <value>022</value>
+ </property>
+
+ <property>
+ <name>fs.viprfs.auth.anonymous_translation</name>
+ <value>LOCAL_USER</value>
+ </property>
+
+ <property>
+ <name>fs.viprfs.auth.identity_translation</name>
+ <value>NONE</value>
+ </property>
+
+ <property>
+ <name>fs.defaultFS</name>
+ <value></value>
+ </property>
+
+ <property>
+ <name>io.file.buffer.size</name>
+ <value>131072</value>
+ <description>The size of buffer for use in sequence files.
+ The size of this buffer should probably be a multiple of hardware
+ page size (4096 on Intel x86), and it determines how much data is
+ buffered during read and write operations.</description>
+ </property>
+
+ <property>
+ <name>io.serializations</name>
+ <value>org.apache.hadoop.io.serializer.WritableSerialization</value>
+ <description> A list of comma-delimited serialization classes that can be used for obtaining serializers and deserializers.
+ </description>
+ </property>
+
+ <property>
+ <name>io.compression.codecs</name>
+ <value>org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.DefaultCodec,org.apache.hadoop.io.compress.SnappyCodec</value>
+ <description>A list of the compression codec classes that can be used for compression/decompression.</description>
+ </property>
+
+ <property>
+ <name>hadoop.security.authentication</name>
+ <value>simple</value>
+ <description>
+ Set the authentication for the cluster. Valid values are: simple or kerberos
+ </description>
+ </property>
+
+ <property>
+ <name>hadoop.security.authorization</name>
+ <value>false</value>
+ <description>
+ Enable authorization for different protocols.
+ </description>
+ </property>
+
+
+</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hadoop-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hadoop-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hadoop-env.xml
new file mode 100644
index 0000000..8e8896f
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hadoop-env.xml
@@ -0,0 +1,130 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<configuration supports_final="false">
+ <property>
+ <name>hdfs_log_dir_prefix</name>
+ <value>/var/log/hadoop</value>
+ <description>Hadoop Log Dir Prefix</description>
+ </property>
+ <property>
+ <name>proxyuser_group</name>
+ <value>users</value>
+ <property-type>GROUP</property-type>`
+ <description>Proxy user group.</description>
+ </property>
+ <property>
+ <name>hdfs_user</name>
+ <value>hdfs</value>
+ <property-type>USER</property-type>
+ <description>ECS bucket owner user</description>
+ </property>
+ <property>
+ <name>user_group</name>
+ <value>hadoop</value>
+ <property-type>GROUP</property-type>
+ <description>Proxy user group.</description>
+ </property>
+ <!-- hadoop-env.sh -->
+ <property>
+ <name>content</name>
+ <description>This is the jinja template for hadoop-env.sh file</description>
+ <value>
+# Set Hadoop-specific environment variables here.
+
+# The only required environment variable is JAVA_HOME. All others are
+# optional. When running a distributed configuration it is best to
+# set JAVA_HOME in this file, so that it is correctly defined on
+# remote nodes.
+
+# The java implementation to use. Required.
+export JAVA_HOME={{java_home}}
+export HADOOP_HOME_WARN_SUPPRESS=1
+
+# Hadoop home directory
+export HADOOP_HOME=${HADOOP_HOME:-/usr/lib/hadoop}
+
+# Hadoop Configuration Directory
+#TODO: if env var set that can cause problems
+export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-{{hadoop_conf_dir}}}
+
+{# this is different for HDP1 #}
+# Path to jsvc required by secure HDP 2.0 datanode
+export JSVC_HOME={{jsvc_path}}
+
+
+# Extra Java runtime options. Empty by default.
+export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true ${HADOOP_OPTS}"
+
+HADOOP_TASKTRACKER_OPTS="-server -Xmx{{ttnode_heapsize}} -Dhadoop.security.logger=ERROR,console -Dmapred.audit.logger=ERROR,console ${HADOOP_TASKTRACKER_OPTS}"
+
+# Extra ssh options. Empty by default.
+export HADOOP_SSH_OPTS="-o ConnectTimeout=5 -o SendEnv=HADOOP_CONF_DIR"
+
+# Where log files are stored. $HADOOP_HOME/logs by default.
+export HADOOP_LOG_DIR={{hdfs_log_dir_prefix}}/$USER
+
+# History server logs
+export HADOOP_MAPRED_LOG_DIR={{mapred_log_dir_prefix}}/$USER
+
+# Where log files are stored in the secure data environment.
+export HADOOP_SECURE_DN_LOG_DIR={{hdfs_log_dir_prefix}}/$HADOOP_SECURE_DN_USER
+
+# History server pid
+export HADOOP_MAPRED_PID_DIR={{mapred_pid_dir_prefix}}/$USER
+
+YARN_RESOURCEMANAGER_OPTS="-Dyarn.server.resourcemanager.appsummary.logger=INFO,RMSUMMARY"
+
+# A string representing this instance of hadoop. $USER by default.
+export HADOOP_IDENT_STRING=$USER
+
+# Use libraries from standard classpath
+JAVA_JDBC_LIBS=""
+#Add libraries required by mysql connector
+for jarFile in `ls /usr/share/java/*mysql* 2>/dev/null`
+do
+ JAVA_JDBC_LIBS=${JAVA_JDBC_LIBS}:$jarFile
+done
+#Add libraries required by oracle connector
+for jarFile in `ls /usr/share/java/*ojdbc* 2>/dev/null`
+do
+ JAVA_JDBC_LIBS=${JAVA_JDBC_LIBS}:$jarFile
+done
+#Add libraries required by nodemanager
+MAPREDUCE_LIBS={{mapreduce_libs_path}}
+
+export VIPRFS_LIBS=/usr/lib/hadoop/lib/*
+export HADOOP_CLASSPATH=${HADOOP_CLASSPATH}${JAVA_JDBC_LIBS}:${MAPREDUCE_LIBS}:${VIPRFS_LIBS}
+
+if [ -d "/usr/lib/tez" ]; then
+ export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/usr/lib/tez/*:/usr/lib/tez/lib/*:/etc/tez/conf
+fi
+
+# Setting path to hdfs command line
+export HADOOP_LIBEXEC_DIR={{hadoop_libexec_dir}}
+
+#Mostly required for hadoop 2.0
+export JAVA_LIBRARY_PATH=${JAVA_LIBRARY_PATH}:/usr/lib/hadoop/lib/native/Linux-amd64-64
+ </value>
+ </property>
+
+</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hdfs-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hdfs-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hdfs-site.xml
new file mode 100644
index 0000000..586e176
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hdfs-site.xml
@@ -0,0 +1,17 @@
+
+<configuration>
+
+ <property>
+ <name>dfs.permissions.enabled</name>
+ <value>true</value>
+ </property>
+
+ <!-- default value is hdfs but ECS implementation does not use default superusergroup as default group for objects owned by superuser-->
+ <!-- Adding group name to be hadoop resolves some permission issues for HBASE and HIVE services. This is only a temporary fix -->
+ <property>
+ <name>dfs.permissions.superusergroup</name>
+ <!--<value>hdfs</value>-->
+ <value>hadoop</value>
+ </property>
+
+</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/metainfo.xml
new file mode 100644
index 0000000..1a3b742
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/metainfo.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>ECS</name>
+ <displayName>ECS</displayName>
+ <serviceType>HCFS</serviceType>
+ <comment>Hadoop Compatible File System Client for ECS</comment>
+ <version>2.3.0.0</version>
+ <components>
+ <component>
+ <name>ECS_CLIENT</name>
+ <displayName>ECS Client</displayName>
+ <category>CLIENT</category>
+ <commandScript>
+ <script>scripts/ecs_client.py</script>
+ <scriptType>PYTHON</scriptType>
+ <timeout>600</timeout>
+ </commandScript>
+ <configFile>
+ <type>xml</type>
+ <fileName>core-site.xml</fileName>
+ <dictionaryName>core-site</dictionaryName>
+ </configFile>
+ <configFile>
+ <type>xml</type>
+ <fileName>hdfs-site.xml</fileName>
+ <dictionaryName>hdfs-site</dictionaryName>
+ </configFile>
+ <configFile>
+ <type>env</type>
+ <fileName>hadoop-env.sh</fileName>
+ <dictionaryName>hadoop-env</dictionaryName>
+ </configFile>
+ </component>
+ </components>
+
+ <osSpecifics>
+ <osSpecific>
+ <osFamily>any</osFamily>
+ <packages>
+ <package>
+ <name>hadoop-client</name>
+ </package>
+ <package>
+ <name>viprfs-client</name>
+ </package>
+ </packages>
+ </osSpecific>
+ </osSpecifics>
+
+ <commandScript>
+ <script>scripts/service_check.py</script>
+ <scriptType>PYTHON</scriptType>
+ <timeout>300</timeout>
+ </commandScript>
+
+ <configuration-dependencies>
+ <config-type>core-site</config-type>
+ <config-type>hdfs-site</config-type>
+ <config-type>hadoop-env</config-type>
+ </configuration-dependencies>
+
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/ecs_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/ecs_client.py b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/ecs_client.py
new file mode 100644
index 0000000..b9f9180
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/ecs_client.py
@@ -0,0 +1,110 @@
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+import sys
+import os
+from resource_management import *
+
+class ECSClient(Script):
+
+ def install(self, env):
+ self.install_packages(env)
+ self.configure(env)
+
+ def configure(self, env):
+ self.setup_config(env)
+ self.setup_hadoop_env(env)
+ self.create_dirs(env)
+
+ def status(self, env):
+ raise ClientComponentHasNoStatus()
+
+ def setup_config(self, env):
+ import params
+ env.set_params(params)
+ stackversion = params.stack_version_unformatted
+
+ XmlConfig("core-site.xml",
+ conf_dir=params.hadoop_conf_dir,
+ configurations=params.config['configurations']['core-site'],
+ configuration_attributes=params.config['configuration_attributes']['core-site'],
+ owner=params.hdfs_user,
+ group=params.user_group,
+ only_if=format("ls {hadoop_conf_dir}"))
+
+ XmlConfig("hdfs-site.xml",
+ conf_dir=params.hadoop_conf_dir,
+ configurations=params.config['configurations']['hdfs-site'],
+ configuration_attributes=params.config['configuration_attributes']['hdfs-site'],
+ owner=params.hdfs_user,
+ group=params.user_group,
+ only_if=format("ls {hadoop_conf_dir}"))
+
+ File(format("{ambari_libs_dir}/fast-hdfs-resource.jar"),
+ mode=0644,
+ content=StaticFile("/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/hooks/before-START/files/fast-hdfs-resource.jar")
+ )
+
+ def setup_hadoop_env(self, env):
+ import params
+ env.set_params(params)
+ stackversion = params.stack_version_unformatted
+ if params.security_enabled:
+ tc_owner = "root"
+ else:
+ tc_owner = params.hdfs_user
+
+ # create /etc/hadoop
+ Directory(params.hadoop_dir, mode=0755)
+
+ # write out hadoop-env.sh, but only if the directory exists
+ if os.path.exists(params.hadoop_conf_dir):
+ File(os.path.join(params.hadoop_conf_dir, 'hadoop-env.sh'), owner=tc_owner,
+ group=params.user_group,
+ content=InlineTemplate(params.hadoop_env_sh_template))
+
+ # Create tmp dir for java.io.tmpdir
+ # Handle a situation when /tmp is set to noexec
+ Directory(params.hadoop_java_io_tmpdir,
+ owner=params.hdfs_user,
+ group=params.user_group,
+ mode=0777
+ )
+
+ def create_dirs(self,env):
+ import params
+ env.set_params(params)
+ params.HdfsResource("/tmp",
+ type="directory",
+ action="create_on_execute",
+ owner=params.hdfs_user,
+ mode=0777
+ )
+ params.HdfsResource(params.smoke_hdfs_user_dir,
+ type="directory",
+ action="create_on_execute",
+ owner=params.smoke_user,
+ mode=params.smoke_hdfs_user_mode
+ )
+ params.HdfsResource(None,
+ action="execute"
+ )
+
+if __name__ == "__main__":
+ ECSClient().execute()
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/params.py
new file mode 100644
index 0000000..8fe8efb
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/params.py
@@ -0,0 +1,85 @@
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
+from resource_management import *
+import os
+import itertools
+import re
+from resource_management.libraries.functions import conf_select
+from resource_management.libraries.resources.hdfs_resource import HdfsResource
+
+config = Script.get_config()
+
+jdk_name = default("/hostLevelParams/jdk_name", None)
+java_home = config['hostLevelParams']['java_home']
+java_version = int(config['hostLevelParams']['java_version'])
+jdk_location = config['hostLevelParams']['jdk_location']
+
+#hadoop_conf_dir = "/etc/hadoop/conf"
+hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']
+kinit_path_local = functions.get_kinit_path()
+
+stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
+hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
+
+if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
+ hadoop_bin_dir = "/usr/hdp/current/hadoop-client/bin"
+else:
+ hadoop_bin_dir = "/usr/bin"
+
+smoke_user = config['configurations']['cluster-env']['smokeuser']
+smoke_hdfs_user_dir = format("/user/{smoke_user}")
+smoke_hdfs_user_mode = 0770
+
+java64_home = config['hostLevelParams']['java_home']
+java_version = int(config['hostLevelParams']['java_version'])
+
+hadoop_conf_dir = conf_select.get_hadoop_conf_dir(force_latest_on_upgrade=True)
+security_enabled = config['configurations']['cluster-env']['security_enabled']
+hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
+hadoop_dir = "/etc/hadoop"
+user_group = config['configurations']['cluster-env']['user_group']
+hadoop_env_sh_template = config['configurations']['hadoop-env']['content']
+tmp_dir = Script.get_tmp_dir()
+hadoop_java_io_tmpdir = os.path.join(tmp_dir, "hadoop_java_io_tmpdir")
+
+hdfs_principal_name = default('/configurations/hadoop-env/hdfs_principal_name', None)
+hdfs_site = config['configurations']['hdfs-site']
+default_fs = config['configurations']['core-site']['fs.defaultFS']
+dfs_type = default("/commandParams/dfs_type", "")
+
+ambari_libs_dir = "/var/lib/ambari-agent/lib"
+
+import functools
+#create partial functions with common arguments for every HdfsResource call
+#to create/delete/copyfromlocal hdfs directories/files we need to call params.HdfsResource in code
+HdfsResource = functools.partial(
+ HdfsResource,
+ user=hdfs_user,
+ security_enabled = security_enabled,
+ keytab = hdfs_user_keytab,
+ kinit_path_local = kinit_path_local,
+ hadoop_bin_dir = hadoop_bin_dir,
+ hadoop_conf_dir = hadoop_conf_dir,
+ principal_name = hdfs_principal_name,
+ hdfs_site = hdfs_site,
+ default_fs = default_fs,
+ dfs_type = dfs_type
+)
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/service_check.py
new file mode 100644
index 0000000..76d4252
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/package/scripts/service_check.py
@@ -0,0 +1,36 @@
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+"""
+
+from resource_management import *
+
+
+class ECSServiceCheck(Script):
+ def service_check(self, env):
+ import params
+ env.set_params(params)
+
+ # run fs list command to make sure ECS client can talk to ECS backend
+ Execute(format("hadoop fs -ls /"),
+ logoutput=True,
+ tries = 3,
+ try_sleep = 20
+ )
+
+if __name__ == "__main__":
+ ECSServiceCheck().execute()
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/FALCON/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/FALCON/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/FALCON/metainfo.xml
new file mode 100644
index 0000000..4c6f935
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/FALCON/metainfo.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>FALCON</name>
+ <version>0.6.1.2.3</version>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/FLUME/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/FLUME/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/FLUME/metainfo.xml
new file mode 100644
index 0000000..07db648
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/FLUME/metainfo.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>FLUME</name>
+ <version>1.5.2.2.3</version>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HBASE/configuration/hbase-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HBASE/configuration/hbase-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HBASE/configuration/hbase-env.xml
new file mode 100644
index 0000000..b28f50e
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HBASE/configuration/hbase-env.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<configuration>
+ <!-- hbase-env.sh -->
+ <property>
+ <name>content</name>
+ <description>This is the jinja template for hbase-env.sh file</description>
+ <value>
+# Set environment variables here.
+
+# The java implementation to use. Java 1.6 required.
+export JAVA_HOME={{java64_home}}
+
+# HBase Configuration directory
+export HBASE_CONF_DIR=${HBASE_CONF_DIR:-{{hbase_conf_dir}}}
+
+# Add ECS Client Classpath
+export VIPRFS_LIBS=/usr/lib/hadoop/lib/*
+
+# Extra Java CLASSPATH elements. Optional.
+export HBASE_CLASSPATH=${HBASE_CLASSPATH}:${VIPRFS_LIBS}
+
+
+# The maximum amount of heap to use, in MB. Default is 1000.
+# export HBASE_HEAPSIZE=1000
+
+# Extra Java runtime options.
+# Below are what we set by default. May only work with SUN JVM.
+# For more on why as well as other possible settings,
+# see http://wiki.apache.org/hadoop/PerformanceTuning
+export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:{{log_dir}}/gc.log-`date +'%Y%m%d%H%M'`"
+# Uncomment below to enable java garbage collection logging.
+# export HBASE_OPTS="$HBASE_OPTS -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$HBASE_HOME/logs/gc-hbase.log"
+
+# Uncomment and adjust to enable JMX exporting
+# See jmxremote.password and jmxremote.access in $JRE_HOME/lib/management to configure remote password access.
+# More details at: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
+#
+# export HBASE_JMX_BASE="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
+# If you want to configure BucketCache, specify '-XX: MaxDirectMemorySize=' with proper direct memory size
+# export HBASE_THRIFT_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10103"
+# export HBASE_ZOOKEEPER_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10104"
+
+# File naming hosts on which HRegionServers will run. $HBASE_HOME/conf/regionservers by default.
+export HBASE_REGIONSERVERS=${HBASE_CONF_DIR}/regionservers
+
+# Extra ssh options. Empty by default.
+# export HBASE_SSH_OPTS="-o ConnectTimeout=1 -o SendEnv=HBASE_CONF_DIR"
+
+# Where log files are stored. $HBASE_HOME/logs by default.
+export HBASE_LOG_DIR={{log_dir}}
+
+# A string representing this instance of hbase. $USER by default.
+# export HBASE_IDENT_STRING=$USER
+
+# The scheduling priority for daemon processes. See 'man nice'.
+# export HBASE_NICENESS=10
+
+# The directory where pid files are stored. /tmp by default.
+export HBASE_PID_DIR={{pid_dir}}
+
+# Seconds to sleep between slave commands. Unset by default. This
+# can be useful in large clusters, where, e.g., slave rsyncs can
+# otherwise arrive faster than the master can service them.
+# export HBASE_SLAVE_SLEEP=0.1
+
+# Tell HBase whether it should manage it's own instance of Zookeeper or not.
+export HBASE_MANAGES_ZK=false
+
+{% if java_version < 8 %}
+JDK_DEPENDED_OPTS="-XX:PermSize=128m -XX:MaxPermSize=128m"
+{% endif %}
+
+{% if security_enabled %}
+export HBASE_OPTS="$HBASE_OPTS -XX:+UseConcMarkSweepGC -XX:ErrorFile={{log_dir}}/hs_err_pid%p.log -Djava.security.auth.login.config={{client_jaas_config_file}}"
+export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -Xmx{{master_heapsize}} -Djava.security.auth.login.config={{master_jaas_config_file}} $JDK_DEPENDED_OPTS"
+export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -Xmn{{regionserver_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70 -Xms{{regionserver_heapsize}} -Xmx{{regionserver_heapsize}} {% if hbase_max_direct_memory_size %} -XX:MaxDirectMemorySize={{hbase_max_direct_memory_size}}m {% endif %} -Djava.security.auth.login.config={{regionserver_jaas_config_file}} $JDK_DEPENDED_OPTS"
+export PHOENIX_QUERYSERVER_OPTS="$PHOENIX_QUERYSERVER_OPTS -Djava.security.auth.login.config={{queryserver_jaas_config_file}}"
+{% else %}
+export HBASE_OPTS="$HBASE_OPTS -XX:+UseConcMarkSweepGC -XX:ErrorFile={{log_dir}}/hs_err_pid%p.log"
+export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -Xmx{{master_heapsize}} $JDK_DEPENDED_OPTS"
+export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -Xmn{{regionserver_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70 -Xms{{regionserver_heapsize}} -Xmx{{regionserver_heapsize}} {% if hbase_max_direct_memory_size %} -XX:MaxDirectMemorySize={{hbase_max_direct_memory_size}}m {% endif %} $JDK_DEPENDED_OPTS"
+{% endif %}
+ </value>
+ </property>
+
+</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HBASE/configuration/hbase-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HBASE/configuration/hbase-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HBASE/configuration/hbase-site.xml
new file mode 100644
index 0000000..db83c3f
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HBASE/configuration/hbase-site.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<configuration>
+ <property>
+ <name>hbase.rootdir</name>
+ <value></value>
+ </property>
+</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HBASE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HBASE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HBASE/metainfo.xml
new file mode 100644
index 0000000..16fb847
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HBASE/metainfo.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>HBASE</name>
+ <version>1.1.1.2.3</version>
+ <components>
+ <component>
+ <name>HBASE_MASTER</name>
+ <displayName>HBase Master</displayName>
+ <category>MASTER</category>
+ <cardinality>1+</cardinality>
+ <versionAdvertised>true</versionAdvertised>
+ <timelineAppid>HBASE</timelineAppid>
+ <dependencies>
+ <dependency>
+ <name>ECS/ECS_CLIENT</name>
+ <scope>host</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ </auto-deploy>
+ </dependency>
+ <dependency>
+ <name>ZOOKEEPER/ZOOKEEPER_SERVER</name>
+ <scope>cluster</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ <co-locate>HBASE/HBASE_MASTER</co-locate>
+ </auto-deploy>
+ </dependency>
+ </dependencies>
+ </component>
+ </components>
+ <requiredServices>
+ <service>ZOOKEEPER</service>
+ <service>ECS</service>
+ </requiredServices>
+ </service>
+ </services>
+</metainfo>
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HDFS/metainfo.xml
new file mode 100644
index 0000000..78c75f9
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HDFS/metainfo.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>HDFS</name>
+ <version>2.7.1.2.3</version>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HIVE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HIVE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HIVE/metainfo.xml
new file mode 100644
index 0000000..ff24b71
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/HIVE/metainfo.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>HIVE</name>
+ <version>1.2.1.2.3</version>
+ <components>
+ <component>
+ <name>WEBHCAT_SERVER</name>
+ <displayName>WebHCat Server</displayName>
+ <category>MASTER</category>
+ <cardinality>1</cardinality>
+ <versionAdvertised>true</versionAdvertised>
+ <clientsToUpdateConfigs>
+ <client>HCAT</client>
+ </clientsToUpdateConfigs>
+ <dependencies>
+ <dependency>
+ <name>ECS/ECS_CLIENT</name>
+ <scope>host</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ </auto-deploy>
+ </dependency>
+ <dependency>
+ <name>MAPREDUCE2/MAPREDUCE2_CLIENT</name>
+ <scope>host</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ </auto-deploy>
+ </dependency>
+ <dependency>
+ <name>ZOOKEEPER/ZOOKEEPER_SERVER</name>
+ <scope>cluster</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ <co-locate>HIVE/WEBHCAT_SERVER</co-locate>
+ </auto-deploy>
+ </dependency>
+ <dependency>
+ <name>ZOOKEEPER/ZOOKEEPER_CLIENT</name>
+ <scope>host</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ </auto-deploy>
+ </dependency>
+ <dependency>
+ <name>YARN/YARN_CLIENT</name>
+ <scope>host</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ </auto-deploy>
+ </dependency>
+ <dependency>
+ <name>PIG/PIG</name>
+ <scope>host</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ </auto-deploy>
+ </dependency>
+ </dependencies>
+ </component>
+ </components>
+
+ <requiredServices>
+ <service>ZOOKEEPER</service>
+ <service>YARN</service>
+ <service>TEZ</service>
+ </requiredServices>
+
+ </service>
+ </services>
+</metainfo>
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/KAFKA/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/KAFKA/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/KAFKA/metainfo.xml
new file mode 100644
index 0000000..ba43aee
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/KAFKA/metainfo.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>KAFKA</name>
+ <version>0.8.2.2.3</version>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/KERBEROS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/KERBEROS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/KERBEROS/metainfo.xml
new file mode 100644
index 0000000..25cfcc6
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/KERBEROS/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>KERBEROS</name>
+ <extends>common-services/KERBEROS/1.10.3-10</extends>
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/KNOX/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/KNOX/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/KNOX/metainfo.xml
new file mode 100644
index 0000000..357c9d5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/KNOX/metainfo.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>KNOX</name>
+ <version>0.6.0.2.3</version>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/MAHOUT/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/MAHOUT/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/MAHOUT/metainfo.xml
new file mode 100644
index 0000000..79dfdb6
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/MAHOUT/metainfo.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>MAHOUT</name>
+ <version>0.9.0.2.3</version>
+ <extends>common-services/MAHOUT/1.0.0.2.3</extends>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/OOZIE/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/OOZIE/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/OOZIE/metainfo.xml
new file mode 100644
index 0000000..aa8f5ce
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/OOZIE/metainfo.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>OOZIE</name>
+ <extends>common-services/OOZIE/4.2.0.2.3</extends>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/RANGER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/RANGER/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/RANGER/metainfo.xml
new file mode 100644
index 0000000..d582b1f
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/RANGER/metainfo.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>RANGER</name>
+ <displayName>Ranger</displayName>
+ <comment>Comprehensive security for Hadoop</comment>
+ <version>0.5.0.2.3</version>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/RANGER_KMS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/RANGER_KMS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/RANGER_KMS/metainfo.xml
new file mode 100644
index 0000000..bd8c955
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/RANGER_KMS/metainfo.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>RANGER_KMS</name>
+ <extends>common-services/RANGER_KMS/0.5.0.2.3</extends>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/SLIDER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/SLIDER/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/SLIDER/metainfo.xml
new file mode 100644
index 0000000..e4613bd
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/SLIDER/metainfo.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>SLIDER</name>
+ <version>0.80.0.2.3</version>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/SPARK/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/SPARK/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/SPARK/metainfo.xml
new file mode 100644
index 0000000..f764b2c
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/SPARK/metainfo.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>SPARK</name>
+ <version>1.3.1.2.3</version>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/SQOOP/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/SQOOP/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/SQOOP/metainfo.xml
new file mode 100644
index 0000000..2941368
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/SQOOP/metainfo.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>SQOOP</name>
+ <version>1.4.6.2.3</version>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/STORM/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/STORM/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/STORM/metainfo.xml
new file mode 100644
index 0000000..edf3b2e
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/STORM/metainfo.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>STORM</name>
+ <version>0.10.0</version>
+ <deleted>true</deleted>
+ </service>
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/TEZ/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/TEZ/configuration/tez-site.xml
new file mode 100644
index 0000000..4b7d3a4
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/TEZ/configuration/tez-site.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<configuration supports_final="true">
+ <property>
+ <name>tez.cluster.additional.classpath.prefix</name>
+ <value>/usr/hdp/${hdp.version}/hadoop/lib/hadoop-lzo-0.6.0.${hdp.version}.jar:/etc/hadoop/conf/secure:/usr/lib/hadoop/lib/*</value>
+ <description></description>
+ </property>
+
+</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/TEZ/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/TEZ/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/TEZ/metainfo.xml
new file mode 100644
index 0000000..fec7c5a
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/TEZ/metainfo.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>TEZ</name>
+ <version>0.7.0.2.3</version>
+ <components>
+ <component>
+ <name>TEZ_CLIENT</name>
+ <displayName>Tez Client</displayName>
+ <cardinality>1+</cardinality>
+ <versionAdvertised>true</versionAdvertised>
+ <category>CLIENT</category>
+ <dependencies>
+ <dependency>
+ <name>ECS/ECS_CLIENT</name>
+ <scope>host</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ </auto-deploy>
+ </dependency>
+ <dependency>
+ <name>YARN/YARN_CLIENT</name>
+ <scope>host</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ </auto-deploy>
+ </dependency>
+ <dependency>
+ <name>MAPREDUCE2/MAPREDUCE2_CLIENT</name>
+ <scope>host</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ </auto-deploy>
+ </dependency>
+ </dependencies>
+ </component>
+ </components>
+ </service>
+ </services>
+</metainfo>
+
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/YARN/configuration-mapred/mapred-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/YARN/configuration-mapred/mapred-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/YARN/configuration-mapred/mapred-site.xml
new file mode 100644
index 0000000..3547630
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/YARN/configuration-mapred/mapred-site.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- Put site-specific property overrides in this file. -->
+
+<configuration supports_final="true" xmlns:xi="http://www.w3.org/2001/XInclude">
+
+ <property>
+ <name>mapreduce.application.classpath</name>
+ <value>$PWD/mr-framework/hadoop/share/hadoop/mapreduce/*:$PWD/mr-framework/hadoop/share/hadoop/mapreduce/lib/*:$PWD/mr-framework/hadoop/share/hadoop/common/*:$PWD/mr-framework/hadoop/share/hadoop/common/lib/*:$PWD/mr-framework/hadoop/share/hadoop/yarn/*:$PWD/mr-framework/hadoop/share/hadoop/yarn/lib/*:$PWD/mr-framework/hadoop/share/hadoop/hdfs/*:$PWD/mr-framework/hadoop/share/hadoop/hdfs/lib/*:$PWD/mr-framework/hadoop/share/hadoop/tools/lib/*:/usr/hdp/${hdp.version}/hadoop/lib/hadoop-lzo-0.6.0.${hdp.version}.jar:/etc/hadoop/conf/secure:/usr/lib/hadoop/lib/*</value>
+ <description>
+ CLASSPATH for MR applications. A comma-separated list of CLASSPATH
+ entries.
+ </description>
+ </property>
+
+</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/YARN/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/YARN/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/YARN/metainfo.xml
new file mode 100644
index 0000000..ee70733
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/YARN/metainfo.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>YARN</name>
+ <version>2.7.1.2.3</version>
+ <requiredServices>
+ <service>ECS</service>
+ <service>MAPREDUCE2</service>
+ <service>ZOOKEEPER</service>
+ </requiredServices>
+ </service>
+
+ <service>
+ <name>MAPREDUCE2</name>
+ <version>2.7.1.2.3</version>
+ <components>
+ <component>
+ <name>HISTORYSERVER</name>
+ <displayName>History Server</displayName>
+ <category>MASTER</category>
+ <cardinality>1</cardinality>
+ <versionAdvertised>true</versionAdvertised>
+ <auto-deploy>
+ <enabled>true</enabled>
+ <co-locate>YARN/RESOURCEMANAGER</co-locate>
+ </auto-deploy>
+ <dependencies>
+ <dependency>
+ <name>ECS/ECS_CLIENT</name>
+ <scope>host</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ </auto-deploy>
+ </dependency>
+ <dependency>
+ <name>TEZ/TEZ_CLIENT</name>
+ <scope>host</scope>
+ <auto-deploy>
+ <enabled>true</enabled>
+ </auto-deploy>
+ </dependency>
+ </dependencies>
+ </component>
+
+ <component>
+ <name>MAPREDUCE2_CLIENT</name>
+ <displayName>MapReduce2 Client</displayName>
+ <category>CLIENT</category>
+ <cardinality>0+</cardinality>
+ <versionAdvertised>true</versionAdvertised>
+ </component>
+ </components>
+
+ <requiredServices>
+ <service>YARN</service>
+ </requiredServices>
+
+ <configuration-dir>configuration-mapred</configuration-dir>
+ </service>
+
+ </services>
+</metainfo>
http://git-wip-us.apache.org/repos/asf/ambari/blob/c9f8d1a8/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ZOOKEEPER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ZOOKEEPER/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ZOOKEEPER/metainfo.xml
new file mode 100644
index 0000000..c2fe742
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ZOOKEEPER/metainfo.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<metainfo>
+ <schemaVersion>2.0</schemaVersion>
+ <services>
+ <service>
+ <name>ZOOKEEPER</name>
+ <version>3.4.6.2.3</version>
+ <osSpecifics>
+ <osSpecific>
+ <osFamily>redhat7,redhat6,suse11</osFamily>
+ <packages>
+ <package>
+ <name>zookeeper_2_3_*</name>
+ </package>
+ <package>
+ <name>zookeeper_2_3_*-server</name>
+ </package>
+ </packages>
+ </osSpecific>
+ <osSpecific>
+ <osFamily>debian7,ubuntu12,ubuntu14</osFamily>
+ <packages>
+ <package>
+ <name>zookeeper-2-3-.*</name>
+ </package>
+ <package>
+ <name>zookeeper-2-3-.*-server</name>
+ </package>
+ </packages>
+ </osSpecific>
+ </osSpecifics>
+
+ </service>
+ </services>
+</metainfo>
[05/31] ambari git commit: AMBARI-12777. Develop ECS/VIPRFS stack
based on HDP 2.3 - add missing RAT (Vijay Srinivasaraghavan via smohanty)
Posted by nc...@apache.org.
AMBARI-12777. Develop ECS/VIPRFS stack based on HDP 2.3 - add missing RAT (Vijay Srinivasaraghavan via smohanty)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a125f978
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a125f978
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a125f978
Branch: refs/heads/branch-dev-patch-upgrade
Commit: a125f978cb3bbae5ffcb81742cfe12dec2177f1f
Parents: 7aa9f6c
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Sun Oct 4 07:45:20 2015 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Sun Oct 4 07:45:20 2015 -0700
----------------------------------------------------------------------
.../services/ECS/configuration/hdfs-site.xml | 21 ++++++++++++++++++++
1 file changed, 21 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/a125f978/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hdfs-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hdfs-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hdfs-site.xml
index 586e176..e8e6f12 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hdfs-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3.ECS/services/ECS/configuration/hdfs-site.xml
@@ -1,3 +1,24 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
<configuration>
[14/31] ambari git commit: AMBARI-13313. Ability to export graphs as
CSV
Posted by nc...@apache.org.
AMBARI-13313. Ability to export graphs as CSV
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ef80b5ef
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ef80b5ef
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ef80b5ef
Branch: refs/heads/branch-dev-patch-upgrade
Commit: ef80b5ef38f8761b69ea2c01cf225d36e39c58a1
Parents: ce8238b
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Oct 5 20:12:14 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon Oct 5 20:15:00 2015 +0300
----------------------------------------------------------------------
ambari-web/app/assets/test/tests.js | 1 +
.../main/admin/kerberos/step5_controller.js | 47 +---
ambari-web/app/messages.js | 4 +
ambari-web/app/mixins.js | 1 +
.../common/widgets/export_metrics_mixin.js | 119 +++++++++
.../app/mixins/common/widgets/widget_mixin.js | 1 +
ambari-web/app/styles/application.less | 111 +++++---
ambari-web/app/styles/common.less | 7 +
.../app/styles/enhanced_service_dashboard.less | 105 ++++----
.../app/templates/common/chart/linear_time.hbs | 13 +-
.../templates/common/widget/graph_widget.hbs | 7 +
.../app/templates/main/charts/linear_time.hbs | 14 +-
.../main/dashboard/widgets/cluster_metrics.hbs | 11 +
ambari-web/app/utils/file_utils.js | 79 ++++++
.../app/views/common/chart/linear_time.js | 59 ++++-
.../views/common/widget/graph_widget_view.js | 24 +-
.../dashboard/widgets/cluster_metrics_widget.js | 27 +-
.../common/widgets/export_metrics_mixin_test.js | 263 +++++++++++++++++++
18 files changed, 756 insertions(+), 137 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index 8ace78c..4a5af5c 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -140,6 +140,7 @@ var files = [
'test/mixins/common/configs/configs_saver_test',
'test/mixins/common/configs/toggle_isrequired_test',
'test/mixins/common/chart/storm_linear_time_test',
+ 'test/mixins/common/widgets/export_metrics_mixin_test',
'test/mixins/common/widgets/widget_section_test',
'test/mixins/common/localStorage_test',
'test/mixins/common/reload_popup_test',
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
index 3d16f84..f2b469c 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step5_controller.js
@@ -15,7 +15,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
- var stringUtils = require('utils/string_utils');
+var stringUtils = require('utils/string_utils');
+var fileUtils = require('utils/file_utils');
App.KerberosWizardStep5Controller = App.KerberosProgressPageController.extend({
name: 'kerberosWizardStep5Controller',
@@ -46,7 +47,7 @@ App.KerberosWizardStep5Controller = App.KerberosProgressPageController.extend({
getCSVDataSuccessCallback: function (data, opt, params) {
this.set('csvData', this.prepareCSVData(data.split('\n')));
if(!Em.get(params, 'skipDownload')){
- this.downloadCSV();
+ fileUtils.downloadTextFile(stringUtils.arrayToCSV(this.get('csvData')), 'csv', 'kerberos.csv');
}
},
@@ -59,48 +60,6 @@ App.KerberosWizardStep5Controller = App.KerberosProgressPageController.extend({
},
/**
- * download CSV file
- */
- downloadCSV: function () {
- if ($.browser.msie && $.browser.version < 10) {
- this.openInfoInNewTab();
- } else if (typeof safari !== 'undefined') {
- this.safariDownload();
- } else {
- try {
- var blob = new Blob([stringUtils.arrayToCSV(this.get('csvData'))], {type: "text/csv;charset=utf-8;"});
- saveAs(blob, "kerberos.csv");
- } catch (e) {
- this.openInfoInNewTab();
- }
- }
- },
-
- /**
- * Hack to dowload csv data in Safari
- */
- safariDownload: function() {
- var file = 'data:attachment/csv;charset=utf-8,' + encodeURI(stringUtils.arrayToCSV(this.get('csvData')));
- var linkEl = document.createElement("a");
- linkEl.href = file;
- linkEl.download = 'kerberos.csv';
-
- document.body.appendChild(linkEl);
- linkEl.click();
- document.body.removeChild(linkEl);
- },
-
- /**
- * open content of CSV file in new window
- */
- openInfoInNewTab: function () {
- var newWindow = window.open('');
- var newDocument = newWindow.document;
- newDocument.write(stringUtils.arrayToCSV(this.get('hostComponents')));
- newWindow.focus();
- },
-
- /**
* Send request to post kerberos descriptor
* @param kerberosDescriptor
* @returns {$.ajax|*}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index a3bb574..0d60a91 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -273,6 +273,10 @@ Em.I18n.translations = {
'common.removed': 'Removed',
'common.testing': 'Testing',
'common.noData': 'No Data',
+ 'common.export': 'Export',
+ 'common.csv': 'CSV',
+ 'common.json': 'JSON',
+ 'common.timestamp': 'Timestamp',
'common.loading.eclipses': 'Loading...',
'common.running': 'Running',
'common.stopped': 'Stopped',
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/mixins.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins.js b/ambari-web/app/mixins.js
index 6552c61..f5000eb 100644
--- a/ambari-web/app/mixins.js
+++ b/ambari-web/app/mixins.js
@@ -49,6 +49,7 @@ require('mixins/common/configs/configs_saver');
require('mixins/common/configs/configs_loader');
require('mixins/common/configs/configs_comparator');
require('mixins/common/configs/toggle_isrequired');
+require('mixins/common/widgets/export_metrics_mixin');
require('mixins/common/widgets/widget_mixin');
require('mixins/common/widgets/widget_section');
require('mixins/unit_convert/base_unit_convert_mixin');
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js b/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
new file mode 100644
index 0000000..395557e
--- /dev/null
+++ b/ambari-web/app/mixins/common/widgets/export_metrics_mixin.js
@@ -0,0 +1,119 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+var stringUtils = require('utils/string_utils');
+var fileUtils = require('utils/file_utils');
+
+App.ExportMetricsMixin = Em.Mixin.create({
+
+ /**
+ * Used as argument passed from template to indicate that resulting format is CSV, not JSON
+ */
+ exportToCSVArgument: true,
+
+ toggleFormatsList: function () {
+ this.$('.export-graph-list').toggle();
+ },
+
+ exportGraphData: function () {
+ this.toggleFormatsList();
+ },
+
+ exportGraphDataSuccessCallback: function (response, request, params) {
+ var hasData = response && response.metrics && Em.keys(response.metrics).length;
+ if (!hasData) {
+ App.showAlertPopup(Em.I18n.t('graphs.noData.title'), Em.I18n.t('graphs.noData.tooltip.title'));
+ } else {
+ var fileType = params.isCSV ? 'csv' : 'json',
+ fileName = 'data.' + fileType,
+ data = params.isCSV ? this.prepareCSV(response) : this.prepareJSON(response);
+ fileUtils.downloadTextFile(data, fileType, fileName);
+ }
+ },
+
+ exportGraphDataErrorCallback: function (jqXHR, ajaxOptions, error, opt) {
+ App.ajax.defaultErrorHandler(jqXHR, opt.url, opt.method, jqXHR.status);
+ },
+
+ /**
+ * Take metrics from any depth level in JSON response
+ * @method setMetricsArrays
+ * @param data
+ * @param metrics
+ * @param titles
+ */
+ setMetricsArrays: function (data, metrics, titles) {
+ Em.keys(data).forEach(function (key) {
+ if (Em.isArray(data[key])) {
+ titles.push(key);
+ metrics.push(data[key]);
+ } else {
+ this.setMetricsArrays(data[key], metrics, titles);
+ }
+ }, this);
+ },
+
+ prepareCSV: function (data) {
+ var metrics = [],
+ getMetricsItem = function (i, j, k) {
+ var item;
+ if (data.metrics) {
+ item = metrics[j][i][k];
+ } else if (Em.isArray(data)) {
+ item = data[j].data[i][k];
+ }
+ return item;
+ },
+ titles,
+ ticksNumber,
+ metricsNumber,
+ metricsArray;
+ if (data.metrics) {
+ titles = [Em.I18n.t('common.timestamp')];
+ this.setMetricsArrays(data.metrics, metrics, titles);
+ ticksNumber = metrics[0].length;
+ metricsNumber = metrics.length
+ } else if (Em.isArray(data)) {
+ titles = data.mapProperty('name');
+ titles.unshift(Em.I18n.t('common.timestamp'));
+ ticksNumber = data[0].data.length;
+ metricsNumber = data.length;
+ }
+ metricsArray = [titles];
+ for (var i = 0; i < ticksNumber; i++) {
+ metricsArray.push([getMetricsItem(i, 0, 1)]);
+ for (var j = 0; j < metricsNumber; j++) {
+ metricsArray[i + 1].push(getMetricsItem(i, j, 0));
+ };
+ }
+ return stringUtils.arrayToCSV(metricsArray);
+ },
+
+ prepareJSON: function (data) {
+ var fileData;
+ if (data.metrics) {
+ fileData = JSON.stringify(data.metrics, null, 4);
+ } else if (Em.isArray(data)) {
+ fileData = JSON.stringify(data, ['name', 'data'], 4);
+ }
+ return fileData;
+ }
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/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 078ae98..a0d507b 100644
--- a/ambari-web/app/mixins/common/widgets/widget_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/widget_mixin.js
@@ -374,6 +374,7 @@ App.WidgetMixin = Ember.Mixin.create({
Em.run.next(function(){
App.tooltip(self.$(".corner-icon > .icon-copy"), {title: Em.I18n.t('common.clone')});
App.tooltip(self.$(".corner-icon > .icon-edit"), {title: Em.I18n.t('common.edit')});
+ App.tooltip(self.$(".corner-icon > .icon-save"), {title: Em.I18n.t('common.export')});
});
}
}.observes('isLoaded'),
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 2b1f2f5..46e3d4a 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -2177,6 +2177,16 @@ a:focus {
.modal-body {
min-height: 420px !important;
overflow: hidden;
+ .corner-icon {
+ text-decoration: none;
+ .icon-save {
+ color: #555;
+ }
+ }
+ .export-graph-list {
+ top: auto;
+ right: 15px;
+ }
}
}
@@ -2299,9 +2309,31 @@ a:focus {
z-index: 5;
}
.chart-title {
+ padding-right: 15px;
text-align: center;
font-size: small;
}
+ .corner-icon {
+ position: absolute;
+ right: 0;
+ bottom: -10px;
+ text-decoration: none;
+ i {
+ color: #555;
+ }
+ }
+ .export-graph-list-top {
+ position: absolute;
+ bottom: -5px;
+ display: block;
+ width: 100%;
+ height: 10px;
+ }
+ .export-graph-list {
+ top: auto;
+ right: -1px;
+ bottom: -65px;
+ }
}
.modal-body {
@@ -2649,10 +2681,17 @@ table.graphs {
left: -13px;
top: -10px;
}
- .icon-edit{
+ .icon-edit, .icon-save {
color: #555555;
}
}
+ .export-graph-list {
+ right: 3px;
+ li {
+ margin: 0;
+ height: auto;
+ }
+ }
.thumbnail .hidden-info-general{
color: #555555;
font-size: 12px;
@@ -2792,47 +2831,49 @@ table.graphs {
}
}
- .cluster-metrics .chart-container{
- margin: 0px 10px 0px 10px;
- .chart-y-axis{
- margin-top: 10px;
+ .cluster-metrics {
+ position: relative;
+ .chart-container{
+ margin: 0px 10px 0px 10px;
+ .chart-y-axis{
+ margin-top: 10px;
+ }
+ .chart svg{
+ margin-right: 20px;
+ }
+ .rickshaw_legend{
+ padding-top: 3px;
+ }
+ .chart-legend {
+ top: 120px;
+ left:15px;
+ text-align: left;
+ z-index: 3;
+ ul >li{
+ max-height: 10px;
+ }
+ }
}
- .chart svg{
- margin-right: 20px;
+ &> ul {
+ margin:0;
}
- .rickshaw_legend{
- padding-top: 3px;
+ .alert {
+ padding: 0px;
+ font-size: 12px;
}
- .chart-legend {
- top: 120px;
- left:15px;
- text-align: left;
- z-index: 3;
- ul >li{
- max-height: 10px;
+ .thumbnail:hover {
+ cursor: move;
+ .corner-icon {
+ display:block;
+ text-decoration: none;
+ z-index: 9;
+ }
+ .caption {
+ margin-left: -6px;
}
}
}
- .cluster-metrics > ul {
- margin:0;
- }
-
- .cluster-metrics .alert {
- padding: 0px;
- font-size: 12px;
- }
- .cluster-metrics .thumbnail:hover{
- cursor: move;
- .corner-icon{
- display:block;
- text-decoration: none;
- z-index: 9;
- }
- .caption{
- margin-left: -6px;
- }
- }
.links {
ul {
margin: 0;
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/styles/common.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/common.less b/ambari-web/app/styles/common.less
index e828653..6559c06 100644
--- a/ambari-web/app/styles/common.less
+++ b/ambari-web/app/styles/common.less
@@ -348,4 +348,11 @@
padding: 0;
}
}
+}
+
+.export-graph-list {
+ top: 25px;
+ min-width: 60px;
+ font-size: 14px;
+ cursor: default;
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/styles/enhanced_service_dashboard.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/enhanced_service_dashboard.less b/ambari-web/app/styles/enhanced_service_dashboard.less
index f6f17ea..c1a241c 100644
--- a/ambari-web/app/styles/enhanced_service_dashboard.less
+++ b/ambari-web/app/styles/enhanced_service_dashboard.less
@@ -59,6 +59,9 @@
.chart-container .alert {
margin-bottom: 5px;
}
+ .export-graph-list {
+ right: -5px;
+ }
}
}
@@ -202,59 +205,67 @@
#widget_layout {
.widget {
- .thumbnail .corner-icon {
- display: none;
- .icon-remove-sign{
- color: #000000;
- text-shadow: #fff 0px 0px 15px;
- position: absolute;
- left: -7px;
- top: -7px;
- }
- .icon-edit,.icon-copy{
- color: #555555;
- font-weight: bold;
- text-shadow: #ffffff -8px 8px 10px;
- background-color: rgba(255,255,255,0.6);
- position: absolute;
- padding: 5px 5px;
+ .thumbnail {
+ .corner-icon {
+ display: none;
+ .icon-remove-sign{
+ color: #000000;
+ text-shadow: #fff 0px 0px 15px;
+ position: absolute;
+ left: -7px;
+ top: -7px;
+ }
+ .icon-edit, .icon-copy, .icon-save {
+ color: #555555;
+ font-weight: bold;
+ text-shadow: #ffffff -8px 8px 10px;
+ background-color: rgba(255,255,255,0.6);
+ position: absolute;
+ padding: 5px 5px;
+ }
+ .icon-copy {
+ right: 45px;
+ }
+ .icon-edit {
+ right: 25px;
+ }
+ .icon-save {
+ right: 5px;
+ }
}
- .icon-copy {
- right: 25px;
+ .export-graph-list {
+ right: -1px;
}
- .icon-edit {
- right: 5px;
+ &:hover {
+ cursor: move;
+ .corner-icon{
+ display: block;
+ text-decoration: none;
+ z-index: 9;
+ }
+ .caption{
+ margin-left: -10px;
+ }
}
- }
- .thumbnail:hover {
- cursor: move;
- .corner-icon{
- display: block;
+ & .hidden-description{
+ display: none;
+ color: #555555;
+ z-index: 7;
+ font-size: 12px;
+ font-weight: bold;
+ line-height: 18px;
+ text-align: center;
text-decoration: none;
- z-index: 9;
- }
- .caption{
- margin-left: -10px;
+ position: absolute;
+ top: 40px;
+ padding: 8px 5px;
+ width: 89%;
+ height: 62%;
+ overflow: scroll;
+ white-space: pre-line;
+ background: rgba(255,255,255, 0.7);
}
}
- .thumbnail .hidden-description{
- display: none;
- color: #555555;
- z-index: 7;
- font-size: 12px;
- font-weight: bold;
- line-height: 18px;
- text-align: center;
- text-decoration: none;
- position: absolute;
- top: 40px;
- padding: 8px 5px;
- width: 89%;
- height: 62%;
- overflow: scroll;
- white-space: pre-line;
- background: rgba(255,255,255, 0.7);
- }
}
.thumbnail .chart-legend {
.description-line {
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/templates/common/chart/linear_time.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/chart/linear_time.hbs b/ambari-web/app/templates/common/chart/linear_time.hbs
index b488dd3..35a3f3f 100644
--- a/ambari-web/app/templates/common/chart/linear_time.hbs
+++ b/ambari-web/app/templates/common/chart/linear_time.hbs
@@ -17,7 +17,18 @@
}}
<div {{bindAttr class="view.isReady:hide:show :screensaver :no-borders :chart-container"}}></div>
-<div {{bindAttr class="view.isReady::hidden :time-label"}}>{{view.parentView.currentTimeState.name}}</div>
+<div {{bindAttr class="view.isReady::hidden :time-label"}}>
+ {{view.parentView.currentTimeState.name}}
+ {{#if view.parentView.graph.hasData}}
+ <a class="corner-icon pull-right" href="#" {{action toggleFormatsList target="view"}}>
+ <i class="icon-save"></i>
+ </a>
+ <ul class="export-graph-list pull-right dropdown-menu">
+ <li><a {{action exportGraphData view.parentView.graph.exportToCSVArgument target="view"}}>{{t common.csv}}</a></li>
+ <li><a {{action exportGraphData target="view"}}>{{t common.json}}</a></li>
+ </ul>
+ {{/if}}
+</div>
{{#if view.isTimePagingEnable}}
<div {{bindAttr class="view.leftArrowVisible:visibleArrow :arrow-left"}} {{action "switchTimeBack" target="view.parentView"}}></div>
{{/if}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/templates/common/widget/graph_widget.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/widget/graph_widget.hbs b/ambari-web/app/templates/common/widget/graph_widget.hbs
index dd5fd1d..6632db8 100644
--- a/ambari-web/app/templates/common/widget/graph_widget.hbs
+++ b/ambari-web/app/templates/common/widget/graph_widget.hbs
@@ -29,6 +29,13 @@
<a class="corner-icon pull-right" href="#" {{action editWidget target="view"}}>
<i class="icon-edit"></i>
</a>
+ <a class="corner-icon pull-right" href="#" {{action toggleFormatsList target="view"}}>
+ <i class="icon-save"></i>
+ </a>
+ <ul class="export-graph-list pull-right dropdown-menu">
+ <li><a {{action exportGraphData view.exportToCSVArgument target="view"}}>{{t common.csv}}</a></li>
+ <li><a {{action exportGraphData target="view"}}>{{t common.json}}</a></li>
+ </ul>
{{/isAccessible}}
<div class="content"> {{view view.graphView}}</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/templates/main/charts/linear_time.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/charts/linear_time.hbs b/ambari-web/app/templates/main/charts/linear_time.hbs
index 24c13e9..f91f149 100644
--- a/ambari-web/app/templates/main/charts/linear_time.hbs
+++ b/ambari-web/app/templates/main/charts/linear_time.hbs
@@ -26,7 +26,19 @@
<div id="{{unbound view.id}}-chart" class="chart" {{action showGraphInPopup target="view"}}></div>
<div id="{{unbound view.id}}-timeline" class="timeline" {{action showGraphInPopup target="view"}}></div>
{{#unless view.noTitleUnderGraph}}
- <div id="{{unbound view.id}}-title" class="chart-title">{{view.title}}</div>
+ <div id="{{unbound view.id}}-title" class="chart-title">
+ {{view.title}}
+ </div>
+ {{#if view.isReady}}
+ <a class="corner-icon span1" href="#" {{action toggleFormatsList target="view"}}>
+ <i class="icon-save"></i>
+ </a>
+ <div class="export-graph-list-top"></div>
+ <ul class="export-graph-list pull-right dropdown-menu">
+ <li><a {{action exportGraphData view.exportToCSVArgument target="view"}}>{{t common.csv}}</a></li>
+ <li><a {{action exportGraphData target="view"}}>{{t common.json}}</a></li>
+ </ul>
+ {{/if}}
{{/unless}}
</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs b/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
index 6156906..6feeb86 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
@@ -23,6 +23,17 @@
<i class="icon-remove-sign icon-large"></i>
</a>
<div class="caption span10">{{view.title}}</div>
+ {{#if view.isDataLoaded}}
+ {{#if view.childViews.firstObject.hasData}}
+ <a class="corner-icon span1" href="#" {{action toggleFormatsList target="view"}}>
+ <i class="icon-save"></i>
+ </a>
+ <ul class="export-graph-list pull-right dropdown-menu">
+ <li><a {{action exportGraphData view.exportToCSVArgument target="view"}}>{{t common.csv}}</a></li>
+ <li><a {{action exportGraphData target="view"}}>{{t common.json}}</a></li>
+ </ul>
+ {{/if}}
+ {{/if}}
<div class="widget-content" >
{{view view.content}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/utils/file_utils.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/file_utils.js b/ambari-web/app/utils/file_utils.js
new file mode 100644
index 0000000..59a9416
--- /dev/null
+++ b/ambari-web/app/utils/file_utils.js
@@ -0,0 +1,79 @@
+/**
+ * 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.
+ */
+
+var stringUtils = require('utils/string_utils');
+
+module.exports = {
+
+ fileTypeMap: {
+ csv: 'text/csv',
+ json: 'application/json'
+ },
+
+ /**
+ * download text file
+ * @param data {String}
+ * @param fileType {String}
+ * @param fileName {String}
+ */
+ downloadTextFile: function (data, fileType, fileName) {
+ if ($.browser.msie && $.browser.version < 10) {
+ this.openInfoInNewTab(data);
+ } else if (typeof safari !== 'undefined') {
+ this.safariDownload(data, fileType, fileName);
+ } else {
+ try {
+ var blob = new Blob([data], {
+ type: (this.fileTypeMap[fileType] || 'text/' + fileType) + ';charset=utf-8;'
+ });
+ saveAs(blob, fileName);
+ } catch (e) {
+ this.openInfoInNewTab(data);
+ }
+ }
+ },
+
+ /**
+ * open content of text file in new window
+ * @param data {String}
+ */
+ openInfoInNewTab: function (data) {
+ var newWindow = window.open('');
+ var newDocument = newWindow.document;
+ newDocument.write(data);
+ newWindow.focus();
+ },
+
+ /**
+ * Hack to dowload text data in Safari
+ * @param data {String}
+ * @param fileType {String}
+ * @param fileName {String}
+ */
+ safariDownload: function (data, fileType, fileName) {
+ var file = 'data:attachment/' + fileType + ';charset=utf-8,' + encodeURI(data);
+ var linkEl = document.createElement("a");
+ linkEl.href = file;
+ linkEl.download = fileName;
+
+ document.body.appendChild(linkEl);
+ linkEl.click();
+ document.body.removeChild(linkEl);
+ }
+
+};
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/views/common/chart/linear_time.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/chart/linear_time.js b/ambari-web/app/views/common/chart/linear_time.js
index 97e3d7d..4cb496b 100644
--- a/ambari-web/app/views/common/chart/linear_time.js
+++ b/ambari-web/app/views/common/chart/linear_time.js
@@ -46,7 +46,7 @@ var dateUtils = require('utils/date');
* @extends Ember.Object
* @extends Ember.View
*/
-App.ChartLinearTimeView = Ember.View.extend({
+App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, {
templateName: require('templates/main/charts/linear_time'),
/**
@@ -163,12 +163,28 @@ App.ChartLinearTimeView = Ember.View.extend({
didInsertElement: function () {
this.loadData();
this.registerGraph();
+ this.$().parent().on('mouseleave', function () {
+ $(this).find('.export-graph-list').hide();
+ });
App.tooltip(this.$("[rel='ZoomInTooltip']"), {
placement: 'left',
template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner graph-tooltip"></div></div>'
});
},
+ setExportTooltip: function () {
+ if (this.get('isReady')) {
+ Em.run.next(this, function () {
+ this.$('.corner-icon').on('mouseover', function () {
+ $(this).closest("[rel='ZoomInTooltip']").trigger('mouseleave');
+ });
+ App.tooltip(this.$('.corner-icon > .icon-save'), {
+ title: Em.I18n.t('common.export')
+ });
+ });
+ }
+ }.observes('isReady'),
+
willDestroyElement: function () {
this.$("[rel='ZoomInTooltip']").tooltip('destroy');
$(this.get('_containerSelector') + ' li.line').off();
@@ -391,7 +407,9 @@ App.ChartLinearTimeView = Ember.View.extend({
}
else {
graph_container.children().each(function () {
- $(this).children().remove();
+ if (!($(this).is('.export-graph-list, .corner-icon'))) {
+ $(this).children().remove();
+ }
});
}
if (this.checkSeries(seriesData)) {
@@ -713,7 +731,7 @@ App.ChartLinearTimeView = Ember.View.extend({
var self = this;
App.ModalPopup.show({
- bodyClass: Em.View.extend({
+ bodyClass: Em.View.extend(App.ExportMetricsMixin, {
containerId: null,
containerClass: null,
@@ -733,6 +751,14 @@ App.ChartLinearTimeView = Ember.View.extend({
}.property('parentView.graph.isPopupReady'),
didInsertElement: function () {
+ App.tooltip(this.$('.corner-icon > .icon-save'), {
+ title: Em.I18n.t('common.export')
+ });
+ this.$().closest('.modal').on('click', function (event) {
+ if (!($(event.target).is('.corner-icon, .icon-save, .export-graph-list, .export-graph-list *'))) {
+ $(this).find('.export-graph-list').hide();
+ }
+ });
$('#modal').addClass('modal-graph-line');
var popupSuffix = this.get('parentView.graph.popupSuffix');
var id = this.get('parentView.graph.id');
@@ -766,8 +792,17 @@ App.ChartLinearTimeView = Ember.View.extend({
leftArrowVisible: function () {
return (this.get('isReady') && (this.get('parentView.currentTimeIndex') != 7));
- }.property('isReady', 'parentView.currentTimeIndex')
+ }.property('isReady', 'parentView.currentTimeIndex'),
+ exportGraphData: function (event) {
+ this._super();
+ var ajaxIndex = this.get('parentView.graph.ajaxIndex'),
+ isCSV = !!event.context,
+ targetView = ajaxIndex ? this.get('parentView.graph') : self.get('parentView');
+ targetView.exportGraphData({
+ context: event.context
+ });
+ }
}),
header: this.get('title'),
/**
@@ -847,7 +882,21 @@ App.ChartLinearTimeView = Ember.View.extend({
currentTimeIndex: 0,
timeUnitSeconds: function () {
return this.get('timeStates').objectAt(this.get('currentTimeIndex')).seconds;
- }.property('currentTimeIndex')
+ }.property('currentTimeIndex'),
+
+ exportGraphData: function (event) {
+ this._super();
+ var ajaxIndex = this.get('ajaxIndex');
+ App.ajax.send({
+ name: ajaxIndex,
+ data: $.extend(this.getDataForAjaxRequest(), {
+ isCSV: !!event.context
+ }),
+ sender: this,
+ success: 'exportGraphDataSuccessCallback',
+ error: 'exportGraphDataErrorCallback'
+ });
+ }
});
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/views/common/widget/graph_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/widget/graph_widget_view.js b/ambari-web/app/views/common/widget/graph_widget_view.js
index b5abc96..3ad0419 100644
--- a/ambari-web/app/views/common/widget/graph_widget_view.js
+++ b/ambari-web/app/views/common/widget/graph_widget_view.js
@@ -18,7 +18,9 @@
var App = require('app');
-App.GraphWidgetView = Em.View.extend(App.WidgetMixin, {
+var fileUtils = require('utils/file_utils');
+
+App.GraphWidgetView = Em.View.extend(App.WidgetMixin, App.ExportMetricsMixin, {
templateName: require('templates/common/widget/graph_widget'),
/**
@@ -286,6 +288,9 @@ App.GraphWidgetView = Em.View.extend(App.WidgetMixin, {
},
didInsertElement: function () {
+ this.$().closest('.graph-widget').on('mouseleave', function () {
+ $(this).find('.export-graph-list').hide();
+ });
this.setYAxisFormatter();
this.loadData();
var self = this;
@@ -300,5 +305,20 @@ App.GraphWidgetView = Em.View.extend(App.WidgetMixin, {
}
});
}.observes('parentView.data')
- })
+ }),
+
+ toggleFormatsList: function () {
+ this.get('childViews.firstObject').$().closest('.graph-widget').find('.export-graph-list').toggle();
+ },
+
+ exportGraphData: function (event) {
+ this._super();
+ var data,
+ isCSV = !!event.context,
+ fileType = isCSV ? 'csv' : 'json',
+ fileName = 'data.' + fileType,
+ metrics = this.get('content.metrics'),
+ data = isCSV ? this.prepareCSV(metrics) : this.prepareJSON(metrics);
+ fileUtils.downloadTextFile(data, fileType, fileName);
+ }
});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/app/views/main/dashboard/widgets/cluster_metrics_widget.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets/cluster_metrics_widget.js b/ambari-web/app/views/main/dashboard/widgets/cluster_metrics_widget.js
index d6b2db7..69bf666 100644
--- a/ambari-web/app/views/main/dashboard/widgets/cluster_metrics_widget.js
+++ b/ambari-web/app/views/main/dashboard/widgets/cluster_metrics_widget.js
@@ -18,8 +18,31 @@
var App = require('app');
-App.ClusterMetricsDashboardWidgetView = App.DashboardWidgetView.extend({
+App.ClusterMetricsDashboardWidgetView = App.DashboardWidgetView.extend(App.ExportMetricsMixin, {
- templateName: require('templates/main/dashboard/widgets/cluster_metrics')
+ templateName: require('templates/main/dashboard/widgets/cluster_metrics'),
+
+ didInsertElement: function () {
+ this.$().on('mouseleave', function () {
+ $(this).find('.export-graph-list').hide();
+ });
+ App.tooltip(this.$('.corner-icon > .icon-save'), {
+ title: Em.I18n.t('common.export')
+ });
+ },
+
+ exportGraphData: function (event) {
+ this._super();
+ var ajaxIndex = this.get('childViews.firstObject.ajaxIndex');
+ App.ajax.send({
+ name: ajaxIndex,
+ data: $.extend(this.get('childViews.firstObject').getDataForAjaxRequest(), {
+ isCSV: !!event.context
+ }),
+ sender: this,
+ success: 'exportGraphDataSuccessCallback',
+ error: 'exportGraphDataErrorCallback'
+ });
+ }
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef80b5ef/ambari-web/test/mixins/common/widgets/export_metrics_mixin_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/widgets/export_metrics_mixin_test.js b/ambari-web/test/mixins/common/widgets/export_metrics_mixin_test.js
new file mode 100644
index 0000000..79fbfdb
--- /dev/null
+++ b/ambari-web/test/mixins/common/widgets/export_metrics_mixin_test.js
@@ -0,0 +1,263 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+require('mixins/common/widgets/export_metrics_mixin');
+var fileUtils = require('utils/file_utils');
+
+describe('App.ExportMetricsMixin', function () {
+
+ var obj;
+
+ beforeEach(function () {
+ obj = Em.Object.create(App.ExportMetricsMixin);
+ });
+
+ describe('#exportGraphData', function () {
+
+ beforeEach(function () {
+ sinon.stub(obj, 'toggleFormatsList', Em.K);
+ });
+
+ afterEach(function () {
+ obj.toggleFormatsList.restore();
+ });
+
+ it('should toggle formats menu', function () {
+ obj.exportGraphData();
+ expect(obj.toggleFormatsList.calledOnce).to.be.true;
+ });
+
+ });
+
+ describe('#exportGraphDataSuccessCallback', function () {
+
+ var cases = [
+ {
+ response: null,
+ showAlertPopupCallCount: 1,
+ prepareCSVCallCount: 0,
+ prepareJSONCallCount: 0,
+ downloadTextFileCallCount: 0,
+ title: 'no response'
+ },
+ {
+ response: {
+ metrics: null
+ },
+ showAlertPopupCallCount: 1,
+ prepareCSVCallCount: 0,
+ prepareJSONCallCount: 0,
+ downloadTextFileCallCount: 0,
+ title: 'no metrics object in response'
+ },
+ {
+ response: {
+ metrics: {}
+ },
+ showAlertPopupCallCount: 1,
+ prepareCSVCallCount: 0,
+ prepareJSONCallCount: 0,
+ downloadTextFileCallCount: 0,
+ title: 'empty metrics object'
+ },
+ {
+ response: {
+ metrics: {
+ m0: [0, 1]
+ }
+ },
+ params: {
+ isCSV: true
+ },
+ showAlertPopupCallCount: 0,
+ prepareCSVCallCount: 1,
+ prepareJSONCallCount: 0,
+ downloadTextFileCallCount: 1,
+ fileType: 'csv',
+ fileName: 'data.csv',
+ title: 'export to CSV'
+ },
+ {
+ response: {
+ metrics: {
+ m0: [0, 1]
+ }
+ },
+ params: {
+ isCSV: false
+ },
+ showAlertPopupCallCount: 0,
+ prepareCSVCallCount: 0,
+ prepareJSONCallCount: 1,
+ downloadTextFileCallCount: 1,
+ fileType: 'json',
+ fileName: 'data.json',
+ title: 'export to JSON'
+ }
+ ];
+
+ beforeEach(function () {
+ sinon.stub(App, 'showAlertPopup', Em.K);
+ sinon.stub(fileUtils, 'downloadTextFile', Em.K);
+ sinon.stub(obj, 'prepareCSV', Em.K);
+ sinon.stub(obj, 'prepareJSON', Em.K);
+ });
+
+ afterEach(function () {
+ App.showAlertPopup.restore();
+ fileUtils.downloadTextFile.restore();
+ obj.prepareCSV.restore();
+ obj.prepareJSON.restore();
+ });
+
+ cases.forEach(function (item) {
+ it(item.title, function () {
+ obj.exportGraphDataSuccessCallback(item.response, null, item.params);
+ expect(obj.prepareCSV.callCount).to.equal(item.prepareCSVCallCount);
+ expect(obj.prepareJSON.callCount).to.equal(item.prepareJSONCallCount);
+ expect(fileUtils.downloadTextFile.callCount).to.equal(item.downloadTextFileCallCount);
+ if (item.downloadTextFileCallCount) {
+ expect(fileUtils.downloadTextFile.firstCall.args[1]).to.equal(item.fileType);
+ expect(fileUtils.downloadTextFile.firstCall.args[2]).to.equal(item.fileName);
+ }
+ });
+ });
+
+ });
+
+ describe('#exportGraphDataErrorCallback', function () {
+
+ beforeEach(function () {
+ sinon.stub(App.ajax, 'defaultErrorHandler', Em.K);
+ });
+
+ afterEach(function () {
+ App.ajax.defaultErrorHandler.restore();
+ });
+
+ it('should display error popup', function () {
+ obj.exportGraphDataErrorCallback({
+ status: 404
+ }, null, '', {
+ url: 'url',
+ method: 'GET'
+ });
+ expect(App.ajax.defaultErrorHandler.calledOnce).to.be.true;
+ expect(App.ajax.defaultErrorHandler.calledWith({
+ status: 404
+ }, 'url', 'GET', 404)).to.be.true;
+ });
+
+ });
+
+ describe('#setMetricsArrays', function () {
+
+ var metrics = [],
+ titles = [],
+ data = {
+ key0: {
+ key1: {
+ key2: [[0, 1], [2, 3]],
+ key3: [[4, 5], [6, 7]]
+ }
+ }
+ };
+
+ it('should construct arrays with metrics info', function () {
+ obj.setMetricsArrays(data, metrics, titles);
+ expect(metrics).to.eql([[[0, 1], [2, 3]], [[4, 5], [6, 7]]]);
+ expect(titles).to.eql(['key2', 'key3']);
+ })
+
+ });
+
+ describe('#prepareCSV', function () {
+
+ var cases = [
+ {
+ data: {
+ metrics: {
+ key0: [[0, 1], [2, 3]],
+ key1: [[4, 1], [5, 3]]
+ }
+ },
+ result: 'Timestamp,key0,key1\n1,0,4\n3,2,5\n',
+ title: 'old style widget metrics'
+ },
+ {
+ data: [
+ {
+ data: [[6, 7], [8, 9]]
+ },
+ {
+ data: [[10, 7], [11, 9]]
+ }
+ ],
+ result: 'Timestamp,,\n7,6,10\n9,8,11\n',
+ title: 'enhanced widget metrics'
+ }
+ ];
+
+ cases.forEach(function (item) {
+ it(item.title, function () {
+ expect(obj.prepareCSV(item.data)).to.equal(item.result);
+ });
+ });
+
+ });
+
+ describe('#prepareJSON', function () {
+
+ var cases = [
+ {
+ data: {
+ metrics: {
+ key0: [[0, 1], [2, 3]],
+ key1: [[4, 1], [5, 3]]
+ }
+ },
+ result: "{\"key0\":[[0,1],[2,3]],\"key1\":[[4,1],[5,3]]}",
+ title: 'old style widget metrics'
+ },
+ {
+ data: [
+ {
+ name: 'n0',
+ data: [[6, 7], [8, 9]]
+ },
+ {
+ name: 'n1',
+ data: [[10, 7], [11, 9]]
+ }
+ ],
+ result: "[{\"name\":\"n0\",\"data\":[[6,7],[8,9]]},{\"name\":\"n1\",\"data\":[[10,7],[11,9]]}]",
+ title: 'enhanced widget metrics'
+ }
+ ];
+
+ cases.forEach(function (item) {
+ it(item.title, function () {
+ expect(obj.prepareJSON(item.data).replace(/\s/g, '')).to.equal(item.result);
+ });
+ });
+
+ });
+
+});
[04/31] ambari git commit: AMBARI-13303. Ranger smart config: User
Info Tab should change visibility of configs dynamically. (jaimin)
Posted by nc...@apache.org.
AMBARI-13303. Ranger smart config: User Info Tab should change visibility of configs dynamically. (jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7aa9f6ca
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7aa9f6ca
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7aa9f6ca
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 7aa9f6ca335812f57625a6aed7bbd274d0165b5e
Parents: 1f5acf2
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Fri Oct 2 17:49:46 2015 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Fri Oct 2 17:51:17 2015 -0700
----------------------------------------------------------------------
.../ambari/server/state/theme/Subsection.java | 11 +
.../RANGER/configuration/ranger-admin-site.xml | 2 +-
.../RANGER/configuration/ranger-ugsync-site.xml | 24 +-
.../HDP/2.3/services/RANGER/themes/theme.json | 264 +++++++++++++++----
ambari-web/app/mappers/configs/themes_mapper.js | 1 +
.../app/models/configs/theme/sub_section.js | 8 +-
.../configs/service_config_layout_tab.hbs | 4 +-
.../configs/widgets/config_widget_view.js | 7 +-
8 files changed, 243 insertions(+), 78 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/7aa9f6ca/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java
index c9f9019..5748dca 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java
@@ -172,6 +172,8 @@ public class Subsection {
private String name;
@JsonProperty("display-name")
private String displayName;
+ @JsonProperty("depends-on")
+ private List<ConfigCondition> dependsOn;
public String getName() {
return name;
@@ -188,5 +190,14 @@ public class Subsection {
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
+
+ public List<ConfigCondition> getDependsOn() {
+ return dependsOn;
+ }
+
+ public void setDependsOn(List<ConfigCondition> dependsOn) {
+ this.dependsOn = dependsOn;
+ }
+
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/7aa9f6ca/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
index d93d758..bff0225 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
@@ -269,7 +269,7 @@
<property>
<name>ranger.ldap.ad.domain</name>
- <display-name>Domain Name</display-name>
+ <display-name>Domain Name (AD specific)</display-name>
<value>localhost</value>
<description>AD domain, only used if Authentication method is AD</description>
<value-attributes>
http://git-wip-us.apache.org/repos/asf/ambari/blob/7aa9f6ca/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-ugsync-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-ugsync-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-ugsync-site.xml
index c73c592..39dfe43 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-ugsync-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-ugsync-site.xml
@@ -120,18 +120,12 @@
<name>ranger.usersync.unix.group.file</name>
<display-name>Group File</display-name>
<value></value>
- <value-attributes>
- <empty-value-valid>true</empty-value-valid>
- </value-attributes>
</property>
<property>
<name>ranger.usersync.unix.password.file</name>
<display-name>Password File</display-name>
<value></value>
- <value-attributes>
- <empty-value-valid>true</empty-value-valid>
- </value-attributes>
</property>
<property>
@@ -151,10 +145,6 @@
<overridable>false</overridable>
<entries>
<entry>
- <value></value>
- <label>NONE</label>
- </entry>
- <entry>
<value>org.apache.ranger.unixusersync.process.UnixUserGroupBuilder</value>
<label>UNIX</label>
</entry>
@@ -164,11 +154,7 @@
</entry>
<entry>
<value>org.apache.ranger.ldapusersync.process.LdapUserGroupBuilder</value>
- <label>LDAP</label>
- </entry>
- <entry>
- <value>org.apache.ranger.ldapusersync.process.LdapUserGroupBuilder</value>
- <label>AD</label>
+ <label>LDAP/AD</label>
</entry>
</entries>
<selection-cardinality>1</selection-cardinality>
@@ -209,9 +195,6 @@
<value></value>
<property-type>PASSWORD</property-type>
<description>Password for the account that can search for users.</description>
- <value-attributes>
- <empty-value-valid>true</empty-value-valid>
- </value-attributes>
</property>
<property>
@@ -317,7 +300,7 @@
<property>
<name>ranger.usersync.group.searchenabled</name>
- <display-name>Enable Group Sync (Group Search Filter)</display-name>
+ <display-name>Enable Group Sync</display-name>
<value>false</value>
<description>"# do we want to do ldapsearch to find groups instead of relying on user entry attributes
# valid values: true, false
@@ -373,9 +356,6 @@
# overrides value specified in ranger.usersync.ldap.searchBase, ranger.usersync.ldap.user.searchbase
# if a value is not specified, takes the value of ranger.usersync.ldap.searchBase
# if ranger.usersync.ldap.searchBase is also not specified, takes the value of ranger.usersync.ldap.user.searchbase"</description>
- <value-attributes>
- <empty-value-valid>true</empty-value-valid>
- </value-attributes>
</property>
<property>
http://git-wip-us.apache.org/repos/asf/ambari/blob/7aa9f6ca/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
index b398a3b..c4f7d59 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
@@ -127,29 +127,108 @@
"display-name": "Ranger User Info",
"row-index": "0",
"column-index": "0",
- "row-span": "1",
+ "row-span": "2",
"column-span": "1",
"section-columns": "1",
- "section-rows": "1",
+ "section-rows": "2",
"subsections": [
{
"name": "subsection-ranger-user-row1-col1",
"row-index": "0",
"column-index": "0",
"row-span": "1",
+ "column-span": "1"
+ },
+ {
+ "name": "subsection-ranger-user-row2-col1",
+ "row-index": "1",
+ "column-index": "0",
+ "row-span": "1",
"column-span": "1",
"subsection-tabs": [
{
"name": "ldap-common-configs",
- "display-name": "Common Configs"
+ "display-name": "Common Configs",
+ "depends-on": [
+ {
+ "configs": [
+ "ranger-ugsync-site/ranger.usersync.source.impl.class"
+ ],
+ "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.ldapusersync.process.LdapUserGroupBuilder",
+ "then": {
+ "property_value_attributes": {
+ "visible": true
+ }
+ },
+ "else": {
+ "property_value_attributes": {
+ "visible": false
+ }
+ }
+ }
+ ]
},
{
"name": "ldap-user-configs",
- "display-name": "User Configs"
+ "display-name": "User Configs",
+ "depends-on": [
+ {
+ "configs": [
+ "ranger-ugsync-site/ranger.usersync.source.impl.class"
+ ],
+ "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.ldapusersync.process.LdapUserGroupBuilder",
+ "then": {
+ "property_value_attributes": {
+ "visible": true
+ }
+ },
+ "else": {
+ "property_value_attributes": {
+ "visible": false
+ }
+ }
+ }
+ ]
},
{
"name": "ldap-group-configs",
- "display-name": "Group Configs"
+ "display-name": "Group Configs",
+ "depends-on": [
+ {
+ "configs": [
+ "ranger-ugsync-site/ranger.usersync.source.impl.class"
+ ],
+ "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.ldapusersync.process.LdapUserGroupBuilder",
+ "then": {
+ "property_value_attributes": {
+ "visible": true
+ }
+ },
+ "else": {
+ "property_value_attributes": {
+ "visible": false
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "depends-on": [
+ {
+ "configs": [
+ "ranger-ugsync-site/ranger.usersync.enabled"
+ ],
+ "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+ "then": {
+ "property_value_attributes": {
+ "visible": true
+ }
+ },
+ "else": {
+ "property_value_attributes": {
+ "visible": false
+ }
+ }
}
]
}
@@ -237,48 +316,142 @@
}
},
{
- "config": "ranger-ugsync-site/ranger.usersync.source.impl.class",
+ "config": "ranger-ugsync-site/ranger.usersync.enabled",
"subsection-name": "subsection-ranger-user-row1-col1"
},
+ {
+ "config": "ranger-ugsync-site/ranger.usersync.source.impl.class",
+ "subsection-name": "subsection-ranger-user-row2-col1"
+ },
{
"config": "ranger-ugsync-site/ranger.usersync.unix.minUserId",
- "subsection-name": "subsection-ranger-user-row1-col1"
+ "subsection-name": "subsection-ranger-user-row2-col1",
+ "depends-on": [
+ {
+ "configs":[
+ "ranger-ugsync-site/ranger.usersync.source.impl.class"
+ ],
+ "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.unixusersync.process.UnixUserGroupBuilder",
+ "then": {
+ "property_value_attributes": {
+ "visible": true
+ }
+ },
+ "else": {
+ "property_value_attributes": {
+ "visible": false
+ }
+ }
+ }
+ ]
},
{
"config": "ranger-ugsync-site/ranger.usersync.unix.password.file",
- "subsection-name": "subsection-ranger-user-row1-col1"
+ "subsection-name": "subsection-ranger-user-row2-col1",
+ "depends-on": [
+ {
+ "configs":[
+ "ranger-ugsync-site/ranger.usersync.source.impl.class"
+ ],
+ "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.unixusersync.process.UnixUserGroupBuilder",
+ "then": {
+ "property_value_attributes": {
+ "visible": true
+ }
+ },
+ "else": {
+ "property_value_attributes": {
+ "visible": false
+ }
+ }
+ }
+ ]
},
{
"config": "ranger-ugsync-site/ranger.usersync.unix.group.file",
- "subsection-name": "subsection-ranger-user-row1-col1"
+ "subsection-name": "subsection-ranger-user-row2-col1",
+ "depends-on": [
+ {
+ "configs":[
+ "ranger-ugsync-site/ranger.usersync.source.impl.class"
+ ],
+ "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.unixusersync.process.UnixUserGroupBuilder",
+ "then": {
+ "property_value_attributes": {
+ "visible": true
+ }
+ },
+ "else": {
+ "property_value_attributes": {
+ "visible": false
+ }
+ }
+ }
+ ]
},
{
"config": "ranger-ugsync-site/ranger.usersync.filesource.file",
- "subsection-name": "subsection-ranger-user-row1-col1"
+ "subsection-name": "subsection-ranger-user-row2-col1",
+ "depends-on": [
+ {
+ "configs":[
+ "ranger-ugsync-site/ranger.usersync.source.impl.class"
+ ],
+ "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.unixusersync.process.FileSourceUserGroupBuilder",
+ "then": {
+ "property_value_attributes": {
+ "visible": true
+ }
+ },
+ "else": {
+ "property_value_attributes": {
+ "visible": false
+ }
+ }
+ }
+ ]
},
{
"config": "ranger-ugsync-site/ranger.usersync.filesource.text.delimiter",
- "subsection-name": "subsection-ranger-user-row1-col1"
+ "subsection-name": "subsection-ranger-user-row2-col1",
+ "depends-on": [
+ {
+ "configs":[
+ "ranger-ugsync-site/ranger.usersync.source.impl.class"
+ ],
+ "if": "${ranger-ugsync-site/ranger.usersync.source.impl.class} === org.apache.ranger.unixusersync.process.FileSourceUserGroupBuilder",
+ "then": {
+ "property_value_attributes": {
+ "visible": true
+ }
+ },
+ "else": {
+ "property_value_attributes": {
+ "visible": false
+ }
+ }
+ }
+ ]
},
{
"config": "ranger-ugsync-site/ranger.usersync.ldap.url",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-common-configs"
},
{
"config": "ranger-admin-site/ranger.ldap.ad.domain",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-common-configs"
},
{
"config": "ranger-env/bind_anonymous",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-common-configs"
},
{
"config": "ranger-ugsync-site/ranger.usersync.ldap.binddn",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-common-configs",
"depends-on": [
{
@@ -302,7 +475,7 @@
},
{
"config": "ranger-ugsync-site/ranger.usersync.ldap.ldapbindpassword",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-common-configs",
"depends-on": [
{
@@ -323,22 +496,21 @@
}
]
},
-
{
- "config": "ranger-ugsync-site/ranger.usersync.enabled",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "config": "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-user-configs"
},
{
"config": "ranger-ugsync-site/ranger.usersync.ldap.user.nameattribute",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-user-configs",
"depends-on": [
{
"configs":[
- "ranger-ugsync-site/ranger.usersync.enabled"
+ "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled"
],
- "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+ "if": "${ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled}",
"then": {
"property_value_attributes": {
"visible": true
@@ -354,14 +526,14 @@
},
{
"config": "ranger-ugsync-site/ranger.usersync.ldap.user.objectclass",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-user-configs",
"depends-on": [
{
"configs":[
- "ranger-ugsync-site/ranger.usersync.enabled"
+ "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled"
],
- "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+ "if": "${ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled}",
"then": {
"property_value_attributes": {
"visible": true
@@ -377,14 +549,14 @@
},
{
"config": "ranger-ugsync-site/ranger.usersync.ldap.user.searchbase",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-user-configs",
"depends-on": [
{
"configs":[
- "ranger-ugsync-site/ranger.usersync.enabled"
+ "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled"
],
- "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+ "if": "${ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled}",
"then": {
"property_value_attributes": {
"visible": true
@@ -400,14 +572,14 @@
},
{
"config": "ranger-ugsync-site/ranger.usersync.ldap.user.searchfilter",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-user-configs",
"depends-on": [
{
"configs":[
- "ranger-ugsync-site/ranger.usersync.enabled"
+ "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled"
],
- "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+ "if": "${ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled}",
"then": {
"property_value_attributes": {
"visible": true
@@ -423,14 +595,14 @@
},
{
"config": "ranger-ugsync-site/ranger.usersync.ldap.user.searchscope",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-user-configs",
"depends-on": [
{
"configs":[
- "ranger-ugsync-site/ranger.usersync.enabled"
+ "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled"
],
- "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+ "if": "${ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled}",
"then": {
"property_value_attributes": {
"visible": true
@@ -446,14 +618,14 @@
},
{
"config": "ranger-ugsync-site/ranger.usersync.ldap.user.groupnameattribute",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-user-configs",
"depends-on": [
{
"configs":[
- "ranger-ugsync-site/ranger.usersync.enabled"
+ "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled"
],
- "if": "${ranger-ugsync-site/ranger.usersync.enabled}",
+ "if": "${ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled}",
"then": {
"property_value_attributes": {
"visible": true
@@ -467,20 +639,14 @@
}
]
},
-
- {
- "config": "ranger-ugsync-site/ranger.usersync.group.usermapsyncenabled",
- "subsection-name": "subsection-ranger-user-row1-col1",
- "subsection-tab-name": "ldap-group-configs"
- },
{
"config": "ranger-ugsync-site/ranger.usersync.group.searchenabled",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-group-configs"
},
{
"config": "ranger-ugsync-site/ranger.usersync.group.memberattributename",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-group-configs",
"depends-on": [
{
@@ -503,7 +669,7 @@
},
{
"config": "ranger-ugsync-site/ranger.usersync.group.nameattribute",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-group-configs",
"depends-on": [
{
@@ -526,7 +692,7 @@
},
{
"config": "ranger-ugsync-site/ranger.usersync.group.objectclass",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-group-configs",
"depends-on": [
{
@@ -549,7 +715,7 @@
},
{
"config": "ranger-ugsync-site/ranger.usersync.group.searchbase",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-group-configs",
"depends-on": [
{
@@ -572,7 +738,7 @@
},
{
"config": "ranger-ugsync-site/ranger.usersync.group.searchfilter",
- "subsection-name": "subsection-ranger-user-row1-col1",
+ "subsection-name": "subsection-ranger-user-row2-col1",
"subsection-tab-name": "ldap-group-configs",
"depends-on": [
{
http://git-wip-us.apache.org/repos/asf/ambari/blob/7aa9f6ca/ambari-web/app/mappers/configs/themes_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/themes_mapper.js b/ambari-web/app/mappers/configs/themes_mapper.js
index c296713..e23b691 100644
--- a/ambari-web/app/mappers/configs/themes_mapper.js
+++ b/ambari-web/app/mappers/configs/themes_mapper.js
@@ -66,6 +66,7 @@ App.themesMapper = App.QuickDataMapper.create({
"id": "name",
"name": "name",
"display_name": "display-name",
+ "depends_on": "depends-on",
"sub_section_id": "sub_section_id"
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/7aa9f6ca/ambari-web/app/models/configs/theme/sub_section.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/theme/sub_section.js b/ambari-web/app/models/configs/theme/sub_section.js
index ba6cc99..937e5ba 100644
--- a/ambari-web/app/models/configs/theme/sub_section.js
+++ b/ambari-web/app/models/configs/theme/sub_section.js
@@ -92,6 +92,10 @@ App.SubSection = DS.Model.extend({
return this.get('subSectionTabs.length');
}.property('subSectionTabs.length'),
+ showTabs: function() {
+ return this.get('hasTabs') && this.get('subSectionTabs').someProperty('isVisible');
+ }.property('hasTabs','subSectionTabs.@each.isVisible'),
+
/**
* Number of the errors in all configs
* @type {number}
@@ -99,8 +103,8 @@ App.SubSection = DS.Model.extend({
errorsCount: function () {
return this.get('configs').filter(function(config) {
return !config.get('isValid') || (config.get('overrides') || []).someProperty('isValid', false);
- }).length;
- }.property('configs.@each.isValid', 'configs.@each.overrideErrorTrigger'),
+ }).filterProperty('isVisible').length;
+ }.property('configs.@each.isValid', 'configs.@each.isVisible', 'configs.@each.overrideErrorTrigger'),
/**
* @type {boolean}
http://git-wip-us.apache.org/repos/asf/ambari/blob/7aa9f6ca/ambari-web/app/templates/common/configs/service_config_layout_tab.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_config_layout_tab.hbs b/ambari-web/app/templates/common/configs/service_config_layout_tab.hbs
index 0afe6ac..c1bb92b 100644
--- a/ambari-web/app/templates/common/configs/service_config_layout_tab.hbs
+++ b/ambari-web/app/templates/common/configs/service_config_layout_tab.hbs
@@ -47,10 +47,10 @@
{{/if}}
{{/if}}
{{/each}}
- {{#if subsection.hasTabs}}
+ {{#if subsection.showTabs}}
<ul class="nav nav-tabs mbm config-tabs">
{{#each subSectionTab in subsection.subSectionTabs}}
- <li rel='tooltip' {{bindAttr class="subSectionTab.isActive:active subSectionTab.isHiddenByFilter:disabled" data-original-title="tab.tooltipMsg"}}>
+ <li rel='tooltip' {{bindAttr class="subSectionTab.isActive:active subSectionTab.isVisible::disabled" data-original-title="tab.tooltipMsg"}}>
<a href="#" {{action setActiveSubTab subSectionTab target="view"}}{{bindAttr data-target="subSectionTab.id"}} data-toggle="tab">
{{subSectionTab.displayName}}
</a>
http://git-wip-us.apache.org/repos/asf/ambari/blob/7aa9f6ca/ambari-web/app/views/common/configs/widgets/config_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/widgets/config_widget_view.js b/ambari-web/app/views/common/configs/widgets/config_widget_view.js
index 30c942b..5fa6430 100644
--- a/ambari-web/app/views/common/configs/widgets/config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/config_widget_view.js
@@ -394,7 +394,10 @@ App.ConfigWidgetView = Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
var serviceName = this.get('config.serviceName');
var serviceConfigs = this.get('controller.stepConfigs').findProperty('serviceName',serviceName).get('configs');
configConditions.forEach(function(configCondition){
- var ifCondition = configCondition.get("if");
+ var ifStatement = configCondition.get("if");
+ var splitIfCondition = ifStatement.split('===');
+ var ifCondition = splitIfCondition[0];
+ var result = splitIfCondition[1] || "true";
var conditionalConfigName = configCondition.get("configName");
var conditionalConfigFileName = configCondition.get("fileName");
var parseIfConditionVal = ifCondition;
@@ -409,7 +412,7 @@ App.ConfigWidgetView = Em.View.extend(App.SupportsDependentConfigs, App.WidgetPo
}
}, this);
- var isConditionTrue = Boolean(window.eval(parseIfConditionVal));
+ var isConditionTrue = window.eval(JSON.stringify(parseIfConditionVal.trim())) === result.trim();
var action = isConditionTrue ? configCondition.get("then") : configCondition.get("else");
var valueAttributes = action.property_value_attributes;
for (var key in valueAttributes) {
[10/31] ambari git commit: AMBARI-13310. alerts should log into
ambari-agent.log rather than to ambari-agent.out (aonishuk)
Posted by nc...@apache.org.
AMBARI-13310. alerts should log into ambari-agent.log rather than to ambari-agent.out (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/33c86817
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/33c86817
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/33c86817
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 33c8681709894495263ebc9f22f7825c08605155
Parents: cad57c5
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Oct 5 15:12:47 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Oct 5 15:12:47 2015 +0300
----------------------------------------------------------------------
.../main/python/ambari_agent/AmbariConfig.py | 7 +++++++
.../python/ambari_agent/alerts/script_alert.py | 2 +-
.../src/main/python/ambari_agent/main.py | 20 +++++++++-----------
.../src/test/python/ambari_agent/TestMain.py | 4 ++--
.../resource_management/core/environment.py | 6 ++++--
5 files changed, 23 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/33c86817/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
index f8f220b..453d59c 100644
--- a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
+++ b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
@@ -202,6 +202,13 @@ class AmbariConfig:
return os.path.join(os.environ['AMBARI_AGENT_LOG_DIR'], "ambari-agent.log")
else:
return os.path.join(os.sep, "var", "log", "ambari-agent", "ambari-agent.log")
+
+ @staticmethod
+ def getAlertsLogFile():
+ if 'AMBARI_ALERTS_AGENT_LOG_DIR' in os.environ:
+ return os.path.join(os.environ['AMBARI_ALERTS_AGENT_LOG_DIR'], "ambari-agent.log")
+ else:
+ return os.path.join(os.sep, "var", "log", "ambari-agent", "ambari-alerts.log")
@staticmethod
def getOutFile():
http://git-wip-us.apache.org/repos/asf/ambari/blob/33c86817/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py b/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py
index e70dc22..97c3b64 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py
+++ b/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py
@@ -100,7 +100,7 @@ class ScriptAlert(BaseAlert):
matchObj = re.match( r'((.*)services(.*)package)', self.path_to_script)
if matchObj:
basedir = matchObj.group(1)
- with Environment(basedir, tmp_dir=Constants.AGENT_TMP_DIR) as env:
+ with Environment(basedir, tmp_dir=Constants.AGENT_TMP_DIR, logger=logging.getLogger('ambari_alerts')) as env:
return cmd_module.execute(configurations, self.parameters, self.host_name)
else:
return cmd_module.execute(configurations, self.parameters, self.host_name)
http://git-wip-us.apache.org/repos/asf/ambari/blob/33c86817/ambari-agent/src/main/python/ambari_agent/main.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/main.py b/ambari-agent/src/main/python/ambari_agent/main.py
index 25f7fa0..6ab89fd 100644
--- a/ambari-agent/src/main/python/ambari_agent/main.py
+++ b/ambari-agent/src/main/python/ambari_agent/main.py
@@ -46,6 +46,7 @@ import HeartbeatHandlers
from HeartbeatHandlers import bind_signal_handlers
from ambari_commons.constants import AMBARI_SUDO_BINARY
logger = logging.getLogger()
+alerts_logger = logging.getLogger('ambari_alerts')
formatstr = "%(levelname)s %(asctime)s %(filename)s:%(lineno)d - %(message)s"
agentPid = os.getpid()
@@ -57,24 +58,20 @@ IS_LINUX = platform.system() == "Linux"
SYSLOG_FORMAT_STRING = ' ambari_agent - %(filename)s - [%(process)d] - %(name)s - %(levelname)s - %(message)s'
SYSLOG_FORMATTER = logging.Formatter(SYSLOG_FORMAT_STRING)
-
-def setup_logging(verbose):
+def setup_logging(logger, filename, verbose):
formatter = logging.Formatter(formatstr)
- rotateLog = logging.handlers.RotatingFileHandler(AmbariConfig.AmbariConfig.getLogFile(), "a", 10000000, 25)
+ rotateLog = logging.handlers.RotatingFileHandler(filename, "a", 10000000, 25)
rotateLog.setFormatter(formatter)
logger.addHandler(rotateLog)
if verbose:
- logging.basicConfig(format=formatstr, level=logging.DEBUG, filename=AmbariConfig.AmbariConfig.getLogFile())
+ logging.basicConfig(format=formatstr, level=logging.DEBUG, filename=filename)
logger.setLevel(logging.DEBUG)
logger.info("loglevel=logging.DEBUG")
else:
- logging.basicConfig(format=formatstr, level=logging.INFO, filename=AmbariConfig.AmbariConfig.getLogFile())
+ logging.basicConfig(format=formatstr, level=logging.INFO, filename=filename)
logger.setLevel(logging.INFO)
logger.info("loglevel=logging.INFO")
-
- global is_logger_setup
- is_logger_setup = True
def add_syslog_handler(logger):
@@ -236,9 +233,10 @@ def main(heartbeat_stop_callback=None):
expected_hostname = options.expected_hostname
- current_user = getpass.getuser()
-
- setup_logging(options.verbose)
+ setup_logging(logger, AmbariConfig.AmbariConfig.getLogFile(), options.verbose)
+ global is_logger_setup
+ is_logger_setup = True
+ setup_logging(alerts_logger, AmbariConfig.AmbariConfig.getAlertsLogFile(), options.verbose)
default_cfg = {'agent': {'prefix': '/home/ambari'}}
config.load(default_cfg)
http://git-wip-us.apache.org/repos/asf/ambari/blob/33c86817/ambari-agent/src/test/python/ambari_agent/TestMain.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestMain.py b/ambari-agent/src/test/python/ambari_agent/TestMain.py
index 995dcca..e837fcf 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestMain.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestMain.py
@@ -80,7 +80,7 @@ class TestMain(unittest.TestCase):
@patch("logging.basicConfig")
def test_setup_logging(self, basicConfig_mock, rfh_mock, setLevel_mock, addHandler_mock):
# Testing silent mode
- main.setup_logging(False)
+ main.setup_logging(logging.getLogger(), '/var/log/ambari-agent/ambari-agent.log', False)
self.assertTrue(addHandler_mock.called)
setLevel_mock.assert_called_with(logging.INFO)
@@ -88,7 +88,7 @@ class TestMain(unittest.TestCase):
setLevel_mock.reset_mock()
# Testing verbose mode
- main.setup_logging(True)
+ main.setup_logging(logging.getLogger(), '/var/log/ambari-agent/ambari-agent.log', True)
self.assertTrue(addHandler_mock.called)
setLevel_mock.assert_called_with(logging.DEBUG)
http://git-wip-us.apache.org/repos/asf/ambari/blob/33c86817/ambari-common/src/main/python/resource_management/core/environment.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/environment.py b/ambari-common/src/main/python/resource_management/core/environment.py
index 907521f..134f164 100644
--- a/ambari-common/src/main/python/resource_management/core/environment.py
+++ b/ambari-common/src/main/python/resource_management/core/environment.py
@@ -39,7 +39,7 @@ from resource_management.core.logger import Logger
class Environment(object):
_instances = []
- def __init__(self, basedir=None, tmp_dir=None, test_mode=False, logging_level=logging.INFO):
+ def __init__(self, basedir=None, tmp_dir=None, test_mode=False, logger=None, logging_level=logging.INFO):
"""
@param basedir: basedir/files, basedir/templates are the places where templates / static files
are looked up
@@ -47,7 +47,9 @@ class Environment(object):
"""
self.reset(basedir, test_mode, tmp_dir)
- if not Logger.logger:
+ if logger:
+ Logger.logger = logger
+ else:
Logger.initialize_logger(__name__, logging_level)
def reset(self, basedir, test_mode, tmp_dir):
[02/31] ambari git commit: Updated website for 2.1.2 release.
Posted by nc...@apache.org.
Updated website for 2.1.2 release.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/279a269e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/279a269e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/279a269e
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 279a269e60b84f20780000bbe016e3df0ba2b517
Parents: c9f8d1a
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Fri Oct 2 15:53:56 2015 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Fri Oct 2 15:53:56 2015 -0700
----------------------------------------------------------------------
docs/pom.xml | 4 ++--
docs/src/site/apt/index.apt | 6 ++++--
docs/src/site/apt/whats-new.apt | 23 +++++++----------------
3 files changed, 13 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/279a269e/docs/pom.xml
----------------------------------------------------------------------
diff --git a/docs/pom.xml b/docs/pom.xml
index 916f598..59794a7 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -28,7 +28,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.ambari</groupId>
- <version>2.1.1</version>
+ <version>2.1.2</version>
<artifactId>ambari</artifactId>
<packaging>pom</packaging>
@@ -42,7 +42,7 @@
<package.pid.dir>/var/run/ambari</package.pid.dir>
<package.release>1</package.release>
<package.type>tar.gz</package.type>
- <ambari.version>2.1.1</ambari.version>
+ <ambari.version>2.1.2</ambari.version>
<final.name>${project.artifactId}-${ambari.version}</final.name>
</properties>
http://git-wip-us.apache.org/repos/asf/ambari/blob/279a269e/docs/src/site/apt/index.apt
----------------------------------------------------------------------
diff --git a/docs/src/site/apt/index.apt b/docs/src/site/apt/index.apt
index f98cbe0..eeebce2 100644
--- a/docs/src/site/apt/index.apt
+++ b/docs/src/site/apt/index.apt
@@ -52,7 +52,7 @@ Introduction
Getting Started with Ambari
- Follow the {{{https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.1.1} installation guide for Ambari 2.1.1}}.
+ Follow the {{{https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.1.2} installation guide for Ambari 2.1.2}}.
Note: Ambari currently supports the 64-bit version of the following Operating Systems:
@@ -64,7 +64,9 @@ Getting Started with Ambari
* SLES (SuSE Linux Enterprise Server) 11
- * Ubuntu 12
+ * Ubuntu 12 and 14
+
+ * Debian 7
Get Involved
http://git-wip-us.apache.org/repos/asf/ambari/blob/279a269e/docs/src/site/apt/whats-new.apt
----------------------------------------------------------------------
diff --git a/docs/src/site/apt/whats-new.apt b/docs/src/site/apt/whats-new.apt
index 64fb349..8dc6bc0 100644
--- a/docs/src/site/apt/whats-new.apt
+++ b/docs/src/site/apt/whats-new.apt
@@ -16,26 +16,17 @@
What's New with Ambari?
- * The latest release Ambari 2.1.1 is a maintenance release for Ambari 2.1.0.
+ * The latest release Ambari 2.1.2 is a maintenance release for Ambari 2.1.
- * Ambari 2.1.0 added the following features:
+ * Ambari 2.1.2 added the following features:
- * Updated Ambari OS Support
+ * Ubuntu 12 support
- * Updated Ambari JDK support
+ * Ubuntu 14 support
- * Enhanced Configuration support in the Ambari User Interface
-
- * Additional Blueprint HA Support (Oozie, Hive, Storm Nimbus)
-
- * New Dynamic Provisioning model for Blueprint installs
-
- * Rack Awareness
-
- * Updated stacks (NFS Gateway, Accumulo)
-
- * Delivered set of contrib Views
+ * Debian 7 support
+ * Performance and stability improvements
Getting Ambari Source
@@ -50,7 +41,7 @@ JIRA
User Guide
- Take a look at {{{https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.1.1} how to install a Hadoop cluster using Ambari 2.1.1}}.
+ Take a look at {{{https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.1.2} how to install a Hadoop cluster using Ambari 2.1.2}}.
Stay Tuned
[03/31] ambari git commit: Updated website for 2.1.2 release.
Posted by nc...@apache.org.
Updated website for 2.1.2 release.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1f5acf20
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1f5acf20
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1f5acf20
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 1f5acf20f19c0965c88185b5e19b487694db9c56
Parents: 279a269
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Fri Oct 2 15:56:25 2015 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Fri Oct 2 15:56:25 2015 -0700
----------------------------------------------------------------------
docs/src/site/site.xml | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/1f5acf20/docs/src/site/site.xml
----------------------------------------------------------------------
diff --git a/docs/src/site/site.xml b/docs/src/site/site.xml
index e60632c..49d5c3e 100644
--- a/docs/src/site/site.xml
+++ b/docs/src/site/site.xml
@@ -107,6 +107,7 @@
<item name="Quick Start Guide" href="https://cwiki.apache.org/confluence/display/AMBARI/Quick+Start+Guide"/>
<item name="Features + Roadmap" href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=30755705"/>
<item name="API Reference" href="https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/index.md"/>
+ <item name="Install Guide for 2.1.2" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.1.2"/>
<item name="Install Guide for 2.1.1" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.1.1"/>
<item name="Install Guide for 2.1.0" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.1.0"/>
<item name="Install Guide for 2.0.2" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.0.2"/>
@@ -131,6 +132,7 @@
</menu>
<menu name="Releases">
+ <item name="2.1.2" href="http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.1.2"/>
<item name="2.1.1" href="http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.1.1"/>
<item name="2.1.0" href="http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.1.0"/>
<item name="2.0.2" href="http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.0.2"/>
[20/31] ambari git commit: AMBARI-13319. Flume summary: there are no
hosts after page refresh (akovalenko)
Posted by nc...@apache.org.
AMBARI-13319. Flume summary: there are no hosts after page refresh (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6b8f6924
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6b8f6924
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6b8f6924
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 6b8f692437a923510c60b157aceef57e749c271b
Parents: 4011611
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Tue Oct 6 13:06:27 2015 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Tue Oct 6 13:28:03 2015 +0300
----------------------------------------------------------------------
ambari-web/app/mappers/service_metrics_mapper.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/6b8f6924/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 9fc3d70..5910574 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -283,8 +283,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
} else if (item && item.ServiceInfo && item.ServiceInfo.service_name == "FLUME") {
finalJson = this.flumeMapper(item);
finalJson.rand = Math.random();
- App.store.load(App.FlumeService, finalJson);
App.store.loadMany(App.FlumeAgent, finalJson.agentJsons);
+ App.store.load(App.FlumeService, finalJson);
} else if (item && item.ServiceInfo && item.ServiceInfo.service_name == "YARN") {
finalJson = this.yarnMapper(item);
finalJson.rand = Math.random();
[06/31] ambari git commit: AMBARI-13307. Agent instance memory
footprint likely gradually growing (aonishuk)
Posted by nc...@apache.org.
AMBARI-13307. Agent instance memory footprint likely gradually growing (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b8be80b0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b8be80b0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b8be80b0
Branch: refs/heads/branch-dev-patch-upgrade
Commit: b8be80b08cf50436fb1285b5deaa6a4ca8fe8739
Parents: a125f97
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Oct 5 12:12:34 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Oct 5 12:12:34 2015 +0300
----------------------------------------------------------------------
ambari-common/src/main/python/resource_management/core/logger.py | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b8be80b0/ambari-common/src/main/python/resource_management/core/logger.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/logger.py b/ambari-common/src/main/python/resource_management/core/logger.py
index 7642c6d..0ea34ff 100644
--- a/ambari-common/src/main/python/resource_management/core/logger.py
+++ b/ambari-common/src/main/python/resource_management/core/logger.py
@@ -37,6 +37,10 @@ class Logger:
@staticmethod
def initialize_logger(name='resource_management', logging_level=logging.INFO, format='%(asctime)s - %(message)s'):
# set up logging (two separate loggers for stderr and stdout with different loglevels)
+
+ if Logger.logger:
+ return
+
logger = logging.getLogger(name)
logger.setLevel(logging_level)
formatter = logging.Formatter(format)
[26/31] ambari git commit: AMBARI-13331. Allow user to customize time
period for graphs on dashboard and host summary page.
Posted by nc...@apache.org.
AMBARI-13331. Allow user to customize time period for graphs on dashboard and host summary page.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8eceffe5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8eceffe5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8eceffe5
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 8eceffe5de2e82ce1ca38430d068e35cda56be45
Parents: 828c7fa
Author: Alex Antonenko <hi...@gmail.com>
Authored: Wed Oct 7 11:35:04 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Wed Oct 7 11:35:04 2015 +0300
----------------------------------------------------------------------
ambari-web/app/assets/test/tests.js | 1 +
ambari-web/app/messages.js | 1 +
ambari-web/app/mixins.js | 1 +
.../mixins/common/widgets/time_range_mixin.js | 58 ++++++++++++++++++++
.../app/templates/common/time_range_list.hbs | 26 +++++++++
.../app/templates/main/dashboard/widgets.hbs | 8 ++-
ambari-web/app/templates/main/host/summary.hbs | 1 +
.../app/templates/main/service/info/summary.hbs | 11 +---
ambari-web/app/views.js | 1 +
.../app/views/common/chart/linear_time.js | 8 ++-
ambari-web/app/views/common/time_range_list.js | 27 +++++++++
ambari-web/app/views/main/dashboard/widgets.js | 4 +-
ambari-web/app/views/main/host/summary.js | 2 +-
.../app/views/main/service/info/summary.js | 24 +-------
.../common/widgets/time_range_mixin_test.js | 58 ++++++++++++++++++++
.../test/views/common/chart/linear_time_test.js | 44 ++++++++++++++-
16 files changed, 236 insertions(+), 39 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index 4a5af5c..b3b0e2c 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -141,6 +141,7 @@ var files = [
'test/mixins/common/configs/toggle_isrequired_test',
'test/mixins/common/chart/storm_linear_time_test',
'test/mixins/common/widgets/export_metrics_mixin_test',
+ 'test/mixins/common/widgets/time_range_mixin_test',
'test/mixins/common/widgets/widget_section_test',
'test/mixins/common/localStorage_test',
'test/mixins/common/reload_popup_test',
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 0d60a91..14df65e 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2343,6 +2343,7 @@ Em.I18n.translations = {
'dashboard.button.switchShort': 'Switch',
'dashboard.button.reset': 'Reset all widgets to default ',
'dashboard.button.gangliaLink': 'View metrics in Ganglia',
+ 'dashboard.widgets.actions.title': 'Metric Actions',
'dashboard.widgets.create': 'Create Widget',
'dashboard.widgets.actions.browse': 'Browse Widgets',
'dashboard.widgets.layout.import': 'Import a layout',
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/mixins.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins.js b/ambari-web/app/mixins.js
index f5000eb..4c9da09 100644
--- a/ambari-web/app/mixins.js
+++ b/ambari-web/app/mixins.js
@@ -50,6 +50,7 @@ require('mixins/common/configs/configs_loader');
require('mixins/common/configs/configs_comparator');
require('mixins/common/configs/toggle_isrequired');
require('mixins/common/widgets/export_metrics_mixin');
+require('mixins/common/widgets/time_range_mixin');
require('mixins/common/widgets/widget_mixin');
require('mixins/common/widgets/widget_section');
require('mixins/unit_convert/base_unit_convert_mixin');
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/mixins/common/widgets/time_range_mixin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/widgets/time_range_mixin.js b/ambari-web/app/mixins/common/widgets/time_range_mixin.js
new file mode 100644
index 0000000..c3f7c02
--- /dev/null
+++ b/ambari-web/app/mixins/common/widgets/time_range_mixin.js
@@ -0,0 +1,58 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+require('views/common/time_range_list');
+
+App.TimeRangeMixin = Em.Mixin.create({
+
+ timeRangeClassName: 'pull-right',
+
+ /**
+ * time range options for service metrics, a dropdown will list all options
+ * value set in hours
+ */
+ timeRangeOptions: [
+ {index: 0, name: Em.I18n.t('graphs.timeRange.hour'), value: '1'},
+ {index: 1, name: Em.I18n.t('graphs.timeRange.twoHours'), value: '2'},
+ {index: 2, name: Em.I18n.t('graphs.timeRange.fourHours'), value: '4'},
+ {index: 3, name: Em.I18n.t('graphs.timeRange.twelveHours'), value: '12'},
+ {index: 4, name: Em.I18n.t('graphs.timeRange.day'), value: '24'},
+ {index: 5, name: Em.I18n.t('graphs.timeRange.week'), value: '168'},
+ {index: 6, name: Em.I18n.t('graphs.timeRange.month'), value: '720'},
+ {index: 7, name: Em.I18n.t('graphs.timeRange.year'), value: '8760'}
+ ],
+
+ currentTimeRangeIndex: 0,
+
+ currentTimeRange: function() {
+ return this.get('timeRangeOptions').objectAt(this.get('currentTimeRangeIndex'));
+ }.property('currentTimeRangeIndex'),
+
+ /**
+ * onclick handler for a time range option
+ * @param {object} event
+ */
+ setTimeRange: function (event) {
+ this.set('currentTimeRangeIndex', event.context.index);
+ },
+
+ timeRangeListView: App.TimeRangeListView.extend()
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/templates/common/time_range_list.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/time_range_list.hbs b/ambari-web/app/templates/common/time_range_list.hbs
new file mode 100644
index 0000000..8e6f075
--- /dev/null
+++ b/ambari-web/app/templates/common/time_range_list.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.
+}}
+
+<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
+ {{view.parentView.currentTimeRange.name}} <span class="caret"></span>
+</button>
+<ul class="dropdown-menu">
+ {{#each option in view.parentView.timeRangeOptions}}
+ <li><a href="#" {{action setTimeRange option target="view.parentView"}}>{{option.name}}</a></li>
+ {{/each}}
+</ul>
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/templates/main/dashboard/widgets.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets.hbs b/ambari-web/app/templates/main/dashboard/widgets.hbs
index 56e681d..f55b9b9 100644
--- a/ambari-web/app/templates/main/dashboard/widgets.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets.hbs
@@ -17,10 +17,10 @@
}}
{{#if view.isDataLoaded}}
- <div id="widgets-options-menu" class="dropdown">
+ <div id="widgets-options-menu" class="dropdown btn-group pull-left">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
- <span>Metric Actions</span>
- <span class="caret"></span>
+ <span>{{t dashboard.widgets.actions.title}}</span>
+ <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="dropdown-submenu add-widgets-text">
@@ -46,6 +46,8 @@
</li>
</ul>
</div>
+ {{view view.timeRangeListView}}
+ <div class="clearfix"></div>
<div class="dashboard-widgets-box">
<div id="dashboard-widgets" class="widgets-container">
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/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 7026bc8..02cbcd1 100644
--- a/ambari-web/app/templates/main/host/summary.hbs
+++ b/ambari-web/app/templates/main/host/summary.hbs
@@ -183,6 +183,7 @@
{{/if}}
</div>
{{/if}}
+ {{view view.timeRangeListView}}
</div>
<div>
{{view App.MainHostMetricsView contentBinding="view.content"}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/templates/main/service/info/summary.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/summary.hbs b/ambari-web/app/templates/main/service/info/summary.hbs
index 85d7414..9326623 100644
--- a/ambari-web/app/templates/main/service/info/summary.hbs
+++ b/ambari-web/app/templates/main/service/info/summary.hbs
@@ -76,16 +76,7 @@
<div class="box-header">
<h4>{{t services.service.metrics}}</h4>
{{#if showTimeRangeControl}}
- <div class="btn-group pull-right">
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
- {{view.currentTimeRange.name}} <span class="caret"></span>
- </button>
- <ul class="dropdown-menu">
- {{#each option in view.timeRangeOptions}}
- <li><a href="#" {{action setTimeRange option target="view"}}>{{option.name}}</a></li>
- {{/each}}
- </ul>
- </div>
+ {{view view.timeRangeListView}}
{{/if}}
{{#if isServiceWithEnhancedWidgets}}
{{#if isAmbariMetricsInstalled}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index 33403a3..857fcec 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -39,6 +39,7 @@ require('views/common/rolling_restart_view');
require('views/common/select_custom_date_view');
require('views/common/metric');
require('views/common/time_range');
+require('views/common/time_range_list');
require('views/common/form/field');
require('views/common/form/spinner_input_view');
require('views/common/quick_view_link_view');
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/views/common/chart/linear_time.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/chart/linear_time.js b/ambari-web/app/views/common/chart/linear_time.js
index 4cb496b..5ffc628 100644
--- a/ambari-web/app/views/common/chart/linear_time.js
+++ b/ambari-web/app/views/common/chart/linear_time.js
@@ -814,7 +814,8 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, {
onPrimary: function () {
self.setProperties({
- currentTimeIndex: 0,
+ currentTimeIndex: self.get('controller.isServiceWithEnhancedWidgets') === false ?
+ self.get('parentView.currentTimeRangeIndex') : self.get('parentView.parentView.currentTimeRangeIndex'),
isPopup: false
});
this._super();
@@ -880,6 +881,11 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, {
],
// should be set by time range control dropdown list when create current graph
currentTimeIndex: 0,
+ setCurrentTimeIndexFromParent: function () {
+ var index = this.get('controller.isServiceWithEnhancedWidgets') === false ?
+ this.get('parentView.currentTimeRangeIndex') : this.get('parentView.parentView.currentTimeRangeIndex');
+ this.set('currentTimeIndex', index);
+ }.observes('parentView.parentView.currentTimeRangeIndex', 'parentView.currentTimeRangeIndex'),
timeUnitSeconds: function () {
return this.get('timeStates').objectAt(this.get('currentTimeIndex')).seconds;
}.property('currentTimeIndex'),
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/views/common/time_range_list.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/time_range_list.js b/ambari-web/app/views/common/time_range_list.js
new file mode 100644
index 0000000..9a895f2
--- /dev/null
+++ b/ambari-web/app/views/common/time_range_list.js
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+App.TimeRangeListView = Em.View.extend({
+
+ templateName: require('templates/common/time_range_list'),
+
+ classNameBindings: [':btn-group', 'parentView.timeRangeClassName']
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/views/main/dashboard/widgets.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets.js b/ambari-web/app/views/main/dashboard/widgets.js
index c3a9941..264fda7 100644
--- a/ambari-web/app/views/main/dashboard/widgets.js
+++ b/ambari-web/app/views/main/dashboard/widgets.js
@@ -19,7 +19,7 @@
var App = require('app');
var filters = require('views/common/filter_view');
-App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, {
+App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, App.TimeRangeMixin, {
name: 'mainDashboardWidgetsView',
@@ -51,6 +51,8 @@ App.MainDashboardWidgetsView = Em.View.extend(App.UserPref, App.LocalStorage, {
*/
isMoving: false,
+ timeRangeClassName: 'pull-left',
+
/**
* Make widgets' list sortable on New Dashboard style
*/
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/views/main/host/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/summary.js b/ambari-web/app/views/main/host/summary.js
index a97ebaf..0d76a04 100644
--- a/ambari-web/app/views/main/host/summary.js
+++ b/ambari-web/app/views/main/host/summary.js
@@ -18,7 +18,7 @@
var App = require('app');
-App.MainHostSummaryView = Em.View.extend({
+App.MainHostSummaryView = Em.View.extend(App.TimeRangeMixin, {
templateName: require('templates/main/host/summary'),
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/app/views/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js
index 6a5d801..c1f96d9 100644
--- a/ambari-web/app/views/main/service/info/summary.js
+++ b/ambari-web/app/views/main/service/info/summary.js
@@ -21,7 +21,7 @@ var misc = require('utils/misc');
require('views/main/service/service');
require('data/service_graph_config');
-App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, {
+App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, App.TimeRangeMixin, {
templateName: require('templates/main/service/info/summary'),
/**
* @property {Number} chunkSize - number of columns in Metrics section
@@ -499,31 +499,11 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, {
},
/**
- * time range options for service metrics, a dropdown will list all options
- * value set in hours
- */
- timeRangeOptions: [
- {index: 0, name: Em.I18n.t('graphs.timeRange.hour'), value: '1'},
- {index: 1, name: Em.I18n.t('graphs.timeRange.twoHours'), value: '2'},
- {index: 2, name: Em.I18n.t('graphs.timeRange.fourHours'), value: '4'},
- {index: 3, name: Em.I18n.t('graphs.timeRange.twelveHours'), value: '12'},
- {index: 4, name: Em.I18n.t('graphs.timeRange.day'), value: '24'},
- {index: 5, name: Em.I18n.t('graphs.timeRange.week'), value: '168'},
- {index: 6, name: Em.I18n.t('graphs.timeRange.month'), value: '720'},
- {index: 7, name: Em.I18n.t('graphs.timeRange.year'), value: '8760'}
- ],
-
- currentTimeRangeIndex: 0,
- currentTimeRange: function() {
- return this.get('timeRangeOptions').objectAt(this.get('currentTimeRangeIndex'));
- }.property('currentTimeRangeIndex'),
-
- /**
* onclick handler for a time range option
* @param {object} event
*/
setTimeRange: function (event) {
- this.set('currentTimeRangeIndex', event.context.index);
+ this._super(event);
this.get('controller.widgets').filterProperty('widgetType', 'GRAPH').forEach(function (widget) {
widget.set('properties.time_range', event.context.value);
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/test/mixins/common/widgets/time_range_mixin_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/widgets/time_range_mixin_test.js b/ambari-web/test/mixins/common/widgets/time_range_mixin_test.js
new file mode 100644
index 0000000..0f360fc
--- /dev/null
+++ b/ambari-web/test/mixins/common/widgets/time_range_mixin_test.js
@@ -0,0 +1,58 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+require('mixins/common/widgets/time_range_mixin');
+
+describe('App.TimeRangeMixin', function () {
+
+ var obj;
+
+ beforeEach(function () {
+ obj = Em.Object.create(App.TimeRangeMixin);
+ });
+
+ describe('#currentTimeRange', function () {
+
+ var cases = Em.Object.create(App.TimeRangeMixin).get('timeRangeOptions'),
+ title = 'should set "{0}" time range';
+
+ cases.forEach(function (item) {
+ it(title.format(item.name), function () {
+ obj.set('currentTimeRangeIndex', item.index);
+ expect(obj.get('currentTimeRange')).to.eql(item);
+ });
+ });
+
+ });
+
+ describe('#setTimeRange', function () {
+
+ it('should set time range', function () {
+ obj.setTimeRange({
+ context: {
+ index: 1
+ }
+ });
+ expect(obj.get('currentTimeRangeIndex')).to.equal(1);
+ });
+
+ });
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/8eceffe5/ambari-web/test/views/common/chart/linear_time_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/chart/linear_time_test.js b/ambari-web/test/views/common/chart/linear_time_test.js
index 66ac5c0..7730e9c 100644
--- a/ambari-web/test/views/common/chart/linear_time_test.js
+++ b/ambari-web/test/views/common/chart/linear_time_test.js
@@ -93,7 +93,7 @@ describe('App.ChartLinearTimeView', function () {
expect(App.ChartLinearTimeView.BytesFormatter(test.i)).to.equal(test.e);
});
});
- }),
+ });
describe('#PercentageFormatter', function() {
var tests = [
{m:'undefined to "0 %"',i:undefined,e:'0 %'},
@@ -208,6 +208,48 @@ describe('App.ChartLinearTimeView', function () {
services.yarnService = [];
});
});
+
+ describe('#setCurrentTimeIndexFromParent', function () {
+
+ var view,
+ cases = [
+ {
+ isServiceWithEnhancedWidgets: false,
+ currentTimeIndex: 1,
+ title: 'service with enhanced widgets'
+ },
+ {
+ isServiceWithEnhancedWidgets: true,
+ currentTimeIndex: 2,
+ title: 'service without enhanced widgets'
+ },
+ {
+ currentTimeIndex: 2,
+ title: 'other view'
+ }
+ ];
+
+ beforeEach(function () {
+ view = App.ChartLinearTimeView.create({
+ controller: {},
+ parentView: {
+ currentTimeRangeIndex: 1,
+ parentView: {
+ currentTimeRangeIndex: 2
+ }
+ }
+ });
+ });
+
+ cases.forEach(function (item) {
+ it(item.title, function () {
+ view.set('controller.isServiceWithEnhancedWidgets', item.isServiceWithEnhancedWidgets);
+ view.propertyDidChange('parentView.currentTimeRangeIndex');
+ expect(view.get('currentTimeIndex')).to.equal(item.currentTimeIndex);
+ });
+ });
+
+ });
});
[16/31] ambari git commit: AMBARI-13242. AMBARI-13242: ambari-server
setup failed if use another server as ambari-server next time (Di Li via
aonishuk)
Posted by nc...@apache.org.
AMBARI-13242. AMBARI-13242: ambari-server setup failed if use another server as ambari-server next time (Di Li via aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/329d2b54
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/329d2b54
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/329d2b54
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 329d2b5424492eac6c6b16f3e85ce5e33da6f51f
Parents: 93f0896
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Oct 5 23:57:25 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Oct 5 23:57:25 2015 +0300
----------------------------------------------------------------------
ambari-agent/conf/unix/install-helper.sh | 20 +++++++++++++++++++
ambari-server/conf/unix/install-helper.sh | 27 +++++++++++++++++++++++++-
2 files changed, 46 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/329d2b54/ambari-agent/conf/unix/install-helper.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/unix/install-helper.sh b/ambari-agent/conf/unix/install-helper.sh
index 35c67fb..185290c 100644
--- a/ambari-agent/conf/unix/install-helper.sh
+++ b/ambari-agent/conf/unix/install-helper.sh
@@ -68,6 +68,26 @@ do_remove(){
if [ -f "$PYTHON_WRAPER_TARGET" ]; then
rm -f "$PYTHON_WRAPER_TARGET"
fi
+
+ if [ -d "$COMMON_DIR" ]; then
+ rm -f $COMMON_DIR
+ fi
+
+ if [ -d "$RESOURCE_MANAGEMENT_DIR" ]; then
+ rm -rf $RESOURCE_MANAGEMENT_DIR
+ fi
+
+ if [ -d "$JINJA_DIR" ]; then
+ rm -rf $JINJA_DIR
+ fi
+
+ if [ -d "$SIMPLEJSON_DIR" ]; then
+ rm -f $SIMPLEJSON_DIR
+ fi
+
+ if [ -d "$OLD_COMMON_DIR" ]; then
+ rm -f $OLD_COMMON_DIR
+ fi
# if server package exists, restore their settings
if [ -f "$INSTALL_HELPER_SERVER" ]; then # call server shared files installer
http://git-wip-us.apache.org/repos/asf/ambari/blob/329d2b54/ambari-server/conf/unix/install-helper.sh
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/install-helper.sh b/ambari-server/conf/unix/install-helper.sh
index 9dbb2b8..2635694 100644
--- a/ambari-server/conf/unix/install-helper.sh
+++ b/ambari-server/conf/unix/install-helper.sh
@@ -22,6 +22,7 @@ RESOURCE_MANAGEMENT_DIR="/usr/lib/python2.6/site-packages/resource_management"
JINJA_DIR="/usr/lib/python2.6/site-packages/ambari_jinja2"
SIMPLEJSON_DIR="/usr/lib/python2.6/site-packages/ambari_simplejson"
OLD_COMMON_DIR="/usr/lib/python2.6/site-packages/common_functions"
+AMBARI_SERVER="/usr/lib/python2.6/site-packages/ambari_server"
INSTALL_HELPER_AGENT="/var/lib/ambari-agent/install-helper.sh"
COMMON_DIR_SERVER="/usr/lib/ambari-server/lib/ambari_commons"
RESOURCE_MANAGEMENT_DIR_SERVER="/usr/lib/ambari-server/lib/resource_management"
@@ -61,9 +62,33 @@ do_remove(){
rm -f "$PYTHON_WRAPER_TARGET"
fi
+ if [ -d "$COMMON_DIR" ]; then
+ rm -f $COMMON_DIR
+ fi
+
+ if [ -d "$RESOURCE_MANAGEMENT_DIR" ]; then
+ rm -f $RESOURCE_MANAGEMENT_DIR
+ fi
+
+ if [ -d "$JINJA_DIR" ]; then
+ rm -f $JINJA_DIR
+ fi
+
+ if [ -d "$SIMPLEJSON_DIR" ]; then
+ rm -f $SIMPLEJSON_DIR
+ fi
+
+ if [ -d "$OLD_COMMON_DIR" ]; then
+ rm -rf $OLD_COMMON_DIR
+ fi
+
+ if [ -d "$AMBARI_SERVER" ]; then
+ rm -rf "$AMBARI_SERVER"
+ fi
+
# if server package exists, restore their settings
if [ -f "$INSTALL_HELPER_AGENT" ]; then # call agent shared files installer
- $INSTALL_HELPER_AGENT install
+ $INSTALL_HELPER_AGENT install
fi
}
[28/31] ambari git commit: AMBARI-13333 Devdeploy:Change in property
at Customize Services Page. (ababiichuk)
Posted by nc...@apache.org.
AMBARI-13333 Devdeploy:Change in property at Customize Services Page. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d729ce3f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d729ce3f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d729ce3f
Branch: refs/heads/branch-dev-patch-upgrade
Commit: d729ce3fb565b6e06a7d51e89642fa267d4cbdb2
Parents: 20d0883
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Wed Oct 7 11:57:29 2015 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Wed Oct 7 12:00:37 2015 +0300
----------------------------------------------------------------------
ambari-web/app/data/HDP2/site_properties.js | 1 +
ambari-web/test/data/HDP2.2/site_properties_test.js | 2 +-
ambari-web/test/data/HDP2.3/site_properties_test.js | 2 +-
ambari-web/test/data/HDP2/site_properties_test.js | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/d729ce3f/ambari-web/app/data/HDP2/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js
index 7b2b5c5..b846650 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -478,6 +478,7 @@ var hdp2properties = [
},
{
"name": "oozie_hostname",
+ "displayName": "Database Host",
"displayType": "host",
"serviceName": "OOZIE",
"filename": "oozie-env.xml",
http://git-wip-us.apache.org/repos/asf/ambari/blob/d729ce3f/ambari-web/test/data/HDP2.2/site_properties_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/data/HDP2.2/site_properties_test.js b/ambari-web/test/data/HDP2.2/site_properties_test.js
index 82d0ab1..5c88198 100644
--- a/ambari-web/test/data/HDP2.2/site_properties_test.js
+++ b/ambari-web/test/data/HDP2.2/site_properties_test.js
@@ -25,7 +25,7 @@ describe('hdp2SiteProperties', function () {
* @stackProperties: All the properties that are derived from stack definition
*/
var stackProperties = siteProperties.filter(function(item){
- return (!(item.isRequiredByAgent === false || item.filename === 'alert_notification' || item.category === 'Ambari Principals'))
+ return (!(item.isRequiredByAgent === false || item.filename === 'alert_notification' || item.category === 'Ambari Principals' || item.name === 'oozie_hostname'))
});
stackProperties.forEach(function(siteProperty){
http://git-wip-us.apache.org/repos/asf/ambari/blob/d729ce3f/ambari-web/test/data/HDP2.3/site_properties_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/data/HDP2.3/site_properties_test.js b/ambari-web/test/data/HDP2.3/site_properties_test.js
index 45c841f..86e83f0 100644
--- a/ambari-web/test/data/HDP2.3/site_properties_test.js
+++ b/ambari-web/test/data/HDP2.3/site_properties_test.js
@@ -25,7 +25,7 @@ describe('hdp2SiteProperties', function () {
* @stackProperties: All the properties that are derived from stack definition
*/
var stackProperties = siteProperties.filter(function(item){
- return (!(item.isRequiredByAgent === false || item.filename === 'alert_notification' || item.category === 'Ambari Principals'))
+ return (!(item.isRequiredByAgent === false || item.filename === 'alert_notification' || item.category === 'Ambari Principals' || item.name === 'oozie_hostname'))
});
stackProperties.forEach(function(siteProperty){
http://git-wip-us.apache.org/repos/asf/ambari/blob/d729ce3f/ambari-web/test/data/HDP2/site_properties_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/data/HDP2/site_properties_test.js b/ambari-web/test/data/HDP2/site_properties_test.js
index 4fcce33..9310fbf 100644
--- a/ambari-web/test/data/HDP2/site_properties_test.js
+++ b/ambari-web/test/data/HDP2/site_properties_test.js
@@ -25,7 +25,7 @@ describe('hdp2SiteProperties', function () {
* @stackProperties: All the properties that are derived from stack definition
*/
var stackProperties = siteProperties.filter(function(item){
- return (!(item.isRequiredByAgent === false || item.filename === 'alert_notification' || item.category === 'Ambari Principals'))
+ return (!(item.isRequiredByAgent === false || item.filename === 'alert_notification' || item.category === 'Ambari Principals' || item.name === 'oozie_hostname'))
});
stackProperties.forEach(function(siteProperty){
[29/31] ambari git commit: AMBARI-13332. User Timezone setting fixes
(onechiporenko)
Posted by nc...@apache.org.
AMBARI-13332. User Timezone setting fixes (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e1caac3a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e1caac3a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e1caac3a
Branch: refs/heads/branch-dev-patch-upgrade
Commit: e1caac3aaa6e719bed91ab0cde814c14347288ed
Parents: d729ce3
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Wed Oct 7 12:18:10 2015 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Wed Oct 7 12:18:10 2015 +0300
----------------------------------------------------------------------
.../global/user_settings_controller.js | 50 +++++++++++++++++---
ambari-web/app/messages.js | 4 +-
ambari-web/app/styles/application.less | 11 ++++-
ambari-web/app/templates/common/settings.hbs | 20 +++++---
ambari-web/app/utils/date.js | 28 +++++++++++
5 files changed, 98 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/e1caac3a/ambari-web/app/controllers/global/user_settings_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/user_settings_controller.js b/ambari-web/app/controllers/global/user_settings_controller.js
index 1748ea2..ef53d81 100644
--- a/ambari-web/app/controllers/global/user_settings_controller.js
+++ b/ambari-web/app/controllers/global/user_settings_controller.js
@@ -18,6 +18,8 @@
var App = require('app');
+var dateUtils = require('utils/date');
+
/**
* Controller for user settings
* Allows to get them from persist and update them to the persist
@@ -47,11 +49,47 @@ App.UserSettingsController = Em.Controller.extend(App.UserPref, {
},
timezone: {
name: prefix + 'timezone-' + loginName,
- defaultValue: ''
+ defaultValue: dateUtils.detectUserTimezone()
}
};
}.property('App.router.loginName'),
+ init: function () {
+ this.set('timezonesFormatted', this._parseTimezones());
+ this._super();
+ },
+
+ /**
+ *
+ * @private
+ * @method _parseTimezones
+ * @return {{utcOffset: number, label: string, value: string}[]}
+ */
+ _parseTimezones: function () {
+ return dateUtils.getAllTimezoneNames().map(function (timeZoneName) {
+ var zone = moment(new Date()).tz(timeZoneName);
+ var offset = zone.format('Z');
+ return {
+ utcOffset: zone.utcOffset(),
+ label: '(UTC' + offset + ') ' + timeZoneName,
+ value: timeZoneName
+ };
+ }).sort(function (zoneA, zoneB) {
+ if (zoneA.utcOffset === zoneB.utcOffset) {
+ if (zoneA.value === zoneB.value) {
+ return 0;
+ }
+ return zoneA.value < zoneB.value ? -1 : 1;
+ }
+ else {
+ if(zoneA.utcOffset === zoneB.utcOffset) {
+ return 0;
+ }
+ return zoneA.utcOffset < zoneB.utcOffset ? -1 : 1;
+ }
+ });
+ },
+
/**
* Load some user's setting from the persist
* If <code>persistKey</code> is not provided, all settings are loaded
@@ -152,11 +190,11 @@ App.UserSettingsController = Em.Controller.extend(App.UserPref, {
var self = this;
var curValue = null;
var keys = this.get('userSettingsKeys');
+ var timezonesFormatted = this.get('timezonesFormatted');
this.dataLoading().done(function (response) {
var initValue = JSON.parse(response[keys.show_bg.name]);
- var initTimezone = JSON.parse(response[keys.timezone.name]);
-
+ var initTimezone = timezonesFormatted.findProperty('value', JSON.parse(response[keys.timezone.name]));
return App.ModalPopup.show({
header: Em.I18n.t('common.userSettings'),
@@ -172,9 +210,9 @@ App.UserSettingsController = Em.Controller.extend(App.UserPref, {
}.observes('isNotShowBgChecked'),
/**
- * @type {string[]}
+ * @type {{label: string, value: string}}
*/
- timezonesList: [''].concat(moment.tz.names())
+ timezonesList: timezonesFormatted
}),
@@ -191,7 +229,7 @@ App.UserSettingsController = Em.Controller.extend(App.UserPref, {
}
if (!App.get('testMode')) {
self.postUserPref('show_bg', curValue);
- self.postUserPref('timezone', this.get('selectedTimezone'));
+ self.postUserPref('timezone', this.get('selectedTimezone.value'));
}
if (this.needsPageRefresh()) {
location.reload();
http://git-wip-us.apache.org/repos/asf/ambari/blob/e1caac3a/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 14df65e..ab9a874 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -39,9 +39,11 @@ Em.I18n.translations = {
'app.settings':'Settings',
'app.manageAmbari': 'Manage Ambari',
'app.aboutAmbari':'About',
- 'app.settings.selectTimezone': 'Select your timezone',
+ 'app.settings.selectTimezone': 'Timezone',
'app.settings.notshowBgOperationsPopup': 'Do not show the Background Operations dialog when starting an operation',
'app.settings.notShowBgOperations': 'Do not show this dialog again when starting a background operation',
+ 'app.settings.categories.general': 'General',
+ 'app.settings.categories.locale': 'Locale',
'app.aboutAmbari.getInvolved': 'Get involved!',
'app.aboutAmbari.version': 'Version',
http://git-wip-us.apache.org/repos/asf/ambari/blob/e1caac3a/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 46e3d4a..fcc4863 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -3741,8 +3741,17 @@ table.graphs {
}
.admin-user-settings {
+ hr {
+ margin: 5px 0;
+ }
+ select {
+ width: auto;
+ }
+ .setting-wrapper {
+ margin-bottom: 20px;
+ }
.checkbox {
- margin: 0px;
+ margin: 0;
}
}
/*End Admin*/
http://git-wip-us.apache.org/repos/asf/ambari/blob/e1caac3a/ambari-web/app/templates/common/settings.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/settings.hbs b/ambari-web/app/templates/common/settings.hbs
index cd1dd44..2254c17 100644
--- a/ambari-web/app/templates/common/settings.hbs
+++ b/ambari-web/app/templates/common/settings.hbs
@@ -17,20 +17,26 @@
}}
<div class="admin-user-settings">
- <div>
+ <div class="setting-wrapper">
+ <h4>{{t app.settings.categories.general}}</h4>
+ <hr />
<label>
{{view Ember.Checkbox checkedBinding="view.isNotShowBgChecked" class="checkbox"}}
{{t app.settings.notshowBgOperationsPopup}}
</label>
</div>
- <div>
+ <div class="setting-wrapper">
+ <h4>{{t app.settings.categories.locale}}</h4>
+ <hr />
<label>
{{t app.settings.selectTimezone}}
- {{view Em.Select
- contentBinding="view.timezonesList"
- selectionBinding="view.parentView.selectedTimezone"
- class="group-select select-group-box"
- }}
+ {{view Em.Select
+ contentBinding="view.timezonesList"
+ optionLabelPath="content.label"
+ optionValuePath="content.value"
+ selectionBinding="view.parentView.selectedTimezone"
+ class="group-select select-group-box"
+ }}
</label>
</div>
</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/e1caac3a/ambari-web/app/utils/date.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/date.js b/ambari-web/app/utils/date.js
index f6d98f5..84b67f9 100644
--- a/ambari-web/app/utils/date.js
+++ b/ambari-web/app/utils/date.js
@@ -210,5 +210,33 @@ module.exports = {
duration = endTime - startTime;
}
return duration;
+ },
+
+ /**
+ * Load list of timezones from moment.tz
+ * Zones "Etc/*" are excluded
+ * @returns {object[]}
+ */
+ getAllTimezoneNames: function () {
+ return moment.tz.names().filter(function (timeZoneName) {
+ return !timeZoneName.startsWith('Etc/');
+ });
+ },
+
+ /**
+ * Try detect user's timezone using timezoneOffset and moment.tz
+ * @returns {string}
+ */
+ detectUserTimezone: function () {
+ var timezoneOffset = new Date().getTimezoneOffset();
+ var timezoneNames = this.getAllTimezoneNames();
+ for (var i = 0; i < timezoneNames.length; i++) {
+ var zone = moment.tz.zone(timezoneNames[i]);
+ if (zone.offsets.contains(timezoneOffset)) {
+ return timezoneNames[i];
+ }
+ }
+ return '';
}
+
};
[21/31] ambari git commit: AMBARI-13321. Oozie Alert Fails In
Kerberized Environment That Is Not SSL (aonishuk)
Posted by nc...@apache.org.
AMBARI-13321. Oozie Alert Fails In Kerberized Environment That Is Not SSL (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/815c5caa
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/815c5caa
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/815c5caa
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 815c5caaa846a45dbded22da488a0242127ead2e
Parents: 6b8f692
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Oct 6 14:12:23 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Oct 6 14:12:23 2015 +0300
----------------------------------------------------------------------
.../package/alerts/alert_check_oozie_server.py | 72 +++++++++-----------
1 file changed, 34 insertions(+), 38 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/815c5caa/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
index c3143c6..764473e 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
@@ -43,28 +43,26 @@ KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY = '{{kerberos-env/executable_search_paths}}
OOZIE_URL_KEY = '{{oozie-site/oozie.base.url}}'
SECURITY_ENABLED = '{{cluster-env/security_enabled}}'
-OOZIE_PRINCIPAL = '{{cluster-env/smokeuser_principal_name}}'
-OOZIE_KEYTAB = '{{cluster-env/smokeuser_keytab}}'
OOZIE_USER = '{{oozie-env/oozie_user}}'
OOZIE_CONF_DIR = '/usr/hdp/current/oozie-server/conf'
OOZIE_CONF_DIR_LEGACY = '/etc/oozie/conf'
OOZIE_HTTPS_PORT = '{{oozie-site/oozie.https.port}}'
OOZIE_ENV_CONTENT = '{{oozie-env/content}}'
-SMOKEUSER_KEYTAB_KEY = '{{cluster-env/smokeuser_keytab}}'
-SMOKEUSER_PRINCIPAL_KEY = '{{cluster-env/smokeuser_principal_name}}'
-SMOKEUSER_KEY = '{{cluster-env/smokeuser}}'
+USER_KEYTAB_KEY = '{{oozie-site/oozie.service.HadoopAccessorService.keytab.file}}'
+USER_PRINCIPAL_KEY = '{{oozie-site/oozie.service.HadoopAccessorService.kerberos.principal}}'
+USER_KEY = '{{oozie-env/oozie_user}}'
# default keytab location
-SMOKEUSER_KEYTAB_SCRIPT_PARAM_KEY = 'default.smoke.keytab'
-SMOKEUSER_KEYTAB_DEFAULT = '/etc/security/keytabs/smokeuser.headless.keytab'
+USER_KEYTAB_SCRIPT_PARAM_KEY = 'default.oozie.keytab'
+USER_KEYTAB_DEFAULT = '/etc/security/keytabs/oozie.headless.keytab'
-# default smoke principal
-SMOKEUSER_PRINCIPAL_SCRIPT_PARAM_KEY = 'default.smoke.principal'
-SMOKEUSER_PRINCIPAL_DEFAULT = 'ambari-qa@EXAMPLE.COM'
+# default user principal
+USER_PRINCIPAL_SCRIPT_PARAM_KEY = 'default.oozie.principal'
+USER_PRINCIPAL_DEFAULT = 'oozie@EXAMPLE.COM'
-# default smoke user
-SMOKEUSER_DEFAULT = 'ambari-qa'
+# default user
+USER_DEFAULT = 'oozie'
class KerberosPropertiesNotFound(Exception): pass
@@ -82,8 +80,8 @@ def get_tokens():
Returns a tuple of tokens in the format {{site/property}} that will be used
to build the dictionary passed into execute
"""
- return (OOZIE_URL_KEY, SMOKEUSER_PRINCIPAL_KEY, SECURITY_ENABLED, SMOKEUSER_KEYTAB_KEY, KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY,
- SMOKEUSER_KEY, OOZIE_HTTPS_PORT, OOZIE_ENV_CONTENT)
+ return (OOZIE_URL_KEY, USER_PRINCIPAL_KEY, SECURITY_ENABLED, USER_KEYTAB_KEY, KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY,
+ USER_KEY, OOZIE_HTTPS_PORT, OOZIE_ENV_CONTENT)
@OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY)
def get_check_command(oozie_url, host_name, configurations):
@@ -98,9 +96,9 @@ def get_check_command(oozie_url, host_name, configurations):
def get_check_command(oozie_url, host_name, configurations, parameters):
kerberos_env = None
- smokeuser = SMOKEUSER_DEFAULT
- if SMOKEUSER_KEY in configurations:
- smokeuser = configurations[SMOKEUSER_KEY]
+ user = USER_DEFAULT
+ if USER_KEY in configurations:
+ user = configurations[USER_KEY]
security_enabled = False
if SECURITY_ENABLED in configurations:
@@ -108,20 +106,22 @@ def get_check_command(oozie_url, host_name, configurations, parameters):
if security_enabled:
# defaults
- smokeuser_keytab = SMOKEUSER_KEYTAB_DEFAULT
- smokeuser_principal = SMOKEUSER_PRINCIPAL_DEFAULT
+ user_keytab = USER_KEYTAB_DEFAULT
+ user_principal = USER_PRINCIPAL_DEFAULT
# check script params
- if SMOKEUSER_PRINCIPAL_SCRIPT_PARAM_KEY in parameters:
- smokeuser_principal = parameters[SMOKEUSER_PRINCIPAL_SCRIPT_PARAM_KEY]
- if SMOKEUSER_KEYTAB_SCRIPT_PARAM_KEY in parameters:
- smokeuser_keytab = parameters[SMOKEUSER_KEYTAB_SCRIPT_PARAM_KEY]
+ if USER_PRINCIPAL_SCRIPT_PARAM_KEY in parameters:
+ user_principal = parameters[USER_PRINCIPAL_SCRIPT_PARAM_KEY]
+ user_principal = user_principal.replace('_HOST', host_name.lower())
+ if USER_KEYTAB_SCRIPT_PARAM_KEY in parameters:
+ user_keytab = parameters[USER_KEYTAB_SCRIPT_PARAM_KEY]
# check configurations last as they should always take precedence
- if SMOKEUSER_PRINCIPAL_KEY in configurations:
- smokeuser_principal = configurations[SMOKEUSER_PRINCIPAL_KEY]
- if SMOKEUSER_KEYTAB_KEY in configurations:
- smokeuser_keytab = configurations[SMOKEUSER_KEYTAB_KEY]
+ if USER_PRINCIPAL_KEY in configurations:
+ user_principal = configurations[USER_PRINCIPAL_KEY]
+ user_principal = user_principal.replace('_HOST', host_name.lower())
+ if USER_KEYTAB_KEY in configurations:
+ user_keytab = configurations[USER_KEYTAB_KEY]
# Create the kerberos credentials cache (ccache) file and set it in the environment to use
# when executing curl
@@ -140,13 +140,13 @@ def get_check_command(oozie_url, host_name, configurations, parameters):
# Determine if we need to kinit by testing to see if the relevant cache exists and has
# non-expired tickets. Tickets are marked to expire after 5 minutes to help reduce the number
# it kinits we do but recover quickly when keytabs are regenerated
- return_code, _ = call(klist_command, user=smokeuser)
+ return_code, _ = call(klist_command, user=user)
if return_code != 0:
kinit_path_local = get_kinit_path(kerberos_executable_search_paths)
- kinit_command = format("{kinit_path_local} -l 5m -kt {smokeuser_keytab} {smokeuser_principal}; ")
+ kinit_command = format("{kinit_path_local} -l 5m -kt {user_keytab} {user_principal}; ")
# kinit
- Execute(kinit_command, environment=kerberos_env, user=smokeuser)
+ Execute(kinit_command, environment=kerberos_env, user=user)
# oozie configuration directory uses a symlink when > HDP 2.2
oozie_config_directory = OOZIE_CONF_DIR_LEGACY
@@ -156,7 +156,7 @@ def get_check_command(oozie_url, host_name, configurations, parameters):
command = "source {0}/oozie-env.sh ; oozie admin -oozie {1} -status".format(
oozie_config_directory, oozie_url)
- return (command, kerberos_env, smokeuser)
+ return (command, kerberos_env, user)
def execute(configurations={}, parameters={}, host_name=None):
"""
@@ -174,10 +174,6 @@ def execute(configurations={}, parameters={}, host_name=None):
if not OOZIE_URL_KEY in configurations:
return (RESULT_CODE_UNKNOWN, ['The Oozie URL is a required parameter.'])
- # use localhost on Windows, 0.0.0.0 on others; 0.0.0.0 means bind to all
- # interfaces, which doesn't work on Windows
- localhost_address = 'localhost' if OSCheck.get_os_family() == OSConst.WINSRV_FAMILY else '0.0.0.0'
-
https_port = None
# try to get https port form oozie-env content
if OOZIE_ENV_CONTENT in configurations:
@@ -203,12 +199,12 @@ def execute(configurations={}, parameters={}, host_name=None):
# https will not work with localhost address, we need put fqdn
if https_port is None:
- oozie_url = oozie_url.replace(urlparse(oozie_url).hostname, localhost_address)
+ oozie_url = oozie_url.replace(urlparse(oozie_url).hostname, host_name)
try:
- command, env, smokeuser = get_check_command(oozie_url, host_name, configurations, parameters)
+ command, env, user = get_check_command(oozie_url, host_name, configurations, parameters)
# execute the command
- Execute(command, environment=env, user=smokeuser)
+ Execute(command, environment=env, user=user)
return (RESULT_CODE_OK, ["Successful connection to {0}".format(oozie_url)])
except KerberosPropertiesNotFound, ex:
[19/31] ambari git commit: AMBARI-13318. Issue with "Memory allocated
for all YARN containers on a node" enhanced config (aonishuk)
Posted by nc...@apache.org.
AMBARI-13318. Issue with "Memory allocated for all YARN containers on a node" enhanced config (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/40116115
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/40116115
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/40116115
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 4011611574cf2c1de9517b165ec109feba97c622
Parents: aeebae6
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Oct 6 12:39:08 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Oct 6 12:39:08 2015 +0300
----------------------------------------------------------------------
.../internal/BlueprintConfigurationProcessor.java | 2 ++
.../internal/BlueprintConfigurationProcessorTest.java | 9 ++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/40116115/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 5fd5563..3d13725 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
@@ -1937,6 +1937,7 @@ public class BlueprintConfigurationProcessor {
mPropertyUpdaters.put("hbase-env", hbaseEnvMap);
mPropertyUpdaters.put("mapred-env", mapredEnvMap);
mPropertyUpdaters.put("oozie-env", oozieEnvHeapSizeMap);
+ mPropertyUpdaters.put("yarn-site", yarnSiteMap);
multiHostTopologyUpdaters.put("webhcat-site", multiWebhcatSiteMap);
multiHostTopologyUpdaters.put("hbase-site", multiHbaseSiteMap);
@@ -2144,6 +2145,7 @@ public class BlueprintConfigurationProcessor {
hbaseEnvMap.put("hbase_regionserver_heapsize", new MPropertyUpdater());
oozieEnvHeapSizeMap.put("oozie_heapsize", new MPropertyUpdater());
oozieEnvHeapSizeMap.put("oozie_permsize", new MPropertyUpdater());
+ yarnSiteMap.put("yarn.nodemanager.resource.memory-mb", new MPropertyUpdater());
}
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/40116115/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 ac86668..402c69d 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
@@ -1427,11 +1427,13 @@ public class BlueprintConfigurationProcessorTest {
Map<String, String> oozieSiteProperties = new HashMap<String, String>();
Map<String, String> oozieEnvProperties = new HashMap<String, String>();
Map<String, String> coreSiteProperties = new HashMap<String, String>();
-
+ Map<String, String> yarnSiteProperties = new HashMap<String, String>();
+
configProperties.put("oozie-site", oozieSiteProperties);
configProperties.put("oozie-env", oozieEnvProperties);
configProperties.put("hive-env", oozieEnvProperties);
configProperties.put("core-site", coreSiteProperties);
+ configProperties.put("yarn-site", yarnSiteProperties);
oozieSiteProperties.put("oozie.base.url", expectedHostName);
oozieSiteProperties.put("oozie.authentication.kerberos.principal", expectedHostName);
@@ -1444,6 +1446,8 @@ public class BlueprintConfigurationProcessorTest {
oozieEnvProperties.put("oozie_permsize", "2048m");
coreSiteProperties.put("hadoop.proxyuser.oozie.hosts", expectedHostName + "," + expectedHostNameTwo);
+
+ oozieEnvProperties.put("yarn.nodemanager.resource.memory-mb", "2048m");
Configuration clusterConfig = new Configuration(configProperties,
Collections.<String, Map<String, Map<String, String>>>emptyMap());
@@ -1497,6 +1501,9 @@ public class BlueprintConfigurationProcessorTest {
"1024m", oozieEnvProperties.get("oozie_heapsize"));
assertEquals("oozie_permsize should have been included in exported configuration",
"2048m", oozieEnvProperties.get("oozie_permsize"));
+
+ assertEquals("yarn.nodemanager.resource.memory-mb should have been included in exported configuration",
+ "2048m", oozieEnvProperties.get("yarn.nodemanager.resource.memory-mb"));
}
[18/31] ambari git commit: AMBARI-13317 API call to load Host
Component links on Service dashboard should be independent of metrics.
(atkach)
Posted by nc...@apache.org.
AMBARI-13317 API call to load Host Component links on Service dashboard should be independent of metrics. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/aeebae6e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/aeebae6e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/aeebae6e
Branch: refs/heads/branch-dev-patch-upgrade
Commit: aeebae6eb7609398c807360985724e1310829681
Parents: e672501
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Tue Oct 6 11:19:39 2015 +0300
Committer: Andrii Tkach <at...@hortonworks.com>
Committed: Tue Oct 6 11:19:39 2015 +0300
----------------------------------------------------------------------
.../controllers/global/cluster_controller.js | 2 +
.../app/controllers/global/update_controller.js | 99 ++++++++++++--------
.../global/wizard_watcher_controller.js | 4 +
.../global/update_controller_test.js | 57 +++++++----
.../global/wizard_watcher_controller_test.js | 13 +++
5 files changed, 117 insertions(+), 58 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/aeebae6e/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index b6dba0e..f4c2837 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -249,6 +249,8 @@ App.ClusterController = Em.Controller.extend(App.ReloadPopupMixin, {
// service metrics loading doesn't affect overall progress
updater.updateServiceMetric(function () {
self.set('isServiceMetricsLoaded', true);
+ // make second call, because first is light since it doesn't request host-component metrics
+ updater.updateServiceMetric(Em.K);
// components config loading doesn't affect overall progress
updater.updateComponentConfig(function () {
self.set('isComponentsConfigLoaded', true);
http://git-wip-us.apache.org/repos/asf/ambari/blob/aeebae6e/ambari-web/app/controllers/global/update_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js
index 69deb74..0d003ca 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -39,6 +39,47 @@ App.UpdateController = Em.Controller.extend({
paginationKeys: ['page_size', 'from'],
/**
+ * @type {Array}
+ */
+ serviceComponentMetrics: [
+ 'host_components/metrics/jvm/memHeapUsedM',
+ 'host_components/metrics/jvm/HeapMemoryMax',
+ 'host_components/metrics/jvm/HeapMemoryUsed',
+ 'host_components/metrics/jvm/memHeapCommittedM',
+ 'host_components/metrics/mapred/jobtracker/trackers_decommissioned',
+ 'host_components/metrics/cpu/cpu_wio',
+ 'host_components/metrics/rpc/RpcQueueTime_avg_time',
+ 'host_components/metrics/dfs/FSNamesystem/*',
+ 'host_components/metrics/dfs/namenode/Version',
+ 'host_components/metrics/dfs/namenode/LiveNodes',
+ 'host_components/metrics/dfs/namenode/DeadNodes',
+ 'host_components/metrics/dfs/namenode/DecomNodes',
+ 'host_components/metrics/dfs/namenode/TotalFiles',
+ 'host_components/metrics/dfs/namenode/UpgradeFinalized',
+ 'host_components/metrics/dfs/namenode/Safemode',
+ 'host_components/metrics/runtime/StartTime'
+ ],
+
+ /**
+ * @type {object}
+ */
+ serviceSpecificParams: {
+ 'FLUME': "host_components/processes/HostComponentProcess",
+ 'YARN': "host_components/metrics/yarn/Queue," +
+ "host_components/metrics/yarn/ClusterMetrics/NumActiveNMs," +
+ "host_components/metrics/yarn/ClusterMetrics/NumLostNMs," +
+ "host_components/metrics/yarn/ClusterMetrics/NumUnhealthyNMs," +
+ "host_components/metrics/yarn/ClusterMetrics/NumRebootedNMs," +
+ "host_components/metrics/yarn/ClusterMetrics/NumDecommissionedNMs",
+ 'HBASE': "host_components/metrics/hbase/master/IsActiveMaster," +
+ "host_components/metrics/hbase/master/MasterStartTime," +
+ "host_components/metrics/hbase/master/MasterActiveTime," +
+ "host_components/metrics/hbase/master/AverageLoad," +
+ "host_components/metrics/master/AssignmentManger/ritCount",
+ 'STORM': 'metrics/api/v1/cluster/summary,metrics/api/v1/topology/summary,metrics/api/v1/nimbus/summary'
+ },
+
+ /**
* @type {string}
*/
HOSTS_TEST_URL: '/data/hosts/HDP2/hosts.json',
@@ -409,22 +450,6 @@ App.UpdateController = Em.Controller.extend({
'host_components/HostRoles/stale_configs,' +
'host_components/HostRoles/ha_state,' +
'host_components/HostRoles/desired_admin_state,' +
- 'host_components/metrics/jvm/memHeapUsedM,' +
- 'host_components/metrics/jvm/HeapMemoryMax,' +
- 'host_components/metrics/jvm/HeapMemoryUsed,' +
- 'host_components/metrics/jvm/memHeapCommittedM,' +
- 'host_components/metrics/mapred/jobtracker/trackers_decommissioned,' +
- 'host_components/metrics/cpu/cpu_wio,' +
- 'host_components/metrics/rpc/RpcQueueTime_avg_time,' +
- 'host_components/metrics/dfs/FSNamesystem/*,' +
- 'host_components/metrics/dfs/namenode/Version,' +
- 'host_components/metrics/dfs/namenode/LiveNodes,' +
- 'host_components/metrics/dfs/namenode/DeadNodes,' +
- 'host_components/metrics/dfs/namenode/DecomNodes,' +
- 'host_components/metrics/dfs/namenode/TotalFiles,' +
- 'host_components/metrics/dfs/namenode/UpgradeFinalized,' +
- 'host_components/metrics/dfs/namenode/Safemode,' +
- 'host_components/metrics/runtime/StartTime' +
conditionalFieldsString +
'&minimal_response=true';
@@ -438,8 +463,8 @@ App.UpdateController = Em.Controller.extend({
App.HttpClient.get(servicesUrl, App.serviceMetricsMapper, {
complete: function () {
App.set('router.mainServiceItemController.isServicesInfoLoaded', App.get('router.clusterController.isLoaded'));
- callback();
requestsRunningStatus["updateServiceMetric"] = false;
+ callback();
}
});
} else {
@@ -451,37 +476,33 @@ App.UpdateController = Em.Controller.extend({
* @return {Array}
*/
getConditionalFields: function () {
- var conditionalFields = [];
- var stormMetric = 'metrics/api/v1/cluster/summary,metrics/api/v1/topology/summary,metrics/api/v1/nimbus/summary';
+ var conditionalFields = this.get('serviceComponentMetrics').slice(0);
+ var serviceSpecificParams = $.extend({}, this.get('serviceSpecificParams'));
+ var metricsKey = 'metrics/';
+
if (/^2.1/.test(App.get('currentStackVersionNumber'))) {
- stormMetric = 'metrics/api/cluster/summary';
+ serviceSpecificParams['STORM'] = 'metrics/api/cluster/summary';
} else if (/^2.2/.test(App.get('currentStackVersionNumber'))) {
- stormMetric = 'metrics/api/v1/cluster/summary,metrics/api/v1/topology/summary';
+ serviceSpecificParams['STORM'] = 'metrics/api/v1/cluster/summary,metrics/api/v1/topology/summary';
}
- var serviceSpecificParams = {
- 'FLUME': "host_components/processes/HostComponentProcess",
- 'YARN': "host_components/metrics/yarn/Queue," +
- "host_components/metrics/yarn/ClusterMetrics/NumActiveNMs," +
- "host_components/metrics/yarn/ClusterMetrics/NumLostNMs," +
- "host_components/metrics/yarn/ClusterMetrics/NumUnhealthyNMs," +
- "host_components/metrics/yarn/ClusterMetrics/NumRebootedNMs," +
- "host_components/metrics/yarn/ClusterMetrics/NumDecommissionedNMs",
- 'HBASE': "host_components/metrics/hbase/master/IsActiveMaster," +
- "host_components/metrics/hbase/master/MasterStartTime," +
- "host_components/metrics/hbase/master/MasterActiveTime," +
- "host_components/metrics/hbase/master/AverageLoad," +
- "host_components/metrics/master/AssignmentManger/ritCount",
- 'STORM': stormMetric
- };
- var services = App.cache['services'];
- services.forEach(function (service) {
+
+ App.cache['services'].forEach(function (service) {
var urlParams = serviceSpecificParams[service.ServiceInfo.service_name];
if (urlParams) {
conditionalFields.push(urlParams);
}
});
+
+ //first load shouldn't contain metrics in order to make call lighter
+ if (!App.get('router.clusterController.isServiceMetricsLoaded')) {
+ return conditionalFields.filter(function (condition) {
+ return (condition.indexOf(metricsKey) === -1);
+ });
+ }
+
return conditionalFields;
},
+
updateServices: function (callback) {
var testUrl = '/data/services/HDP2/services.json';
var componentConfigUrl = this.getUrl(testUrl, '/services?fields=ServiceInfo/state,ServiceInfo/maintenance_state,components/ServiceComponentInfo/component_name&minimal_response=true');
@@ -496,6 +517,7 @@ App.UpdateController = Em.Controller.extend({
complete: callback
});
},
+
updateComponentsState: function (callback) {
var testUrl = '/data/services/HDP2/components_state.json';
var realUrl = '/components/?fields=ServiceComponentInfo/service_name,' +
@@ -506,6 +528,7 @@ App.UpdateController = Em.Controller.extend({
complete: callback
});
},
+
updateAlertDefinitions: function (callback) {
var testUrl = '/data/alerts/alertDefinitions.json';
var realUrl = '/alert_definitions?fields=' +
http://git-wip-us.apache.org/repos/asf/ambari/blob/aeebae6e/ambari-web/app/controllers/global/wizard_watcher_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/wizard_watcher_controller.js b/ambari-web/app/controllers/global/wizard_watcher_controller.js
index e9cd958..438e41a 100644
--- a/ambari-web/app/controllers/global/wizard_watcher_controller.js
+++ b/ambari-web/app/controllers/global/wizard_watcher_controller.js
@@ -103,5 +103,9 @@ App.WizardWatcherController = Em.Controller.extend(App.UserPref, {
this.set('wizardUser', data.userName);
this.set('controllerName', data.controllerName);
}
+ },
+
+ getUserPrefErrorCallback: function () {
+ this.resetUser();
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/aeebae6e/ambari-web/test/controllers/global/update_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/global/update_controller_test.js b/ambari-web/test/controllers/global/update_controller_test.js
index 83f0630..e8d4353 100644
--- a/ambari-web/test/controllers/global/update_controller_test.js
+++ b/ambari-web/test/controllers/global/update_controller_test.js
@@ -72,7 +72,7 @@ describe('App.UpdateController', function () {
{
title: 'No services exist',
services: [],
- result: []
+ result: ['metrics/1']
},
{
title: 'HDFS service',
@@ -83,7 +83,7 @@ describe('App.UpdateController', function () {
}
}
],
- result: []
+ result: ['metrics/1']
},
{
title: 'FLUME service',
@@ -94,7 +94,7 @@ describe('App.UpdateController', function () {
}
}
],
- result: ["host_components/processes/HostComponentProcess"]
+ result: ['metrics/1', "host_components/processes/HostComponentProcess"]
},
{
title: 'YARN service',
@@ -105,7 +105,7 @@ describe('App.UpdateController', function () {
}
}
],
- result: ["host_components/metrics/yarn/Queue," +
+ result: ['metrics/1', "host_components/metrics/yarn/Queue," +
"host_components/metrics/yarn/ClusterMetrics/NumActiveNMs," +
"host_components/metrics/yarn/ClusterMetrics/NumLostNMs," +
"host_components/metrics/yarn/ClusterMetrics/NumUnhealthyNMs," +
@@ -121,7 +121,7 @@ describe('App.UpdateController', function () {
}
}
],
- result: ["host_components/metrics/hbase/master/IsActiveMaster," +
+ result: ['metrics/1', "host_components/metrics/hbase/master/IsActiveMaster," +
"host_components/metrics/hbase/master/MasterStartTime," +
"host_components/metrics/hbase/master/MasterActiveTime," +
"host_components/metrics/hbase/master/AverageLoad," +
@@ -136,9 +136,9 @@ describe('App.UpdateController', function () {
}
}
],
- result: ["metrics/api/v1/cluster/summary," +
- "metrics/api/v1/topology/summary," +
- "metrics/api/v1/nimbus/summary"]
+ result: ['metrics/1', "metrics/api/v1/cluster/summary," +
+ "metrics/api/v1/topology/summary," +
+ "metrics/api/v1/nimbus/summary"]
}
];
@@ -153,7 +153,7 @@ describe('App.UpdateController', function () {
}
],
stackVersionNumber: '2.1',
- result: ["metrics/api/cluster/summary"]
+ result: ['metrics/1', "metrics/api/cluster/summary"]
},
{
title: 'STORM service stack 2.2',
@@ -165,7 +165,7 @@ describe('App.UpdateController', function () {
}
],
stackVersionNumber: '2.2',
- result: ["metrics/api/v1/cluster/summary,metrics/api/v1/topology/summary"]
+ result: ['metrics/1', "metrics/api/v1/cluster/summary,metrics/api/v1/topology/summary"]
},
{
title: 'STORM service stack 2.3',
@@ -177,28 +177,45 @@ describe('App.UpdateController', function () {
}
],
stackVersionNumber: '2.3',
- result: ["metrics/api/v1/cluster/summary,metrics/api/v1/topology/summary,metrics/api/v1/nimbus/summary"]
+ result: ['metrics/1', "metrics/api/v1/cluster/summary,metrics/api/v1/topology/summary,metrics/api/v1/nimbus/summary"]
}
];
- testCases.forEach(function(test){
+
+ beforeEach(function () {
+ this.mock = sinon.stub(App, 'get');
+ controller.set('serviceComponentMetrics', ['metrics/1']);
+ });
+ afterEach(function () {
+ this.mock.restore();
+ });
+ testCases.forEach(function (test) {
it(test.title, function () {
App.cache['services'] = test.services;
+ this.mock.withArgs('router.clusterController.isServiceMetricsLoaded').returns(true);
expect(controller.getConditionalFields()).to.eql(test.result);
});
});
- testCasesByStackVersion.forEach(function(test) {
- it(test.title, function() {
+ testCasesByStackVersion.forEach(function (test) {
+ it(test.title, function () {
App.cache['services'] = test.services;
- sinon.stub(App, 'get', function(key) {
- if (key == 'currentStackVersionNumber') {
- return test.stackVersionNumber;
- }
- });
+ this.mock.withArgs('currentStackVersionNumber').returns(test.stackVersionNumber);
+ this.mock.withArgs('router.clusterController.isServiceMetricsLoaded').returns(true);
expect(controller.getConditionalFields()).to.eql(test.result);
- App.get.restore();
});
});
+
+ it('FLUME service, first load', function () {
+ App.cache['services'] = [
+ {
+ ServiceInfo: {
+ service_name: 'FLUME'
+ }
+ }
+ ];
+ this.mock.withArgs('router.clusterController.isServiceMetricsLoaded').returns(false);
+ expect(controller.getConditionalFields()).to.eql(["host_components/processes/HostComponentProcess"]);
+ });
});
describe("#getComplexUrl()", function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/aeebae6e/ambari-web/test/controllers/global/wizard_watcher_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/global/wizard_watcher_controller_test.js b/ambari-web/test/controllers/global/wizard_watcher_controller_test.js
index 4afc70f..7c72977 100644
--- a/ambari-web/test/controllers/global/wizard_watcher_controller_test.js
+++ b/ambari-web/test/controllers/global/wizard_watcher_controller_test.js
@@ -148,4 +148,17 @@ describe('App.wizardWatcherController', function () {
expect(controller.get('controllerName')).to.equal('ctrl1');
});
});
+
+ describe("#getUserPrefErrorCallback()", function() {
+ beforeEach(function () {
+ sinon.stub(controller, 'resetUser', Em.K);
+ });
+ afterEach(function () {
+ controller.resetUser.restore();
+ });
+ it("reset wizard-data", function() {
+ controller.getUserPrefErrorCallback();
+ expect(controller.resetUser.calledOnce).to.be.true;
+ });
+ });
});
[23/31] ambari git commit: AMBARI-13323 JDBC connection string for
Ranger does not update when changing database option. (ababiichuk)
Posted by nc...@apache.org.
AMBARI-13323 JDBC connection string for Ranger does not update when changing database option. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7ffa43ef
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7ffa43ef
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7ffa43ef
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 7ffa43ef5aafa716f8e4d0f7647d85e4675c9371
Parents: ebccd72
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Tue Oct 6 16:30:44 2015 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Tue Oct 6 16:30:44 2015 +0300
----------------------------------------------------------------------
ambari-web/app/views/common/controls_view.js | 39 +++++++++++------------
1 file changed, 19 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/7ffa43ef/ambari-web/app/views/common/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/controls_view.js b/ambari-web/app/views/common/controls_view.js
index 28d3090..085ae11 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -74,13 +74,6 @@ App.ServiceConfigPopoverSupport = Ember.Mixin.create({
App.SupportsDependentConfigs = Ember.Mixin.create({
/**
- * do not apply recommended value if user change value by himself.
- */
- keyUp: function() {
- this.get('controller').removeCurrentFromDependentList(this.get('serviceConfig') || this.get('config'));
- },
-
- /**
* method send request to check if some of dependent configs was changes
* and in case there was changes shows popup with info about changed configs
*
@@ -91,7 +84,7 @@ App.SupportsDependentConfigs = Ember.Mixin.create({
if (!config || !config.get('isValid')) return $.Deferred().resolve().promise();
if (['mainServiceInfoConfigsController','wizardStep7Controller'].contains(this.get('controller.name'))) {
var name = config.get('name');
- var saveRecommended = (this.get('config.value') === this.get('config.recommendedValue'));
+ var saveRecommended = (config.get('value') === config.get('recommendedValue'));
var controller = this.get('controller');
var type = App.config.getConfigTagFromFileName(config.get('filename'));
var p = App.StackConfigProperty.find(App.config.configId(name, type));
@@ -172,10 +165,12 @@ App.ServiceConfigTextField = Ember.TextField.extend(App.ServiceConfigPopoverSupp
placeholderBinding: 'serviceConfig.savedValue',
onValueUpdate: function () {
- var self = this;
- delay(function(){
- self.sendRequestRorDependentConfigs(self.get('serviceConfig'));
- }, 500);
+ if ($(this.get('element')).is(':focus')) {
+ var self = this;
+ delay(function(){
+ self.sendRequestRorDependentConfigs(self.get('serviceConfig'));
+ }, 500);
+ }
}.observes('serviceConfig.value'),
//Set editDone true for last edited config text field parameter
@@ -213,10 +208,12 @@ App.ServiceConfigTextFieldWithUnit = Ember.View.extend(App.ServiceConfigPopoverS
placeholderBinding: 'serviceConfig.savedValue',
onValueUpdate: function () {
- var self = this;
- delay(function(){
- self.sendRequestRorDependentConfigs(self.get('serviceConfig'));
- }, 500);
+ if ($(this.get('element')).is(':focus')) {
+ var self = this;
+ delay(function(){
+ self.sendRequestRorDependentConfigs(self.get('serviceConfig'));
+ }, 500);
+ }
}.observes('serviceConfig.value'),
templateName: require('templates/wizard/controls_service_config_textfield_with_unit')
@@ -273,10 +270,12 @@ App.ServiceConfigTextArea = Ember.TextArea.extend(App.ServiceConfigPopoverSuppor
onValueUpdate: function () {
- var self = this;
- delay(function(){
- self.sendRequestRorDependentConfigs(self.get('serviceConfig'));
- }, 500);
+ if ($(this.get('element')).is(':focus')) {
+ var self = this;
+ delay(function(){
+ self.sendRequestRorDependentConfigs(self.get('serviceConfig'));
+ }, 500);
+ }
}.observes('serviceConfig.value'),
valueBinding: 'serviceConfig.value',
[27/31] ambari git commit: AMBARI-13304. Add security-related HTTP
headers to Views to keep Ambari up to date with best-practices (rlevas)
Posted by nc...@apache.org.
AMBARI-13304. Add security-related HTTP headers to Views to keep Ambari up to date with best-practices (rlevas)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/20d08834
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/20d08834
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/20d08834
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 20d08834df93376d9845facc2581e5c8267fe436
Parents: 8eceffe
Author: Robert Levas <rl...@hortonworks.com>
Authored: Wed Oct 7 01:59:20 2015 -0700
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Wed Oct 7 01:59:24 2015 -0700
----------------------------------------------------------------------
.../apache/ambari/server/controller/AmbariHandlerList.java | 8 ++++++++
.../ambari/server/controller/AmbariHandlerListTest.java | 6 ++++++
2 files changed, 14 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/20d08834/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
index d1a7fde..1265b6a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariHandlerList.java
@@ -20,6 +20,7 @@ package org.apache.ambari.server.controller;
import org.apache.ambari.server.api.AmbariPersistFilter;
import org.apache.ambari.server.orm.entities.ViewEntity;
import org.apache.ambari.server.orm.entities.ViewInstanceEntity;
+import org.apache.ambari.server.security.SecurityHeaderFilter;
import org.apache.ambari.server.view.ViewContextImpl;
import org.apache.ambari.server.view.ViewInstanceHandlerList;
import org.apache.ambari.server.view.ViewRegistry;
@@ -94,6 +95,12 @@ public class AmbariHandlerList extends HandlerCollection implements ViewInstance
DelegatingFilterProxy springSecurityFilter;
/**
+ * The security header filter - conditionlly adds security-related headers to the HTTP response.
+ */
+ @Inject
+ SecurityHeaderFilter securityHeaderFilter;
+
+ /**
* Mapping of view instance entities to handlers.
*/
private final Map<ViewInstanceEntity, Handler> viewHandlerMap = new HashMap<ViewInstanceEntity, Handler>();
@@ -234,6 +241,7 @@ public class AmbariHandlerList extends HandlerCollection implements ViewInstance
webAppContext.setClassLoader(viewInstanceDefinition.getViewEntity().getClassLoader());
webAppContext.setAttribute(ViewContext.CONTEXT_ATTRIBUTE, new ViewContextImpl(viewInstanceDefinition, viewRegistry));
webAppContext.setSessionHandler(new SharedSessionHandler(sessionManager));
+ webAppContext.addFilter(new FilterHolder(securityHeaderFilter), "/*", AmbariServer.DISPATCHER_TYPES);
webAppContext.addFilter(new FilterHolder(persistFilter), "/*", AmbariServer.DISPATCHER_TYPES);
webAppContext.addFilter(new FilterHolder(springSecurityFilter), "/*", AmbariServer.DISPATCHER_TYPES);
webAppContext.setAllowNullPathInfo(true);
http://git-wip-us.apache.org/repos/asf/ambari/blob/20d08834/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariHandlerListTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariHandlerListTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariHandlerListTest.java
index 03bf6c4..a0cb8d0 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariHandlerListTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariHandlerListTest.java
@@ -22,6 +22,7 @@ import org.apache.ambari.server.api.AmbariPersistFilter;
import org.apache.ambari.server.orm.entities.ViewEntity;
import org.apache.ambari.server.orm.entities.ViewInstanceEntity;
import org.apache.ambari.server.orm.entities.ViewInstanceEntityTest;
+import org.apache.ambari.server.security.SecurityHeaderFilter;
import org.apache.ambari.server.view.ViewRegistry;
import org.easymock.Capture;
import org.eclipse.jetty.server.Handler;
@@ -51,6 +52,7 @@ import static org.easymock.EasyMock.verify;
*/
public class AmbariHandlerListTest {
+ private final SecurityHeaderFilter securityHeaderFilter = createNiceMock(SecurityHeaderFilter.class);
private final AmbariPersistFilter persistFilter = createNiceMock(AmbariPersistFilter.class);
private final DelegatingFilterProxy springSecurityFilter = createNiceMock(DelegatingFilterProxy.class);
@@ -66,9 +68,11 @@ public class AmbariHandlerListTest {
expect(handler.getServer()).andReturn(server);
handler.setServer(null);
+ Capture<FilterHolder> securityHeaderFilterCapture = new Capture<FilterHolder>();
Capture<FilterHolder> persistFilterCapture = new Capture<FilterHolder>();
Capture<FilterHolder> securityFilterCapture = new Capture<FilterHolder>();
+ handler.addFilter(capture(securityHeaderFilterCapture), eq("/*"), eq(AmbariServer.DISPATCHER_TYPES));
handler.addFilter(capture(persistFilterCapture), eq("/*"), eq(AmbariServer.DISPATCHER_TYPES));
handler.addFilter(capture(securityFilterCapture), eq("/*"), eq(AmbariServer.DISPATCHER_TYPES));
handler.setAllowNullPathInfo(true);
@@ -83,6 +87,7 @@ public class AmbariHandlerListTest {
Assert.assertTrue(handlers.contains(handler));
+ Assert.assertEquals(securityHeaderFilter, securityHeaderFilterCapture.getValue().getFilter());
Assert.assertEquals(persistFilter, persistFilterCapture.getValue().getFilter());
Assert.assertEquals(springSecurityFilter, securityFilterCapture.getValue().getFilter());
@@ -156,6 +161,7 @@ public class AmbariHandlerListTest {
AmbariHandlerList handlerList = new AmbariHandlerList();
handlerList.webAppContextProvider = new HandlerProvider(handler);
+ handlerList.securityHeaderFilter = securityHeaderFilter;
handlerList.persistFilter = persistFilter;
handlerList.springSecurityFilter = springSecurityFilter;
[25/31] ambari git commit: AMBARI-13329. Test connection button for
Ranger privileged user should not connect to ranger database. (jaimin)
Posted by nc...@apache.org.
AMBARI-13329. Test connection button for Ranger privileged user should not connect to ranger database. (jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/828c7fa8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/828c7fa8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/828c7fa8
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 828c7fa8a818b4b7e8d83b4d2c470894cac0c714
Parents: 0d676b3
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Tue Oct 6 18:11:42 2015 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Tue Oct 6 18:12:32 2015 -0700
----------------------------------------------------------------------
.../RANGER/configuration/ranger-env.xml | 20 ++++++
.../HDP/2.3/services/RANGER/themes/theme.json | 64 +++++++++-----------
.../stacks/HDP/2.3/services/stack_advisor.py | 21 ++++++-
3 files changed, 68 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/828c7fa8/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-env.xml
index a8ad1b6..5ed7b22 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-env.xml
@@ -75,5 +75,25 @@
</value-attributes>
</property>
+ <property>
+ <name>ranger_privelege_user_jdbc_url</name>
+ <display-name>JDBC connect string for root user</display-name>
+ <description>JDBC connect string - auto populated based on other values. This is to be used by root user</description>
+ <value>jdbc:mysql://localhost</value>
+ <value-attributes>
+ <overridable>false</overridable>
+ </value-attributes>
+ <depends-on>
+ <property>
+ <type>admin-properties</type>
+ <name>DB_FLAVOR</name>
+ </property>
+ <property>
+ <type>admin-properties</type>
+ <name>db_host</name>
+ </property>
+ </depends-on>
+ </property>
+
</configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/828c7fa8/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
index c4f7d59..31d5cf7 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/themes/theme.json
@@ -18,10 +18,10 @@
"display-name": "Ranger Admin",
"row-index": "0",
"column-index": "0",
- "row-span": "4",
+ "row-span": "3",
"column-span": "2",
"section-columns": "2",
- "section-rows": "4",
+ "section-rows": "3",
"subsections": [
{
"name": "subsection-ranger-db-row1-col1",
@@ -38,30 +38,15 @@
"column-span": "1"
},
{
- "name": "subsection-ranger-db-row2-col1",
+ "name": "subsection-ranger-db-row2",
"row-index": "1",
"column-index": "0",
"row-span": "1",
- "column-span": "1"
- },
- {
- "name": "subsection-ranger-db-row2-col2",
- "row-index": "1",
- "column-index": "1",
- "row-span": "1",
- "column-span": "1",
- "left-vertical-splitter": false
- },
- {
- "name": "subsection-ranger-db-row3",
- "row-index": "2",
- "column-index": "0",
- "row-span": "1",
"column-span": "2"
},
{
- "name": "subsection-ranger-db-row4-col1",
- "row-index": "3",
+ "name": "subsection-ranger-db-row3-col1",
+ "row-index": "2",
"column-index": "0",
"row-span": "1",
"column-span": "1",
@@ -85,8 +70,8 @@
]
},
{
- "name": "subsection-ranger-db-row4-col2",
- "row-index": "3",
+ "name": "subsection-ranger-db-row3-col2",
+ "row-index": "2",
"column-index": "1",
"row-span": "1",
"column-span": "1",
@@ -107,8 +92,7 @@
}
}
}
- ],
- "left-vertical-splitter": false
+ ]
}
]
}
@@ -252,6 +236,10 @@
"subsection-name": "subsection-ranger-db-row1-col1"
},
{
+ "config": "admin-properties/db_user",
+ "subsection-name": "subsection-ranger-db-row1-col1"
+ },
+ {
"config": "ranger-admin-site/ranger.jpa.jdbc.url",
"subsection-name": "subsection-ranger-db-row1-col1"
},
@@ -264,16 +252,12 @@
"subsection-name": "subsection-ranger-db-row1-col2"
},
{
- "config": "admin-properties/db_user",
- "subsection-name": "subsection-ranger-db-row2-col1"
- },
- {
"config": "admin-properties/db_password",
- "subsection-name": "subsection-ranger-db-row2-col2"
+ "subsection-name": "subsection-ranger-db-row1-col2"
},
{
"config": "ranger-env/test_db_connection",
- "subsection-name": "subsection-ranger-db-row2-col2",
+ "subsection-name": "subsection-ranger-db-row2",
"property_value_attributes": {
"ui_only_property": true
},
@@ -298,19 +282,23 @@
},
{
"config": "ranger-env/create_db_dbuser",
- "subsection-name": "subsection-ranger-db-row3"
+ "subsection-name": "subsection-ranger-db-row2"
},
{
"config": "admin-properties/db_root_user",
- "subsection-name": "subsection-ranger-db-row4-col1"
+ "subsection-name": "subsection-ranger-db-row3-col1"
+ },
+ {
+ "config": "ranger-env/ranger_privelege_user_jdbc_url",
+ "subsection-name": "subsection-ranger-db-row3-col1"
},
{
"config": "admin-properties/db_root_password",
- "subsection-name": "subsection-ranger-db-row4-col2"
+ "subsection-name": "subsection-ranger-db-row3-col2"
},
{
"config": "ranger-env/test_root_db_connection",
- "subsection-name": "subsection-ranger-db-row4-col2",
+ "subsection-name": "subsection-ranger-db-row3-col1",
"property_value_attributes": {
"ui_only_property": true
}
@@ -827,6 +815,12 @@
}
},
{
+ "config": "ranger-env/ranger_privelege_user_jdbc_url",
+ "widget": {
+ "type": "text-field"
+ }
+ },
+ {
"config": "admin-properties/db_root_user",
"widget": {
"type": "text-field"
@@ -845,7 +839,7 @@
"display-name": "Test Connection",
"required-properties": {
"jdbc.driver.class": "ranger-admin-site/ranger.jpa.jdbc.driver",
- "jdbc.driver.url": "ranger-admin-site/ranger.jpa.jdbc.url",
+ "jdbc.driver.url": "ranger-env/ranger_privelege_user_jdbc_url",
"db.connection.source.host": "ranger-site/ranger_admin_hosts",
"db.type": "admin-properties/DB_FLAVOR",
"db.connection.destination.host": "admin-properties/db_host",
http://git-wip-us.apache.org/repos/asf/ambari/blob/828c7fa8/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
index adb6689..51a514e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
@@ -255,6 +255,7 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
def recommendRangerConfigurations(self, configurations, clusterData, services, hosts):
super(HDP23StackAdvisor, self).recommendRangerConfigurations(configurations, clusterData, services, hosts)
putRangerAdminProperty = self.putProperty(configurations, "ranger-admin-site", services)
+ putRangerEnvProperty = self.putProperty(configurations, "ranger-env", services)
if 'admin-properties' in services['configurations'] and ('DB_FLAVOR' in services['configurations']['admin-properties']['properties'])\
and ('db_host' in services['configurations']['admin-properties']['properties']) and ('db_name' in services['configurations']['admin-properties']['properties']):
@@ -262,17 +263,33 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
rangerDbFlavor = services['configurations']["admin-properties"]["properties"]["DB_FLAVOR"]
rangerDbHost = services['configurations']["admin-properties"]["properties"]["db_host"]
rangerDbName = services['configurations']["admin-properties"]["properties"]["db_name"]
- ranger_db_driver_dict = {
+ ranger_db_url_dict = {
'MYSQL': {'ranger.jpa.jdbc.driver': 'com.mysql.jdbc.Driver', 'ranger.jpa.jdbc.url': 'jdbc:mysql://' + rangerDbHost + '/' + rangerDbName},
'ORACLE': {'ranger.jpa.jdbc.driver': 'oracle.jdbc.driver.OracleDriver', 'ranger.jpa.jdbc.url': 'jdbc:oracle:thin:@/' + rangerDbHost + ':1521/' + rangerDbName},
'POSTGRES': {'ranger.jpa.jdbc.driver': 'org.postgresql.Driver', 'ranger.jpa.jdbc.url': 'jdbc:postgresql://' + rangerDbHost + ':5432/' + rangerDbName},
'MSSQL': {'ranger.jpa.jdbc.driver': 'com.microsoft.sqlserver.jdbc.SQLServerDriver', 'ranger.jpa.jdbc.url': 'jdbc:sqlserver://' + rangerDbHost + ';databaseName=' + rangerDbName},
'SQLA': {'ranger.jpa.jdbc.driver': 'sap.jdbc4.sqlanywhere.IDriver', 'ranger.jpa.jdbc.url': 'jdbc:sqlanywhere:host=' + rangerDbHost + ';database=' + rangerDbName}
}
- rangerDbProperties = ranger_db_driver_dict.get(rangerDbFlavor, ranger_db_driver_dict['MYSQL'])
+ rangerDbProperties = ranger_db_url_dict.get(rangerDbFlavor, ranger_db_url_dict['MYSQL'])
for key in rangerDbProperties:
putRangerAdminProperty(key, rangerDbProperties.get(key))
+ if 'admin-properties' in services['configurations'] and ('DB_FLAVOR' in services['configurations']['admin-properties']['properties']) \
+ and ('db_host' in services['configurations']['admin-properties']['properties']):
+
+ rangerDbFlavor = services['configurations']["admin-properties"]["properties"]["DB_FLAVOR"]
+ rangerDbHost = services['configurations']["admin-properties"]["properties"]["db_host"]
+ ranger_db_privelege_url_dict = {
+ 'MYSQL': {'ranger_privelege_user_jdbc_url': 'jdbc:mysql://' + rangerDbHost},
+ 'ORACLE': {'ranger_privelege_user_jdbc_url': 'jdbc:oracle:thin:@/' + rangerDbHost + ':1521'},
+ 'POSTGRES': {'ranger_privelege_user_jdbc_url': 'jdbc:postgresql://' + rangerDbHost + ':5432'},
+ 'MSSQL': {'ranger_privelege_user_jdbc_url': 'jdbc:sqlserver://' + rangerDbHost + ';'},
+ 'SQLA': {'ranger_privelege_user_jdbc_url': 'jdbc:sqlanywhere:host=' + rangerDbHost + ';'}
+ }
+ rangerPrivelegeDbProperties = ranger_db_privelege_url_dict.get(rangerDbFlavor, ranger_db_privelege_url_dict['MYSQL'])
+ for key in rangerPrivelegeDbProperties:
+ putRangerEnvProperty(key, rangerPrivelegeDbProperties.get(key))
+
def getServiceConfigurationValidators(self):
parentValidators = super(HDP23StackAdvisor, self).getServiceConfigurationValidators()
childValidators = {
[12/31] ambari git commit: AMBARI-13154. Label of required fields in
Details section of Create View Instance UI should include an asterisk
(alexantonenko)
Posted by nc...@apache.org.
AMBARI-13154. Label of required fields in Details section of Create View Instance UI should include an asterisk (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f20ebd72
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f20ebd72
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f20ebd72
Branch: refs/heads/branch-dev-patch-upgrade
Commit: f20ebd72bbf21098680d66cf8777b9fcb7d6b72e
Parents: c53cfff
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Oct 5 15:44:51 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon Oct 5 15:45:01 2015 +0300
----------------------------------------------------------------------
.../resources/ui/admin-web/app/views/ambariViews/create.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f20ebd72/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
index dffd66e..dcc77ef 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
@@ -44,7 +44,7 @@
<div class="form-group"
ng-class="{'has-error' : ( (form.instanceCreateForm.instanceNameInput.$error.required || form.instanceCreateForm.instanceNameInput.$error.pattern) && form.instanceCreateForm.submitted) || instanceExists }"
>
- <label for="" class="control-label col-sm-3">Instance Name</label>
+ <label for="" class="control-label col-sm-3">Instance Name*</label>
<div class="col-sm-9">
<input type="text" class="form-control instancename-input" name="instanceNameInput" ng-pattern="nameValidationPattern" required ng-model="instance.instance_name" autocomplete="off">
@@ -61,7 +61,7 @@
</div>
<div class="form-group"
ng-class="{'has-error' : ( (form.instanceCreateForm.displayLabel.$error.required || form.instanceCreateForm.displayLabel.$error.pattern) && form.instanceCreateForm.submitted)}">
- <label for="" class="control-label col-sm-3">Display Name</label>
+ <label for="" class="control-label col-sm-3">Display Name*</label>
<div class="col-sm-9">
<input type="text" class="form-control instancelabel-input" name="displayLabel" ng-model="instance.label" required ng-pattern="/^([a-zA-Z0-9._\s]+)$/" autocomplete="off">
@@ -74,7 +74,7 @@
</div>
</div>
<div class="form-group" ng-class="{'has-error' : form.instanceCreateForm.description.$error.required && form.instanceCreateForm.submitted }">
- <label for="" class="control-label col-sm-3">Description</label>
+ <label for="" class="control-label col-sm-3">Description*</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="description" ng-model="instance.description" maxlength="140" required>
<div class="alert alert-danger no-margin-bottom top-margin" ng-show='form.instanceCreateForm.description.$error.required && form.instanceCreateForm.submitted'>
[31/31] ambari git commit: AMBARI-13338 Ambari Web should surface
HTTP 413 error. (atkach)
Posted by nc...@apache.org.
AMBARI-13338 Ambari Web should surface HTTP 413 error. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/15ac2836
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/15ac2836
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/15ac2836
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 15ac283641e22a5c1ce25a24020480ade79ffd0e
Parents: 61f6523
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Wed Oct 7 15:10:33 2015 +0300
Committer: Andrii Tkach <at...@hortonworks.com>
Committed: Wed Oct 7 15:10:33 2015 +0300
----------------------------------------------------------------------
ambari-web/app/utils/ajax/ajax.js | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/15ac2836/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 1e389aa..f10eff1 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -2749,6 +2749,13 @@ var ajax = Em.Object.extend({
// A single instance of App.ModalPopup view
modalPopup: null,
+
+ /**
+ * Upon error with one of these statuses modal should be displayed
+ * @type {Array}
+ */
+ statuses: ['500', '401', '407', '413'],
+
/**
* defaultErrorHandler function is referred from App.ajax.send function and App.HttpClient.defaultErrorHandler function
* @jqXHR {jqXHR Object}
@@ -2759,15 +2766,14 @@ var ajax = Em.Object.extend({
defaultErrorHandler: function (jqXHR, url, method, showStatus) {
method = method || 'GET';
var self = this;
+ showStatus = (Em.isNone(showStatus)) ? this.get('statuses') : [showStatus];
try {
var json = $.parseJSON(jqXHR.responseText);
var message = json.message;
} catch (err) {
}
- if (!showStatus) {
- showStatus = 500;
- }
- if (jqXHR.status === showStatus && !this.get('modalPopup')) {
+
+ if (showStatus.contains(jqXHR.status) && !this.get('modalPopup')) {
this.set('modalPopup', App.ModalPopup.show({
header: Em.I18n.t('common.error'),
secondary: false,
[22/31] ambari git commit: AMBARI-13322. Should not log "unable to
get latest URL" as ERROR (aonishuk)
Posted by nc...@apache.org.
AMBARI-13322. Should not log "unable to get latest URL" as ERROR (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ebccd722
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ebccd722
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ebccd722
Branch: refs/heads/branch-dev-patch-upgrade
Commit: ebccd7224d53ce4178c57cb0fa6379d6a6470c3b
Parents: 815c5ca
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Oct 6 15:16:13 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Oct 6 15:16:13 2015 +0300
----------------------------------------------------------------------
.../core/providers/system.py | 24 +-------------------
.../core/resources/system.py | 1 -
.../server/state/stack/LatestRepoCallable.java | 5 ++--
3 files changed, 4 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/ebccd722/ambari-common/src/main/python/resource_management/core/providers/system.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/providers/system.py b/ambari-common/src/main/python/resource_management/core/providers/system.py
index d53779c..a3b01f0 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/system.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/system.py
@@ -149,11 +149,7 @@ class DirectoryProvider(Provider):
Logger.info("Following the link {0} to {1} to create the directory".format(self.resource.path, path))
if self.resource.recursive:
- if self.resource.recursive_permission:
- DirectoryProvider.makedirs_and_set_permission_recursively(path, self.resource.owner,
- self.resource.group, self.resource.mode)
- else:
- sudo.makedirs(path, self.resource.mode or 0755)
+ sudo.makedirs(path, self.resource.mode or 0755)
else:
dirname = os.path.dirname(path)
if not sudo.path_isdir(dirname):
@@ -167,24 +163,6 @@ class DirectoryProvider(Provider):
_ensure_metadata(path, self.resource.owner, self.resource.group,
mode=self.resource.mode, cd_access=self.resource.cd_access)
- @staticmethod
- def makedirs_and_set_permission_recursively(path, owner, group, mode):
- folders = []
- path, folder = os.path.split(path)
- while folder != "":
- folders.append(folder)
- path, folder = os.path.split(path)
- if path != "":
- folders.append(path)
-
- folders.reverse()
- dir_prefix = ""
- for folder in folders:
- dir_prefix = os.path.join(dir_prefix, folder)
- if not sudo.path_exists(dir_prefix):
- sudo.makedir(dir_prefix, mode or 0755)
- _ensure_metadata(dir_prefix, None, None, mode)
-
def action_delete(self):
path = self.resource.path
if sudo.path_exists(path):
http://git-wip-us.apache.org/repos/asf/ambari/blob/ebccd722/ambari-common/src/main/python/resource_management/core/resources/system.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/resources/system.py b/ambari-common/src/main/python/resource_management/core/resources/system.py
index f74e258..83abc64 100644
--- a/ambari-common/src/main/python/resource_management/core/resources/system.py
+++ b/ambari-common/src/main/python/resource_management/core/resources/system.py
@@ -60,7 +60,6 @@ class Directory(Resource):
group = ResourceArgument()
follow = BooleanArgument(default=True) # follow links?
recursive = BooleanArgument(default=False) # this work for 'create', 'delete' is anyway recursive
- recursive_permission = BooleanArgument(default=False) # sets given perms to all non-existent folders which are created recursively
"""
Grants x-bit for all the folders up-to the directory
http://git-wip-us.apache.org/repos/asf/ambari/blob/ebccd722/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
index cd7d229..0ad24fe 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
@@ -90,8 +90,9 @@ public class LatestRepoCallable implements Callable<Void> {
}
}
} catch (Exception e) {
- LOG.error("Could not load the URI for stack " + stack.getName() + "-" +
- stack.getVersion() + " from " + sourceUri + " (" + e.getMessage() + ")");
+ LOG.info("Could not load the URI for stack " + stack.getName() + "-" +
+ stack.getVersion() + " from " + sourceUri + " (" + e.getMessage() + ")" +
+ ". Using default repository values.");
throw e;
}
[11/31] ambari git commit: AMBARI-13277. Provide an option to not
start services in Install / Add Hosts / Add Service Wizard. Additional patch
(akovalenko)
Posted by nc...@apache.org.
AMBARI-13277. Provide an option to not start services in Install / Add Hosts / Add Service Wizard. Additional patch (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c53cfffd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c53cfffd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c53cfffd
Branch: refs/heads/branch-dev-patch-upgrade
Commit: c53cfffdd09774906a7a97b9b9fff6b4cd5c7c3d
Parents: 33c8681
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Mon Oct 5 15:19:16 2015 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Mon Oct 5 15:19:16 2015 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/wizard/step10_controller.js | 11 ++++++++++-
ambari-web/app/messages.js | 1 +
ambari-web/app/views/wizard/step9_view.js | 4 ++--
ambari-web/test/controllers/wizard/step10_test.js | 9 ++++++++-
4 files changed, 21 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/c53cfffd/ambari-web/app/controllers/wizard/step10_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step10_controller.js b/ambari-web/app/controllers/wizard/step10_controller.js
index ca1badb..874a864 100644
--- a/ambari-web/app/controllers/wizard/step10_controller.js
+++ b/ambari-web/app/controllers/wizard/step10_controller.js
@@ -211,7 +211,8 @@ App.WizardStep10Controller = Em.Controller.extend({
* @method loadStartedServices
*/
loadStartedServices: function () {
- if (this.get('content.cluster.status') === 'STARTED') {
+ var status = this.get('content.cluster.status');
+ if (status === 'STARTED') {
this.get('clusterInfo').pushObject(Em.Object.create({
id: 3,
color: 'text-success',
@@ -225,6 +226,14 @@ App.WizardStep10Controller = Em.Controller.extend({
status: []
}));
return true;
+ } else if (status === 'START_SKIPPED') {
+ this.get('clusterInfo').pushObject(Em.Object.create({
+ id: 3,
+ color: 'text-warning',
+ displayStatement: Em.I18n.t('installer.step10.startStatus.skipped'),
+ status: []
+ }));
+ return false
} else {
this.get('clusterInfo').pushObject(Em.Object.create({
id: 3,
http://git-wip-us.apache.org/repos/asf/ambari/blob/c53cfffd/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index d28127b..a3bb574 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -892,6 +892,7 @@ Em.I18n.translations = {
'installer.step10.installStatus.installed':'Master services installed',
'installer.step10.master.installedOn':'{0} installed on {1}',
'installer.step10.startStatus.failed':'Starting services failed',
+ 'installer.step10.startStatus.skipped':'Starting services skipped',
'installer.step10.startStatus.passed':'All tests passed',
'installer.step10.startStatus.started':'All services started',
'installer.step10.installTime.seconds':'Install and start completed in {0} seconds',
http://git-wip-us.apache.org/repos/asf/ambari/blob/c53cfffd/ambari-web/app/views/wizard/step9_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/step9_view.js b/ambari-web/app/views/wizard/step9_view.js
index 7bcec87..4864c8e 100644
--- a/ambari-web/app/views/wizard/step9_view.js
+++ b/ambari-web/app/views/wizard/step9_view.js
@@ -272,7 +272,7 @@ App.WizardStep9View = App.TableView.extend({
this.set('resultMsg', this.get('controller.content.cluster.status') === 'START_SKIPPED' ? Em.I18n.t('installer.step9.status.skipStartSuccess') : Em.I18n.t('installer.step9.status.success'));
this.set('resultMsgColor', 'alert-success');
}
- }.observes('controller.status', 'controller.startCallFailed','isHostHeartbeatLost'),
+ }.observes('controller.status', 'controller.content.cluster.status', 'controller.startCallFailed','isHostHeartbeatLost'),
/**
* Show popup with info about failed hosts
@@ -434,4 +434,4 @@ App.HostStatusView = Em.View.extend({
});
}
-});
\ No newline at end of file
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/c53cfffd/ambari-web/test/controllers/wizard/step10_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step10_test.js b/ambari-web/test/controllers/wizard/step10_test.js
index 9699919..0c2bbef 100644
--- a/ambari-web/test/controllers/wizard/step10_test.js
+++ b/ambari-web/test/controllers/wizard/step10_test.js
@@ -345,6 +345,13 @@ describe('App.WizardStep10Controller', function () {
ids: [3],
r: false
}
+ },
+ {
+ status: 'START_SKIPPED',
+ e: {
+ ids: [3],
+ r: false
+ }
}
]);
tests.forEach(function(test) {
@@ -432,4 +439,4 @@ describe('App.WizardStep10Controller', function () {
});
});
-});
\ No newline at end of file
+});
[24/31] ambari git commit: AMBARI-13211. Host checks does not report
all errors in the very first check after Ambari Agent gets
installed/registered.
Posted by nc...@apache.org.
AMBARI-13211. Host checks does not report all errors in the very first check after Ambari Agent gets installed/registered.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0d676b32
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0d676b32
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0d676b32
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0d676b3234a5f31c5b11d6b52e6648e44b39e09d
Parents: 7ffa43e
Author: Alex Antonenko <hi...@gmail.com>
Authored: Tue Oct 6 20:17:20 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Tue Oct 6 20:17:29 2015 +0300
----------------------------------------------------------------------
.../custom_actions/scripts/check_host.py | 2 +-
.../app/controllers/wizard/step3_controller.js | 303 +++++++++++-
.../test/controllers/wizard/step3_test.js | 488 +++++++++++++++++++
3 files changed, 790 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/0d676b32/ambari-server/src/main/resources/custom_actions/scripts/check_host.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/custom_actions/scripts/check_host.py b/ambari-server/src/main/resources/custom_actions/scripts/check_host.py
index 6f9a66c..8b49725 100644
--- a/ambari-server/src/main/resources/custom_actions/scripts/check_host.py
+++ b/ambari-server/src/main/resources/custom_actions/scripts/check_host.py
@@ -448,7 +448,7 @@ class CheckHost(Script):
print "Last Agent Env check started."
hostInfo = HostInfo()
last_agent_env_check_structured_output = { }
- hostInfo.register(last_agent_env_check_structured_output)
+ hostInfo.register(last_agent_env_check_structured_output, False, False)
print "Last Agent Env check completed successfully."
return last_agent_env_check_structured_output
http://git-wip-us.apache.org/repos/asf/ambari/blob/0d676b32/ambari-web/app/controllers/wizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js
index 054a364..b3645e9 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -71,6 +71,8 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
registrationStartedAt: null,
+ hostCheckResult: null,
+
requestId: 0,
/**
@@ -1081,6 +1083,13 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
installedPackages: installed_packages ? installed_packages : []
};
}));
+
+ console.log("Host check result available");
+ this.set("hostCheckResult", data); //store the data so that it can be used later on in the getHostInfo handling logic.
+ /**
+ * Still need to get host info for checks that the host check does not perform currently
+ * Such as the OS type check and the disk space check
+ * */
this.getHostInfo();
} else if (data.Requests.inputs.indexOf("host_resolution_check") != -1) {
this.parseHostNameResolution(data);
@@ -1091,6 +1100,288 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
}
},
+ parseHostCheckWarnings: function (data) {
+ data = App.get('testMode') ? data : this.filterHostsData(data);
+ var warnings = [];
+ var warning;
+ var hosts = [];
+ var warningCategories = {
+ fileFoldersWarnings: {},
+ packagesWarnings: {},
+ processesWarnings: {},
+ servicesWarnings: {},
+ usersWarnings: {},
+ alternativeWarnings: {}
+ };
+
+ var hostsPackagesData = this.get('hostsPackagesData');
+ data.tasks.sortPropertyLight('Tasks.host_name').forEach(function (_task) {
+ var hostName = _task.Tasks.host_name;
+ var host = {
+ name: hostName,
+ warnings: []
+ };
+
+ if (!_task.Tasks.structured_out || !_task.Tasks.structured_out.last_agent_env_check) {
+ console.log("last_agent_env is missing for " + hostName + ". Skipping host check.");
+ return;
+ }
+
+ var lastAgentEnvCheck = _task.Tasks.structured_out.last_agent_env_check;
+
+ //parse all directories and files warnings for host
+ var stackFoldersAndFiles = lastAgentEnvCheck.stackFoldersAndFiles || [];
+ stackFoldersAndFiles.forEach(function (path) {
+ warning = warningCategories.fileFoldersWarnings[path.name];
+ if (warning) {
+ warning.hosts.push(hostName);
+ warning.hostsLong.push(hostName);
+ warning.onSingleHost = false;
+ } else {
+ warningCategories.fileFoldersWarnings[path.name] = warning = {
+ name: path.name,
+ hosts: [hostName],
+ hostsLong: [hostName],
+ category: 'fileFolders',
+ onSingleHost: true
+ };
+ }
+ host.warnings.push(warning);
+ }, this);
+
+ //parse all package warnings for host
+ var _hostPackagesData = hostsPackagesData.findProperty('hostName', hostName);
+
+ if (_hostPackagesData) {
+ _hostPackagesData.installedPackages.forEach(function (_package) {
+ warning = warningCategories.packagesWarnings[_package.name];
+ if (warning) {
+ warning.hosts.push(hostName);
+ warning.hostsLong.push(hostName);
+ warning.version = _package.version;
+ warning.onSingleHost = false;
+ } else {
+ warningCategories.packagesWarnings[_package.name] = warning = {
+ name: _package.name,
+ version: _package.version,
+ hosts: [hostName],
+ hostsLong: [hostName],
+ category: 'packages',
+ onSingleHost: true
+ };
+ }
+ host.warnings.push(warning);
+ }, this);
+ }
+
+ //parse all process warnings for host
+ var hostHealth = lastAgentEnvCheck.hostHealth;
+
+ var liveServices = null;
+ var javaProcs = null;
+
+ if(hostHealth) {
+ if(hostHealth.activeJavaProcs)
+ javaProcs = hostHealth.activeJavaProcs;
+ if(hostHealth.liveServices)
+ liveServices = hostHealth.liveServices;
+ }
+
+ if (javaProcs) {
+ javaProcs.forEach(function (process) {
+ warning = warningCategories.processesWarnings[process.pid];
+ if (warning) {
+ warning.hosts.push(hostName);
+ warning.hostsLong.push(hostName);
+ warning.onSingleHost = false;
+ } else {
+ warningCategories.processesWarnings[process.pid] = warning = {
+ name: (process.command.substr(0, 35) + '...'),
+ hosts: [hostName],
+ hostsLong: [hostName],
+ category: 'processes',
+ user: process.user,
+ pid: process.pid,
+ command: '<table><tr><td style="word-break: break-all;">' +
+ ((process.command.length < 500) ? process.command : process.command.substr(0, 230) + '...' +
+ '<p style="text-align: center">................</p>' +
+ '...' + process.command.substr(-230)) + '</td></tr></table>',
+ onSingleHost: true
+ };
+ }
+ host.warnings.push(warning);
+ }, this);
+ }
+
+ //parse all service warnings for host
+ if (liveServices) {
+ liveServices.forEach(function (service) {
+ if (service.status === 'Unhealthy') {
+ warning = warningCategories.servicesWarnings[service.name];
+ if (warning) {
+ warning.hosts.push(hostName);
+ warning.hostsLong.push(hostName);
+ warning.onSingleHost = false;
+ } else {
+ warningCategories.servicesWarnings[service.name] = warning = {
+ name: service.name,
+ hosts: [hostName],
+ hostsLong: [hostName],
+ category: 'services',
+ onSingleHost: true
+ };
+ }
+ host.warnings.push(warning);
+ }
+ }, this);
+ }
+ //parse all user warnings for host
+ var existingUsers = lastAgentEnvCheck.existingUsers;
+ if (existingUsers) {
+ existingUsers.forEach(function (user) {
+ warning = warningCategories.usersWarnings[user.userName];
+ if (warning) {
+ warning.hosts.push(hostName);
+ warning.hostsLong.push(hostName);
+ warning.onSingleHost = false;
+ } else {
+ warningCategories.usersWarnings[user.userName] = warning = {
+ name: user.userName,
+ hosts: [hostName],
+ hostsLong: [hostName],
+ category: 'users',
+ onSingleHost: true
+ };
+ }
+ host.warnings.push(warning);
+ }, this);
+ }
+
+ //parse misc warnings for host
+ var umask = lastAgentEnvCheck.umask;
+ if (umask && umask > 23) {
+ warning = warnings.filterProperty('category', 'misc').findProperty('name', umask);
+ if (warning) {
+ warning.hosts.push(hostName);
+ warning.hostsLong.push(hostName);
+ warning.onSingleHost = false;
+ } else {
+ warning = {
+ name: umask,
+ hosts: [hostName],
+ hostsLong: [hostName],
+ category: 'misc',
+ onSingleHost: true
+ };
+ warnings.push(warning);
+ }
+ host.warnings.push(warning);
+ }
+
+ var firewallRunning = lastAgentEnvCheck.firewallRunning;
+ if (firewallRunning !== null && firewallRunning) {
+ var name = lastAgentEnvCheck.firewallName + " Running";
+ warning = warnings.filterProperty('category', 'firewall').findProperty('name', name);
+ if (warning) {
+ warning.hosts.push(hostName);
+ warning.hostsLong.push(hostName);
+ warning.onSingleHost = false;
+ } else {
+ warning = {
+ name: name,
+ hosts: [hostName],
+ hostsLong: [hostName],
+ category: 'firewall',
+ onSingleHost: true
+ };
+ warnings.push(warning);
+ }
+ host.warnings.push(warning);
+ }
+
+ if (lastAgentEnvCheck.alternatives) {
+ lastAgentEnvCheck.alternatives.forEach(function (alternative) {
+ warning = warningCategories.alternativeWarnings[alternative.name];
+ if (warning) {
+ warning.hosts.push(hostName);
+ warning.hostsLong.push(hostName);
+ warning.onSingleHost = false;
+ } else {
+ warningCategories.alternativeWarnings[alternative.name] = warning = {
+ name: alternative.name,
+ target: alternative.target,
+ hosts: [hostName],
+ hostsLong: [hostName],
+ category: 'alternatives',
+ onSingleHost: true
+ };
+ }
+ host.warnings.push(warning);
+ }, this);
+ }
+
+ if (lastAgentEnvCheck.reverseLookup === false) {
+ var name = Em.I18n.t('installer.step3.hostWarningsPopup.reverseLookup.name');
+ warning = warnings.filterProperty('category', 'reverseLookup').findProperty('name', name);
+ console.log("warning--"+warning);
+ if (warning) {
+ warning.hosts.push(hostName);
+ warning.hostsLong.push(hostName);
+ warning.onSingleHost = false;
+ } else {
+ warning = {
+ name: name,
+ hosts: [hostName],
+ hostsLong: [hostName],
+ category: 'reverseLookup',
+ onSingleHost: true
+ };
+ warnings.push(warning);
+ }
+ host.warnings.push(warning);
+ }
+ hosts.push(host);
+ }, this);
+
+ for (var categoryId in warningCategories) {
+ var category = warningCategories[categoryId];
+ for (var warningId in category) {
+ warnings.push(category[warningId]);
+ }
+ }
+
+ hosts.unshift({
+ name: 'All Hosts',
+ warnings: warnings
+ });
+ this.set('warnings', warnings);
+ this.set('warningsByHost', hosts);
+ },
+
+ /**
+ * Filter data for warnings parse
+ * is data from host in bootStrap
+ * @param {object} data
+ * @return {Object}
+ * @method filterBootHosts
+ */
+ filterHostsData: function (data) {
+ var bootHostNames = {};
+ this.get('bootHosts').forEach(function (bootHost) {
+ bootHostNames[bootHost.get('name')] = true;
+ });
+ var filteredData = {
+ href: data.href,
+ tasks: []
+ };
+ data.tasks.forEach(function (_task) {
+ if (bootHostNames[_task.Tasks.host_name]) {
+ filteredData.tasks.push(_task);
+ }
+ });
+ return filteredData;
+ },
+
/**
* parse warnings for host names resolution only
* @param {object} data
@@ -1143,7 +1434,7 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
* @method getHostCheckTasksError
*/
getHostCheckTasksError: function() {
- console.warn("failed to cheek hostName resolution");
+ console.warn("failed to check hostName resolution");
this.set('stopChecking', true);
},
@@ -1160,7 +1451,15 @@ App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, {
thpWarnings = [], thpContext = [], thpHostsNames = [];
// parse host checks warning
- this.parseWarnings(jsonData);
+ var hostCheckResult = this.get("hostCheckResult");
+ if(hostCheckResult){
+ console.log("Parsing available host check result...");
+ this.parseHostCheckWarnings(hostCheckResult);
+ this.set("hostCheckResult", null);
+ } else {
+ console.log("Parsing host info result...");
+ this.parseWarnings(jsonData);
+ }
this.set('isHostsWarningsLoaded', true);
hosts.forEach(function (_host) {
var host = (App.get('testMode')) ? jsonData.items[0] : jsonData.items.findProperty('Hosts.host_name', _host.name);
http://git-wip-us.apache.org/repos/asf/ambari/blob/0d676b32/ambari-web/test/controllers/wizard/step3_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step3_test.js b/ambari-web/test/controllers/wizard/step3_test.js
index aad0509..74c62e6 100644
--- a/ambari-web/test/controllers/wizard/step3_test.js
+++ b/ambari-web/test/controllers/wizard/step3_test.js
@@ -1314,6 +1314,494 @@ describe('App.WizardStep3Controller', function () {
});
});
+ describe('#parseHostCheckWarnings', function () {
+
+ beforeEach(function () {
+ sinon.stub(App, 'get', function (k) {
+ if ('testMode' === k) return false;
+ return Em.get(App, k);
+ });
+ sinon.stub(c, 'filterHostsData', function (k) {
+ return k;
+ });
+ });
+
+ afterEach(function () {
+ App.get.restore();
+ c.filterHostsData.restore();
+ });
+
+ it('no warnings if last_agent_env isn\'t specified', function () {
+ c.set('warnings', [
+ {}
+ ]);
+ c.set('warningsByHost', [
+ {},
+ {}
+ ]);
+ c.parseHostCheckWarnings({tasks: [
+ {Tasks: {host_name: 'c1'}}
+ ]});
+ expect(c.get('warnings')).to.eql([]);
+ expect(c.get('warningsByHost.length')).to.equal(1); // default group
+ });
+
+ Em.A([
+ {
+ m: 'parse stackFoldersAndFiles',
+ tests: Em.A([
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out:{last_agent_env_check: {stackFoldersAndFiles: []}}
+ }
+ }
+ ],
+ m: 'empty stackFoldersAndFiles',
+ e: {
+ warnings: [],
+ warningsByHost: [0]
+ }
+ },
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out: {last_agent_env_check: {stackFoldersAndFiles: [{name: 'n1'}]}}
+ }
+ }
+ ],
+ m: 'not empty stackFoldersAndFiles',
+ e: {
+ warnings: [
+ {
+ name: 'n1',
+ hosts: ['c1'],
+ onSingleHost: true,
+ category: 'fileFolders'
+ }
+ ],
+ warningsByHost: [1]
+ }
+ },
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1', structured_out:{last_agent_env_check: {stackFoldersAndFiles: [
+ {name: 'n1'}
+ ]}}}},
+ {Tasks: {host_name: 'c2', structured_out: {last_agent_env_check: {stackFoldersAndFiles: [
+ {name: 'n1'}
+ ]}}}}
+ ],
+ m: 'not empty stackFoldersAndFiles on two hosts',
+ e: {
+ warnings: [
+ {
+ name: 'n1',
+ hosts: ['c1', 'c2'],
+ onSingleHost: false,
+ category: 'fileFolders'
+ }
+ ],
+ warningsByHost: [1]
+ }
+ }
+ ])
+ },
+ {
+ m: 'parse hostHealth.liveServices',
+ tests: Em.A([
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1', structured_out: {last_agent_env_check: {hostHealth: []}}}}
+ ],
+ m: 'empty hostHealth',
+ e: {
+ warnings: [],
+ warningsByHost: [0]
+ }
+ },
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1', structured_out: {last_agent_env_check: {hostHealth: {liveServices: []}}}}}
+ ],
+ m: 'empty liveServices',
+ e: {
+ warnings: [],
+ warningsByHost: [0]
+ }
+ },
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out: {last_agent_env_check: {hostHealth: {liveServices: [{status: 'Unhealthy', name: 'n1'}]}}}
+ }
+ }
+ ],
+ m: 'not empty hostHealth.liveServices',
+ e: {
+ warnings: [
+ {
+ name: 'n1',
+ hosts: ['c1'],
+ onSingleHost: true,
+ category: 'services'
+ }
+ ],
+ warningsByHost: [1]
+ }
+ },
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out:{last_agent_env_check: {hostHealth: {liveServices: [{status: 'Unhealthy', name: 'n1'}]}}}
+ }
+ },
+
+ {Tasks: {host_name: 'c2',
+ structured_out:{last_agent_env_check: {hostHealth: {liveServices: [{status: 'Unhealthy', name: 'n1'}]}}}
+ }
+ }
+ ],
+ m: 'not empty hostHealth.liveServices on two hosts',
+ e: {
+ warnings: [
+ {
+ name: 'n1',
+ hosts: ['c1', 'c2'],
+ onSingleHost: false,
+ category: 'services'
+ }
+ ],
+ warningsByHost: [1, 1]
+ }
+ }
+ ])
+ },
+ {
+ m: 'parse existingUsers',
+ tests: Em.A([
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out: {last_agent_env_check: {existingUsers: []}}
+ }
+ }
+ ],
+ m: 'empty existingUsers',
+ e: {
+ warnings: [],
+ warningsByHost: [0]
+ }
+ },
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out: {last_agent_env_check: {existingUsers: [{userName: 'n1'}]}}
+ }
+ }
+ ],
+ m: 'not empty existingUsers',
+ e: {
+ warnings: [
+ {
+ name: 'n1',
+ hosts: ['c1'],
+ onSingleHost: true,
+ category: 'users'
+ }
+ ],
+ warningsByHost: [1]
+ }
+ },
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out:{last_agent_env_check: {existingUsers: [{userName: 'n1'}]}}
+ }
+ },
+ {Tasks: {host_name: 'c2',
+ structured_out:{last_agent_env_check: {existingUsers: [{userName: 'n1'}]}}
+ }
+ }
+ ],
+ m: 'not empty existingUsers on two hosts',
+ e: {
+ warnings: [
+ {
+ name: 'n1',
+ hosts: ['c1', 'c2'],
+ onSingleHost: false,
+ category: 'users'
+ }
+ ],
+ warningsByHost: [1, 1]
+ }
+ }
+ ])
+ },
+ {
+ m: 'parse alternatives',
+ tests: Em.A([
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out:{last_agent_env_check: {alternatives: []}}
+ }
+ }
+ ],
+ m: 'empty alternatives',
+ e: {
+ warnings: [],
+ warningsByHost: [0]
+ }
+ },
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out: {last_agent_env_check: {alternatives: [{name: 'n1'}]}}
+ }
+ }
+ ],
+ m: 'not empty alternatives',
+ e: {
+ warnings: [
+ {
+ name: 'n1',
+ hosts: ['c1'],
+ onSingleHost: true,
+ category: 'alternatives'
+ }
+ ],
+ warningsByHost: [1]
+ }
+ },
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out:{last_agent_env_check: {alternatives: [{name: 'n1'}]}}
+ }
+ },
+ {Tasks: {host_name: 'c2',
+ structured_out:{last_agent_env_check: {alternatives: [{name: 'n1'}]}}
+ }
+ }
+ ],
+ m: 'not empty alternatives on two hosts',
+ e: {
+ warnings: [
+ {
+ name: 'n1',
+ hosts: ['c1', 'c2'],
+ onSingleHost: false,
+ category: 'alternatives'
+ }
+ ],
+ warningsByHost: [1, 1]
+ }
+ }
+ ])
+ },
+ {
+ m: 'parse hostHealth.activeJavaProcs',
+ tests: Em.A([
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out:{last_agent_env_check: {hostHealth: [], javaProcs: []}}
+ }
+ }
+ ],
+ m: 'empty hostHealth',
+ e: {
+ warnings: [],
+ warningsByHost: [0]
+ }
+ },
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1', structured_out:{last_agent_env_check: {hostHealth: {activeJavaProcs: []}}}}}
+ ],
+ m: 'empty activeJavaProcs',
+ e: {
+ warnings: [],
+ warningsByHost: [0]
+ }
+ },
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out:{last_agent_env_check: {hostHealth: {activeJavaProcs: [{pid: 'n1', command: ''}]}}}
+ }
+ }
+ ],
+ m: 'not empty hostHealth.activeJavaProcs',
+ e: {
+ warnings: [
+ {
+ pid: 'n1',
+ hosts: ['c1'],
+ onSingleHost: true,
+ category: 'processes'
+ }
+ ],
+ warningsByHost: [1]
+ }
+ },
+ {
+ tasks: [
+ {Tasks: {host_name: 'c1',
+ structured_out:{last_agent_env_check: {hostHealth: {activeJavaProcs: [{pid: 'n1', command: ''}]}}}
+ }
+ },
+ {Tasks: {host_name: 'c2',
+ structured_out:{last_agent_env_check: {hostHealth: {activeJavaProcs: [{pid: 'n1', command: ''}]}}}
+ }
+ }
+ ],
+ m: 'not empty hostHealth.activeJavaProcs on two hosts',
+ e: {
+ warnings: [
+ {
+ pid: 'n1',
+ hosts: ['c1', 'c2'],
+ onSingleHost: false,
+ category: 'processes'
+ }
+ ],
+ warningsByHost: [1, 1]
+ }
+ }
+ ])
+ }
+ ]).forEach(function (category) {
+ describe(category.m, function () {
+ category.tests.forEach(function (test) {
+ it(test.m, function () {
+ c.parseHostCheckWarnings({tasks: test.tasks});
+ c.get('warnings').forEach(function (w, i) {
+ Em.keys(test.e.warnings[i]).forEach(function (k) {
+ expect(w[k]).to.eql(test.e.warnings[i][k]);
+ });
+ });
+ for (var i in test.e.warningsByHost) {
+ if (test.e.warningsByHost.hasOwnProperty(i)) {
+ expect(c.get('warningsByHost')[i].warnings.length).to.equal(test.e.warningsByHost[i]);
+ }
+ }
+ });
+ });
+ });
+ });
+
+ it('should parse umask warnings', function () {
+
+ var tasks = [
+ {Tasks: {host_name: 'c1', structured_out:{last_agent_env_check: {umask: 24}}}},
+ {Tasks: {host_name: 'c2', structured_out:{last_agent_env_check: {umask: 1}}}}
+ ];
+
+ c.parseHostCheckWarnings({tasks: tasks});
+ var warnings = c.get('warnings');
+ expect(warnings.length).to.equal(1);
+ expect(warnings[0].hosts).to.eql(['c1']);
+ expect(warnings[0].hostsLong).to.eql(['c1']);
+ expect(warnings[0].onSingleHost).to.equal(true);
+
+ });
+
+ it('should parse umask warnings (2)', function () {
+
+ var tasks = [
+ {Tasks: {host_name: 'c1', structured_out:{last_agent_env_check: {umask: 24}}}},
+ {Tasks: {host_name: 'c2', structured_out:{last_agent_env_check: {umask: 25}}}}
+ ];
+
+ c.parseHostCheckWarnings({tasks: tasks});
+ var warnings = c.get('warnings');
+ expect(warnings.length).to.equal(2);
+ expect(warnings.mapProperty('hosts')).to.eql([
+ ['c1'],
+ ['c2']
+ ]);
+
+ });
+
+ it('should parse firewall warnings', function () {
+
+ var tasks = [
+ {Tasks: {host_name: 'c1', structured_out:{last_agent_env_check: {firewallRunning: true, firewallName: "iptables"}}}},
+ {Tasks: {host_name: 'c2', structured_out:{last_agent_env_check: {firewallRunning: false, firewallName: "iptables"}}}}
+ ];
+
+ c.parseHostCheckWarnings({tasks: tasks});
+ var warnings = c.get('warnings');
+ expect(warnings.length).to.equal(1);
+ expect(warnings[0].hosts).to.eql(['c1']);
+ expect(warnings[0].hostsLong).to.eql(['c1']);
+ expect(warnings[0].onSingleHost).to.equal(true);
+
+ });
+
+ it('should parse firewall warnings (2)', function () {
+
+ var tasks = [
+ {Tasks: {host_name: 'c1', structured_out:{last_agent_env_check: {firewallRunning: true, firewallName: "iptables"}}}},
+ {Tasks: {host_name: 'c2', structured_out:{last_agent_env_check: {firewallRunning: true, firewallName: "iptables"}}}}
+ ];
+
+ c.parseHostCheckWarnings({tasks: tasks});
+ var warnings = c.get('warnings');
+ expect(warnings.length).to.equal(1);
+ expect(warnings[0].hosts).to.eql(['c1', 'c2']);
+ expect(warnings[0].hostsLong).to.eql(['c1', 'c2']);
+ expect(warnings[0].onSingleHost).to.equal(false);
+
+ });
+
+ it('should parse reverseLookup warnings', function () {
+
+ var tasks = [
+ {Tasks: {host_name: 'c1', structured_out:{last_agent_env_check: {reverseLookup: true}}}}
+ ];
+
+ c.parseHostCheckWarnings({tasks: tasks});
+ var warnings = c.get('warnings');
+ expect(warnings.length).to.equal(0);
+
+ });
+
+ it('should parse reverseLookup warnings (2)', function () {
+
+ var tasks = [
+ {Tasks: {host_name: 'c1', structured_out:{last_agent_env_check: {reverseLookup: false}}}}
+ ];
+
+ c.parseHostCheckWarnings({tasks: tasks});
+ var warnings = c.get('warnings');
+ expect(warnings.length).to.equal(1);
+ expect(warnings[0].hosts).to.eql(['c1']);
+ expect(warnings[0].hostsLong).to.eql(['c1']);
+ expect(warnings[0].onSingleHost).to.equal(true);
+
+ });
+
+ it('should parse reverseLookup warnings (3)', function () {
+
+ var tasks = [
+ {Tasks: {host_name: 'c1', structured_out:{last_agent_env_check: {reverseLookup: false}}}},
+ {Tasks: {host_name: 'c2', structured_out:{last_agent_env_check: {reverseLookup: false}}}}
+ ];
+
+ c.parseHostCheckWarnings({tasks: tasks});
+ var warnings = c.get('warnings');
+ expect(warnings.length).to.equal(1);
+ expect(warnings[0].hosts).to.eql(['c1', 'c2']);
+ expect(warnings[0].hostsLong).to.eql(['c1', 'c2']);
+ expect(warnings[0].onSingleHost).to.equal(false);
+
+ });
+ });
+
describe('#parseWarnings', function () {
beforeEach(function () {
[08/31] ambari git commit: Revert "AMBARI-13308. Config Versions list
isn't updated while user is on the configs page after adding/removing
HiveServer2 (onechiporenko)"
Posted by nc...@apache.org.
Revert "AMBARI-13308. Config Versions list isn't updated while user is on the configs page after adding/removing HiveServer2 (onechiporenko)"
This reverts commit 920c29dd8d17f874448855398813e140863caf35.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a845a44a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a845a44a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a845a44a
Branch: refs/heads/branch-dev-patch-upgrade
Commit: a845a44a22c6a2ba6222a110359233f365feb51b
Parents: 920c29d
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Oct 5 13:21:07 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon Oct 5 13:21:07 2015 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/main/host/details.js | 5 ++---
ambari-web/test/controllers/main/host/details_test.js | 9 ---------
2 files changed, 2 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/a845a44a/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index 30304b2..507e375 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -433,7 +433,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
self.isServiceMetricsLoaded(function () {
self.loadConfigs();
});
- } else if (['HIVE_METASTORE', 'HIVE_SERVER'].contains(data.componentName)) {
+ } else if (data.componentName == 'HIVE_METASTORE') {
this.set('deleteHiveMetaStore', true);
this.loadConfigs('loadHiveConfigs');
} else if (data.componentName == 'NIMBUS') {
@@ -588,7 +588,6 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
}, Em.I18n.t('hosts.host.addComponent.' + componentName) + manualKerberosWarning);
break;
case 'HIVE_METASTORE':
- case 'HIVE_SERVER':
returnFunc = App.showConfirmationPopup(function () {
self.set('hiveMetastoreHost', hostName);
self.loadConfigs("loadHiveConfigs");
@@ -672,7 +671,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
* @param {object} data
* @param {object} opt
* @param {object} params
- * @method installNewComponentSuccessCallback
+ * @method installNewComponentSuccessCallbÆ’ack
*/
installNewComponentSuccessCallback: function (data, opt, params) {
if (!data || !data.Requests || !data.Requests.id) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/a845a44a/ambari-web/test/controllers/main/host/details_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js
index 846b3ef..673eb8f 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -2399,15 +2399,6 @@ describe('App.MainHostDetailsController', function () {
expect(controller.get('deleteHiveMetaStore')).to.be.true;
expect(controller.loadConfigs.calledWith('loadHiveConfigs')).to.be.true;
});
- it('HIVE_SERVER component', function () {
- var data = {
- componentName: 'HIVE_SERVER'
- };
- controller._doDeleteHostComponentSuccessCallback({}, {}, data);
- expect(controller.get('_deletedHostComponentResult')).to.be.null;
- expect(controller.get('deleteHiveMetaStore')).to.be.true;
- expect(controller.loadConfigs.calledWith('loadHiveConfigs')).to.be.true;
- });
it('NIMBUS component', function () {
var data = {
componentName: 'NIMBUS'
[07/31] ambari git commit: AMBARI-13308. Config Versions list isn't
updated while user is on the configs page after adding/removing HiveServer2
(onechiporenko)
Posted by nc...@apache.org.
AMBARI-13308. Config Versions list isn't updated while user is on the configs page after adding/removing HiveServer2 (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/920c29dd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/920c29dd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/920c29dd
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 920c29dd8d17f874448855398813e140863caf35
Parents: b8be80b
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Mon Oct 5 12:49:30 2015 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Mon Oct 5 12:49:30 2015 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/main/host/details.js | 5 +++--
ambari-web/test/controllers/main/host/details_test.js | 9 +++++++++
2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/920c29dd/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index 507e375..30304b2 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -433,7 +433,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
self.isServiceMetricsLoaded(function () {
self.loadConfigs();
});
- } else if (data.componentName == 'HIVE_METASTORE') {
+ } else if (['HIVE_METASTORE', 'HIVE_SERVER'].contains(data.componentName)) {
this.set('deleteHiveMetaStore', true);
this.loadConfigs('loadHiveConfigs');
} else if (data.componentName == 'NIMBUS') {
@@ -588,6 +588,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
}, Em.I18n.t('hosts.host.addComponent.' + componentName) + manualKerberosWarning);
break;
case 'HIVE_METASTORE':
+ case 'HIVE_SERVER':
returnFunc = App.showConfirmationPopup(function () {
self.set('hiveMetastoreHost', hostName);
self.loadConfigs("loadHiveConfigs");
@@ -671,7 +672,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
* @param {object} data
* @param {object} opt
* @param {object} params
- * @method installNewComponentSuccessCallbÆ’ack
+ * @method installNewComponentSuccessCallback
*/
installNewComponentSuccessCallback: function (data, opt, params) {
if (!data || !data.Requests || !data.Requests.id) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/920c29dd/ambari-web/test/controllers/main/host/details_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js
index 673eb8f..846b3ef 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -2399,6 +2399,15 @@ describe('App.MainHostDetailsController', function () {
expect(controller.get('deleteHiveMetaStore')).to.be.true;
expect(controller.loadConfigs.calledWith('loadHiveConfigs')).to.be.true;
});
+ it('HIVE_SERVER component', function () {
+ var data = {
+ componentName: 'HIVE_SERVER'
+ };
+ controller._doDeleteHostComponentSuccessCallback({}, {}, data);
+ expect(controller.get('_deletedHostComponentResult')).to.be.null;
+ expect(controller.get('deleteHiveMetaStore')).to.be.true;
+ expect(controller.loadConfigs.calledWith('loadHiveConfigs')).to.be.true;
+ });
it('NIMBUS component', function () {
var data = {
componentName: 'NIMBUS'
[13/31] ambari git commit: AMBARI-13054 Pre-Req Endpoint Should Be
Used For Determining Upgrade Button Visibility. (atkach)
Posted by nc...@apache.org.
AMBARI-13054 Pre-Req Endpoint Should Be Used For Determining Upgrade Button Visibility. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ce8238b6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ce8238b6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ce8238b6
Branch: refs/heads/branch-dev-patch-upgrade
Commit: ce8238b605449bee2134cfa8880b44d5fc8545f8
Parents: f20ebd7
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Mon Oct 5 16:14:12 2015 +0300
Committer: Andrii Tkach <at...@hortonworks.com>
Committed: Mon Oct 5 16:14:36 2015 +0300
----------------------------------------------------------------------
.../stack_upgrade/upgrade_version_box_view.js | 50 +-----
.../upgrade_version_box_view_test.js | 165 +++++++------------
2 files changed, 63 insertions(+), 152 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/ce8238b6/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
index faf389a..44d295e 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
@@ -32,12 +32,6 @@ App.UpgradeVersionBoxView = Em.View.extend({
PROGRESS_STATUS: 'IN_PROGRESS',
/**
- * flag that verify Upgrade availability when version in INSTALL_FAILED state
- * @type {boolean}
- */
- isUpgradeAvailable: false,
-
- /**
* @type {boolean}
*/
upgradeCheckInProgress: false,
@@ -132,7 +126,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
element.set('text', Em.I18n.t('common.current'));
element.set('class', 'label label-success');
}
- else if (['INIT', 'INSTALL_FAILED', 'OUT_OF_SYNC'].contains(status) && !this.get('isUpgradeAvailable')) {
+ else if (status === 'INIT') {
element.set('isButton', true);
element.set('text', Em.I18n.t('admin.stackVersions.version.installNow'));
element.set('action', 'installRepoVersionConfirmation');
@@ -145,7 +139,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
element.set('action', 'showProgressPopup');
}
else if ((status === 'INSTALLED' && !this.get('isUpgrading')) ||
- (['INSTALL_FAILED', 'OUT_OF_SYNC'].contains(status) && this.get('isUpgradeAvailable'))) {
+ (['INSTALL_FAILED', 'OUT_OF_SYNC'].contains(status))) {
if (stringUtils.compareVersions(this.get('content.repositoryVersion'), Em.get(currentVersion, 'repository_version')) === 1) {
var isDisabled = !App.isAccessible('ADMIN') || this.get('controller.requestInProgress') || isInstalling;
element.set('isButtonGroup', true);
@@ -207,12 +201,10 @@ App.UpgradeVersionBoxView = Em.View.extend({
'isUpgrading',
'controller.requestInProgress',
'parentView.repoVersions.@each.status',
- 'isUpgradeAvailable',
'App.router.mainAdminStackAndUpgradeController.isSuspended'
),
didInsertElement: function () {
- this.checkUpgradeAvailability();
App.tooltip($('.link-tooltip'), {title: Em.I18n.t('admin.stackVersions.version.linkTooltip')});
App.tooltip($('.hosts-tooltip'));
App.tooltip($('.out-of-sync-badge'), {title: Em.I18n.t('hosts.host.stackVersions.status.out_of_sync')});
@@ -376,43 +368,5 @@ App.UpgradeVersionBoxView = Em.View.extend({
App.router.get('mainHostController').filterByStack(displayName, state);
App.router.get('mainHostController').set('showFilterConditionsFirstLoad', true);
App.router.transitionTo('hosts.index');
- },
-
- /**
- * when version in INSTALL_FAILED state it still could be upgraded if check passed
- */
- checkUpgradeAvailability: function () {
- if (['INSTALL_FAILED', 'OUT_OF_SYNC'].contains(this.get('content.status'))) {
- this.runUpgradeCheck();
- }
- }.observes('content.status'),
-
- /**
- * run Upgrade Check
- */
- runUpgradeCheck: function() {
- if (App.get('supports.preUpgradeCheck') && !this.get('upgradeCheckInProgress')) {
- App.ajax.send({
- name: "admin.rolling_upgrade.pre_upgrade_check",
- sender: this,
- data: {
- value: this.get('content.repositoryVersion'),
- label: this.get('content.displayName')
- },
- success: "runUpgradeCheckSuccess",
- error: "runUpgradeCheckError"
- });
- this.set('upgradeCheckInProgress', true);
- }
- },
-
- runUpgradeCheckSuccess: function (data) {
- this.set('isUpgradeAvailable', !data.items.someProperty('UpgradeChecks.status', 'FAIL'));
- this.set('upgradeCheckInProgress', false);
- },
-
- runUpgradeCheckError: function() {
- this.set('isUpgradeAvailable', false);
- this.set('upgradeCheckInProgress', false);
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ce8238b6/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
index 0911a4d..a638687 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
@@ -393,18 +393,30 @@ describe('App.UpgradeVersionBoxView', function () {
Em.Object.create({
status: 'INSTALLING'
})
- ]
+ ],
+ 'controller.currentVersion': {
+ repository_version: '2.2.0'
+ },
+ 'content.repositoryVersion': '2.2.1',
+ 'controller.upgradeVersion': 'HDP-2.2.0',
+ 'content.displayName': 'HDP-2.2.1'
},
setup: function () {
this.isAccessibleMock.withArgs('ADMIN').returns(false);
},
expected: {
status: 'INSTALL_FAILED',
- isButton: true,
- buttons: [],
+ isButtonGroup: true,
+ buttons: [{
+ text: Em.I18n.t('admin.stackVersions.version.reinstall'),
+ action: 'installRepoVersionConfirmation',
+ isDisabled: true
+ }],
+ text: Em.I18n.t('admin.stackVersions.version.performUpgrade'),
+ action: 'confirmUpgrade',
isDisabled: true
},
- title: 'install failed, no admin access, request in progress, another installation running'
+ title: 'INSTALL_FAILED state, no admin access, request in progress, another installation running'
},
{
inputData: {
@@ -417,46 +429,30 @@ describe('App.UpgradeVersionBoxView', function () {
Em.Object.create({
status: 'INSTALLING'
})
- ]
- },
- setup: function () {
- this.isAccessibleMock.withArgs('ADMIN').returns(false);
- },
- expected: {
- status: 'INSTALL_FAILED',
- isButton: true,
- buttons: [],
- isDisabled: true
- },
- title: 'install failed, no admin access, no requests in progress, another installation running'
- },
- {
- inputData: {
+ ],
'controller.currentVersion': {
repository_version: '2.2.0'
},
'content.repositoryVersion': '2.2.1',
- 'content.status': 'INSTALL_FAILED',
- 'controller.requestInProgress': false,
- 'parentView.repoVersions': [],
- 'isUpgradeAvailable': true
+ 'controller.upgradeVersion': 'HDP-2.2.0',
+ 'content.displayName': 'HDP-2.2.1'
},
setup: function () {
- this.isAccessibleMock.withArgs('ADMIN').returns(true);
+ this.isAccessibleMock.withArgs('ADMIN').returns(false);
},
expected: {
status: 'INSTALL_FAILED',
isButtonGroup: true,
- buttons: [
- {
- text: Em.I18n.t('admin.stackVersions.version.reinstall'),
- action: 'installRepoVersionConfirmation',
- isDisabled: false
- }
- ],
- isDisabled: false
+ buttons: [{
+ text: Em.I18n.t('admin.stackVersions.version.reinstall'),
+ action: 'installRepoVersionConfirmation',
+ isDisabled: true
+ }],
+ text: Em.I18n.t('admin.stackVersions.version.performUpgrade'),
+ action: 'confirmUpgrade',
+ isDisabled: true
},
- title: 'install failed version should be enabled to Upgrade'
+ title: 'INSTALL_FAILED state, no admin access, no requests in progress, another installation running'
},
{
inputData: {
@@ -466,18 +462,30 @@ describe('App.UpgradeVersionBoxView', function () {
Em.Object.create({
status: 'OUT_OF_SYNC'
})
- ]
+ ],
+ 'controller.currentVersion': {
+ repository_version: '2.2.0'
+ },
+ 'content.repositoryVersion': '2.2.1',
+ 'controller.upgradeVersion': 'HDP-2.2.0',
+ 'content.displayName': 'HDP-2.2.1'
},
setup: function () {
this.isAccessibleMock.withArgs('ADMIN').returns(true);
},
expected: {
status: 'OUT_OF_SYNC',
- isButton: true,
- buttons: [],
+ isButtonGroup: true,
+ buttons: [{
+ text: Em.I18n.t('admin.stackVersions.version.reinstall'),
+ action: 'installRepoVersionConfirmation',
+ isDisabled: false
+ }],
+ text: Em.I18n.t('admin.stackVersions.version.performUpgrade'),
+ action: 'confirmUpgrade',
isDisabled: false
},
- title: 'version out of sync, admin access, no requests in progress, no installation'
+ title: 'OUT_OF_SYNC state, admin access, no requests in progress, no installation'
},
{
inputData: {
@@ -487,18 +495,30 @@ describe('App.UpgradeVersionBoxView', function () {
Em.Object.create({
status: 'OUT_OF_SYNC'
})
- ]
+ ],
+ 'controller.currentVersion': {
+ repository_version: '2.2.0'
+ },
+ 'content.repositoryVersion': '2.2.1',
+ 'controller.upgradeVersion': 'HDP-2.2.0',
+ 'content.displayName': 'HDP-2.2.1'
},
setup: function () {
this.isAccessibleMock.withArgs('ADMIN').returns(true);
},
expected: {
status: 'OUT_OF_SYNC',
- isButton: true,
- buttons: [],
+ isButtonGroup: true,
+ buttons: [{
+ text: Em.I18n.t('admin.stackVersions.version.reinstall'),
+ action: 'installRepoVersionConfirmation',
+ isDisabled: true
+ }],
+ text: Em.I18n.t('admin.stackVersions.version.performUpgrade'),
+ action: 'confirmUpgrade',
isDisabled: true
},
- title: 'version out of sync, admin access, request in progress, no installation'
+ title: 'OUT_OF_SYNC state, admin access, request in progress, no installation'
},
{
inputData: {
@@ -856,67 +876,4 @@ describe('App.UpgradeVersionBoxView', function () {
});
});
});
-
- describe("#checkUpgradeAvailability()", function () {
- beforeEach(function () {
- sinon.stub(view, 'runUpgradeCheck', Em.K);
- });
- afterEach(function () {
- view.runUpgradeCheck.restore();
- });
-
- it("status is INSTALLED", function () {
- view.set('content.status', 'INSTALLED');
- view.checkUpgradeAvailability();
- expect(view.runUpgradeCheck.called).to.be.false;
- });
- it("status is INSTALL_FAILED", function () {
- view.set('content.status', 'INSTALL_FAILED');
- view.checkUpgradeAvailability();
- expect(view.runUpgradeCheck.calledTwice).to.be.true;
- });
- });
-
- describe("#runUpgradeCheck()", function () {
- beforeEach(function () {
- sinon.stub(App.ajax, 'send', Em.K);
- });
- afterEach(function () {
- App.ajax.send.restore();
- });
-
- it("upgradeCheckInProgress is true", function () {
- view.set('upgradeCheckInProgress', true);
- view.runUpgradeCheck();
- expect(App.ajax.send.called).to.be.false;
- expect(view.get('upgradeCheckInProgress')).to.be.true;
- });
- it("upgradeCheckInProgress is false", function () {
- view.set('upgradeCheckInProgress', false);
- view.runUpgradeCheck();
- expect(App.ajax.send.calledOnce).to.be.true;
- expect(view.get('upgradeCheckInProgress')).to.be.true;
- });
- });
-
- describe("#runUpgradeCheckSuccess()", function () {
- it("check failed", function () {
- view.runUpgradeCheckSuccess({items: [{UpgradeChecks: {status: 'FAIL'}}]});
- expect(view.get('isUpgradeAvailable')).to.be.false;
- expect(view.get('upgradeCheckInProgress')).to.be.false;
- });
- it("check passed", function () {
- view.runUpgradeCheckSuccess({items: [{UpgradeChecks: {status: 'PASS'}}]});
- expect(view.get('isUpgradeAvailable')).to.be.true;
- expect(view.get('upgradeCheckInProgress')).to.be.false;
- });
- });
-
- describe("#runUpgradeCheckError()", function () {
- it("check failed", function () {
- view.runUpgradeCheckError();
- expect(view.get('isUpgradeAvailable')).to.be.false;
- expect(view.get('upgradeCheckInProgress')).to.be.false;
- });
- });
});
[09/31] ambari git commit: AMBARI-13309. After hdp-select failure
Ambari won't retry resulting in components failures with strange output
(aonishuk)
Posted by nc...@apache.org.
AMBARI-13309. After hdp-select failure Ambari won't retry resulting in components failures with strange output (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cad57c56
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cad57c56
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cad57c56
Branch: refs/heads/branch-dev-patch-upgrade
Commit: cad57c562692ac7bc8c61a3d4504a8c12fdae2f0
Parents: a845a44
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Oct 5 14:30:43 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Oct 5 14:30:43 2015 +0300
----------------------------------------------------------------------
.../scripts/shared_initialization.py | 4 ++--
.../hooks/after-INSTALL/test_after_install.py | 20 ++++++++------------
2 files changed, 10 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/cad57c56/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
index d3b1448..e81f252 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/shared_initialization.py
@@ -36,8 +36,8 @@ def setup_hdp_install_directory():
SELECT_ALL_PERFORMED_MARKER = "/var/lib/ambari-agent/data/hdp-select-set-all.performed"
import params
if params.hdp_stack_version != "" and compare_versions(params.hdp_stack_version, '2.2') >= 0:
- Execute(as_sudo(['touch', SELECT_ALL_PERFORMED_MARKER]) + ' ; ' +
- format('{sudo} /usr/bin/hdp-select set all `ambari-python-wrap /usr/bin/hdp-select versions | grep ^{stack_version_unformatted} | tail -1`'),
+ Execute(format('{sudo} /usr/bin/hdp-select set all `ambari-python-wrap /usr/bin/hdp-select versions | grep ^{stack_version_unformatted} | tail -1`') + ' && ' +
+ as_sudo(['touch', SELECT_ALL_PERFORMED_MARKER]),
only_if=format('ls -d /usr/hdp/{stack_version_unformatted}*'), # If any HDP version is installed
not_if=format("test -f {SELECT_ALL_PERFORMED_MARKER}") # Do that only once (otherwise we break rolling upgrade logic)
)
http://git-wip-us.apache.org/repos/asf/ambari/blob/cad57c56/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py b/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
index 5d5926b..de3d7ce 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
@@ -69,12 +69,10 @@ class TestHookAfterInstall(RMFTestCase):
config_dict = json_content)
- self.assertResourceCalled("Execute",
- "ambari-sudo.sh [RMF_ENV_PLACEHOLDER] -H -E touch /var/lib/ambari-agent/data/hdp-select-set-all.performed ; " \
- "ambari-sudo.sh /usr/bin/hdp-select set all `ambari-python-wrap /usr/bin/hdp-select versions | grep ^2.3 | tail -1`",
- only_if = "ls -d /usr/hdp/2.3*",
- not_if = "test -f /var/lib/ambari-agent/data/hdp-select-set-all.performed")
-
+ self.assertResourceCalled('Execute', 'ambari-sudo.sh /usr/bin/hdp-select set all `ambari-python-wrap /usr/bin/hdp-select versions | grep ^2.3 | tail -1` && ambari-sudo.sh [RMF_ENV_PLACEHOLDER] -H -E touch /var/lib/ambari-agent/data/hdp-select-set-all.performed',
+ not_if = 'test -f /var/lib/ambari-agent/data/hdp-select-set-all.performed',
+ only_if = 'ls -d /usr/hdp/2.3*',
+ )
self.assertResourceCalled('XmlConfig', 'core-site.xml',
owner = 'hdfs',
@@ -310,12 +308,10 @@ class TestHookAfterInstall(RMFTestCase):
config_dict = json_content)
- self.assertResourceCalled("Execute",
- "ambari-sudo.sh [RMF_ENV_PLACEHOLDER] -H -E touch /var/lib/ambari-agent/data/hdp-select-set-all.performed ; " \
- "ambari-sudo.sh /usr/bin/hdp-select set all `ambari-python-wrap /usr/bin/hdp-select versions | grep ^2.3 | tail -1`",
- only_if = "ls -d /usr/hdp/2.3*",
- not_if = "test -f /var/lib/ambari-agent/data/hdp-select-set-all.performed")
-
+ self.assertResourceCalled('Execute', 'ambari-sudo.sh /usr/bin/hdp-select set all `ambari-python-wrap /usr/bin/hdp-select versions | grep ^2.3 | tail -1` && ambari-sudo.sh [RMF_ENV_PLACEHOLDER] -H -E touch /var/lib/ambari-agent/data/hdp-select-set-all.performed',
+ not_if = 'test -f /var/lib/ambari-agent/data/hdp-select-set-all.performed',
+ only_if = 'ls -d /usr/hdp/2.3*',
+ )
self.assertResourceCalled('XmlConfig', 'core-site.xml',
owner = 'hdfs',
[17/31] ambari git commit: AMBARI-13308. Config Versions list isn't
updated while user is on the configs page after adding/removing HiveServer2
(onechiporenko)
Posted by nc...@apache.org.
AMBARI-13308. Config Versions list isn't updated while user is on the configs page after adding/removing HiveServer2 (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e6725016
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e6725016
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e6725016
Branch: refs/heads/branch-dev-patch-upgrade
Commit: e6725016f7417b6e90c1d3cde028a33bda41bf23
Parents: 329d2b5
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Tue Oct 6 10:57:55 2015 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Tue Oct 6 10:57:55 2015 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/main/host/details.js | 19 +++++++++++++------
ambari-web/app/controllers/main/service/item.js | 2 +-
2 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/e6725016/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index 507e375..6c2f0e7 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -436,6 +436,9 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
} else if (data.componentName == 'HIVE_METASTORE') {
this.set('deleteHiveMetaStore', true);
this.loadConfigs('loadHiveConfigs');
+ } else if (data.componentName == 'HIVE_SERVER') {
+ this.set('deleteHiveServer', true);
+ this.loadConfigs('loadHiveConfigs');
} else if (data.componentName == 'NIMBUS') {
this.set('deleteNimbusHost', true);
this.loadConfigs('loadStormConfigs');
@@ -671,7 +674,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
* @param {object} data
* @param {object} opt
* @param {object} params
- * @method installNewComponentSuccessCallbÆ’ack
+ * @method installNewComponentSuccessCallback
*/
installNewComponentSuccessCallback: function (data, opt, params) {
if (!data || !data.Requests || !data.Requests.id) {
@@ -824,13 +827,16 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
* @method loadHiveConfigs
*/
loadHiveConfigs: function (data) {
- App.ajax.send({
+ return App.ajax.send({
name: 'admin.get.all_configurations',
sender: this,
data: {
- urlParams: '(type=hive-site&tag=' + data.Clusters.desired_configs['hive-site'].tag + ')|(type=webhcat-site&tag=' +
- data.Clusters.desired_configs['webhcat-site'].tag + ')|(type=hive-env&tag=' + data.Clusters.desired_configs['hive-env'].tag +
- ')|(type=core-site&tag=' + data.Clusters.desired_configs['core-site'].tag + ')'
+ urlParams: [
+ '(type=hive-site&tag=' + data.Clusters.desired_configs['hive-site'].tag + ')',
+ '(type=webhcat-site&tag=' + data.Clusters.desired_configs['webhcat-site'].tag + ')',
+ '(type=hive-env&tag=' + data.Clusters.desired_configs['hive-env'].tag + ')',
+ '(type=core-site&tag=' + data.Clusters.desired_configs['core-site'].tag + ')'
+ ].join('|')
},
success: 'onLoadHiveConfigs'
});
@@ -965,8 +971,9 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
this.set('hiveMetastoreHost', '');
}
- if (this.get('fromDeleteHost') || this.get('deleteHiveMetaStore')) {
+ if (this.get('fromDeleteHost') || this.get('deleteHiveMetaStore') || this.get('deleteHiveServer')) {
this.set('deleteHiveMetaStore', false);
+ this.set('deleteHiveServer', false);
this.set('fromDeleteHost', false);
return hiveHosts.without(this.get('content.hostName'));
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/e6725016/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index bd5bcc7..223e610 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -800,7 +800,7 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
// Install
if(['HIVE_METASTORE', 'RANGER_KMS_SERVER', 'NIMBUS'].contains(component.get('componentName')) && !!selectedHost){
- App.router.get('mainHostDetailsController').addComponent(
+ App.router.get('mainHostDetailsController').addComponentWithCheck(
{
context: component,
selectedHost: selectedHost
[30/31] ambari git commit: AMBARI-13223. AMS Collector does not start
(dlysnichenko)
Posted by nc...@apache.org.
AMBARI-13223. AMS Collector does not start (dlysnichenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/61f6523a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/61f6523a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/61f6523a
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 61f6523a637e661cc6c5bb4e3f7e31d357bfc904
Parents: e1caac3
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Wed Oct 7 12:23:52 2015 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Wed Oct 7 12:23:52 2015 +0300
----------------------------------------------------------------------
.../server/upgrade/UpgradeCatalog213.java | 110 +++++++++++++++++++
.../0.1.0/configuration/ams-env.xml | 8 +-
.../0.1.0/configuration/ams-hbase-env.xml | 40 +++++--
.../0.1.0/package/scripts/functions.py | 8 +-
.../0.1.0/package/scripts/params.py | 11 +-
.../0.1.0/package/scripts/split_points.py | 8 +-
.../0.96.0.2.0/package/scripts/functions.py | 14 +++
.../0.96.0.2.0/package/scripts/params_linux.py | 6 +-
.../stacks/HDP/2.0.6/services/stack_advisor.py | 20 ++--
.../server/upgrade/UpgradeCatalog213Test.java | 104 ++++++++++++++++++
.../stacks/2.2/common/test_stack_advisor.py | 40 +++----
.../app/controllers/wizard/step8_controller.js | 2 +-
.../app/mixins/common/configs/configs_saver.js | 2 +-
13 files changed, 307 insertions(+), 66 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
index 7caf50e..dcdbb85 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
@@ -39,6 +39,9 @@ import java.util.Map;
public class UpgradeCatalog213 extends AbstractUpgradeCatalog {
private static final String STORM_SITE = "storm-site";
+ private static final String AMS_ENV = "ams-env";
+ private static final String AMS_HBASE_ENV = "ams-hbase-env";
+
/**
* Logger.
@@ -100,6 +103,7 @@ public class UpgradeCatalog213 extends AbstractUpgradeCatalog {
@Override
protected void executeDMLUpdates() throws AmbariException, SQLException {
addMissingConfigs();
+ updateAMSConfigs();
}
protected void addMissingConfigs() throws AmbariException {
@@ -130,4 +134,110 @@ public class UpgradeCatalog213 extends AbstractUpgradeCatalog {
}
}
}
+
+ protected void updateAMSConfigs() throws AmbariException {
+ AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class);
+ Clusters clusters = ambariManagementController.getClusters();
+
+ if (clusters != null) {
+ Map<String, Cluster> clusterMap = clusters.getClusters();
+
+ if (clusterMap != null && !clusterMap.isEmpty()) {
+ for (final Cluster cluster : clusterMap.values()) {
+ Config amsEnv = cluster.getDesiredConfigByType(AMS_ENV);
+ if (amsEnv != null) {
+ Map<String, String> amsEnvProperties = amsEnv.getProperties();
+
+ String metrics_collector_heapsize = amsEnvProperties.get("metrics_collector_heapsize");
+ String content = amsEnvProperties.get("content");
+ Map<String, String> newProperties = new HashMap<>();
+ newProperties.put("metrics_collector_heapsize", memoryToIntMb(metrics_collector_heapsize));
+ newProperties.put("content", updateAmsEnvContent(content));
+ updateConfigurationPropertiesForCluster(cluster, AMS_ENV, newProperties, true, true);
+ }
+ Config amsHbaseEnv = cluster.getDesiredConfigByType(AMS_HBASE_ENV);
+ if (amsHbaseEnv != null) {
+ Map<String, String> amsHbaseEnvProperties = amsHbaseEnv.getProperties();
+ String hbase_regionserver_heapsize = amsHbaseEnvProperties.get("hbase_regionserver_heapsize");
+ String regionserver_xmn_size = amsHbaseEnvProperties.get("regionserver_xmn_size");
+ String hbase_master_xmn_size = amsHbaseEnvProperties.get("hbase_master_xmn_size");
+ String hbase_master_maxperm_size = amsHbaseEnvProperties.get("hbase_master_maxperm_size");
+ String hbase_master_heapsize = amsHbaseEnvProperties.get("hbase_master_heapsize");
+ String content = amsHbaseEnvProperties.get("content");
+
+ Map<String, String> newProperties = new HashMap<>();
+ newProperties.put("hbase_regionserver_heapsize", memoryToIntMb(hbase_regionserver_heapsize));
+ newProperties.put("regionserver_xmn_size", memoryToIntMb(regionserver_xmn_size));
+ newProperties.put("hbase_master_xmn_size", memoryToIntMb(hbase_master_xmn_size));
+ newProperties.put("hbase_master_maxperm_size", memoryToIntMb(hbase_master_maxperm_size));
+ newProperties.put("hbase_master_heapsize", memoryToIntMb(hbase_master_heapsize));
+ newProperties.put("content", updateAmsHbaseEnvContent(content));
+ updateConfigurationPropertiesForCluster(cluster, AMS_HBASE_ENV, newProperties, true, true);
+ }
+ }
+ }
+ }
+
+ }
+
+ protected String updateAmsEnvContent(String oldContent) {
+ if (oldContent == null) {
+ return null;
+ }
+ String regSearch = "export\\s*AMS_COLLECTOR_HEAPSIZE\\s*=\\s*\\{\\{metrics_collector_heapsize\\}\\}";
+ String replacement = "export AMS_COLLECTOR_HEAPSIZE={{metrics_collector_heapsize}}m";
+ return oldContent.replaceAll(regSearch, replacement);
+ }
+
+ protected String updateAmsHbaseEnvContent(String content) {
+ if (content == null) {
+ return null;
+ }
+
+ String regSearch = "\\{\\{hbase_heapsize\\}\\}";
+ String replacement = "{{hbase_heapsize}}m";
+ content = content.replaceAll(regSearch, replacement);
+ regSearch = "\\{\\{hbase_master_maxperm_size\\}\\}";
+ replacement = "{{hbase_master_maxperm_size}}m";
+ content = content.replaceAll(regSearch, replacement);
+ regSearch = "\\{\\{hbase_master_xmn_size\\}\\}";
+ replacement = "{{hbase_master_xmn_size}}m";
+ content = content.replaceAll(regSearch, replacement);
+ regSearch = "\\{\\{regionserver_xmn_size\\}\\}";
+ replacement = "{{regionserver_xmn_size}}m";
+ content = content.replaceAll(regSearch, replacement);
+ regSearch = "\\{\\{regionserver_heapsize\\}\\}";
+ replacement = "{{regionserver_heapsize}}m";
+ content = content.replaceAll(regSearch, replacement);
+ return content;
+ }
+
+ private String memoryToIntMb(String memorySize) {
+ if (memorySize == null) {
+ return "0";
+ }
+ Integer value = 0;
+ try {
+ value = Integer.parseInt(memorySize.replaceAll("\\D+", ""));
+ } catch (NumberFormatException ex) {
+ LOG.error(ex.getMessage());
+ }
+ char unit = memorySize.toUpperCase().charAt(memorySize.length() - 1);
+ // Recalculate memory size to Mb
+ switch (unit) {
+ case 'K':
+ value /= 1024;
+ break;
+ case 'B':
+ value /= (1024*1024);
+ break;
+ case 'G':
+ value *= 1024;
+ break;
+ case 'T':
+ value *= 1024*1024;
+ break;
+ }
+ return value.toString();
+ }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml
index 40a3921..3463af3 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-env.xml
@@ -51,8 +51,12 @@
</property>
<property>
<name>metrics_collector_heapsize</name>
- <value>512m</value>
+ <value>512</value>
<description>Metrics Collector Heap Size</description>
+ <value-attributes>
+ <type>int</type>
+ <unit>MB</unit>
+ </value-attributes>
</property>
<property>
<name>content</name>
@@ -78,7 +82,7 @@ export AMS_MONITOR_PID_DIR={{ams_monitor_pid_dir}}
export AMS_HBASE_PID_DIR={{hbase_pid_dir}}
# AMS Collector heapsize
-export AMS_COLLECTOR_HEAPSIZE={{metrics_collector_heapsize}}
+export AMS_COLLECTOR_HEAPSIZE={{metrics_collector_heapsize}}m
# AMS Collector options
export AMS_COLLECTOR_OPTS="-Djava.library.path=/usr/lib/ams-hbase/lib/hadoop-native"
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-env.xml b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-env.xml
index 7274a12..0b899aa 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-env.xml
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/configuration/ams-hbase-env.xml
@@ -33,11 +33,15 @@
</property>
<property>
<name>hbase_regionserver_heapsize</name>
- <value>512m</value>
+ <value>512</value>
<description>
HBase RegionServer Heap Size. In embedded mode, total heap size is
sum of master and regionserver heap sizes.
</description>
+ <value-attributes>
+ <type>int</type>
+ <unit>MB</unit>
+ </value-attributes>
<depends-on>
<property>
<type>ams-hbase-site</type>
@@ -51,20 +55,32 @@
</property>
<property>
<name>regionserver_xmn_size</name>
- <value>256m</value>
+ <value>256</value>
<description>HBase RegionServer maximum value for young generation heap size.</description>
+ <value-attributes>
+ <type>int</type>
+ <unit>MB</unit>
+ </value-attributes>
</property>
<property>
<name>hbase_master_xmn_size</name>
- <value>256m</value>
+ <value>256</value>
<description>
HBase Master maximum value for young generation heap size.
</description>
+ <value-attributes>
+ <type>int</type>
+ <unit>MB</unit>
+ </value-attributes>
</property>
<property>
<name>hbase_master_maxperm_size</name>
- <value>128m</value>
+ <value>128</value>
<description>HBase RegionServer maximum value for perm heap size.</description>
+ <value-attributes>
+ <type>int</type>
+ <unit>MB</unit>
+ </value-attributes>
</property>
<property>
<name>hbase_regionserver_xmn_ratio</name>
@@ -73,11 +89,15 @@
</property>
<property>
<name>hbase_master_heapsize</name>
- <value>512m</value>
+ <value>512</value>
<description>
HBase Master Heap Size. In embedded mode, total heap size is
sum of master and regionserver heap sizes.
</description>
+ <value-attributes>
+ <type>int</type>
+ <unit>MB</unit>
+ </value-attributes>
<depends-on>
<property>
<type>ams-hbase-site</type>
@@ -114,7 +134,7 @@ export HBASE_CONF_DIR=${HBASE_CONF_DIR:-{{hbase_conf_dir}}}
export HBASE_CLASSPATH=${HBASE_CLASSPATH}
# The maximum amount of heap to use, in MB. Default is 1000.
-export HBASE_HEAPSIZE={{hbase_heapsize}}
+export HBASE_HEAPSIZE={{hbase_heapsize}}m
# Extra Java runtime options.
# Below are what we set by default. May only work with SUN JVM.
@@ -132,11 +152,11 @@ export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -X
# export HBASE_JMX_BASE="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
{% if java_version < 8 %}
-export HBASE_MASTER_OPTS=" -XX:PermSize=64m -XX:MaxPermSize={{hbase_master_maxperm_size}} -Xms{{hbase_heapsize}} -Xmx{{hbase_heapsize}} -Xmn{{hbase_master_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly"
-export HBASE_REGIONSERVER_OPTS="-XX:MaxPermSize=128m -Xmn{{regionserver_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms{{regionserver_heapsize}} -Xmx{{regionserver_heapsize}}"
+export HBASE_MASTER_OPTS=" -XX:PermSize=64m -XX:MaxPermSize={{hbase_master_maxperm_size}}m -Xms{{hbase_heapsize}}m -Xmx{{hbase_heapsize}}m -Xmn{{hbase_master_xmn_size}}m -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly"
+export HBASE_REGIONSERVER_OPTS="-XX:MaxPermSize=128m -Xmn{{regionserver_xmn_size}}m -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms{{regionserver_heapsize}}m -Xmx{{regionserver_heapsize}}m"
{% else %}
-export HBASE_MASTER_OPTS=" -Xms{{hbase_heapsize}} -Xmx{{hbase_heapsize}} -Xmn{{hbase_master_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly"
-export HBASE_REGIONSERVER_OPTS=" -Xmn{{regionserver_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms{{regionserver_heapsize}} -Xmx{{regionserver_heapsize}}"
+export HBASE_MASTER_OPTS=" -Xms{{hbase_heapsize}}m -Xmx{{hbase_heapsize}}m -Xmn{{hbase_master_xmn_size}}m -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly"
+export HBASE_REGIONSERVER_OPTS=" -Xmn{{regionserver_xmn_size}}m -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms{{regionserver_heapsize}}m -Xmx{{regionserver_heapsize}}m"
{% endif %}
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/functions.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/functions.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/functions.py
index a5107d6..4ec3d16 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/functions.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/functions.py
@@ -25,16 +25,14 @@ import datetime
from resource_management.core.shell import checked_call
-def calc_xmn_from_xms(heapsize_str, xmn_percent, xmn_max):
+def calc_xmn_from_xms(heapsize, xmn_percent, xmn_max):
"""
- @param heapsize_str: str (e.g '1000m')
+ @param heapsize: int (e.g 1000)
@param xmn_percent: float (e.g 0.2)
@param xmn_max: integer (e.g 512)
"""
- heapsize = int(re.search('\d+', str(heapsize_str)).group(0))
- heapsize_unit = re.search('\D+', str(heapsize_str)).group(0)
xmn_val = int(math.floor(heapsize*xmn_percent))
xmn_val -= xmn_val % 8
result_xmn_val = xmn_max if xmn_val > xmn_max else xmn_val
- return str(result_xmn_val) + heapsize_unit
+ return result_xmn_val
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
index 23fe77f..29cdec7 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
@@ -32,15 +32,6 @@ else:
config = Script.get_config()
exec_tmp_dir = Script.get_tmp_dir()
-def get_combined_memory_mb(value1, value2):
- try:
- part1 = int(value1.strip()[:-1]) if value1.lower().strip()[-1:] == 'm' else int(value1)
- part2 = int(value2.strip()[:-1]) if value2.lower().strip()[-1:] == 'm' else int(value2)
- return str(part1 + part2) + 'm'
- except:
- return None
-pass
-
#AMBARI_METRICS data
ams_pid_dir = status_params.ams_collector_pid_dir
@@ -107,7 +98,7 @@ hbase_master_maxperm_size = config['configurations']['ams-hbase-env']['hbase_mas
# Choose heap size for embedded mode as sum of master + regionserver
if not is_hbase_distributed:
- hbase_heapsize = get_combined_memory_mb(master_heapsize, regionserver_heapsize)
+ hbase_heapsize = master_heapsize + regionserver_heapsize
if hbase_heapsize is None:
hbase_heapsize = master_heapsize
else:
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/split_points.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/split_points.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/split_points.py
index a585c6f..cd9c844 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/split_points.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/split_points.py
@@ -44,14 +44,14 @@ def to_number(s):
except ValueError:
return None
-def format_Xmx_size_to_bytes(value):
+def format_Xmx_size_to_bytes(value, default='b'):
strvalue = str(value).lower()
if len(strvalue) == 0:
return 0
modifier = strvalue[-1]
if modifier == ' ' or modifier in "0123456789":
- modifier = 'b'
+ modifier = default
m = {
modifier == 'b': b_bytes,
@@ -88,10 +88,10 @@ class FindSplitPointsForAMSRegions():
def initialize_region_counts(self):
try:
- xmx_master_bytes = format_Xmx_size_to_bytes(self.ams_hbase_env['hbase_master_heapsize'])
+ xmx_master_bytes = format_Xmx_size_to_bytes(self.ams_hbase_env['hbase_master_heapsize'], 'm')
xmx_region_bytes = 0
if "hbase_regionserver_heapsize" in self.ams_hbase_env:
- xmx_region_bytes = format_Xmx_size_to_bytes(self.ams_hbase_env['hbase_regionserver_heapsize'])
+ xmx_region_bytes = format_Xmx_size_to_bytes(self.ams_hbase_env['hbase_regionserver_heapsize'], 'm')
xmx_bytes = xmx_master_bytes + xmx_region_bytes
if self.mode == 'distributed':
xmx_bytes = xmx_region_bytes
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/functions.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/functions.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/functions.py
index e6e7fb9..f98b9b9 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/functions.py
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/functions.py
@@ -38,3 +38,17 @@ def calc_xmn_from_xms(heapsize_str, xmn_percent, xmn_max):
result_xmn_val = xmn_max if xmn_val > xmn_max else xmn_val
return str(result_xmn_val) + heapsize_unit
+
+def ensure_unit_for_memory(memory_size):
+ memory_size_values = re.findall('\d+', str(memory_size))
+ memory_size_unit = re.findall('\D+', str(memory_size))
+
+ if len(memory_size_values) > 0:
+ unit = 'm'
+ if len(memory_size_unit) > 0:
+ unit = memory_size_unit[0]
+ if unit not in ['b', 'k', 'm', 'g', 't', 'p']:
+ raise Exception("Memory size unit error. %s - wrong unit" % unit)
+ return "%s%s" % (memory_size_values[0], unit)
+ else:
+ raise Exception('Memory size can not be calculated')
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
index 635be5e..5bfdd5d 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py
@@ -20,7 +20,7 @@ limitations under the License.
import status_params
import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json module and has the same functions set.
-from functions import calc_xmn_from_xms
+from functions import calc_xmn_from_xms, ensure_unit_for_memory
from ambari_commons.constants import AMBARI_SUDO_BINARY
@@ -101,9 +101,9 @@ java64_home = config['hostLevelParams']['java_home']
java_version = int(config['hostLevelParams']['java_version'])
log_dir = config['configurations']['hbase-env']['hbase_log_dir']
-master_heapsize = config['configurations']['hbase-env']['hbase_master_heapsize']
+master_heapsize = ensure_unit_for_memory(config['configurations']['hbase-env']['hbase_master_heapsize'])
-regionserver_heapsize = config['configurations']['hbase-env']['hbase_regionserver_heapsize']
+regionserver_heapsize = ensure_unit_for_memory(config['configurations']['hbase-env']['hbase_regionserver_heapsize'])
regionserver_xmn_max = config['configurations']['hbase-env']['hbase_regionserver_xmn_max']
regionserver_xmn_percent = config['configurations']['hbase-env']['hbase_regionserver_xmn_ratio']
regionserver_xmn_size = calc_xmn_from_xms(regionserver_heapsize, regionserver_xmn_percent, regionserver_xmn_max)
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index c4450b6..2ba1a5c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -351,7 +351,7 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
collector_heapsize, hbase_heapsize, total_sinks_count = self.getAmsMemoryRecommendation(services, hosts)
- putAmsEnvProperty("metrics_collector_heapsize", str(collector_heapsize) + "m")
+ putAmsEnvProperty("metrics_collector_heapsize", collector_heapsize)
# blockCache = 0.3, memstore = 0.35, phoenix-server = 0.15, phoenix-client = 0.25
putAmsHbaseSiteProperty("hfile.block.cache.size", 0.3)
@@ -373,26 +373,26 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
putAmsHbaseSiteProperty("hbase.regionserver.global.memstore.lowerLimit", 0.25)
putAmsHbaseSiteProperty("phoenix.query.maxGlobalMemoryPercentage", 20)
putTimelineServiceProperty("phoenix.query.maxGlobalMemoryPercentage", 30)
- hbase_xmn_size = '512m'
+ hbase_xmn_size = '512'
elif total_sinks_count >= 500:
putAmsHbaseSiteProperty("hbase.regionserver.handler.count", 60)
putAmsHbaseSiteProperty("hbase.regionserver.hlog.blocksize", 134217728)
putAmsHbaseSiteProperty("hbase.regionserver.maxlogs", 64)
putAmsHbaseSiteProperty("hbase.hregion.memstore.flush.size", 268435456)
- hbase_xmn_size = '512m'
+ hbase_xmn_size = '512'
elif total_sinks_count >= 250:
- hbase_xmn_size = '256m'
+ hbase_xmn_size = '256'
else:
- hbase_xmn_size = '128m'
+ hbase_xmn_size = '128'
pass
# Embedded mode heap size : master + regionserver
if rootDir.startswith("hdfs://"):
- putHbaseEnvProperty("hbase_master_heapsize", "512m")
- putHbaseEnvProperty("hbase_regionserver_heapsize", str(hbase_heapsize) + "m")
+ putHbaseEnvProperty("hbase_master_heapsize", "512")
+ putHbaseEnvProperty("hbase_regionserver_heapsize", hbase_heapsize)
putHbaseEnvProperty("regionserver_xmn_size", hbase_xmn_size)
else:
- putHbaseEnvProperty("hbase_master_heapsize", str(hbase_heapsize) + "m")
+ putHbaseEnvProperty("hbase_master_heapsize", hbase_heapsize)
putHbaseEnvProperty("hbase_master_xmn_size", hbase_xmn_size)
# If no local DN in distributed mode
@@ -1217,10 +1217,10 @@ def getHeapsizeProperties():
"default": "1024m"}],
"METRICS_COLLECTOR": [{"config-name": "ams-hbase-env",
"property": "hbase_master_heapsize",
- "default": "1024m"},
+ "default": "1024"},
{"config-name": "ams-env",
"property": "metrics_collector_heapsize",
- "default": "512m"}],
+ "default": "512"}],
}
def getMemorySizeRequired(components, configurations):
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
index b6e0ccb..a54dee2 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
@@ -18,6 +18,7 @@
package org.apache.ambari.server.upgrade;
+import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.createMockBuilder;
import static org.easymock.EasyMock.createNiceMock;
import static org.easymock.EasyMock.createStrictMock;
@@ -27,6 +28,7 @@ import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.reset;
import static org.easymock.EasyMock.verify;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
@@ -46,6 +48,7 @@ import org.apache.ambari.server.state.Clusters;
import org.apache.ambari.server.state.Config;
import org.apache.ambari.server.state.ConfigHelper;
import org.apache.ambari.server.state.stack.OsFamily;
+import org.easymock.EasyMock;
import org.easymock.EasyMockSupport;
import org.junit.After;
import org.junit.Assert;
@@ -93,13 +96,17 @@ public class UpgradeCatalog213Test {
@Test
public void testExecuteDMLUpdates() throws Exception {
Method addMissingConfigs = UpgradeCatalog213.class.getDeclaredMethod("addMissingConfigs");
+ Method updateAMSConfigs = UpgradeCatalog213.class.getDeclaredMethod("updateAMSConfigs");
UpgradeCatalog213 upgradeCatalog213 = createMockBuilder(UpgradeCatalog213.class)
.addMockedMethod(addMissingConfigs)
+ .addMockedMethod(updateAMSConfigs)
.createMock();
upgradeCatalog213.addMissingConfigs();
expectLastCall().once();
+ upgradeCatalog213.updateAMSConfigs();
+ expectLastCall().once();
replay(upgradeCatalog213);
@@ -154,6 +161,103 @@ public class UpgradeCatalog213Test {
easyMockSupport.verifyAll();
}
+ @Test
+ public void testUpdateAmsHbaseEnvContent() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
+ Method updateAmsHbaseEnvContent = UpgradeCatalog213.class.getDeclaredMethod("updateAmsHbaseEnvContent", String.class);
+ UpgradeCatalog213 upgradeCatalog213 = new UpgradeCatalog213(injector);
+ String oldContent = "export HBASE_CLASSPATH=${HBASE_CLASSPATH}\n" +
+ "\n" +
+ "# The maximum amount of heap to use, in MB. Default is 1000.\n" +
+ "export HBASE_HEAPSIZE={{hbase_heapsize}}\n" +
+ "\n" +
+ "{% if java_version < 8 %}\n" +
+ "export HBASE_MASTER_OPTS=\" -XX:PermSize=64m -XX:MaxPermSize={{hbase_master_maxperm_size}} -Xms{{hbase_heapsize}} -Xmx{{hbase_heapsize}} -Xmn{{hbase_master_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly\"\n" +
+ "export HBASE_REGIONSERVER_OPTS=\"-XX:MaxPermSize=128m -Xmn{{regionserver_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms{{regionserver_heapsize}} -Xmx{{regionserver_heapsize}}\"\n" +
+ "{% else %}\n" +
+ "export HBASE_MASTER_OPTS=\" -Xms{{hbase_heapsize}} -Xmx{{hbase_heapsize}} -Xmn{{hbase_master_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly\"\n" +
+ "export HBASE_REGIONSERVER_OPTS=\" -Xmn{{regionserver_xmn_size}} -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms{{regionserver_heapsize}} -Xmx{{regionserver_heapsize}}\"\n" +
+ "{% endif %}\n";
+ String expectedContent = "export HBASE_CLASSPATH=${HBASE_CLASSPATH}\n" +
+ "\n" +
+ "# The maximum amount of heap to use, in MB. Default is 1000.\n" +
+ "export HBASE_HEAPSIZE={{hbase_heapsize}}m\n" +
+ "\n" +
+ "{% if java_version < 8 %}\n" +
+ "export HBASE_MASTER_OPTS=\" -XX:PermSize=64m -XX:MaxPermSize={{hbase_master_maxperm_size}}m -Xms{{hbase_heapsize}}m -Xmx{{hbase_heapsize}}m -Xmn{{hbase_master_xmn_size}}m -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly\"\n" +
+ "export HBASE_REGIONSERVER_OPTS=\"-XX:MaxPermSize=128m -Xmn{{regionserver_xmn_size}}m -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms{{regionserver_heapsize}}m -Xmx{{regionserver_heapsize}}m\"\n" +
+ "{% else %}\n" +
+ "export HBASE_MASTER_OPTS=\" -Xms{{hbase_heapsize}}m -Xmx{{hbase_heapsize}}m -Xmn{{hbase_master_xmn_size}}m -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly\"\n" +
+ "export HBASE_REGIONSERVER_OPTS=\" -Xmn{{regionserver_xmn_size}}m -XX:CMSInitiatingOccupancyFraction=70 -XX:+UseCMSInitiatingOccupancyOnly -Xms{{regionserver_heapsize}}m -Xmx{{regionserver_heapsize}}m\"\n" +
+ "{% endif %}\n";
+ String result = (String) updateAmsHbaseEnvContent.invoke(upgradeCatalog213, oldContent);
+ Assert.assertEquals(expectedContent, result);
+ }
+
+ @Test
+ public void testUpdateAmsEnvContent() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
+ Method updateAmsEnvContent = UpgradeCatalog213.class.getDeclaredMethod("updateAmsEnvContent", String.class);
+ UpgradeCatalog213 upgradeCatalog213 = new UpgradeCatalog213(injector);
+ String oldContent = "# AMS Collector heapsize\n" +
+ "export AMS_COLLECTOR_HEAPSIZE={{metrics_collector_heapsize}}\n";
+ String expectedContent = "# AMS Collector heapsize\n" +
+ "export AMS_COLLECTOR_HEAPSIZE={{metrics_collector_heapsize}}m\n";
+ String result = (String) updateAmsEnvContent.invoke(upgradeCatalog213, oldContent);
+ Assert.assertEquals(expectedContent, result);
+ }
+
+ @Test
+ public void testUpdateAmsConfigs() throws Exception {
+ EasyMockSupport easyMockSupport = new EasyMockSupport();
+ final AmbariManagementController mockAmbariManagementController = easyMockSupport.createNiceMock(AmbariManagementController.class);
+ final ConfigHelper mockConfigHelper = easyMockSupport.createMock(ConfigHelper.class);
+
+ final Clusters mockClusters = easyMockSupport.createStrictMock(Clusters.class);
+ final Cluster mockClusterExpected = easyMockSupport.createNiceMock(Cluster.class);
+ final Map<String, String> propertiesAmsEnv = new HashMap<String, String>() {
+ {
+ put("metrics_collector_heapsize", "512m");
+ }
+ };
+
+ final Map<String, String> propertiesAmsHbaseEnv = new HashMap<String, String>() {
+ {
+ put("hbase_regionserver_heapsize", "512m");
+ put("regionserver_xmn_size", "512m");
+ put("hbase_master_xmn_size", "512m");
+ put("hbase_master_maxperm_size", "512");
+ }
+ };
+
+ final Config mockAmsEnv = easyMockSupport.createNiceMock(Config.class);
+ final Config mockAmsHbaseEnv = easyMockSupport.createNiceMock(Config.class);
+
+ final Injector mockInjector = Guice.createInjector(new AbstractModule() {
+ @Override
+ protected void configure() {
+ bind(AmbariManagementController.class).toInstance(mockAmbariManagementController);
+ bind(ConfigHelper.class).toInstance(mockConfigHelper);
+ bind(Clusters.class).toInstance(mockClusters);
+
+ bind(DBAccessor.class).toInstance(createNiceMock(DBAccessor.class));
+ bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
+ }
+ });
+
+ expect(mockAmbariManagementController.getClusters()).andReturn(mockClusters).once();
+ expect(mockClusters.getClusters()).andReturn(new HashMap<String, Cluster>() {{
+ put("normal", mockClusterExpected);
+ }}).once();
+
+ expect(mockClusterExpected.getDesiredConfigByType("ams-env")).andReturn(mockAmsEnv).atLeastOnce();
+ expect(mockClusterExpected.getDesiredConfigByType("ams-hbase-env")).andReturn(mockAmsHbaseEnv).atLeastOnce();
+ expect(mockAmsEnv.getProperties()).andReturn(propertiesAmsEnv).atLeastOnce();
+ expect(mockAmsHbaseEnv.getProperties()).andReturn(propertiesAmsHbaseEnv).atLeastOnce();
+
+ easyMockSupport.replayAll();
+ mockInjector.getInstance(UpgradeCatalog213.class).updateAMSConfigs();
+ easyMockSupport.verifyAll();
+ }
+
/**
* @param dbAccessor
* @return
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
index aa9a302..6424bb5 100644
--- a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
@@ -1983,13 +1983,13 @@ class TestHDP22StackAdvisor(TestCase):
expected = {
"ams-hbase-env": {
"properties": {
- "hbase_master_xmn_size": "128m",
- "hbase_master_heapsize": "512m"
+ "hbase_master_xmn_size": "128",
+ "hbase_master_heapsize": "512"
}
},
"ams-env": {
"properties": {
- "metrics_collector_heapsize": "512m",
+ "metrics_collector_heapsize": "512",
}
},
"ams-hbase-site": {
@@ -2042,8 +2042,8 @@ class TestHDP22StackAdvisor(TestCase):
]
}
]
- expected["ams-hbase-env"]['properties']['hbase_master_heapsize'] = '1408m'
- expected["ams-env"]['properties']['metrics_collector_heapsize'] = '512m'
+ expected["ams-hbase-env"]['properties']['hbase_master_heapsize'] = '1408'
+ expected["ams-env"]['properties']['metrics_collector_heapsize'] = '512'
self.stackAdvisor.recommendAmsConfigurations(configurations, clusterData, services, hosts)
self.assertEquals(configurations, expected)
@@ -2109,9 +2109,9 @@ class TestHDP22StackAdvisor(TestCase):
}
]
- expected["ams-hbase-env"]['properties']['hbase_master_heapsize'] = '2432m'
- expected["ams-hbase-env"]['properties']['hbase_master_xmn_size'] = '256m'
- expected["ams-env"]['properties']['metrics_collector_heapsize'] = '640m'
+ expected["ams-hbase-env"]['properties']['hbase_master_heapsize'] = '2432'
+ expected["ams-hbase-env"]['properties']['hbase_master_xmn_size'] = '256'
+ expected["ams-env"]['properties']['metrics_collector_heapsize'] = '640'
self.stackAdvisor.recommendAmsConfigurations(configurations, clusterData, services, hosts)
self.assertEquals(configurations, expected)
@@ -2131,29 +2131,29 @@ class TestHDP22StackAdvisor(TestCase):
}
# Embedded mode, 512m master heapsize, no splitpoints recommended
- services["configurations"]['ams-hbase-env']['properties']['hbase_master_heapsize'] = '512m'
+ services["configurations"]['ams-hbase-env']['properties']['hbase_master_heapsize'] = '512'
services["configurations"]['ams-hbase-site']['properties']['hbase.regionserver.global.memstore.lowerLimit'] = '0.3'
services["configurations"]['ams-hbase-site']['properties']['hbase.hregion.memstore.flush.size'] = '134217728'
expected['ams-site']['properties']['timeline.metrics.host.aggregate.splitpoints'] = ' '
expected['ams-site']['properties']['timeline.metrics.cluster.aggregate.splitpoints'] = ' '
- expected['ams-hbase-env']['properties']['hbase_master_heapsize'] = '512m'
+ expected['ams-hbase-env']['properties']['hbase_master_heapsize'] = '512'
self.stackAdvisor.recommendAmsConfigurations(configurations, clusterData, services, hosts)
self.assertEquals(configurations, expected)
# Embedded mode, 4096m master heapsize, some splitpoints recommended
- services["configurations"]['ams-hbase-env']['properties']['hbase_master_heapsize'] = '4096m'
+ services["configurations"]['ams-hbase-env']['properties']['hbase_master_heapsize'] = '4096'
expected['ams-site']['properties']['timeline.metrics.host.aggregate.splitpoints'] = \
'jvm.JvmMetrics.MemHeapCommittedM,regionserver.Server.Increment_median'
expected['ams-site']['properties']['timeline.metrics.cluster.aggregate.splitpoints'] = ' '
- expected['ams-hbase-env']['properties']['hbase_master_heapsize'] = '4096m'
+ expected['ams-hbase-env']['properties']['hbase_master_heapsize'] = '4096'
self.stackAdvisor.recommendAmsConfigurations(configurations, clusterData, services, hosts)
self.assertEquals(configurations, expected)
# Embedded mode, 8192m master heapsize, more splitpoints recommended
- services["configurations"]['ams-hbase-env']['properties']['hbase_master_heapsize'] = '8192m'
- expected['ams-hbase-env']['properties']['hbase_master_heapsize'] = '8192m'
+ services["configurations"]['ams-hbase-env']['properties']['hbase_master_heapsize'] = '8192'
+ expected['ams-hbase-env']['properties']['hbase_master_heapsize'] = '8192'
self.stackAdvisor.recommendAmsConfigurations(configurations, clusterData, services, hosts)
self.assertEquals(len(configurations['ams-site']['properties']['timeline.metrics.host.aggregate.splitpoints'].split(',')), 10)
self.assertEquals(len(configurations['ams-site']['properties']['timeline.metrics.cluster.aggregate.splitpoints'].split(',')), 2)
@@ -2168,22 +2168,22 @@ class TestHDP22StackAdvisor(TestCase):
]
services["configurations"]['ams-hbase-site']['properties']['hbase.rootdir'] = 'hdfs://host1/amshbase'
expected['ams-hbase-site']['properties']['hbase.rootdir'] = 'hdfs://host1/amshbase'
- expected['ams-hbase-env']['properties']['hbase_master_heapsize'] = '512m'
+ expected['ams-hbase-env']['properties']['hbase_master_heapsize'] = '512'
# services["configurations"]['ams-hbase-site']['properties']['dfs.client.read.shortcircuit'] = 'true'
expected['ams-hbase-site']['properties']['dfs.client.read.shortcircuit'] = 'true'
# Distributed mode, low memory, no splitpoints recommended
- services["configurations"]['ams-hbase-env']['properties']['hbase_regionserver_heapsize'] = '512m'
+ services["configurations"]['ams-hbase-env']['properties']['hbase_regionserver_heapsize'] = '512'
expected['ams-site']['properties']['timeline.metrics.host.aggregate.splitpoints'] = ' '
expected['ams-site']['properties']['timeline.metrics.cluster.aggregate.splitpoints'] = ' '
- expected['ams-hbase-env']['properties']['hbase_regionserver_heapsize'] = '512m'
- expected['ams-hbase-env']['properties']['regionserver_xmn_size'] = '256m'
+ expected['ams-hbase-env']['properties']['hbase_regionserver_heapsize'] = '512'
+ expected['ams-hbase-env']['properties']['regionserver_xmn_size'] = '256'
self.stackAdvisor.recommendAmsConfigurations(configurations, clusterData, services, hosts)
self.assertEquals(configurations, expected)
# Distributed mode, more memory, more splitpoints recommended
- services["configurations"]['ams-hbase-env']['properties']['hbase_regionserver_heapsize'] = '8192m'
- expected['ams-hbase-env']['properties']['hbase_regionserver_heapsize'] = '8192m'
+ services["configurations"]['ams-hbase-env']['properties']['hbase_regionserver_heapsize'] = '8192'
+ expected['ams-hbase-env']['properties']['hbase_regionserver_heapsize'] = '8192'
self.stackAdvisor.recommendAmsConfigurations(configurations, clusterData, services, hosts)
self.assertEquals(len(configurations['ams-site']['properties']['timeline.metrics.host.aggregate.splitpoints'].split(',')), 10)
self.assertEquals(len(configurations['ams-site']['properties']['timeline.metrics.cluster.aggregate.splitpoints'].split(',')), 2)
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/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 be0404c..248466b 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1585,7 +1585,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
var configs = this.get('configs').filterProperty('filename', site + '.xml');
var attributes = App.router.get('mainServiceInfoConfigsController').getConfigAttributes(configs);
configs.forEach(function (_configProperty) {
- var heapsizeExceptions = ['hadoop_heapsize', 'yarn_heapsize', 'nodemanager_heapsize', 'resourcemanager_heapsize', 'apptimelineserver_heapsize', 'jobhistory_heapsize', 'nfsgateway_heapsize', 'accumulo_master_heapsize', 'accumulo_tserver_heapsize', 'accumulo_monitor_heapsize', 'accumulo_gc_heapsize', 'accumulo_other_heapsize'];
+ var heapsizeExceptions = ['hadoop_heapsize', 'yarn_heapsize', 'nodemanager_heapsize', 'resourcemanager_heapsize', 'apptimelineserver_heapsize', 'jobhistory_heapsize', 'nfsgateway_heapsize', 'accumulo_master_heapsize', 'accumulo_tserver_heapsize', 'accumulo_monitor_heapsize', 'accumulo_gc_heapsize', 'accumulo_other_heapsize', 'hbase_master_heapsize', 'hbase_regionserver_heapsize'];
// do not pass any globals whose name ends with _host or _hosts
if (_configProperty.isRequiredByAgent !== false) {
// append "m" to JVM memory options except for heapsizeExtensions
http://git-wip-us.apache.org/repos/asf/ambari/blob/61f6523a/ambari-web/app/mixins/common/configs/configs_saver.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/configs_saver.js b/ambari-web/app/mixins/common/configs/configs_saver.js
index 6352dec..8d2271a 100644
--- a/ambari-web/app/mixins/common/configs/configs_saver.js
+++ b/ambari-web/app/mixins/common/configs/configs_saver.js
@@ -50,7 +50,7 @@ App.ConfigsSaverMixin = Em.Mixin.create({
* List of heapsize properties not to be parsed
* @type {string[]}
*/
- heapsizeException: ['hadoop_heapsize', 'yarn_heapsize', 'nodemanager_heapsize', 'resourcemanager_heapsize', 'apptimelineserver_heapsize', 'jobhistory_heapsize', 'nfsgateway_heapsize', 'accumulo_master_heapsize', 'accumulo_tserver_heapsize', 'accumulo_monitor_heapsize', 'accumulo_gc_heapsize', 'accumulo_other_heapsize'],
+ heapsizeException: ['hadoop_heapsize', 'yarn_heapsize', 'nodemanager_heapsize', 'resourcemanager_heapsize', 'apptimelineserver_heapsize', 'jobhistory_heapsize', 'nfsgateway_heapsize', 'accumulo_master_heapsize', 'accumulo_tserver_heapsize', 'accumulo_monitor_heapsize', 'accumulo_gc_heapsize', 'accumulo_other_heapsize', 'hbase_master_heapsize', 'hbase_regionserver_heapsize'],
/**
* Regular expression for heapsize properties detection
[15/31] ambari git commit: AMBARI-13297. change
nimbus.monitor.freq.secs=120 in ambari (dlysnichenko)
Posted by nc...@apache.org.
AMBARI-13297. change nimbus.monitor.freq.secs=120 in ambari (dlysnichenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/93f0896e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/93f0896e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/93f0896e
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 93f0896ec28a60a70e72ea9870374003fd2dcc90
Parents: ef80b5e
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Mon Oct 5 20:51:06 2015 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Mon Oct 5 20:51:06 2015 +0300
----------------------------------------------------------------------
.../server/upgrade/SchemaUpgradeHelper.java | 1 +
.../server/upgrade/UpgradeCatalog213.java | 133 +++++++++++++
.../0.9.1.2.1/configuration/storm-site.xml | 2 +-
.../stacks/HDP/2.2/upgrades/upgrade-2.3.xml | 8 +
.../server/upgrade/UpgradeCatalog213Test.java | 189 +++++++++++++++++++
5 files changed, 332 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/93f0896e/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
index 2fa4275..ca7707b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/SchemaUpgradeHelper.java
@@ -179,6 +179,7 @@ public class SchemaUpgradeHelper {
catalogBinder.addBinding().to(UpgradeCatalog210.class);
catalogBinder.addBinding().to(UpgradeCatalog211.class);
catalogBinder.addBinding().to(UpgradeCatalog212.class);
+ catalogBinder.addBinding().to(UpgradeCatalog213.class);
catalogBinder.addBinding().to(UpgradeCatalog220.class);
catalogBinder.addBinding().to(FinalUpgradeCatalog.class);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93f0896e/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
new file mode 100644
index 0000000..7caf50e
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
@@ -0,0 +1,133 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.upgrade;
+
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.orm.dao.DaoUtils;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Upgrade catalog for version 2.1.3.
+ */
+public class UpgradeCatalog213 extends AbstractUpgradeCatalog {
+
+ private static final String STORM_SITE = "storm-site";
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = LoggerFactory.getLogger(UpgradeCatalog212.class);
+
+ @Inject
+ DaoUtils daoUtils;
+
+
+ // ----- Constructors ------------------------------------------------------
+
+ /**
+ * Don't forget to register new UpgradeCatalogs in {@link org.apache.ambari.server.upgrade.SchemaUpgradeHelper.UpgradeHelperModule#configure()}
+ *
+ * @param injector Guice injector to track dependencies and uses bindings to inject them.
+ */
+ @Inject
+ public UpgradeCatalog213(Injector injector) {
+ super(injector);
+
+ daoUtils = injector.getInstance(DaoUtils.class);
+ }
+
+ // ----- UpgradeCatalog ----------------------------------------------------
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getTargetVersion() {
+ return "2.1.3";
+ }
+
+ // ----- AbstractUpgradeCatalog --------------------------------------------
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getSourceVersion() {
+ return "2.1.2";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void executeDDLUpdates() throws AmbariException, SQLException {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void executePreDMLUpdates() throws AmbariException, SQLException {
+ }
+
+ @Override
+ protected void executeDMLUpdates() throws AmbariException, SQLException {
+ addMissingConfigs();
+ }
+
+ protected void addMissingConfigs() throws AmbariException {
+ updateStormConfigs();
+ }
+
+ protected void updateStormConfigs() throws AmbariException {
+ AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class);
+ Clusters clusters = ambariManagementController.getClusters();
+
+ if (clusters != null) {
+ Map<String, Cluster> clusterMap = clusters.getClusters();
+
+ if ((clusterMap != null) && !clusterMap.isEmpty()) {
+ // Iterate through the clusters and perform any configuration updates
+ for (final Cluster cluster : clusterMap.values()) {
+ Config stormSiteProps = cluster.getDesiredConfigByType(STORM_SITE);
+
+ if (stormSiteProps != null) {
+ String value = stormSiteProps.getProperties().get("nimbus.monitor.freq.secs");
+ if (value != null && value.equals("10")) {
+ Map<String, String> updates = new HashMap<String, String>();
+ updates.put("nimbus.monitor.freq.secs", "120");
+ updateConfigurationPropertiesForCluster(cluster, STORM_SITE, updates, true, false);
+ }
+ }
+ }
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/93f0896e/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/configuration/storm-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/configuration/storm-site.xml b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/configuration/storm-site.xml
index 5055a67..b7453f9 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/configuration/storm-site.xml
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/configuration/storm-site.xml
@@ -156,7 +156,7 @@
</property>
<property>
<name>nimbus.monitor.freq.secs</name>
- <value>10</value>
+ <value>120</value>
<description>
How often nimbus should wake up to check heartbeats and do reassignments. Note
that if a machine ever goes down Nimbus will immediately wake up and take action.
http://git-wip-us.apache.org/repos/asf/ambari/blob/93f0896e/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
index 7d1f6ee..8ca800e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
@@ -1236,6 +1236,14 @@
<function>delete_storm_local_data</function>
</task>
+ <task xsi:type="configure">
+ <condition type="storm-site" key="nimbus.monitor.freq.secs" value="10">
+ <type>storm-site</type>
+ <key>nimbus.monitor.freq.secs</key>
+ <value>120</value>
+ </condition>
+ </task>
+
<task xsi:type="configure" summary="Converting nimbus.host into nimbus.seeds">
<type>storm-site</type>
<transfer operation="copy" from-key="nimbus.host" to-key="nimbus.seeds" coerce-to="yaml-array"/>
http://git-wip-us.apache.org/repos/asf/ambari/blob/93f0896e/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
new file mode 100644
index 0000000..b6e0ccb
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
@@ -0,0 +1,189 @@
+/*
+ * 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.upgrade;
+
+import static org.easymock.EasyMock.createMockBuilder;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.createStrictMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.reset;
+import static org.easymock.EasyMock.verify;
+
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.persistence.EntityManager;
+
+import com.google.inject.AbstractModule;
+import org.apache.ambari.server.api.services.AmbariMetaInfo;
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.orm.DBAccessor;
+import org.apache.ambari.server.orm.GuiceJpaInitializer;
+import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
+import org.apache.ambari.server.orm.dao.StackDAO;
+import org.apache.ambari.server.orm.entities.StackEntity;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+import org.apache.ambari.server.state.ConfigHelper;
+import org.apache.ambari.server.state.stack.OsFamily;
+import org.easymock.EasyMockSupport;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.google.inject.Binder;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Module;
+import com.google.inject.Provider;
+import com.google.inject.persist.PersistService;
+
+/**
+ * {@link org.apache.ambari.server.upgrade.UpgradeCatalog213} unit tests.
+ */
+public class UpgradeCatalog213Test {
+ private Injector injector;
+ private Provider<EntityManager> entityManagerProvider = createStrictMock(Provider.class);
+ private EntityManager entityManager = createNiceMock(EntityManager.class);
+ private UpgradeCatalogHelper upgradeCatalogHelper;
+ private StackEntity desiredStackEntity;
+
+ @Before
+ public void init() {
+ reset(entityManagerProvider);
+ expect(entityManagerProvider.get()).andReturn(entityManager).anyTimes();
+ replay(entityManagerProvider);
+ injector = Guice.createInjector(new InMemoryDefaultTestModule());
+ injector.getInstance(GuiceJpaInitializer.class);
+
+ upgradeCatalogHelper = injector.getInstance(UpgradeCatalogHelper.class);
+ // inject AmbariMetaInfo to ensure that stacks get populated in the DB
+ injector.getInstance(AmbariMetaInfo.class);
+ // load the stack entity
+ StackDAO stackDAO = injector.getInstance(StackDAO.class);
+ desiredStackEntity = stackDAO.find("HDP", "2.2.0");
+ }
+
+ @After
+ public void tearDown() {
+ injector.getInstance(PersistService.class).stop();
+ }
+
+ @Test
+ public void testExecuteDMLUpdates() throws Exception {
+ Method addMissingConfigs = UpgradeCatalog213.class.getDeclaredMethod("addMissingConfigs");
+
+ UpgradeCatalog213 upgradeCatalog213 = createMockBuilder(UpgradeCatalog213.class)
+ .addMockedMethod(addMissingConfigs)
+ .createMock();
+
+ upgradeCatalog213.addMissingConfigs();
+ expectLastCall().once();
+
+ replay(upgradeCatalog213);
+
+ upgradeCatalog213.executeDMLUpdates();
+
+ verify(upgradeCatalog213);
+ }
+
+ @Test
+ public void testUpdateStormSiteConfigs() throws Exception {
+ EasyMockSupport easyMockSupport = new EasyMockSupport();
+ final AmbariManagementController mockAmbariManagementController = easyMockSupport.createNiceMock(AmbariManagementController.class);
+ final ConfigHelper mockConfigHelper = easyMockSupport.createMock(ConfigHelper.class);
+
+ final Clusters mockClusters = easyMockSupport.createStrictMock(Clusters.class);
+ final Cluster mockClusterExpected = easyMockSupport.createNiceMock(Cluster.class);
+ final Map<String, String> propertiesStormSite = new HashMap<String, String>() {
+ {
+ put("nimbus.monitor.freq.secs", "10");
+ }
+ };
+
+ final Config mockStormSite = easyMockSupport.createNiceMock(Config.class);
+ expect(mockStormSite.getProperties()).andReturn(propertiesStormSite).once();
+
+ final Map<String, String> propertiesExpectedHiveSite = new HashMap<String, String>() {{
+ put("nimbus.monitor.freq.secs", "210");
+ }};
+
+ final Injector mockInjector = Guice.createInjector(new AbstractModule() {
+ @Override
+ protected void configure() {
+ bind(AmbariManagementController.class).toInstance(mockAmbariManagementController);
+ bind(ConfigHelper.class).toInstance(mockConfigHelper);
+ bind(Clusters.class).toInstance(mockClusters);
+
+ bind(DBAccessor.class).toInstance(createNiceMock(DBAccessor.class));
+ bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
+ }
+ });
+
+ expect(mockAmbariManagementController.getClusters()).andReturn(mockClusters).once();
+ expect(mockClusters.getClusters()).andReturn(new HashMap<String, Cluster>() {{
+ put("normal", mockClusterExpected);
+ }}).once();
+
+ expect(mockClusterExpected.getDesiredConfigByType("storm-site")).andReturn(mockStormSite).atLeastOnce();
+ expect(mockStormSite.getProperties()).andReturn(propertiesExpectedHiveSite).atLeastOnce();
+
+ easyMockSupport.replayAll();
+ mockInjector.getInstance(UpgradeCatalog213.class).updateStormConfigs();
+ easyMockSupport.verifyAll();
+ }
+
+ /**
+ * @param dbAccessor
+ * @return
+ */
+ private AbstractUpgradeCatalog getUpgradeCatalog(final DBAccessor dbAccessor) {
+ Module module = new Module() {
+ @Override
+ public void configure(Binder binder) {
+ binder.bind(DBAccessor.class).toInstance(dbAccessor);
+ binder.bind(EntityManager.class).toInstance(entityManager);
+ binder.bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
+ }
+ };
+
+ Injector injector = Guice.createInjector(module);
+ return injector.getInstance(UpgradeCatalog213.class);
+ }
+
+ @Test
+ public void testGetSourceVersion() {
+ final DBAccessor dbAccessor = createNiceMock(DBAccessor.class);
+ UpgradeCatalog upgradeCatalog = getUpgradeCatalog(dbAccessor);
+ Assert.assertEquals("2.1.2", upgradeCatalog.getSourceVersion());
+ }
+
+ @Test
+ public void testGetTargetVersion() throws Exception {
+ final DBAccessor dbAccessor = createNiceMock(DBAccessor.class);
+ UpgradeCatalog upgradeCatalog = getUpgradeCatalog(dbAccessor);
+
+ Assert.assertEquals("2.1.3", upgradeCatalog.getTargetVersion());
+ }
+}
\ No newline at end of file