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 2016/12/20 14:35:03 UTC
[01/15] ambari git commit: AMBARI-19230. Ambari does not select
correct heap size for HSIHS2 (smohanty)
Repository: ambari
Updated Branches:
refs/heads/branch-dev-patch-upgrade e7399fe9c -> 7a87817b8
AMBARI-19230. Ambari does not select correct heap size for HSIHS2 (smohanty)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7ec550aa
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7ec550aa
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7ec550aa
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 7ec550aaefc3eac236933e198994bbb3bc2d573a
Parents: e8a6b85
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Sun Dec 18 21:16:26 2016 -0800
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Sun Dec 18 21:18:07 2016 -0800
----------------------------------------------------------------------
.../HIVE/0.12.0.2.0/package/scripts/params_linux.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/7ec550aa/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index 27fe5b9..4e5ae36 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -404,7 +404,7 @@ start_metastore_path = format("{tmp_dir}/start_metastore_script")
hadoop_heapsize = config['configurations']['hadoop-env']['hadoop_heapsize']
-if 'role' in config and config['role'] in ["HIVE_SERVER", "HIVE_METASTORE"]:
+if 'role' in config and config['role'] in ["HIVE_SERVER", "HIVE_METASTORE", "HIVE_SERVER_INTERACTIVE"]:
if check_stack_feature(StackFeature.HIVE_ENV_HEAPSIZE, version_for_stack_feature_checks):
hive_heapsize = config['configurations']['hive-env']['hive.heapsize']
else:
@@ -595,7 +595,10 @@ if has_hive_interactive:
hive_interactive_env_sh_template = config['configurations']['hive-interactive-env']['content']
hive_interactive_enabled = default('/configurations/hive-interactive-env/enable_hive_interactive', False)
llap_app_java_opts = default('/configurations/hive-interactive-env/llap_java_opts', '-XX:+AlwaysPreTouch {% if java_version > 7 %}-XX:+UseG1GC -XX:TLABSize=8m -XX:+ResizeTLAB -XX:+UseNUMA -XX:+AggressiveOpts -XX:MetaspaceSize=1024m -XX:InitiatingHeapOccupancyPercent=80 -XX:MaxGCPauseMillis=200{% else %}-XX:+PrintGCDetails -verbose:gc -XX:+PrintGCTimeStamps -XX:+UseNUMA -XX:+UseParallelGC{% endif %}')
- hive_interactive_heapsize = config['configurations']['hive-interactive-env']['hive_heapsize']
+ hive_interactive_heapsize = hive_heapsize
+ # Ambari upgrade may not add this config as it will force restart of HSI (stack upgrade should)
+ if 'hive_heapsize' in config['configurations']['hive-interactive-env']:
+ hive_interactive_heapsize = config['configurations']['hive-interactive-env']['hive_heapsize']
# Service check related
if hive_transport_mode.lower() == "http":
[13/15] ambari git commit: AMBARI-19221. Preview xml feature is not
functional across (Padma Priya via pallavkul)
Posted by nc...@apache.org.
AMBARI-19221. Preview xml feature is not functional across (Padma Priya via pallavkul)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/28f1f2e5
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/28f1f2e5
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/28f1f2e5
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 28f1f2e5e21583174be497eb1ad7c8f1a290332f
Parents: 6da5935
Author: pallavkul <pa...@gmail.com>
Authored: Tue Dec 20 17:34:44 2016 +0530
Committer: pallavkul <pa...@gmail.com>
Committed: Tue Dec 20 17:34:44 2016 +0530
----------------------------------------------------------------------
.../main/resources/ui/app/components/bundle-config.js | 3 +++
.../main/resources/ui/app/components/coord-config.js | 3 +++
.../main/resources/ui/app/components/flow-designer.js | 3 +++
.../main/resources/ui/app/components/preview-dialog.js | 12 ++++++++++--
.../ui/app/templates/components/bundle-config.hbs | 4 ++--
.../ui/app/templates/components/coord-config.hbs | 4 ++--
.../ui/app/templates/components/flow-designer.hbs | 4 ++--
7 files changed, 25 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
index 4f409a1..4a8ac90 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
@@ -254,6 +254,9 @@ export default Ember.Component.extend(Ember.Evented, Validations, {
this.set("previewXml", vkbeautify.xml(bundleXml));
this.set("showingPreview", true);
},
+ closePreview(){
+ this.set("showingPreview", false);
+ },
importBundleTest(){
var deferred = this.importSampleBundle();
deferred.promise.then(function(data){
http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
index 23d1955..15eb1ce 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
@@ -453,6 +453,9 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
this.set("previewXml", vkbeautify.xml(coordinatorXml));
this.set("showingPreview", true);
},
+ closePreview(){
+ this.set("showingPreview", false);
+ },
confirmReset(){
this.set('showingResetConfirmation', true);
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
index 02682a4..28239fa 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
@@ -922,6 +922,9 @@ export default Ember.Component.extend(FindNodeMixin, Validations, {
this.set("showingPreview",true);
}
},
+ closePreview(){
+ this.set("showingPreview", false);
+ },
downloadWorkflowXml(){
this.get('workflowContext').clearErrors();
var workflowGenerator=WorkflowGenerator.create({workflow:this.get("workflow"),
http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/components/preview-dialog.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/preview-dialog.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/preview-dialog.js
index 7e956a6..cd6c171 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/preview-dialog.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/preview-dialog.js
@@ -19,9 +19,17 @@ import Ember from 'ember';
export default Ember.Component.extend({
elementsInserted :function(){
+ this.$('#previewModal').modal({
+ backdrop: 'static',
+ keyboard: false
+ });
+ this.$('#previewModal').modal('show');
var self = this;
this.$('#previewModal').on('shown.bs.modal', function (e) {
self.$('.CodeMirror')[0].CodeMirror.refresh();
- });
- }.on('didInsertElement'),
+ });
+ this.$('#previewModal').on('hidden.bs.modal', function () {
+ this.sendAction("closePreview");
+ }.bind(this));
+ }.on('didInsertElement')
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
index 698535f..8293dbe 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/bundle-config.hbs
@@ -39,7 +39,7 @@
</a>
</li>
<li>
- <a class="pointer" href="#" data-toggle="modal" data-target="#previewModal" title="Preview Xml" {{action "preview"}}>
+ <a class="pointer" href="#" data-toggle="modal" title="Preview Xml" {{action "preview"}}>
<i class="fa fa-eye marginright5"></i>Preview xml
</a>
</li>
@@ -124,7 +124,7 @@
okBtnText="Continue" cancelBtnText="Cancel" onOk="resetBundle"}}{{/confirmation-dialog}}
{{/if}}
{{#if showingPreview}}
- {{#preview-dialog title="Bundle XML Preview" previewXml=previewXml}}{{/preview-dialog}}
+ {{#preview-dialog title="Bundle XML Preview" previewXml=previewXml closePreview="closePreview"}}{{/preview-dialog}}
{{/if}}
{{#if showVersionSettings}}
{{bundle-version-settings schemaVersions=bundle.schemaVersions showVersionSettings="showVersionSettings" }}
http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
index f26c2ec..6b0ea84 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/coord-config.hbs
@@ -39,7 +39,7 @@
</a>
</li>
<li>
- <a class="pointer" href="#" data-toggle="modal" data-target="#previewModal" title="Preview Xml" {{action "preview"}}>
+ <a class="pointer" href="#" data-toggle="modal" title="Preview Xml" {{action "preview"}}>
<i class="fa fa-eye marginright5"></i>Preview xml
</a>
</li>
@@ -320,7 +320,7 @@ confirmationMessage="Any unsaved changes may be lost. Do you want to proceed res
okBtnText="Continue" cancelBtnText="Cancel" onOk="resetCoordinator"}}{{/confirmation-dialog}}
{{/if}}
{{#if showingPreview}}
-{{#preview-dialog title="Coordinator XML Preview" previewXml=previewXml}}{{/preview-dialog}}
+{{#preview-dialog title="Coordinator XML Preview" previewXml=previewXml closePreview="closePreview"}}{{/preview-dialog}}
{{/if}}
{{#if showParameterSettings}}
{{#workflow-parameters type='coord' closeWorkFlowParam="closeWorkFlowParam" saveWorkFlowParam="saveWorkFlowParam" parameters=parameters}}{{/workflow-parameters}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/28f1f2e5/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
index fa3215a..101f861 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/flow-designer.hbs
@@ -61,7 +61,7 @@
</a>
</li>
<li>
- <a class="pointer" data-toggle="modal" data-target="#previewModal" title="Preview workflow" {{action "previewWorkflow"}}>
+ <a class="pointer" data-toggle="modal" title="Preview workflow" {{action "previewWorkflow"}}>
<i class="fa fa-eye marginright5"></i>Preview xml
</a>
</li>
@@ -333,7 +333,7 @@
{{hdfs-browser closeFileBrowser="closeExportActionNodeFileBrowser" selectFileCallback=selectFileCallback filePath=exportActionNodeFilePath}}
{{/if}}
{{#if showingPreview}}
- {{#preview-dialog title="Workflow XML Preview" previewXml=previewXml}}{{/preview-dialog}}
+ {{#preview-dialog title="Workflow XML Preview" previewXml=previewXml closePreview="closePreview"}}{{/preview-dialog}}
{{/if}}
{{#if showingConfirmationNewWorkflow}}
{{#confirmation-dialog title="Confirm workflow reset"
[09/15] ambari git commit: AMBARI-19132. Use "rm" to delete Ambari
Server keytab files when disabling Kerberos (Attila Doroszlai via rlevas)
Posted by nc...@apache.org.
AMBARI-19132. Use "rm" to delete Ambari Server keytab files when disabling Kerberos (Attila Doroszlai via rlevas)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f0544dfa
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f0544dfa
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f0544dfa
Branch: refs/heads/branch-dev-patch-upgrade
Commit: f0544dfa9a1bf462451dbbaf688ceb22e5ceb773
Parents: f9d37df
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Mon Dec 19 12:40:53 2016 -0500
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Mon Dec 19 12:40:53 2016 -0500
----------------------------------------------------------------------
.../kerberos/DestroyPrincipalsServerAction.java | 11 +++++-
.../ambari/server/utils/ShellCommandUtil.java | 41 +++++++++++++++++++-
.../server/utils/TestShellCommandUtil.java | 35 +++++++++++++++++
3 files changed, 83 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0544dfa/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java
index 8197e76..3f631b4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/DestroyPrincipalsServerAction.java
@@ -19,6 +19,7 @@
package org.apache.ambari.server.serveraction.kerberos;
import java.io.File;
+import java.io.IOException;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@@ -30,6 +31,7 @@ import org.apache.ambari.server.audit.event.kerberos.DestroyPrincipalKerberosAud
import org.apache.ambari.server.controller.KerberosHelper;
import org.apache.ambari.server.orm.dao.KerberosPrincipalDAO;
import org.apache.ambari.server.orm.entities.KerberosPrincipalEntity;
+import org.apache.ambari.server.utils.ShellCommandUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -141,8 +143,13 @@ public class DestroyPrincipalsServerAction extends KerberosServerAction {
if (hostName != null && hostName.equalsIgnoreCase(KerberosHelper.AMBARI_SERVER_HOST_NAME)) {
String keytabFilePath = identityRecord.get(KerberosIdentityDataFileReader.KEYTAB_FILE_PATH);
if (keytabFilePath != null) {
- if (!new File(keytabFilePath).delete()) {
- LOG.debug(String.format("Failed to remove ambari keytab for %s", evaluatedPrincipal));
+ try {
+ ShellCommandUtil.Result result = ShellCommandUtil.delete(keytabFilePath, true, true);
+ if (!result.isSuccessful()) {
+ LOG.warn("Failed to remove ambari keytab for {} due to {}", evaluatedPrincipal, result.getStderr());
+ }
+ } catch (IOException|InterruptedException e) {
+ LOG.warn("Failed to remove ambari keytab for " + evaluatedPrincipal, e);
}
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0544dfa/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java b/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
index 57044d7..344c8a8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
@@ -24,6 +24,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
@@ -342,7 +343,7 @@ public class ShellCommandUtil {
command.add(directoryPath);
- return runCommand(command.toArray(new String[command.size()]), null, null, sudo);
+ return runCommand(command, null, null, sudo);
}
}
@@ -377,7 +378,43 @@ public class ShellCommandUtil {
command.add(srcFile);
command.add(destFile);
- return runCommand(command.toArray(new String[command.size()]), null, null, sudo);
+ return runCommand(command, null, null, sudo);
+ }
+
+ /**
+ * Deletes the <code>file</code>.
+ *
+ * @param file the path to the file to be deleted
+ * @param force true to force copy even if the file exists
+ * @param sudo true to execute the command using sudo (ambari-sudo); otherwise false
+ * @return the shell command result
+ */
+ public static Result delete(String file, boolean force, boolean sudo) throws IOException, InterruptedException {
+ List<String> command = new ArrayList<>();
+
+ if (WINDOWS) {
+ command.add("del");
+ if (force) {
+ command.add("/f");
+ }
+ } else {
+ command.add("/bin/rm");
+ if (force) {
+ command.add("-f");
+ }
+ }
+
+ command.add(file);
+
+ return runCommand(command, null, null, sudo);
+ }
+
+ /**
+ * @see #runCommand(String[], Map, InteractiveHandler, boolean)
+ */
+ public static Result runCommand(List<String> args, Map<String, String> vars, InteractiveHandler interactiveHandler, boolean sudo)
+ throws IOException, InterruptedException {
+ return runCommand(args.toArray(new String[args.size()]), vars, interactiveHandler, sudo);
}
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/f0544dfa/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java b/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
index 797ceb2..1595a24 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
@@ -214,4 +214,39 @@ public class TestShellCommandUtil {
Assert.assertTrue(destFile.length() > 0);
Assert.assertEquals(destFile.length(), srcFile.length());
}
+
+ @Test
+ public void deleteExistingFile() throws Exception {
+ File file = temp.newFile();
+
+ ShellCommandUtil.Result result = ShellCommandUtil.delete(file.getAbsolutePath(), false, false);
+
+ Assert.assertTrue(result.getStderr(), result.isSuccessful());
+ Assert.assertFalse(file.exists());
+ }
+
+ @Test
+ public void deleteNonexistentFile() throws Exception {
+ File file = temp.newFile();
+
+ if (file.delete()) {
+ ShellCommandUtil.Result result = ShellCommandUtil.delete(file.getAbsolutePath(), false, false);
+
+ Assert.assertFalse(result.getStderr(), result.isSuccessful());
+ Assert.assertFalse(file.exists());
+ }
+ }
+
+ @Test
+ public void forceDeleteNonexistentFile() throws Exception {
+ File file = temp.newFile();
+
+ if (file.delete()) {
+ ShellCommandUtil.Result result = ShellCommandUtil.delete(file.getAbsolutePath(), true, false);
+
+ Assert.assertTrue(result.getStderr(), result.isSuccessful());
+ Assert.assertFalse(file.exists());
+ }
+ }
+
}
[06/15] ambari git commit: AMBARI-19238. Avoid copying hadoop xml
files for druid configs (Nishant Bangarwa via smohanty)
Posted by nc...@apache.org.
AMBARI-19238. Avoid copying hadoop xml files for druid configs (Nishant Bangarwa via smohanty)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9cb96ad0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9cb96ad0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9cb96ad0
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 9cb96ad08fe2ff148a4fdb148fc6358ebb8155d0
Parents: 32896cb
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Mon Dec 19 07:04:14 2016 -0800
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Mon Dec 19 07:04:14 2016 -0800
----------------------------------------------------------------------
.../DRUID/0.9.2/configuration/druid-env.xml | 1 +
.../DRUID/0.9.2/package/scripts/druid.py | 37 --------------------
.../test/python/stacks/2.6/DRUID/test_druid.py | 24 -------------
3 files changed, 1 insertion(+), 61 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9cb96ad0/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-env.xml b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-env.xml
index fa24cac..539ef0c 100644
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-env.xml
+++ b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-env.xml
@@ -231,6 +231,7 @@
export DRUID_LOG_DIR={{druid_log_dir}}
export DRUID_CONF_DIR={{druid_conf_dir}}
export DRUID_LIB_DIR={{druid_home}}/lib
+ export HADOOP_CONF_DIR={{hadoop_conf_dir}}
</value>
<value-attributes>
http://git-wip-us.apache.org/repos/asf/ambari/blob/9cb96ad0/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py
index 6ace5e3..6ddedac 100644
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py
+++ b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py
@@ -80,43 +80,6 @@ def druid(upgrade_type=None, nodeType=None):
Logger.info("Created log rotate file")
- # Write Hadoop Configs if configured
- if 'core-site' in params.config['configurations']:
- XmlConfig("core-site.xml",
- conf_dir=params.druid_common_conf_dir,
- configurations=params.config['configurations']['core-site'],
- configuration_attributes=params.config['configuration_attributes']['core-site'],
- owner=params.druid_user,
- group=params.user_group
- )
-
- if 'mapred-site' in params.config['configurations']:
- XmlConfig("mapred-site.xml",
- conf_dir=params.druid_common_conf_dir,
- configurations=params.config['configurations']['mapred-site'],
- configuration_attributes=params.config['configuration_attributes']['mapred-site'],
- owner=params.druid_user,
- group=params.user_group
- )
-
- if 'yarn-site' in params.config['configurations']:
- XmlConfig("yarn-site.xml",
- conf_dir=params.druid_common_conf_dir,
- configurations=params.config['configurations']['yarn-site'],
- configuration_attributes=params.config['configuration_attributes']['yarn-site'],
- owner=params.druid_user,
- group=params.user_group
- )
-
- if 'hdfs-site' in params.config['configurations']:
- XmlConfig("hdfs-site.xml",
- conf_dir=params.druid_common_conf_dir,
- configurations=params.config['configurations']['hdfs-site'],
- configuration_attributes=params.config['configuration_attributes']['hdfs-site'],
- owner=params.druid_user,
- group=params.user_group
- )
-
# node specific configs
for node_type in ['coordinator', 'overlord', 'historical', 'broker', 'middleManager', 'router']:
node_config_dir = format('{params.druid_conf_dir}/{node_type}')
http://git-wip-us.apache.org/repos/asf/ambari/blob/9cb96ad0/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py b/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py
index 9c3353f..95cbb94 100644
--- a/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py
+++ b/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py
@@ -441,30 +441,6 @@ class TestDruid(RMFTestCase):
content = InlineTemplate(self.getConfig()['configurations']['druid-logrotate']['content'])
)
- self.assertResourceCalled('XmlConfig', "core-site.xml",
- conf_dir=format('/usr/hdp/current/{role}/conf/_common'),
- configurations=self.getConfig()['configurations']['core-site'],
- configuration_attributes=self.getConfig()['configuration_attributes']['core-site'],
- owner='druid',
- group='hadoop'
- )
-
- self.assertResourceCalled('XmlConfig', "yarn-site.xml",
- conf_dir=format('/usr/hdp/current/{role}/conf/_common'),
- configurations=self.getConfig()['configurations']['yarn-site'],
- configuration_attributes=self.getConfig()['configuration_attributes']['yarn-site'],
- owner='druid',
- group='hadoop'
- )
-
- self.assertResourceCalled('XmlConfig', "hdfs-site.xml",
- conf_dir=format('/usr/hdp/current/{role}/conf/_common'),
- configurations=self.getConfig()['configurations']['hdfs-site'],
- configuration_attributes=self.getConfig()['configuration_attributes']['hdfs-site'],
- owner='druid',
- group='hadoop'
- )
-
self.assertResourceCalled('PropertiesFile', "runtime.properties",
dir=format('/usr/hdp/current/{role}/conf/coordinator'),
properties=self.getConfig()['configurations']['druid-coordinator'],
[15/15] ambari git commit: Merge branch 'trunk' into
branch-dev-patch-upgrade
Posted by nc...@apache.org.
Merge branch 'trunk' into branch-dev-patch-upgrade
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7a87817b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7a87817b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7a87817b
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 7a87817b8cd4730e2b648bb42e2e2a1b1661c775
Parents: e7399fe 95e9804
Author: Nate Cole <nc...@hortonworks.com>
Authored: Tue Dec 20 09:34:42 2016 -0500
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Tue Dec 20 09:34:42 2016 -0500
----------------------------------------------------------------------
.../src/main/python/ambari_agent/ActionQueue.py | 13 +
.../src/main/python/ambari_agent/main.py | 8 +
.../test/python/ambari_agent/TestActionQueue.py | 61 +++
.../conf/unix/ambari-metrics-monitor | 9 +-
.../src/main/python/core/host_info.py | 2 +-
.../kerberos/DestroyPrincipalsServerAction.java | 11 +-
.../quicklinksprofile/AcceptAllFilter.java | 46 ++
.../state/quicklinksprofile/Component.java | 57 +++
.../server/state/quicklinksprofile/Filter.java | 78 ++++
.../state/quicklinksprofile/LinkNameFilter.java | 61 +++
.../state/quicklinksprofile/PropertyFilter.java | 60 +++
.../quicklinksprofile/QuickLinksProfile.java | 70 ++++
.../QuickLinksProfileParser.java | 108 +++++
.../server/state/quicklinksprofile/Service.java | 72 ++++
.../ambari/server/utils/ShellCommandUtil.java | 41 +-
.../DRUID/0.9.2/configuration/druid-env.xml | 1 +
.../DRUID/0.9.2/package/scripts/druid.py | 37 --
.../0.12.0.2.0/package/scripts/params_linux.py | 7 +-
.../0.6.0.2.5/package/scripts/master.py | 1 -
.../src/main/resources/stacks/stack_advisor.py | 19 +-
.../QuickLinksConfigurationModuleTest.java | 2 -
.../QuickLinksProfileParserTest.java | 70 ++++
.../server/utils/TestShellCommandUtil.java | 35 ++
.../stacks/2.2/common/test_stack_advisor.py | 53 +++
.../test/python/stacks/2.6/DRUID/test_druid.py | 24 --
.../resources/example_quicklinks_profile.json | 48 +++
.../inconsistent_quicklinks_profile.json | 10 +
ambari-web/app/controllers/main/host/details.js | 418 ++++++++++---------
ambari-web/app/messages.js | 7 -
.../main/host/details/actions/check_host.js | 3 +-
.../templates/common/configs/service_config.hbs | 2 +-
.../main/host/details/addComponentPopup.hbs | 19 -
.../details/addComponentWithConfigsChanges.hbs | 27 --
.../host/details/addDeleteComponentPopup.hbs | 40 ++
.../main/host/details/deleteComponentPopup.hbs | 45 --
ambari-web/app/utils/ajax/ajax.js | 13 +-
ambari-web/app/views/main/host/summary.js | 4 -
.../test/controllers/main/host/details_test.js | 223 +++-------
.../test/controllers/wizard/step3_test.js | 6 +-
contrib/views/slider/pom.xml | 6 +
.../ui/app/components/bundle-config.js | 3 +
.../resources/ui/app/components/coord-config.js | 3 +
.../ui/app/components/flow-designer.js | 3 +
.../ui/app/components/preview-dialog.js | 12 +-
.../app/templates/components/bundle-config.hbs | 4 +-
.../app/templates/components/coord-config.hbs | 4 +-
.../app/templates/components/flow-designer.hbs | 4 +-
47 files changed, 1286 insertions(+), 564 deletions(-)
----------------------------------------------------------------------
[07/15] ambari git commit: AMBARI-19236. Stackadvisor: incorrect
recommendations when only one of two dependencies was changed.(vbrodetskyi)
Posted by nc...@apache.org.
AMBARI-19236. Stackadvisor: incorrect recommendations when only one of two dependencies was changed.(vbrodetskyi)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a08bdc06
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a08bdc06
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a08bdc06
Branch: refs/heads/branch-dev-patch-upgrade
Commit: a08bdc0618ca99d98ae6b93a0a15c278eeec5f75
Parents: 9cb96ad
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Mon Dec 19 17:42:57 2016 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Mon Dec 19 17:42:57 2016 +0200
----------------------------------------------------------------------
.../src/main/resources/stacks/stack_advisor.py | 19 ++++++-
.../stacks/2.2/common/test_stack_advisor.py | 53 ++++++++++++++++++++
2 files changed, 71 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/a08bdc06/ambari-server/src/main/resources/stacks/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/stack_advisor.py b/ambari-server/src/main/resources/stacks/stack_advisor.py
index 8148379..8865b70 100644
--- a/ambari-server/src/main/resources/stacks/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/stack_advisor.py
@@ -313,6 +313,10 @@ class DefaultStackAdvisor(StackAdvisor):
# Dictionary that maps serviceName or componentName to serviceAdvisor
self.serviceAdvisorsDict = {}
+ # Contains requested properties during 'recommend-configuration-dependencies' request.
+ # It's empty during other requests.
+ self.allRequestedProperties = None
+
def getActiveHosts(self, hosts):
""" Filters the list of specified hosts object and returns
@@ -880,6 +884,7 @@ class DefaultStackAdvisor(StackAdvisor):
return component["StackServiceComponents"]["hostnames"]
def recommendConfigurationDependencies(self, services, hosts):
+ self.allRequestedProperties = self.getAllRequestedProperties(services)
result = self.recommendConfigurations(services, hosts)
return self.filterResult(result, services)
@@ -1000,7 +1005,8 @@ class DefaultStackAdvisor(StackAdvisor):
config[configType]["properties"] = {}
def appendProperty(key, value):
# If property exists in changedConfigs, do not override, use user defined property
- if self.__isPropertyInChangedConfigs(configType, key, changedConfigs):
+ if not self.isPropertyRequested(configType, key, changedConfigs) \
+ and configType in userConfigs and key in userConfigs[configType]['properties']:
config[configType]["properties"][key] = userConfigs[configType]['properties'][key]
else:
config[configType]["properties"][key] = str(value)
@@ -1012,6 +1018,17 @@ class DefaultStackAdvisor(StackAdvisor):
return True
return False
+ def isPropertyRequested(self, configType, propertyName, changedConfigs):
+ # When the property depends on more than one property, we need to recalculate it based on the actual values
+ # of all related properties. But "changed-configurations" usually contains only one on the dependent on properties.
+ # So allRequestedProperties is used to avoid recommendations of other properties that are not requested.
+ # Calculations should use user provided values for all properties that we depend on, not only the one that
+ # came in the "changed-configurations".
+ if self.allRequestedProperties:
+ return configType in self.allRequestedProperties and propertyName in self.allRequestedProperties[configType]
+ else:
+ return not self.__isPropertyInChangedConfigs(configType, propertyName, changedConfigs)
+
def updateProperty(self, config, configType, services=None):
userConfigs = {}
changedConfigs = []
http://git-wip-us.apache.org/repos/asf/ambari/blob/a08bdc06/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 70ce79e..54349a2 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
@@ -1173,6 +1173,59 @@ class TestHDP22StackAdvisor(TestCase):
self.stackAdvisor.recommendYARNConfigurations(configurations, clusterData, services, hosts)
self.assertEquals(configurations, expected)
+ def test_multipleDependsOn(self):
+ configurations = {
+ "yarn-env": {
+ "properties": {
+ "min_user_id": "500"
+ }
+ },
+ "yarn-site": {
+ "properties": {
+ "yarn.nodemanager.resource.memory-mb": "1280",
+ "yarn.scheduler.minimum-allocation-mb": "350",
+ "yarn.scheduler.maximum-allocation-mb": "1000",
+ },
+ },
+ "mapred-site": {
+ "properties": {
+ "mapreduce.map.memory.mb": "0",
+ "mapreduce.reduce.memory.mb": "111"
+ }
+ }
+ }
+ clusterData = {
+ "cpu": 4,
+ "containers" : 5,
+ "ramPerContainer": 256
+ }
+
+ services = {
+ "configurations": configurations,
+ "services": [],
+ "changed-configurations": [
+ {
+ "type": "yarn-site",
+ "name": "yarn.scheduler.maximum-allocation-mb",
+ "old_value": "512"
+ },
+ ]
+
+ }
+ hosts = {}
+
+ # immitate recommend-configuration-dependencies request with only "yarn.scheduler.maximum-allocation-mb" in "changed-configurations"
+ self.stackAdvisor.allRequestedProperties = {'yarn-site': ['yarn.scheduler.maximum-allocation-mb'], 'mapred-site': ['mapreduce.map.memory.mb']}
+
+ self.stackAdvisor.recommendMapReduce2Configurations(configurations, clusterData, services, hosts)
+
+ # changed-configurations contain only "yarn.scheduler.maximum-allocation-mb".
+ # Ensure that user provided value (350) for "yarn.scheduler.minimum-allocation-mb" is used.
+ # The recommended default for "yarn.scheduler.minimum-allocation-mb" is 256.
+ self.assertEquals(configurations['mapred-site']['properties']['mapreduce.map.memory.mb'], '350') # should not be 256
+
+ # assert that not requested property was not changed
+ self.assertEquals(configurations['mapred-site']['properties']['mapreduce.reduce.memory.mb'], '111')
def test_recommendHiveConfigurationAttributes(self):
self.maxDiff = None
[02/15] ambari git commit: AMBARI-19222 %livy interpreter gives 400
HttpClientError due to spark.master property present in livy-spark-blacklist
(Prabhjyot Singh via r-kamath)
Posted by nc...@apache.org.
AMBARI-19222 %livy interpreter gives 400 HttpClientError due to spark.master property present in livy-spark-blacklist (Prabhjyot Singh via r-kamath)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fce9d6e0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fce9d6e0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fce9d6e0
Branch: refs/heads/branch-dev-patch-upgrade
Commit: fce9d6e090c9433f5783871aab73cdb3e16c9335
Parents: 7ec550a
Author: Renjith Kamath <re...@gmail.com>
Authored: Mon Dec 19 12:40:02 2016 +0530
Committer: Renjith Kamath <re...@gmail.com>
Committed: Mon Dec 19 12:41:13 2016 +0530
----------------------------------------------------------------------
.../common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/fce9d6e0/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
index 9cc808b..0b79d37 100644
--- a/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
+++ b/ambari-server/src/main/resources/common-services/ZEPPELIN/0.6.0.2.5/package/scripts/master.py
@@ -312,7 +312,6 @@ class Master(Script):
interpreter['dependencies'].append(
{"groupArtifactVersion": "org.apache.phoenix:phoenix-core:4.7.0-HBase-1.1", "local": "false"})
elif interpreter['group'] == 'livy' and params.livy_livyserver_host:
- interpreter['properties']['livy.spark.master'] = "yarn-cluster"
interpreter['properties']['zeppelin.livy.url'] = "http://" + params.livy_livyserver_host +\
":" + params.livy_livyserver_port
[03/15] ambari git commit: AMBARI-18978. Create Quick link profile
data model and json parser. (Balazs Bence Sari via stoader)
Posted by nc...@apache.org.
AMBARI-18978. Create Quick link profile data model and json parser. (Balazs Bence Sari via stoader)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/61dcdc3f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/61dcdc3f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/61dcdc3f
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 61dcdc3f1db0f8091ab3314f6746dace68847178
Parents: fce9d6e
Author: Balazs Bence Sari <bs...@hortonworks.com>
Authored: Mon Dec 19 10:47:47 2016 +0100
Committer: Toader, Sebastian <st...@hortonworks.com>
Committed: Mon Dec 19 10:47:47 2016 +0100
----------------------------------------------------------------------
.../quicklinksprofile/AcceptAllFilter.java | 46 ++++++++
.../state/quicklinksprofile/Component.java | 57 ++++++++++
.../server/state/quicklinksprofile/Filter.java | 78 ++++++++++++++
.../state/quicklinksprofile/LinkNameFilter.java | 61 +++++++++++
.../state/quicklinksprofile/PropertyFilter.java | 60 +++++++++++
.../quicklinksprofile/QuickLinksProfile.java | 70 ++++++++++++
.../QuickLinksProfileParser.java | 108 +++++++++++++++++++
.../server/state/quicklinksprofile/Service.java | 72 +++++++++++++
.../QuickLinksConfigurationModuleTest.java | 2 -
.../QuickLinksProfileParserTest.java | 70 ++++++++++++
.../resources/example_quicklinks_profile.json | 48 +++++++++
.../inconsistent_quicklinks_profile.json | 10 ++
12 files changed, 680 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/61dcdc3f/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/AcceptAllFilter.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/AcceptAllFilter.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/AcceptAllFilter.java
new file mode 100644
index 0000000..5124241
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/AcceptAllFilter.java
@@ -0,0 +1,46 @@
+/*
+ * 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.state.quicklinksprofile;
+
+import org.apache.ambari.server.state.quicklinks.Link;
+
+/**
+ * A filter that accepts all links. It is useful to specify a general rule while the more specific
+ * ({@link LinkNameFilter} and {@link PropertyFilter}) filters handle more special cases.
+ */
+public class AcceptAllFilter extends Filter {
+
+ @Override
+ public boolean accept(Link link) {
+ return true;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ AcceptAllFilter that = (AcceptAllFilter) o;
+ return isVisible() == that.isVisible();
+ }
+
+ @Override
+ public int hashCode() {
+ return java.util.Objects.hash(isVisible());
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/61dcdc3f/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/Component.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/Component.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/Component.java
new file mode 100644
index 0000000..7ef0259
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/Component.java
@@ -0,0 +1,57 @@
+/*
+ * 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.state.quicklinksprofile;
+
+import java.util.List;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+/**
+ * Class to represent component-level filter definitions
+ */
+@JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Component {
+ @JsonProperty("name")
+ private String name;
+
+ @JsonProperty("filters")
+ private List<Filter> filters;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the quicklink filters for this component
+ */
+ public List<Filter> getFilters() {
+ return filters;
+ }
+
+ public void setFilters(List<Filter> filters) {
+ this.filters = filters;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/61dcdc3f/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/Filter.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/Filter.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/Filter.java
new file mode 100644
index 0000000..1711628
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/Filter.java
@@ -0,0 +1,78 @@
+/*
+ * 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.state.quicklinksprofile;
+
+import org.apache.ambari.server.state.quicklinks.Link;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+/**
+ * Base class to represent a quicklink filter. A quicklink filter has two important features:
+ * <ul>
+ * <li>It can tell if it applies to a link (see {@link #accept(Link)} method).</li>
+ * <li>It can specify the visibility of the links it applies to (see {@link #isVisible()} method).</li>
+ * </ul>
+ */
+public abstract class Filter {
+
+ @JsonProperty("visible")
+ private boolean visible;
+
+ /**
+ * @return a boolean indicating whether links accepted by this filter should be shown or hidden
+ */
+ public boolean isVisible() {
+ return visible;
+ }
+
+ public void setVisible(boolean visible) {
+ this.visible = visible;
+ }
+
+ /**
+ * @param link the link to examine
+ * @return if this filter applies to the link in the parameter
+ */
+ public abstract boolean accept(Link link);
+
+ // Factory methods
+
+ static AcceptAllFilter acceptAllFilter(boolean visible) {
+ AcceptAllFilter acceptAllFilter = new AcceptAllFilter();
+ acceptAllFilter.setVisible(visible);
+ return acceptAllFilter;
+ }
+
+ static LinkNameFilter linkNameFilter(String linkName, boolean visible) {
+ LinkNameFilter linkNameFilter = new LinkNameFilter();
+ linkNameFilter.setLinkName(linkName);
+ linkNameFilter.setVisible(visible);
+ return linkNameFilter;
+ }
+
+ static PropertyFilter propertyFilter(String propertyName, boolean visible) {
+ PropertyFilter propertyFilter = new PropertyFilter();
+ propertyFilter.setPropertyName(propertyName);
+ propertyFilter.setVisible(visible);
+ return propertyFilter;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/61dcdc3f/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/LinkNameFilter.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/LinkNameFilter.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/LinkNameFilter.java
new file mode 100644
index 0000000..b874295
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/LinkNameFilter.java
@@ -0,0 +1,61 @@
+/*
+ * 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.state.quicklinksprofile;
+
+import java.util.Objects;
+
+import org.apache.ambari.server.state.quicklinks.Link;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * A filter that accepts quicklinks based on name match.
+ */
+public class LinkNameFilter extends Filter {
+
+ static final String LINK_NAME = "link_name";
+
+ @JsonProperty(LINK_NAME)
+ private String linkName;
+
+ public String getLinkName() {
+ return linkName;
+ }
+
+ public void setLinkName(String linkName) {
+ this.linkName = linkName;
+ }
+
+ @Override
+ public boolean accept(Link link) {
+ return Objects.equals(link.getName(), linkName);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ LinkNameFilter that = (LinkNameFilter) o;
+ return isVisible() == that.isVisible() && Objects.equals(linkName, that.linkName);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(isVisible(), linkName);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/61dcdc3f/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/PropertyFilter.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/PropertyFilter.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/PropertyFilter.java
new file mode 100644
index 0000000..7b5eba0
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/PropertyFilter.java
@@ -0,0 +1,60 @@
+/*
+ * 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.state.quicklinksprofile;
+
+import java.util.Objects;
+
+import org.apache.ambari.server.state.quicklinks.Link;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * A quicklink filter based on property-match (the filter's property is contained by the links set of properties)
+ */
+public class PropertyFilter extends Filter {
+ static final String PROPERTY_NAME = "property_name";
+
+ @JsonProperty(PROPERTY_NAME)
+ private String propertyName;
+
+ public String getPropertyName() {
+ return propertyName;
+ }
+
+ public void setPropertyName(String propertyName) {
+ this.propertyName = propertyName;
+ }
+
+ @Override
+ public boolean accept(Link link) {
+ return link.getProperties().contains(propertyName);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ PropertyFilter that = (PropertyFilter) o;
+ return isVisible() == that.isVisible() && Objects.equals(propertyName, that.propertyName);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(isVisible(), propertyName);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/61dcdc3f/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfile.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfile.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfile.java
new file mode 100644
index 0000000..1a1488b
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfile.java
@@ -0,0 +1,70 @@
+/*
+ * 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.state.quicklinksprofile;
+
+import java.util.List;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+/**
+ * A quicklinks profile is essentially a set of filters defined on three levels:
+ * <ul>
+ * <li>global level</li>
+ * <li>service level</li>
+ * <li>component level (within a service)</li>
+ * </ul>
+ *
+ * For each link, filters are evaluated bottom up: component level filters take priority to service level filters
+ * and service level filters take priority to global filters.
+ */
+@JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class QuickLinksProfile {
+
+ @JsonProperty("filters")
+ private List<Filter> filters;
+
+ @JsonProperty("services")
+ private List<Service> services;
+
+ /**
+ * @return service-specific quicklink filter definitions
+ */
+ public List<Service> getServices() {
+ return services;
+ }
+
+ public void setServices(List<Service> services) {
+ this.services = services;
+ }
+
+ /**
+ * @return the global quicklink filters
+ */
+ public List<Filter> getFilters() {
+ return filters;
+ }
+
+ public void setFilters(List<Filter> filters) {
+ this.filters = filters;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/61dcdc3f/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfileParser.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfileParser.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfileParser.java
new file mode 100644
index 0000000..c1f3c86
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfileParser.java
@@ -0,0 +1,108 @@
+/*
+ * 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.state.quicklinksprofile;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.JsonParser;
+import org.codehaus.jackson.JsonProcessingException;
+import org.codehaus.jackson.Version;
+import org.codehaus.jackson.map.DeserializationContext;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.deser.std.StdDeserializer;
+import org.codehaus.jackson.map.module.SimpleModule;
+import org.codehaus.jackson.node.ObjectNode;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.io.Resources;
+
+/**
+ * Loads and parses JSON quicklink profiles.
+ */
+public class QuickLinksProfileParser {
+ private final ObjectMapper mapper = new ObjectMapper();
+
+ public QuickLinksProfileParser() {
+ SimpleModule module =
+ new SimpleModule("Quick Links Parser", new Version(1, 0, 0, null));
+ module.addDeserializer(Filter.class, new QuickLinksFilterDeserializer());
+ mapper.registerModule(module);
+ }
+
+
+ public QuickLinksProfile parse(byte[] input) throws IOException {
+ return mapper.readValue(input, QuickLinksProfile.class);
+ }
+
+ public QuickLinksProfile parse(URL url) throws IOException {
+ return parse(Resources.toByteArray(url));
+ }
+}
+
+/**
+ * Custom deserializer is needed to handle filter polymorphism.
+ */
+class QuickLinksFilterDeserializer extends StdDeserializer<Filter> {
+ private static final String PARSE_ERROR_MESSAGE =
+ "A filter is not allowed to declare both property_name and link_name at the same time.";
+
+ QuickLinksFilterDeserializer() {
+ super(Filter.class);
+ }
+
+ /**
+ * Filter polymorphism is handled here. If a filter object in the JSON document has:
+ * <ul>
+ * <li>a {@code property_name} field, it will parsed as {@link PropertyFilter}</li>
+ * <li>a {@code link_name} field, it will be parsed as {@link LinkNameFilter}</li>
+ * <li>both {@code property_name} and {@code link_name}, it will throw a {@link JsonParseException}</li>
+ * <li>neither of the above fields, it will be parsed as {@link AcceptAllFilter}</li>
+ * </ul>
+ *
+ * @throws JsonParseException if ambiguous filter definitions are found, or any JSON syntax error.
+ */
+ @Override
+ public Filter deserialize (JsonParser parser, DeserializationContext context) throws IOException, JsonProcessingException {
+ ObjectMapper mapper = (ObjectMapper) parser.getCodec();
+ ObjectNode root = (ObjectNode) mapper.readTree(parser);
+ Class<? extends Filter> filterClass = null;
+ for (String fieldName: ImmutableList.copyOf(root.getFieldNames())) {
+ switch(fieldName) {
+ case PropertyFilter.PROPERTY_NAME:
+ if (null != filterClass) {
+ throw new JsonParseException(PARSE_ERROR_MESSAGE, parser.getCurrentLocation());
+ }
+ filterClass = PropertyFilter.class;
+ break;
+ case LinkNameFilter.LINK_NAME:
+ if (null != filterClass) {
+ throw new JsonParseException(PARSE_ERROR_MESSAGE, parser.getCurrentLocation());
+ }
+ filterClass = LinkNameFilter.class;
+ break;
+ }
+ }
+ if (null == filterClass) {
+ filterClass = AcceptAllFilter.class;
+ }
+ return mapper.readValue(root, filterClass);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/61dcdc3f/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/Service.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/Service.java b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/Service.java
new file mode 100644
index 0000000..600872f
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/Service.java
@@ -0,0 +1,72 @@
+/*
+ * 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.state.quicklinksprofile;
+
+import java.util.List;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+/**
+ * Class to represent component-level filter definitions
+ */
+@JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Service {
+ @JsonProperty("name")
+ private String name;
+
+ @JsonProperty("components")
+ private List<Component> components;
+
+ @JsonProperty("filters")
+ private List<Filter> filters;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return component-specific quicklink filter definitions for components of this service
+ */
+ public List<Component> getComponents() {
+ return components;
+ }
+
+ public void setComponents(List<Component> components) {
+ this.components = components;
+ }
+
+ /**
+ * @return service-specific filters for this service
+ */
+ public List<Filter> getFilters() {
+ return filters;
+ }
+
+ public void setFilters(List<Filter> filters) {
+ this.filters = filters;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/61dcdc3f/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java b/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
index 6f9827d..190e61b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/stack/QuickLinksConfigurationModuleTest.java
@@ -146,10 +146,8 @@ public class QuickLinksConfigurationModuleTest {
assertEquals("Links are not properly overridden for foo_logs",
new ArrayList<>(),
linksByName.get("foo_logs").getProperties());
-
}
-
private QuickLinks[] resolveQuickLinks(String parentJson, String childJson) throws AmbariException{
File parentQuiclinksFile = new File(this.getClass().getClassLoader().getResource(parentJson).getFile());
File childQuickLinksFile = new File(this.getClass().getClassLoader().getResource(childJson).getFile());
http://git-wip-us.apache.org/repos/asf/ambari/blob/61dcdc3f/ambari-server/src/test/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfileParserTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfileParserTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfileParserTest.java
new file mode 100644
index 0000000..0644027
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfileParserTest.java
@@ -0,0 +1,70 @@
+/*
+ * 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.state.quicklinksprofile;
+
+import static org.junit.Assert.assertEquals;
+
+import com.google.common.io.Resources;
+import org.codehaus.jackson.JsonParseException;
+import org.junit.Test;
+
+
+public class QuickLinksProfileParserTest {
+
+
+ @Test
+ public void testParseProfile() throws Exception {
+ String profileName = "example_quicklinks_profile.json";
+ QuickLinksProfileParser parser = new QuickLinksProfileParser();
+ QuickLinksProfile profile = parser.parse(Resources.getResource(profileName));
+ assertEquals(1, profile.getFilters().size());
+ assertEquals(
+ Filter.propertyFilter("sso", true),
+ profile.getFilters().get(0));
+ assertEquals(2, profile.getServices().size());
+
+ Service hdfs = profile.getServices().get(0);
+ assertEquals("HDFS", hdfs.getName());
+ assertEquals(1, hdfs.getFilters().size());
+ assertEquals(1, hdfs.getComponents().size());
+ assertEquals(
+ Filter.propertyFilter("authenticated", true),
+ hdfs.getFilters().get(0));
+
+ Component nameNode = hdfs.getComponents().get(0);
+ assertEquals(2, nameNode.getFilters().size());
+ assertEquals(
+ Filter.linkNameFilter("namenode_ui", false),
+ nameNode.getFilters().get(0));
+
+ Component historyServer = profile.getServices().get(1).getComponents().get(0);
+ assertEquals(1, historyServer.getFilters().size());
+ assertEquals(
+ Filter.acceptAllFilter(true),
+ historyServer.getFilters().get(0));
+ }
+
+ @Test(expected = JsonParseException.class)
+ public void testParseInconsistentProfile() throws Exception {
+ String profileName = "inconsistent_quicklinks_profile.json";
+ QuickLinksProfileParser parser = new QuickLinksProfileParser();
+ QuickLinksProfile profile = parser.parse(Resources.getResource(profileName));
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/61dcdc3f/ambari-server/src/test/resources/example_quicklinks_profile.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/example_quicklinks_profile.json b/ambari-server/src/test/resources/example_quicklinks_profile.json
new file mode 100644
index 0000000..028d011
--- /dev/null
+++ b/ambari-server/src/test/resources/example_quicklinks_profile.json
@@ -0,0 +1,48 @@
+{
+ "filters": [
+ {
+ "property_name": "sso",
+ "visible": true
+ }
+ ],
+ "services": [
+ {
+ "name": "HDFS",
+ "filters": [
+ {
+ "property_name": "authenticated",
+ "visible": true
+ }
+ ],
+ "components": [
+ {
+ "name": "NAMENODE",
+ "filters": [
+ {
+ "link_name": "namenode_ui",
+ "visible": false
+ },
+ {
+ "link_name": "namenode_jmx",
+ "visible": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "MAPREDUCE2",
+ "filters": [],
+ "components": [
+ {
+ "name": "HISTORYSERVER",
+ "filters": [
+ {
+ "visible": true
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/61dcdc3f/ambari-server/src/test/resources/inconsistent_quicklinks_profile.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/inconsistent_quicklinks_profile.json b/ambari-server/src/test/resources/inconsistent_quicklinks_profile.json
new file mode 100644
index 0000000..e5bc310
--- /dev/null
+++ b/ambari-server/src/test/resources/inconsistent_quicklinks_profile.json
@@ -0,0 +1,10 @@
+{
+ "filters": [
+ {
+ "property_name": "sso",
+ "link_name": "namenode_ui",
+ "visible": true
+ }
+ ],
+ "services": []
+}
\ No newline at end of file
[11/15] ambari git commit: AMBARI-19218: Exception when running
Slider view - java.lang.NoClassDefFoundError:
org/apache/hadoop/yarn/api/protocolrecords/GetLabelsToNodesResponse
(sangeetar)
Posted by nc...@apache.org.
AMBARI-19218: Exception when running Slider view - java.lang.NoClassDefFoundError: org/apache/hadoop/yarn/api/protocolrecords/GetLabelsToNodesResponse (sangeetar)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8a125c57
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8a125c57
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8a125c57
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 8a125c57a383c926f4ae9961b8b1ef7941bad6f1
Parents: 72e9d4a
Author: Sangeeta Ravindran <sa...@apache.org>
Authored: Mon Dec 19 10:32:42 2016 -0800
Committer: Sangeeta Ravindran <sa...@apache.org>
Committed: Mon Dec 19 10:33:00 2016 -0800
----------------------------------------------------------------------
contrib/views/slider/pom.xml | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/8a125c57/contrib/views/slider/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/views/slider/pom.xml b/contrib/views/slider/pom.xml
index e907ece..21afd3d 100644
--- a/contrib/views/slider/pom.xml
+++ b/contrib/views/slider/pom.xml
@@ -27,6 +27,12 @@
<groupId>org.apache.slider</groupId>
<artifactId>slider-core</artifactId>
<version>${slider.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-yarn-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.slider</groupId>
[08/15] ambari git commit: AMBARI-19237. Upper case for selected
config group (alexantonenko)
Posted by nc...@apache.org.
AMBARI-19237. Upper case for selected config group (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f9d37dfb
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f9d37dfb
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f9d37dfb
Branch: refs/heads/branch-dev-patch-upgrade
Commit: f9d37dfbc9b23b92eb3fd2514611513066c3300d
Parents: a08bdc0
Author: Alex Antonenko <hi...@gmail.com>
Authored: Mon Dec 19 16:36:55 2016 +0200
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Mon Dec 19 18:18:12 2016 +0200
----------------------------------------------------------------------
ambari-web/app/templates/common/configs/service_config.hbs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/f9d37dfb/ambari-web/app/templates/common/configs/service_config.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_config.hbs b/ambari-web/app/templates/common/configs/service_config.hbs
index d25515a..f071dd2 100644
--- a/ambari-web/app/templates/common/configs/service_config.hbs
+++ b/ambari-web/app/templates/common/configs/service_config.hbs
@@ -51,7 +51,7 @@
{{t common.group}}
<span class="btn-group config-groups-dropdown">
{{#if controller.configGroupsAreLoaded}}
- <button {{bindAttr disabled="controller.isHostsConfigsPage"}} class="btn btn-default dropdown-toggle first"
+ <button {{bindAttr disabled="controller.isHostsConfigsPage"}} style="text-transform: none;" class="btn btn-default dropdown-toggle first"
data-toggle="dropdown">{{selectedConfigGroup.displayNameHosts}}</button>
<button {{bindAttr disabled="controller.isHostsConfigsPage"}} class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
[05/15] ambari git commit: AMBARI-19233. ATS reports as down in
Ambari UI after upgrade (aonishuk)
Posted by nc...@apache.org.
AMBARI-19233. ATS reports as down in Ambari UI after upgrade (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/32896cb6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/32896cb6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/32896cb6
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 32896cb686599999b49ee30f56cc5efd9d642454
Parents: 195f3ce
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Mon Dec 19 15:06:57 2016 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Mon Dec 19 15:06:57 2016 +0200
----------------------------------------------------------------------
ambari-agent/src/main/python/ambari_agent/main.py | 8 ++++++++
1 file changed, 8 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/32896cb6/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 04e0c2c..f812226 100644
--- a/ambari-agent/src/main/python/ambari_agent/main.py
+++ b/ambari-agent/src/main/python/ambari_agent/main.py
@@ -18,6 +18,13 @@ See the License for the specific language governing permissions and
limitations under the License.
'''
+def fix_encoding_reimport_bug():
+ """
+ Fix https://bugs.python.org/issue14847
+ """
+ b'x'.decode('utf-8')
+ b'x'.decode('ascii')
+
def fix_subprocess_racecondition():
"""
Subprocess in Python has race condition with enabling/disabling gc. Which may lead to turning off python garbage collector.
@@ -36,6 +43,7 @@ def fix_subprocess_racecondition():
import gc
fix_subprocess_racecondition()
+fix_encoding_reimport_bug()
import logging.handlers
import logging.config
[14/15] ambari git commit: AMBARI-19216 After rescanning yarn queue,
Ambari still asks for RM to be restarted (dsen)
Posted by nc...@apache.org.
AMBARI-19216 After rescanning yarn queue, Ambari still asks for RM to be restarted (dsen)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/95e9804a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/95e9804a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/95e9804a
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 95e9804acdd7fa806357feb84d1e9c7f589dd8a0
Parents: 28f1f2e
Author: Dmytro Sen <ds...@apache.org>
Authored: Tue Dec 20 15:12:46 2016 +0200
Committer: Dmytro Sen <ds...@apache.org>
Committed: Tue Dec 20 15:12:46 2016 +0200
----------------------------------------------------------------------
.../src/main/python/ambari_agent/ActionQueue.py | 13 +++++
.../test/python/ambari_agent/TestActionQueue.py | 61 ++++++++++++++++++++
2 files changed, 74 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/95e9804a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index cc1a048..793eeba 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -430,6 +430,19 @@ class ActionQueue(threading.Thread):
# let ambari know that configuration tags were applied
configHandler = ActualConfigHandler(self.config, self.configTags)
+ #update
+ if 'commandParams' in command:
+ command_params = command['commandParams']
+ if command_params and command_params.has_key('forceRefreshConfigTags') and len(command_params['forceRefreshConfigTags']) > 0 :
+ forceRefreshConfigTags = command_params['forceRefreshConfigTags'].split(',')
+ logger.info("Got refresh additional component tags command")
+
+ for configTag in forceRefreshConfigTags :
+ configHandler.update_component_tag(command['role'], configTag, command['configurationTags'][configTag])
+
+ roleResult['customCommand'] = self.CUSTOM_COMMAND_RESTART # force restart for component to evict stale_config on server side
+ command['configurationTags'] = configHandler.read_actual_component(command['role'])
+
if command.has_key('configurationTags'):
configHandler.write_actual(command['configurationTags'])
roleResult['configurationTags'] = command['configurationTags']
http://git-wip-us.apache.org/repos/asf/ambari/blob/95e9804a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
index 65127f2..d4f5436 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
@@ -214,6 +214,20 @@ class TestActionQueue(TestCase):
'hostLevelParams':{'custom_command': 'START'}
}
+ yarn_refresh_queues_custom_command = {
+ 'commandType': 'EXECUTION_COMMAND',
+ 'role': u'RESOURCEMANAGER',
+ 'roleCommand': u'CUSTOM_COMMAND',
+ 'commandId': '1-1',
+ 'taskId': 9,
+ 'clusterName': u'cc',
+ 'serviceName': u'YARN',
+ 'commandParams' : {'forceRefreshConfigTags' : 'capacity-scheduler'},
+ 'configurations':{'global' : {}},
+ 'configurationTags':{'global' : { 'tag': 'v123' }, 'capacity-scheduler' : {'tag': 'v123'}},
+ 'hostLevelParams':{'custom_command': 'REFRESHQUEUES'}
+ }
+
status_command_for_alerts = {
"serviceName" : 'FLUME',
"commandType" : "STATUS_COMMAND",
@@ -826,6 +840,53 @@ class TestActionQueue(TestCase):
@patch.object(OSCheck, "os_distribution", new = MagicMock(return_value = os_distro_value))
@patch.object(ActualConfigHandler, "write_client_components")
@patch.object(ActualConfigHandler, "write_actual_component")
+ @patch.object(ActualConfigHandler, "update_component_tag")
+ @patch.object(CustomServiceOrchestrator, "runCommand")
+ @patch("CommandStatusDict.CommandStatusDict")
+ @patch.object(ActionQueue, "status_update_callback")
+ def test_refresh_queues_custom_command(self, status_update_callback_mock,
+ command_status_dict_mock,
+ cso_runCommand_mock, update_component_tag, write_actual_component_mock, write_client_components_mock):
+ custom_service_orchestrator_execution_result_dict = {
+ 'stdout': 'out',
+ 'stderr': 'stderr',
+ 'structuredOut' : '',
+ 'exitcode' : 0
+ }
+ cso_runCommand_mock.return_value = custom_service_orchestrator_execution_result_dict
+
+ config = AmbariConfig()
+ tempdir = tempfile.gettempdir()
+ config.set('agent', 'prefix', tempdir)
+ config.set('agent', 'cache_dir', "/var/lib/ambari-agent/cache")
+ config.set('agent', 'tolerate_download_failures', "true")
+ dummy_controller = MagicMock()
+ actionQueue = ActionQueue(config, dummy_controller)
+ actionQueue.execute_command(self.yarn_refresh_queues_custom_command)
+
+ report = actionQueue.result()
+ expected = {'status': 'COMPLETED',
+ 'configurationTags': None,
+ 'stderr': 'stderr',
+ 'stdout': 'out\n\nCommand completed successfully!\n',
+ 'clusterName': u'cc',
+ 'structuredOut': '""',
+ 'roleCommand': u'CUSTOM_COMMAND',
+ 'serviceName': u'YARN',
+ 'role': u'RESOURCEMANAGER',
+ 'actionId': '1-1',
+ 'taskId': 9,
+ 'customCommand': 'RESTART',
+ 'exitCode': 0}
+ self.assertEqual(len(report['reports']), 1)
+ self.assertEqual(expected, report['reports'][0])
+
+ # Configuration tags should be updated
+ self.assertTrue(update_component_tag.called)
+
+ @patch.object(OSCheck, "os_distribution", new = MagicMock(return_value = os_distro_value))
+ @patch.object(ActualConfigHandler, "write_client_components")
+ @patch.object(ActualConfigHandler, "write_actual_component")
@patch.object(CustomServiceOrchestrator, "runCommand")
@patch("CommandStatusDict.CommandStatusDict")
@patch.object(ActionQueue, "status_update_callback")
[04/15] ambari git commit: AMBARI-19231 Delete host component should
show configs being changed in recommendation popup modal. (ababiichuk)
Posted by nc...@apache.org.
AMBARI-19231 Delete host component should show configs being changed in recommendation popup modal. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/195f3ce1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/195f3ce1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/195f3ce1
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 195f3ce164e6654b77813c412fe70fe240bb58c1
Parents: 61dcdc3
Author: ababiichuk <ab...@hortonworks.com>
Authored: Mon Dec 19 09:00:37 2016 +0200
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Mon Dec 19 12:13:32 2016 +0200
----------------------------------------------------------------------
ambari-web/app/controllers/main/host/details.js | 418 ++++++++++---------
ambari-web/app/messages.js | 7 -
.../main/host/details/addComponentPopup.hbs | 19 -
.../details/addComponentWithConfigsChanges.hbs | 27 --
.../host/details/addDeleteComponentPopup.hbs | 40 ++
.../main/host/details/deleteComponentPopup.hbs | 45 --
ambari-web/app/views/main/host/summary.js | 4 -
.../test/controllers/main/host/details_test.js | 223 +++-------
8 files changed, 310 insertions(+), 473 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/195f3ce1/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 3a5dca5..5f2af2c 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -75,6 +75,67 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
isConfigsLoaded: false,
+ addDeleteComponentsMap: {
+ 'ZOOKEEPER_SERVER': {
+ deletePropertyName: 'fromDeleteZkServer',
+ configsCallbackName: 'loadStormConfigs'
+ },
+ 'HIVE_METASTORE': {
+ deletePropertyName: 'deleteHiveMetaStore',
+ hostPropertyName: 'hiveMetastoreHost',
+ configsCallbackName: 'loadHiveConfigs'
+ },
+ 'WEBHCAT_SERVER': {
+ deletePropertyName: 'deleteWebHCatServer',
+ hostPropertyName: 'webhcatServerHost',
+ configsCallbackName: 'loadWebHCatConfigs'
+ },
+ 'HIVE_SERVER': {
+ deletePropertyName: 'deleteHiveServer',
+ hostPropertyName: '',
+ configsCallbackName: 'loadHiveConfigs'
+ },
+ 'NIMBUS': {
+ deletePropertyName: 'deleteNimbusHost',
+ hostPropertyName: 'nimbusHost',
+ configsCallbackName: 'loadStormConfigs'
+ },
+ 'RANGER_KMS_SERVER': {
+ deletePropertyName: 'deleteRangerKMSServer',
+ hostPropertyName: 'rangerKMSServerHost',
+ configsCallbackName: 'loadRangerConfigs'
+ }
+ },
+
+ addDeleteComponentPopupBody: Em.View.extend({
+ templateName: require('templates/main/host/details/addDeleteComponentPopup'),
+ isReconfigure: false,
+ commonMessage: '',
+ manualKerberosWarning: App.get('router.mainAdminKerberosController.isManualKerberos') ?
+ Em.I18n.t('hosts.host.manualKerberosWarning') : '',
+ propertiesToChange: [],
+ lastComponent: false,
+ lastComponentError: '',
+ setPopupSize: function () {
+ this.set('parentView.hasPropertiesToChange', !!this.get('propertiesToChange.length'));
+ }.observes('propertiesToChange.length')
+ }),
+
+ applyConfigsCustomization: function (configs) {
+ configs.propertiesToChange.forEach(function (property) {
+ var value = property.saveRecommended ? property.recommendedValue : property.initialValue,
+ filename = property.propertyFileName;
+ if (configs.groups.length) {
+ var group = configs.groups.find(function (item) {
+ return item.properties.hasOwnProperty(filename);
+ });
+ if (group) {
+ group.properties[filename][property.propertyName] = value;
+ }
+ }
+ });
+ },
+
/**
* Open dashboard page
* @method routeHome
@@ -316,47 +377,84 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
var component = event.context;
var componentName = component.get('componentName');
var displayName = component.get('displayName');
- var isLastComponent = (this.getTotalComponent(component) === 1);
+ var hostName = event.selectedHost || this.get('content.hostName');
+ var returnFunc;
+ var componentsMapItem = this.get('addDeleteComponentsMap')[componentName];
+ if (componentsMapItem) {
+ var primary;
+ if (componentsMapItem.deletePropertyName) {
+ this.set(componentsMapItem.deletePropertyName, true);
+ }
+ if (componentName === 'ZOOKEEPER_SERVER') {
+ primary = function () {
+ this.set('fromDeleteZkServer', true);
+ this.updateStormConfigs();
+ this.isServiceMetricsLoaded(function () {
+ self.loadConfigs();
+ });
+ }
+ }
+ returnFunc = this.showDeleteComponentPopup(component, true, componentsMapItem.configsCallbackName, primary);
+ } else if (componentName === 'JOURNALNODE') {
+ returnFunc = App.showConfirmationPopup(function () {
+ App.router.transitionTo('main.services.manageJournalNode');
+ }, Em.I18n.t('hosts.host.deleteComponent.popup.deleteJournalNodeMsg'));
+ } else {
+ returnFunc = this.showDeleteComponentPopup(component);
+ }
+ return returnFunc;
+ },
+
+ showDeleteComponentPopup: function (component, isReconfigure, callbackName, primary) {
+ var self = this,
+ isLastComponent = (this.getTotalComponent(component) === 1),
+ componentName = component.get('componentName'),
+ componentDisplayName = component.get('displayName'),
+ commonMessage = Em.I18n.t('hosts.host.deleteComponent.popup.msg1').format(componentDisplayName);
+ if (isReconfigure) {
+ var configs = {
+ groups: [],
+ propertiesToChange: []
+ };
+ this.loadConfigs(callbackName, configs);
+ }
return App.ModalPopup.show({
header: Em.I18n.t('popup.confirmation.commonHeader'),
- primary: componentName == 'JOURNALNODE'? Em.I18n.t('ok') : Em.I18n.t('hosts.host.deleteComponent.popup.confirm'),
- bodyClass: Em.View.extend({
- templateName: require('templates/main/host/details/deleteComponentPopup')
+ controller: self,
+ hasPropertiesToChange: false,
+ classNameBindings: ['hasPropertiesToChange:common-modal-wrapper', 'hasPropertiesToChange:modal-full-width'],
+ modalDialogClasses: function () {
+ return this.get('hasPropertiesToChange') ? ['modal-lg'] : [];
+ }.property('hasPropertiesToChange'),
+ primary: Em.I18n.t('hosts.host.deleteComponent.popup.confirm'),
+ bodyClass: self.get('addDeleteComponentPopupBody').extend({
+ isReconfigure: isReconfigure,
+ commonMessage: commonMessage,
+ propertiesToChange: isReconfigure ? configs.propertiesToChange : [],
+ lastComponentError: Em.I18n.t('hosts.host.deleteComponent.popup.warning').format(componentDisplayName),
+ lastComponent: function () {
+ this.set('parentView.isChecked', !isLastComponent);
+ return isLastComponent;
+ }.property()
}),
- isHiveMetastore: componentName == 'HIVE_METASTORE',
- isWebHCatServer: componentName == 'WEBHCAT_SERVER',
- isNimbus: componentName == 'NIMBUS',
- isRangerKMSServer: componentName == 'RANGER_KMS_SERVER',
- isZkServer: componentName == 'ZOOKEEPER_SERVER',
- isJournalNode: componentName == 'JOURNALNODE',
-
- deleteHiveMetastoreMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteHiveMetastore'),
- deleteWebHCatServerMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteWebHCatServer'),
- deleteNimbusMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteNimbus'),
- deleteRangerKMSServereMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteRangerKMSServer'),
- lastComponentError: Em.I18n.t('hosts.host.deleteComponent.popup.warning').format(displayName),
- deleteComponentMsg: Em.I18n.t('hosts.host.deleteComponent.popup.msg1').format(displayName),
- deleteZkServerMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteZooKeeperServer'),
- deleteJournalNodeMsg: Em.I18n.t('hosts.host.deleteComponent.popup.deleteJournalNodeMsg'),
-
isChecked: false,
- disablePrimary: Em.computed.not('isChecked'),
- lastComponent: function () {
- this.set('isChecked', !isLastComponent);
- return isLastComponent;
- }.property(),
-
+ disablePrimary: function () {
+ return (isReconfigure && !this.get('controller.isConfigsLoaded')) || !this.get('isChecked');
+ }.property('controller.isConfigsLoaded', 'isChecked'),
onPrimary: function () {
- var popup = this;
- if (componentName == 'JOURNALNODE') {
- popup.hide();
- App.router.transitionTo('main.services.manageJournalNode');
- } else {
- self._doDeleteHostComponent(component, function () {
- self.set('redrawComponents', true);
- popup.hide();
- });
+ this._super();
+ if (isReconfigure) {
+ self.applyConfigsCustomization(configs);
}
+ self._doDeleteHostComponent(componentName, function () {
+ if (isReconfigure) {
+ self.saveConfigsBatch(configs.groups, componentName);
+ if (primary) {
+ primary.call(self);
+ }
+ }
+ self.set('redrawComponents', true);
+ });
}
});
},
@@ -394,13 +492,13 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
* when components failed to get deleted.
* @method _doDeleteHostComponent
*/
- _doDeleteHostComponent: function (component, callback) {
+ _doDeleteHostComponent: function (componentName, callback) {
callback = callback || Em.K;
App.ajax.send({
- name: (Em.isNone(component)) ? 'common.delete.host' : 'common.delete.host_component',
+ name: (Em.isNone(componentName)) ? 'common.delete.host' : 'common.delete.host_component',
sender: this,
data: {
- componentName: (component) ? component.get('componentName') : '',
+ componentName: componentName || '',
hostName: this.get('content.hostName')
},
success: '_doDeleteHostComponentSuccessCallback',
@@ -419,31 +517,8 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
* @method _doDeleteHostComponentSuccessCallback
*/
_doDeleteHostComponentSuccessCallback: function (response, request, data) {
- var self = this;
this.set('_deletedHostComponentResult', null);
this.removeHostComponentModel(data.componentName, data.hostName);
- if (data.componentName == 'ZOOKEEPER_SERVER') {
- this.set('fromDeleteZkServer', true);
- this.updateStormConfigs();
- self.isServiceMetricsLoaded(function () {
- self.loadConfigs();
- });
- } else if (data.componentName == 'HIVE_METASTORE') {
- this.set('deleteHiveMetaStore', true);
- this.loadConfigs('loadHiveConfigs');
- } else if (data.componentName == 'WEBHCAT_SERVER') {
- this.set('deleteWebHCatServer', true);
- this.loadConfigs('loadWebHCatConfigs');
- } 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');
- } else if (data.componentName == 'RANGER_KMS_SERVER') {
- this.set('deleteRangerKMSServer', true);
- this.loadConfigs('loadRangerConfigs');
- }
},
/**
@@ -538,55 +613,6 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
}
},
- showAddComponentConfirmation: function (componentName, callbackName, primary) {
- var self = this,
- componentDisplayName = App.format.role(componentName, false),
- manualKerberosWarning = App.get('router.mainAdminKerberosController.isManualKerberos') ?
- Em.I18n.t('hosts.host.manualKerberosWarning') : '',
- commonMessage = Em.I18n.t('hosts.host.addComponent.msg').format(componentDisplayName),
- configs = {
- groups: [],
- propertiesToChange: []
- };
- this.loadConfigs(callbackName, configs);
- App.ModalPopup.show({
- header: Em.I18n.t('popup.confirmation.commonHeader'),
- controller: self,
- hasPropertiesToChange: false,
- classNameBindings: ['hasPropertiesToChange:common-modal-wrapper', 'hasPropertiesToChange:modal-full-width'],
- modalDialogClasses: function () {
- return this.get('hasPropertiesToChange') ? ['modal-lg'] : [];
- }.property('hasPropertiesToChange'),
- primary: Em.I18n.t('hosts.host.addComponent.popup.confirm'),
- bodyClass: Em.View.extend({
- templateName: require('templates/main/host/details/addComponentWithConfigsChanges'),
- commonMessage: commonMessage,
- manualKerberosWarning: manualKerberosWarning,
- propertiesToChange: configs.propertiesToChange,
- setPopupSize: function () {
- this.set('parentView.hasPropertiesToChange', !!this.get('propertiesToChange.length'));
- }.observes('propertiesToChange.length')
- }),
- disablePrimary: Em.computed.not('controller.isConfigsLoaded'),
- onPrimary: function () {
- this._super();
- configs.propertiesToChange.forEach(function (property) {
- var value = property.saveRecommended ? property.recommendedValue : property.initialValue,
- filename = property.propertyFileName;
- if (configs.groups.length) {
- var group = configs.groups.find(function (item) {
- return item.properties.hasOwnProperty(filename);
- });
- group.properties[filename][property.propertyName] = value;
- }
- });
- if (primary) {
- primary.call(self, configs.groups);
- }
- }
- });
- },
-
/**
* add component as <code>addComponent<code> method but perform
* kdc sessionstate if cluster is secure;
@@ -616,7 +642,8 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
installedComponents: this.get('content.hostComponents').mapProperty('componentName')
}),
isManualKerberos = App.get('router.mainAdminKerberosController.isManualKerberos'),
- manualKerberosWarning = isManualKerberos ? Em.I18n.t('hosts.host.manualKerberosWarning') : '';
+ manualKerberosWarning = isManualKerberos ? Em.I18n.t('hosts.host.manualKerberosWarning') : '',
+ componentsMapItem = this.get('addDeleteComponentsMap')[componentName];
if (!!missedComponents.length) {
var popupMessage = Em.I18n.t('host.host.addComponent.popup.dependedComponents.body').format(component.get('displayName'),
@@ -626,110 +653,74 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
return App.showAlertPopup(Em.I18n.t('host.host.addComponent.popup.dependedComponents.header'), popupMessage);
}
- switch (componentName) {
- case 'ZOOKEEPER_SERVER':
- returnFunc = self.showAddComponentConfirmation(componentName, null, function (groups) {
- this.saveConfigsBatch(groups, componentName, hostName);
- });
- break;
- case 'HIVE_METASTORE':
- self.set('hiveMetastoreHost', hostName);
- returnFunc = self.showAddComponentConfirmation(componentName, 'loadHiveConfigs', function (groups) {
- this.saveConfigsBatch(groups, componentName, hostName);
+ if (componentsMapItem) {
+ var primary;
+ if (componentsMapItem.hostPropertyName) {
+ this.set(componentsMapItem.hostPropertyName, hostName);
+ }
+ if (componentName === 'HIVE_METASTORE') {
+ primary = function () {
this.set('addHiveServer', false);
- });
- break;
- case 'WEBHCAT_SERVER':
- self.set('webhcatServerHost', hostName);
- returnFunc = self.showAddComponentConfirmation(componentName, 'loadWebHCatConfigs', function (groups) {
- this.saveConfigsBatch(groups, componentName, hostName);
- });
- break;
- case 'NIMBUS':
- self.set('nimbusHost', hostName);
- returnFunc = self.showAddComponentConfirmation(componentName, 'loadStormConfigs', function (groups) {
- this.saveConfigsBatch(groups, componentName, hostName);
- });
- break;
- case 'RANGER_KMS_SERVER':
- self.set('rangerKMSServerHost', hostName);
- returnFunc = self.showAddComponentConfirmation(componentName, 'loadRangerConfigs', function (groups) {
- this.saveConfigsBatch(groups, componentName, hostName);
- });
- break;
- case 'JOURNALNODE':
- returnFunc = App.showConfirmationPopup(function () {
- App.router.transitionTo('main.services.manageJournalNode');
- }, Em.I18n.t('hosts.host.addComponent.' + componentName) + manualKerberosWarning);
- break;
- default:
- returnFunc = this.addClientComponent(component, isManualKerberos);
+ };
+ }
+ returnFunc = self.showAddComponentPopup(component, hostName, null, true, componentsMapItem.configsCallbackName, primary);
+ } else if (componentName === 'JOURNALNODE') {
+ returnFunc = App.showConfirmationPopup(function () {
+ App.router.transitionTo('main.services.manageJournalNode');
+ }, Em.I18n.t('hosts.host.addComponent.' + componentName) + manualKerberosWarning);
+ } else {
+ returnFunc = this.showAddComponentPopup(component, hostName, function () {
+ self.installHostComponentCall(hostName, component);
+ });
}
return returnFunc;
},
- /**
- * Send command to server to install client on selected host
- * @param {App.HostComponent} component
- * @param {boolean} isManualKerberos
- * @returns {*}
- */
- addClientComponent: function (component, isManualKerberos) {
+ showAddComponentPopup: function (component, hostName, primary, isReconfigure, callbackName, primaryOnReconfigure) {
var self = this,
- displayName = this.formatClientsMessage(component);
-
- return this.showAddComponentPopup(displayName, isManualKerberos, function () {
- self.installHostComponentCall(self.get('content.hostName'), component);
- });
- },
-
- /**
- *
- * @param {string} displayName
- * @param {boolean} isManualKerberos
- * @param {Function} primary
- * @returns {*}
- */
- showAddComponentPopup: function (displayName, isManualKerberos, primary) {
- isManualKerberos = isManualKerberos || false;
-
+ componentName = component.get('componentName'),
+ componentDisplayName = component.get('displayName'),
+ commonMessage = Em.I18n.t('hosts.host.addComponent.msg').format(componentDisplayName);
+ if (isReconfigure) {
+ var configs = {
+ groups: [],
+ propertiesToChange: []
+ };
+ this.loadConfigs(callbackName, configs);
+ }
return App.ModalPopup.show({
- primary: Em.I18n.t('hosts.host.addComponent.popup.confirm'),
header: Em.I18n.t('popup.confirmation.commonHeader'),
-
- addComponentMsg: Em.I18n.t('hosts.host.addComponent.msg').format(displayName),
-
- manualKerberosWarning: isManualKerberos ? Em.I18n.t('hosts.host.manualKerberosWarning') : '',
-
- bodyClass: Em.View.extend({
- templateName: require('templates/main/host/details/addComponentPopup')
+ controller: self,
+ hasPropertiesToChange: false,
+ classNameBindings: ['hasPropertiesToChange:common-modal-wrapper', 'hasPropertiesToChange:modal-full-width'],
+ modalDialogClasses: function () {
+ return this.get('hasPropertiesToChange') ? ['modal-lg'] : [];
+ }.property('hasPropertiesToChange'),
+ primary: Em.I18n.t('hosts.host.addComponent.popup.confirm'),
+ bodyClass: self.get('addDeleteComponentPopupBody').extend({
+ commonMessage: commonMessage,
+ isReconfigure: isReconfigure,
+ propertiesToChange: isReconfigure ? configs.propertiesToChange : []
}),
-
+ disablePrimary: function () {
+ return isReconfigure && !this.get('controller.isConfigsLoaded');
+ }.property('controller.isConfigsLoaded'),
onPrimary: function () {
- this.hide();
- primary();
+ this._super();
+ if (isReconfigure) {
+ self.applyConfigsCustomization(configs);
+ self.saveConfigsBatch(configs.groups, componentName, hostName);
+ if (primaryOnReconfigure) {
+ primaryOnReconfigure.call(self);
+ }
+ } else if (primary) {
+ primary();
+ }
}
});
},
/**
- * format message for operation of adding clients
- * @param client
- */
- formatClientsMessage: function (client) {
- var displayName = Em.isNone(client.get('displayName')) ? '' : client.get('displayName');
- var subComponentNames = client.get('subComponentNames');
- if (subComponentNames && subComponentNames.length > 0) {
- var dns = [];
- subComponentNames.forEach(function (scn) {
- dns.push(App.format.role(scn, false));
- });
- displayName += " (" + dns.join(", ") + ")";
- }
- return displayName;
- },
-
- /**
* Success callback for install host component request (sent in <code>addNewComponentSuccessCallback</code>)
* @param {object} data
* @param {object} opt
@@ -807,7 +798,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
/**
* get Oozie database config and set databaseType
* @param {object} data
- * @method onLoadHiveConfigs
+ * @method onLoadOozieConfigs
*/
onLoadOozieConfigs: function (data) {
var configs = {};
@@ -931,7 +922,20 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
this.updateZkConfigs(configs, params.configs);
- configs['storm-site']['nimbus.seeds'] = JSON.stringify(stormNimbusHosts).replace(/"/g, "'");
+ var nimbusSeedsInit = configs['storm-site']['nimbus.seeds'],
+ nimbusSeedsRecommended = JSON.stringify(stormNimbusHosts).replace(/"/g, "'");
+ configs['storm-site']['nimbus.seeds'] = nimbusSeedsRecommended;
+ if (params.configs && nimbusSeedsInit !== nimbusSeedsRecommended) {
+ var service = App.config.get('serviceByConfigTypeMap')['storm-site'];
+ params.configs.propertiesToChange.pushObject({
+ propertyFileName: 'storm-site',
+ propertyName: 'nimbus.seeds',
+ serviceDisplayName: service && service.get('displayName'),
+ initialValue: nimbusSeedsInit,
+ recommendedValue: nimbusSeedsRecommended,
+ saveRecommended: true
+ });
+ }
var groups = [
{
properties: {
@@ -2540,7 +2544,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
allComponents.forEach(function (component, index) {
var length = allComponents.get('length');
if (!deleteError) {
- this._doDeleteHostComponent(component, function () {
+ this._doDeleteHostComponent(component.get('componentName'), function () {
deleteError = self.get('_deletedHostComponentResult');
if (index == length - 1) {
dfd.resolve();
@@ -2704,9 +2708,11 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
}
};
if (clientsToAdd.length) {
- var message = stringUtils.getFormattedStringFromArray(clientsToAdd.mapProperty('displayName'));
- var isManualKerberos = App.get('router.mainAdminKerberosController.isManualKerberos');
- self.showAddComponentPopup(message, isManualKerberos, function () {
+ var message = stringUtils.getFormattedStringFromArray(clientsToAdd.mapProperty('displayName')),
+ componentObject = Em.Object.create({
+ displayName: message
+ });
+ self.showAddComponentPopup(componentObject, self.get('content.hostName'), function () {
sendInstallCommand();
clientsToAdd.forEach(function (component) {
self.installHostComponentCall(self.get('content.hostName'), component);
http://git-wip-us.apache.org/repos/asf/ambari/blob/195f3ce1/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index cc8102a..64a5e77 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2653,17 +2653,12 @@ Em.I18n.translations = {
'host.host.componentFilter.slave':'Slave Components',
'host.host.componentFilter.client':'Client Components',
'hosts.host.deleteComponent.popup.msg1':'Are you sure you want to delete {0}?',
- 'hosts.host.deleteComponent.popup.deleteZooKeeperServer':'Deleting <i>ZooKeeper Server</i> may reconfigure such properties:<ul><li>zookeeper.connect</li><li>ha.zookeeper.quorum</li><li>hbase.zookeeper.quorum</li><li>templeton.zookeeper.hosts</li><li>yarn.resourcemanager.zk-address</li><li>hive.zookeeper.quorum</li><li>hive.cluster.delegation.token.store.zookeeper.connectString</li><li>storm.zookeeper.servers</li><li>instance.zookeeper.host</li></ul>',
- 'hosts.host.deleteComponent.popup.deleteRangerKMSServer': 'Deleting <i>Ranger KMS Server</i> may reconfigure such properties:<ul><li>hadoop.security.key.provider.path</li><li>dfs.encryption.key.provider.uri</li>',
'hosts.host.deleteComponent.popup.deleteJournalNodeMsg': 'You are about to open <i>Manage Journal Node Wizard</i>. Are you sure?',
'hosts.host.deleteComponent.popup.warning':'<b>WARNING!</b> Delete the last <i>{0}</i> component in the cluster?</br>Deleting the last component in the cluster could result in permanent loss of service data.',
'hosts.host.deleteComponent.popup.confirm':'Confirm Delete',
'hosts.host.installComponent.popup.confirm':'Confirm Install',
'hosts.host.installComponent.msg':'Are you sure you want to install {0}?',
'hosts.host.addComponent.msg':'Are you sure you want to add {0}?',
- 'hosts.host.addComponent.ZOOKEEPER_SERVER':'Adding ZooKeeper Server may reconfigure such properties:<ul><li>zookeeper.connect</li><li>ha.zookeeper.quorum</li><li>hbase.zookeeper.quorum</li><li>templeton.zookeeper.hosts</li><li>yarn.resourcemanager.zk-address</li><li>hive.zookeeper.quorum</li><li>hive.cluster.delegation.token.store.zookeeper.connectString</li><li>storm.zookeeper.servers</li><li>instance.zookeeper.host</li></ul>',
- 'hosts.host.addComponent.NIMBUS': 'Adding Nimbus will reconfigure <b>nimbus.seeds</b>, <b>topology.min.replication.count</b>, <b>topology.max.replication.wait.time.sec</b> properties if they are defined.',
- 'hosts.host.addComponent.RANGER_KMS_SERVER': 'Adding Ranger KMS Server may reconfigure such properties:<ul><li>hadoop.security.key.provider.path</li><li>dfs.encryption.key.provider.uri</li>',
'hosts.host.addComponent.deleteHostWithZooKeeper':'Deleting host with ZooKeeper Server may reconfigure such properties:<ul><li>ha.zookeeper.quorum</li><li>hbase.zookeeper.quorum</li><li>templeton.zookeeper.hosts</li><li>yarn.resourcemanager.zk-address</li><li>hive.zookeeper.quorum</li><li>hive.cluster.delegation.token.store.zookeeper.connectString</li></ul>',
'host.host.addComponent.popup.dependedComponents.body': '{0} requires {1} to be installed along with it on the same host. Please add them first and then try adding {0}',
'host.host.addComponent.popup.dependedComponents.header': 'Component dependencies',
@@ -2689,8 +2684,6 @@ Em.I18n.translations = {
'hosts.host.hbase_regionserver.decommission.warning':'Last RegionServer can\'t be decommissioned',
'hosts.host.decommissioned':'Decommissioned',
'hosts.host.decommissioning':'Decommissioning',
- 'hosts.host.addComponent.HIVE_METASTORE':'Adding <i>Hive Metastore</i> will reconfigure such properties:<ul><li>hive.metastore.uris</li><li>templeton.hive.properties</li></ul>',
- 'hosts.host.addComponent.WEBHCAT_SERVER':'You are about to add <i>WebHCat Server</i>. Are you sure?',
'hosts.host.addComponent.JOURNALNODE': 'You are about to open <i>Manage Journal Node Wizard</i>. Are you sure?',
'hosts.host.deleteComponent.popup.deleteHiveMetastore':'Deleting <i>Hive Metastore</i> will reconfigure such properties:<ul><li>hive.metastore.uris</li><li>templeton.hive.properties</li></ul>',
'hosts.host.deleteComponent.popup.deleteWebHCatServer':'You are about to delete <i>WebHCat Server</i>. Are you sure?',
http://git-wip-us.apache.org/repos/asf/ambari/blob/195f3ce1/ambari-web/app/templates/main/host/details/addComponentPopup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/details/addComponentPopup.hbs b/ambari-web/app/templates/main/host/details/addComponentPopup.hbs
deleted file mode 100644
index ff69b9e..0000000
--- a/ambari-web/app/templates/main/host/details/addComponentPopup.hbs
+++ /dev/null
@@ -1,19 +0,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.
-}}
-
-{{addComponentMsg}}<br />{{{manualKerberosWarning}}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/195f3ce1/ambari-web/app/templates/main/host/details/addComponentWithConfigsChanges.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/details/addComponentWithConfigsChanges.hbs b/ambari-web/app/templates/main/host/details/addComponentWithConfigsChanges.hbs
deleted file mode 100644
index d62715d..0000000
--- a/ambari-web/app/templates/main/host/details/addComponentWithConfigsChanges.hbs
+++ /dev/null
@@ -1,27 +0,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.
-}}
-
-{{#if controller.isConfigsLoaded}}
- {{view.commonMessage}}
- {{#if view.propertiesToChange.length}}
- {{view App.DependentConfigsListView isAfterRecommendation=false recommendationsBinding="view.propertiesToChange"}}
- {{/if}}
- {{{view.manualKerberosWarning}}}
-{{else}}
- {{view App.SpinnerView}}
-{{/if}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/195f3ce1/ambari-web/app/templates/main/host/details/addDeleteComponentPopup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/details/addDeleteComponentPopup.hbs b/ambari-web/app/templates/main/host/details/addDeleteComponentPopup.hbs
new file mode 100644
index 0000000..713ad8c
--- /dev/null
+++ b/ambari-web/app/templates/main/host/details/addDeleteComponentPopup.hbs
@@ -0,0 +1,40 @@
+{{!
+* 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.
+}}
+
+{{#if view.lastComponent}}
+ <div class="alert alert-danger">
+ <div class="row row-no-pad">
+ <div class="col-md-1">{{view Ember.Checkbox checkedBinding="view.parentView.isChecked"}}</div>
+ <div class="col-md-11">{{{view.lastComponentError}}}</div>
+ </div>
+ </div>
+{{/if}}
+{{#if view.isReconfigure}}
+ {{#if controller.isConfigsLoaded}}
+ {{view.commonMessage}}
+ {{#if view.propertiesToChange.length}}
+ {{view App.DependentConfigsListView isAfterRecommendation=false recommendationsBinding="view.propertiesToChange"}}
+ {{/if}}
+ {{{view.manualKerberosWarning}}}
+ {{else}}
+ {{view App.SpinnerView}}
+ {{/if}}
+{{else}}
+ <div>{{view.commonMessage}}</div>
+ <div>{{{view.manualKerberosWarning}}}</div>
+{{/if}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/195f3ce1/ambari-web/app/templates/main/host/details/deleteComponentPopup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/details/deleteComponentPopup.hbs b/ambari-web/app/templates/main/host/details/deleteComponentPopup.hbs
deleted file mode 100644
index 45cee97..0000000
--- a/ambari-web/app/templates/main/host/details/deleteComponentPopup.hbs
+++ /dev/null
@@ -1,45 +0,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.
-}}
-
-<p>{{{deleteComponentMsg}}}</p>
-{{#if lastComponent}}
- <div class="alert alert-danger">
- <div class="row row-no-pad">
- <div class="col-md-1">{{view App.CheckboxView checkedBinding="isChecked"}}</div>
- <div class="col-md-11">{{{lastComponentError}}}</div>
- </div>
- </div>
-{{/if}}
-{{#if isZkServer}}
- <div class="alert alert-warning">{{{deleteZkServerMsg}}}</div>
-{{/if}}
-{{#if isHiveMetastore}}
- <div class="alert alert-warning">{{{deleteHiveMetastoreMsg}}}</div>
-{{/if}}
-{{#if isWebHCatServer}}
- <div class="alert alert-warning">{{{deleteWebHCatServerMsg}}}</div>
-{{/if}}
-{{#if isNimbus}}
- <div class="alert alert-warning">{{{deleteNimbusMsg}}}</div>
-{{/if}}
-{{#if isRangerKMSServer}}
- <div class="alert alert-warning">{{{deleteRangerKMSServereMsg}}}</div>
-{{/if}}
-{{#if isJournalNode}}
- <div class="alert alert-warning">{{{deleteJournalNodeMsg}}}</div>
-{{/if}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/195f3ce1/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 80c4890..89332de 100644
--- a/ambari-web/app/views/main/host/summary.js
+++ b/ambari-web/app/views/main/host/summary.js
@@ -215,11 +215,7 @@ App.MainHostSummaryView = Em.View.extend(App.TimeRangeMixin, {
*/
addableComponentObject: Em.Object.extend({
componentName: '',
- subComponentNames: null,
displayName: function () {
- if (this.get('componentName') === 'CLIENTS') {
- return this.t('common.clients');
- }
return App.format.role(this.get('componentName'), false);
}.property('componentName')
}),
http://git-wip-us.apache.org/repos/asf/ambari/blob/195f3ce1/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 5dc13a9..4203644 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -500,125 +500,70 @@ describe('App.MainHostDetailsController', function () {
});
describe('#addComponent()', function () {
+ var cases = [
+ {
+ componentName: 'ZOOKEEPER_SERVER',
+ showAddComponentPopupCallCount: 1,
+ showConfirmationPopupCallCount: 0
+ },
+ {
+ componentName: 'RESOURCEMANAGER',
+ showAddComponentPopupCallCount: 1,
+ showConfirmationPopupCallCount: 0
+ },
+ {
+ componentName: 'JOURNALNODE',
+ showAddComponentPopupCallCount: 0,
+ showConfirmationPopupCallCount: 1
+ },
+ {
+ componentName: 'HIVE_CLIENT',
+ showAddComponentPopupCallCount: 1,
+ showConfirmationPopupCallCount: 0
+ }
+ ];
beforeEach(function () {
- sinon.stub(controller, "addClientComponent", Em.K);
- sinon.stub(controller, "installHostComponentCall", Em.K);
sinon.stub(controller, "checkComponentDependencies", Em.K);
- sinon.stub(controller, "showAddComponentConfirmation", Em.K);
+ sinon.stub(controller, "showAddComponentPopup", Em.K);
+ sinon.stub(App, "showConfirmationPopup", Em.K);
controller.set('content', {
hostComponents: [Em.Object.create({
componentName: "HDFS_CLIENT"
})]
});
- controller.reopen({
- securityEnabled: false
- });
});
afterEach(function () {
- controller.addClientComponent.restore();
- controller.installHostComponentCall.restore();
controller.checkComponentDependencies.restore();
- controller.showAddComponentConfirmation.restore();
+ controller.showAddComponentPopup.restore();
+ App.showConfirmationPopup.restore();
});
- it('add ZOOKEEPER_SERVER', function () {
- var event = {
- context: Em.Object.create({
- componentName: 'ZOOKEEPER_SERVER'
- })
- };
- controller.addComponent(event);
- expect(controller.showAddComponentConfirmation.calledOnce).to.be.true;
- });
- it('add WEBHCAT_SERVER', function () {
- var event = {
- context: Em.Object.create({
- componentName: 'WEBHCAT_SERVER'
- })
- };
- controller.addComponent(event);
- expect(controller.showAddComponentConfirmation.calledOnce).to.be.true;
- });
- it('add slave component', function () {
- var event = {
- context: Em.Object.create({
- componentName: 'HIVE_CLIENT'
- })
- };
- controller.set('securityEnabled', false);
- controller.addComponent(event);
- expect(controller.addClientComponent.calledWith(Em.Object.create({
- componentName: 'HIVE_CLIENT'
- }))).to.be.true;
- });
- });
+ cases.forEach(function (testCase) {
- describe('#formatClientsMessage()', function () {
- var testCases = [
- {
- title: 'subComponentNames is null',
- client: Em.Object.create({
- subComponentNames: null,
- displayName: 'CLIENTS'
- }),
- result: 'CLIENTS'
- },
- {
- title: 'subComponentNames is empty',
- client: Em.Object.create({
- subComponentNames: [],
- displayName: 'CLIENTS'
- }),
- result: 'CLIENTS'
- },
- {
- title: 'displayName is null',
- client: Em.Object.create({
- subComponentNames: ['DATANODE'],
- displayName: null
- }),
- result: ' (DataNode)'
- },
- {
- title: 'displayName is CLIENTS',
- client: Em.Object.create({
- subComponentNames: ['DATANODE'],
- displayName: 'CLIENTS'
- }),
- result: 'CLIENTS (DataNode)'
- }
- ];
- testCases.forEach(function (test) {
- it(test.title, function () {
- expect(controller.formatClientsMessage(test.client)).to.equal(test.result);
- });
- });
- });
+ describe('add ' + testCase.componentName, function () {
- describe('#addClientComponent()', function () {
+ beforeEach(function () {
+ var event = {
+ context: Em.Object.create({
+ componentName: testCase.componentName
+ })
+ };
+ controller.addComponent(event);
+ });
- var component = Em.Object.create({
- componentName: ' Comp1'
- });
+ it('controller.showAddComponentPopup', function () {
+ expect(controller.showAddComponentPopup.callCount).to.equal(testCase.showAddComponentPopupCallCount);
+ });
- beforeEach(function () {
- sinon.spy(controller, 'showAddComponentPopup');
- sinon.stub(controller, 'installHostComponentCall', Em.K);
- });
+ it('App.showConfirmationPopup', function () {
+ expect(App.showConfirmationPopup.callCount).to.equal(testCase.showConfirmationPopupCallCount);
+ });
- afterEach(function () {
- controller.showAddComponentPopup.restore();
- controller.installHostComponentCall.restore();
- });
+ });
- it('any CLIENT component', function () {
- controller.set('content.hostName', 'host1');
- var popup = controller.addClientComponent(component);
- expect(controller.showAddComponentPopup.calledOnce).to.be.true;
- popup.onPrimary();
- expect(controller.installHostComponentCall.calledWith('host1', component)).to.be.true;
});
+
});
describe("#loadOozieConfigs()", function() {
@@ -824,7 +769,7 @@ describe('App.MainHostDetailsController', function () {
var message = 'Comp1';
beforeEach(function () {
- sinon.spy(App.ModalPopup, 'show');
+ sinon.stub(App.ModalPopup, 'show');
});
afterEach(function () {
@@ -832,9 +777,8 @@ describe('App.MainHostDetailsController', function () {
});
it('should display add component confirmation', function () {
- var popup = controller.showAddComponentPopup(message, false, Em.K);
+ controller.showAddComponentPopup(Em.Object.create());
expect(App.ModalPopup.show.calledOnce).to.be.true;
- expect(popup.get('addComponentMsg')).to.eql(Em.I18n.t('hosts.host.addComponent.msg').format(message));
});
});
@@ -2538,8 +2482,8 @@ describe('App.MainHostDetailsController', function () {
describe('#_doDeleteHostComponent()', function () {
it('single component', function () {
controller.set('content.hostName', 'host1');
- var component = Em.Object.create({componentName: 'COMP'});
- controller._doDeleteHostComponent(component);
+ var componentName = 'COMP';
+ controller._doDeleteHostComponent(componentName);
var args = testHelpers.findAjaxRequest('name', 'common.delete.host_component');
expect(args[0]).exists;
expect(args[0].data).to.be.eql({
@@ -2560,77 +2504,28 @@ describe('App.MainHostDetailsController', function () {
});
describe('#_doDeleteHostComponentSuccessCallback()', function () {
+ var data = {
+ componentName: 'COMPONENT',
+ hostName: 'h1'
+ };
+
beforeEach(function () {
sinon.stub(controller, 'removeHostComponentModel', Em.K);
- sinon.stub(controller, 'isServiceMetricsLoaded', function (callback) {
- callback();
- });
- sinon.stub(controller, 'loadConfigs', Em.K);
- sinon.stub(App.StackService, 'find').returns({
- compareCurrentVersion: function() {}
- });
+ controller.set('_deletedHostComponentResult', {});
+ controller._doDeleteHostComponentSuccessCallback({}, {}, data);
});
afterEach(function () {
controller.removeHostComponentModel.restore();
- controller.isServiceMetricsLoaded.restore();
- controller.loadConfigs.restore();
- App.StackService.find.restore();
});
- it('ZOOKEEPER_SERVER component', function () {
- var data = {
- componentName: 'ZOOKEEPER_SERVER'
- };
- controller._doDeleteHostComponentSuccessCallback({}, {}, data);
- expect(controller.get('_deletedHostComponentResult')).to.be.null;
- expect(controller.get('fromDeleteZkServer')).to.be.true;
- expect(controller.loadConfigs.calledOnce).to.be.true;
- });
- it('Not ZOOKEEPER_SERVER component', function () {
- var data = {
- componentName: 'COMP'
- };
- controller.set('fromDeleteZkServer', false);
- controller._doDeleteHostComponentSuccessCallback({}, {}, data);
+ it('should reset `_deletedHostComponentResult`', function () {
expect(controller.get('_deletedHostComponentResult')).to.be.null;
- expect(controller.get('fromDeleteZkServer')).to.be.false;
});
+
it('should call `removeHostComponentModel` with correct params', function () {
- var data = {
- componentName: 'COMPONENT',
- hostName: 'h1'
- };
- controller._doDeleteHostComponentSuccessCallback({}, {}, data);
expect(controller.removeHostComponentModel.calledWith('COMPONENT', 'h1')).to.be.true;
});
- it('HIVE_METASTORE component', function () {
- var data = {
- componentName: 'HIVE_METASTORE'
- };
- 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'
- };
- controller._doDeleteHostComponentSuccessCallback({}, {}, data);
- expect(controller.get('_deletedHostComponentResult')).to.be.null;
- expect(controller.get('deleteNimbusHost')).to.be.true;
- expect(controller.loadConfigs.calledWith('loadStormConfigs')).to.be.true;
- });
- it('RANGER_KMS_SERVER component', function () {
- var data = {
- componentName: 'RANGER_KMS_SERVER'
- };
- controller._doDeleteHostComponentSuccessCallback({}, {}, data);
- expect(controller.get('_deletedHostComponentResult')).to.be.null;
- expect(controller.get('deleteRangerKMSServer')).to.be.true;
- expect(controller.loadConfigs.calledWith('loadRangerConfigs')).to.be.true;
- });
});
describe('#upgradeComponentSuccessCallback()', function () {
@@ -3086,9 +2981,7 @@ describe('App.MainHostDetailsController', function () {
});
it('_doDeleteHostComponent is called with correct arguments', function () {
- expect(controller._doDeleteHostComponent.calledWith(Em.Object.create({
- componentName: 'COMP1'
- }))).to.be.true;
+ expect(controller._doDeleteHostComponent.calledWith('COMP1')).to.be.true;
});
it('fromDeleteHost is true', function () {
expect(controller.get('fromDeleteHost')).to.be.true;
[10/15] ambari git commit: AMBARI-19240 Ambari UI should use
"hosts_with_failures" from "host_resolution_check" in host check. (atkach)
Posted by nc...@apache.org.
AMBARI-19240 Ambari UI should use "hosts_with_failures" from "host_resolution_check" in host check. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/72e9d4a4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/72e9d4a4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/72e9d4a4
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 72e9d4a4fb6a09b436a363b7ba8cdf6f6fa17132
Parents: f0544df
Author: Andrii Tkach <at...@apache.org>
Authored: Mon Dec 19 18:58:43 2016 +0200
Committer: Andrii Tkach <at...@apache.org>
Committed: Mon Dec 19 20:09:35 2016 +0200
----------------------------------------------------------------------
.../app/mixins/main/host/details/actions/check_host.js | 3 +--
ambari-web/app/utils/ajax/ajax.js | 13 ++++++++++++-
ambari-web/test/controllers/wizard/step3_test.js | 6 +++---
3 files changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/72e9d4a4/ambari-web/app/mixins/main/host/details/actions/check_host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/main/host/details/actions/check_host.js b/ambari-web/app/mixins/main/host/details/actions/check_host.js
index faf8ef1..fbee24c 100644
--- a/ambari-web/app/mixins/main/host/details/actions/check_host.js
+++ b/ambari-web/app/mixins/main/host/details/actions/check_host.js
@@ -365,8 +365,7 @@ App.CheckHostMixin = Em.Mixin.create({
if (["FAILED", "COMPLETED", "TIMEDOUT"].contains(task.Tasks.status)) {
if (task.Tasks.status === "COMPLETED" && !!Em.get(task, "Tasks.structured_out.host_resolution_check.failed_count")) {
var targetHostName = Em.get(task, "Tasks.host_name");
- var relatedHostNames = Em.get(task, "Tasks.structured_out.host_resolution_check.failures")
- ? Em.get(task, "Tasks.structured_out.host_resolution_check.failures").mapProperty('host') : [];
+ var relatedHostNames = Em.get(task, "Tasks.structured_out.host_resolution_check.hosts_with_failures") || [];
var contextMessage = Em.I18n.t('installer.step3.hostWarningsPopup.resolution.validation.context').format(targetHostName, relatedHostNames.length + ' ' + Em.I18n.t('installer.step3.hostWarningsPopup.host' + (relatedHostNames.length == 1 ? '' : 's')));
var contextMessageLong = Em.I18n.t('installer.step3.hostWarningsPopup.resolution.validation.context').format(targetHostName, relatedHostNames.join(', '));
if (!hostInfo) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/72e9d4a4/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 5831521..d4b1474 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -2188,7 +2188,18 @@ var urls = {
},
'preinstalled.checks.tasks': {
- 'real': '/requests/{requestId}?fields=tasks/Tasks,Requests/inputs,Requests/request_status',
+ 'real': '/requests/{requestId}?fields=Requests/inputs,Requests/request_status,tasks/Tasks/host_name,' +
+ 'tasks/Tasks/structured_out/host_resolution_check/hosts_with_failures,' +
+ 'tasks/Tasks/structured_out/host_resolution_check/failed_count,' +
+ 'tasks/Tasks/structured_out/installed_packages,' +
+ 'tasks/Tasks/structured_out/last_agent_env_check,' +
+ 'tasks/Tasks/structured_out/transparentHugePage,' +
+ 'tasks/Tasks/stdout,' +
+ 'tasks/Tasks/stderr,' +
+ 'tasks/Tasks/error_log,' +
+ 'tasks/Tasks/command_detail,' +
+ 'tasks/Tasks/status' +
+ '&minimal_response=true',
'mock': '/data/requests/host_check/1.json'
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/72e9d4a4/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 1e1b3bd..fa90065 100644
--- a/ambari-web/test/controllers/wizard/step3_test.js
+++ b/ambari-web/test/controllers/wizard/step3_test.js
@@ -3076,9 +3076,9 @@ describe('App.WizardStep3Controller', function () {
var data = {
tasks: [
- {Tasks: {status: 'COMPLETED', host_name: 'h1', structured_out: {host_resolution_check: {failed_count: 2, failures: [{host: 'h2'}, {host: 'h3'}]}}}},
- {Tasks: {status: 'COMPLETED', host_name: 'h4', structured_out: {host_resolution_check: {failed_count: 2, failures: [{host: 'h5'}, {host: 'h6'}]}}}},
- {Tasks: {status: 'COMPLETED', host_name: 'h7', structured_out: {host_resolution_check: {failed_count: 1, failures: [{host: 'h8'}]}}}}
+ {Tasks: {status: 'COMPLETED', host_name: 'h1', structured_out: {host_resolution_check: {failed_count: 2, hosts_with_failures: ['h2', 'h3']}}}},
+ {Tasks: {status: 'COMPLETED', host_name: 'h4', structured_out: {host_resolution_check: {failed_count: 2, hosts_with_failures: ['h5', 'h6']}}}},
+ {Tasks: {status: 'COMPLETED', host_name: 'h7', structured_out: {host_resolution_check: {failed_count: 1, hosts_with_failures: ['h8']}}}}
]
};
var hostCheckWarnings = [];
[12/15] ambari git commit: AMBARI-19243 : Metric monitor start
command failed though the process started successfully. (avijayan)
Posted by nc...@apache.org.
AMBARI-19243 : Metric monitor start command failed though the process started successfully. (avijayan)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6da5935b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6da5935b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6da5935b
Branch: refs/heads/branch-dev-patch-upgrade
Commit: 6da5935bdffee119909741637f8404f7f807f7ec
Parents: 8a125c5
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Mon Dec 19 13:16:54 2016 -0800
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Mon Dec 19 13:16:54 2016 -0800
----------------------------------------------------------------------
.../conf/unix/ambari-metrics-monitor | 9 +++++----
.../src/main/python/core/host_info.py | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/6da5935b/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor b/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor
index 220d533..967e133 100644
--- a/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor
+++ b/ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor
@@ -131,7 +131,7 @@ case "$1" in
echo "Checking for previously running Metric Monitor..."
if [ -f ${PIDFILE} ]; then
PID=`cat ${PIDFILE}`
- if [ -z "`ps ax | grep -w ${PID} | grep resource_monitoring`" ]; then
+ if [ -z "`ps ax -o pid | grep -w ${PID}`" ]; then
echo "${PIDFILE} found with no process. Removing ${PID}..."
rm -f ${PIDFILE}
else
@@ -151,8 +151,9 @@ case "$1" in
sleep 2
- echo "Verifying ${METRIC_MONITOR} process status..."
- if [ -z "`ps ax | grep -w ${PID} | grep resource_monitoring`" ]; then
+ echo "Verifying ${METRIC_MONITOR} process status with PID : ${PID}"
+ if [ -z "`ps ax -o pid | grep -w ${PID}`" ]; then
+ echo "Output of PID check : `ps ax -o pid | grep -w ${PID}`"
if [ -s ${OUTFILE} ]; then
echo "ERROR: ${METRIC_MONITOR} start failed. For more details, see ${OUTFILE}:"
echo "===================="
@@ -173,7 +174,7 @@ case "$1" in
if [ -f ${PIDFILE} ]; then
PID=`cat ${PIDFILE}`
echo "Found ${METRIC_MONITOR} PID: $PID"
- if [ -z "`ps ax | grep -w ${PID} | grep resource_monitoring`" ]; then
+ if [ -z "`ps ax -o pid | grep -w ${PID}`" ]; then
echo "${METRIC_MONITOR} not running. Stale PID File at: $PIDFILE"
retcode=2
else
http://git-wip-us.apache.org/repos/asf/ambari/blob/6da5935b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
index 7992cff..90f73fa 100644
--- a/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
+++ b/ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py
@@ -191,7 +191,7 @@ class HostInfo():
try:
usage = psutil.disk_usage(part.mountpoint)
except Exception, e:
- logger.error('Failed to read disk_usage for a mountpoint : ' + str(e))
+ logger.debug('Failed to read disk_usage for a mountpoint : ' + str(e))
continue
if part.device in devices: # Skip devices already seen.