You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rl...@apache.org on 2017/06/08 19:22:15 UTC
[01/50] [abbrv] ambari git commit: AMBARI-21160 - Upgrade Execution
Commands Are Missing Service/Component For Action Commands (jonathanhurley)
Repository: ambari
Updated Branches:
refs/heads/branch-feature-AMBARI-20859 7460cebf9 -> 103dfffe7
AMBARI-21160 - Upgrade Execution Commands Are Missing Service/Component For Action Commands (jonathanhurley)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/36cc11b3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/36cc11b3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/36cc11b3
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 36cc11b3aa68fc93901ac6ed2fa2c838b3ee6400
Parents: 3912068
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Wed May 31 16:53:32 2017 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Jun 1 09:24:56 2017 -0400
----------------------------------------------------------------------
.../internal/UpgradeResourceProvider.java | 26 +++++++---
.../0.12.0.2.0/package/scripts/params_linux.py | 2 +-
.../2.1.0.3.0/package/scripts/params_linux.py | 2 +-
.../AmbariManagementControllerTest.java | 6 +--
.../internal/UpgradeResourceProviderTest.java | 54 ++++++++++++++++++++
.../upgrades/upgrade_execute_task_test.xml | 42 +++++++++++++++
6 files changed, 121 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/36cc11b3/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index 345bf5f..f8f8faa 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -174,6 +174,12 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
*/
public static final String UPGRADE_HOST_ORDERED_HOSTS = "Upgrade/host_order";
+ /**
+ * The role that will be used when creating HRC's for the type
+ * {@link StageWrapper.Type#RU_TASKS}.
+ */
+ protected static final String EXECUTE_TASK_ROLE = "ru_execute_tasks";
+
/*
* Lifted from RequestResourceProvider
*/
@@ -862,10 +868,6 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
Cluster cluster = context.getCluster();
- // add each host to this stage
- RequestResourceFilter filter = new RequestResourceFilter("", "",
- new ArrayList<>(wrapper.getHosts()));
-
LOG.debug("Analyzing upgrade item {} with tasks: {}.", entity.getText(), entity.getTasks());
Map<String, String> params = getNewParameterMap(request, context);
params.put(UpgradeContext.COMMAND_PARAM_TASKS, entity.getTasks());
@@ -882,9 +884,17 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
StackInfo stackInfo = ambariMetaInfo.getStack(stackId.getStackName(),
stackId.getStackVersion());
+ // if the service/component are specified, then make sure to grab them off
+ // of the wrapper so they can be stored on the command for use later
+ String serviceName = null;
+ String componentName = null;
+
if (wrapper.getTasks() != null && wrapper.getTasks().size() > 0
&& wrapper.getTasks().get(0).getService() != null) {
- String serviceName = wrapper.getTasks().get(0).getService();
+ TaskWrapper taskWrapper = wrapper.getTasks().get(0);
+ serviceName = taskWrapper.getService();
+ componentName = taskWrapper.getComponent();
+
ServiceInfo serviceInfo = ambariMetaInfo.getService(stackId.getStackName(),
stackId.getStackVersion(), serviceName);
@@ -892,8 +902,12 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
params.put(HOOKS_FOLDER, stackInfo.getStackHooksFolder());
}
+ // add each host to this stage
+ RequestResourceFilter filter = new RequestResourceFilter(serviceName, componentName,
+ new ArrayList<>(wrapper.getHosts()));
+
ActionExecutionContext actionContext = new ActionExecutionContext(cluster.getClusterName(),
- "ru_execute_tasks", Collections.singletonList(filter), params);
+ EXECUTE_TASK_ROLE, Collections.singletonList(filter), params);
// hosts in maintenance mode are excluded from the upgrade
actionContext.setMaintenanceModeHostExcluded(true);
http://git-wip-us.apache.org/repos/asf/ambari/blob/36cc11b3/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 c1128a5..f680799 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
@@ -399,7 +399,7 @@ hive_conf_dirs_list = [hive_client_conf_dir]
ranger_hive_component = status_params.SERVER_ROLE_DIRECTORY_MAP['HIVE_SERVER']
if status_params.role == "HIVE_METASTORE" and hive_metastore_hosts is not None and hostname in hive_metastore_hosts:
hive_conf_dirs_list.append(hive_server_conf_dir)
-elif status_params.role == "HIVE_SERVER" and hive_server_hosts is not None and hostname in hive_server_host:
+elif status_params.role == "HIVE_SERVER" and hive_server_hosts is not None and hostname in hive_server_hosts:
hive_conf_dirs_list.append(hive_server_conf_dir)
elif status_params.role == "HIVE_SERVER_INTERACTIVE" and hive_server_interactive_hosts is not None and hostname in hive_server_interactive_hosts:
hive_conf_dirs_list.append(status_params.hive_server_interactive_conf_dir)
http://git-wip-us.apache.org/repos/asf/ambari/blob/36cc11b3/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/params_linux.py
index a12d388..91f10d8 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/2.1.0.3.0/package/scripts/params_linux.py
@@ -399,7 +399,7 @@ hive_conf_dirs_list = [hive_client_conf_dir]
ranger_hive_component = status_params.SERVER_ROLE_DIRECTORY_MAP['HIVE_SERVER']
if status_params.role == "HIVE_METASTORE" and hive_metastore_hosts is not None and hostname in hive_metastore_hosts:
hive_conf_dirs_list.append(hive_server_conf_dir)
-elif status_params.role == "HIVE_SERVER" and hive_server_hosts is not None and hostname in hive_server_host:
+elif status_params.role == "HIVE_SERVER" and hive_server_hosts is not None and hostname in hive_server_hosts:
hive_conf_dirs_list.append(hive_server_conf_dir)
elif status_params.role == "HIVE_SERVER_INTERACTIVE" and hive_server_interactive_hosts is not None and hostname in hive_server_interactive_hosts:
hive_conf_dirs_list.append(status_params.hive_server_interactive_conf_dir)
http://git-wip-us.apache.org/repos/asf/ambari/blob/36cc11b3/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index ec19724..e10e4cd 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -1926,9 +1926,9 @@ public class AmbariManagementControllerTest {
} catch (Exception e) {
// Expected
}
-
+
clusters.addCluster(cluster1, new StackId("HDP-0.1"));
-
+
try {
set1.clear();
HostRequest rInvalid1 =
@@ -6988,7 +6988,7 @@ public class AmbariManagementControllerTest {
Assert.assertEquals(1, responsesWithParams.size());
StackVersionResponse resp = responsesWithParams.iterator().next();
assertNotNull(resp.getUpgradePacks());
- assertEquals(13, resp.getUpgradePacks().size());
+ assertEquals(14, resp.getUpgradePacks().size());
assertTrue(resp.getUpgradePacks().contains("upgrade_test"));
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/36cc11b3/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
index b2555cd..a4f5e9a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
@@ -45,6 +45,7 @@ import org.apache.ambari.server.actionmanager.ExecutionCommandWrapper;
import org.apache.ambari.server.actionmanager.HostRoleCommand;
import org.apache.ambari.server.actionmanager.HostRoleStatus;
import org.apache.ambari.server.actionmanager.Stage;
+import org.apache.ambari.server.agent.ExecutionCommand;
import org.apache.ambari.server.agent.ExecutionCommand.KeyNames;
import org.apache.ambari.server.audit.AuditLogger;
import org.apache.ambari.server.configuration.Configuration;
@@ -95,10 +96,12 @@ import org.apache.ambari.server.state.UpgradeContext;
import org.apache.ambari.server.state.UpgradeHelper;
import org.apache.ambari.server.state.UpgradeState;
import org.apache.ambari.server.state.stack.upgrade.Direction;
+import org.apache.ambari.server.state.stack.upgrade.StageWrapper;
import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
import org.apache.ambari.server.topology.TopologyManager;
import org.apache.ambari.server.utils.StageUtils;
import org.apache.ambari.server.view.ViewRegistry;
+import org.apache.commons.lang3.StringUtils;
import org.easymock.EasyMock;
import org.easymock.EasyMockSupport;
import org.junit.After;
@@ -1656,6 +1659,57 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
}
/**
+ * Tests that commands created for {@link StageWrapper.Type#RU_TASKS} set the
+ * service and component on the {@link ExecutionCommand}.
+ * <p/>
+ * Without this, commands of this type would not be able to determine which
+ * service/component repository they should use when the command is scheduled
+ * to run.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testExecutionCommandServiceAndComponent() throws Exception {
+ Map<String, Object> requestProps = new HashMap<>();
+ requestProps.put(UpgradeResourceProvider.UPGRADE_CLUSTER_NAME, "c1");
+ requestProps.put(UpgradeResourceProvider.UPGRADE_REPO_VERSION_ID, String.valueOf(repoVersionEntity2200.getId()));
+ requestProps.put(UpgradeResourceProvider.UPGRADE_PACK, "upgrade_execute_task_test");
+ requestProps.put(UpgradeResourceProvider.UPGRADE_SKIP_PREREQUISITE_CHECKS, "true");
+ requestProps.put(UpgradeResourceProvider.UPGRADE_DIRECTION, Direction.UPGRADE.name());
+
+ ResourceProvider upgradeResourceProvider = createProvider(amc);
+
+ Request request = PropertyHelper.getCreateRequest(Collections.singleton(requestProps), null);
+ RequestStatus status = upgradeResourceProvider.createResources(request);
+
+ Set<Resource> createdResources = status.getAssociatedResources();
+ assertEquals(1, createdResources.size());
+ Resource res = createdResources.iterator().next();
+ Long id = (Long) res.getPropertyValue("Upgrade/request_id");
+ assertNotNull(id);
+ assertEquals(Long.valueOf(1), id);
+
+
+ ActionManager am = injector.getInstance(ActionManager.class);
+ List<HostRoleCommand> commands = am.getRequestTasks(id);
+
+ boolean foundActionExecuteCommand = false;
+ for (HostRoleCommand command : commands) {
+ ExecutionCommand executionCommand = command.getExecutionCommandWrapper().getExecutionCommand();
+ if (StringUtils.equals(UpgradeResourceProvider.EXECUTE_TASK_ROLE,
+ executionCommand.getRole())) {
+ foundActionExecuteCommand = true;
+ assertNotNull(executionCommand.getServiceName());
+ assertNotNull(executionCommand.getComponentName());
+ }
+ }
+
+ assertTrue(
+ "There was no task found with the role of " + UpgradeResourceProvider.EXECUTE_TASK_ROLE,
+ foundActionExecuteCommand);
+ }
+
+ /**
*
*/
private class MockModule implements Module {
http://git-wip-us.apache.org/repos/asf/ambari/blob/36cc11b3/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_execute_task_test.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_execute_task_test.xml b/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_execute_task_test.xml
new file mode 100644
index 0000000..3e61696
--- /dev/null
+++ b/ambari-server/src/test/resources/stacks/HDP/2.1.1/upgrades/upgrade_execute_task_test.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<upgrade xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="upgrade-pack.xsd">
+ <target>2.2.*.*</target>
+ <target-stack>HDP-2.2.0</target-stack>
+ <type>ROLLING</type>
+ <prerequisite-checks/>
+
+ <order>
+ <group xsi:type="cluster" name="CLUSTER_SERVER_ACTIONS" title="Cluster Server Actions">
+ <execute-stage service="ZOOKEEPER" component="ZOOKEEPER_SERVER" title="Execute Foo/Bar Function">
+ <task xsi:type="execute">
+ <script>scripts/foo.py</script>
+ <function>bar</function>
+ </task>
+ </execute-stage>
+ </group>
+ </order>
+
+ <processing>
+ <service name="ZOOKEEPER">
+ <component name="ZOOKEEPER_SERVER">
+ <upgrade />
+ </component>
+ </service>
+ </processing>
+</upgrade>
[48/50] [abbrv] ambari git commit: AMBARI-21137. Blueprint export
should allow tokenized values in SingleHostUpdater (Amruta Borkar via
alejandro)
Posted by rl...@apache.org.
AMBARI-21137. Blueprint export should allow tokenized values in SingleHostUpdater (Amruta Borkar via alejandro)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b98f07f9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b98f07f9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b98f07f9
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: b98f07f9093a0b9635443f317e96768b2d8b8ef7
Parents: 9c302dc
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Thu Jun 8 10:33:06 2017 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Thu Jun 8 10:33:06 2017 -0700
----------------------------------------------------------------------
.../BlueprintConfigurationProcessor.java | 19 ++++++++++++++++++-
.../BlueprintConfigurationProcessorTest.java | 3 +++
2 files changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b98f07f9/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 508bf15..7ebefdd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -139,6 +139,11 @@ public class BlueprintConfigurationProcessor {
private static Pattern LOCALHOST_PORT_REGEX = Pattern.compile("localhost:?(\\d+)?");
/**
+ * Compiled regex for placeholder
+ */
+ private static final Pattern PLACEHOLDER = Pattern.compile("\\{\\{.*\\}\\}");
+
+ /**
* Special network address
*/
private static String BIND_ALL_IP_ADDRESS = "0.0.0.0";
@@ -1133,7 +1138,8 @@ public class BlueprintConfigurationProcessor {
if (! matchedHost &&
! isNameServiceProperty(propertyName) &&
! isSpecialNetworkAddress(propValue) &&
- ! isUndefinedAddress(propValue)) {
+ ! isUndefinedAddress(propValue) &&
+ ! isPlaceholder(propValue)) {
configuration.removeProperty(type, propertyName);
}
@@ -1143,6 +1149,17 @@ public class BlueprintConfigurationProcessor {
}
/**
+ * Determine if a property is a placeholder
+ *
+ * @param propertyValue property value
+ *
+ * @return true if the property has format "{{%s}}"
+ */
+ private static boolean isPlaceholder(String propertyValue) {
+ return PLACEHOLDER.matcher(propertyValue).find();
+ }
+
+ /**
* Determines if a given property name's value can include
* nameservice references instead of host names.
*
http://git-wip-us.apache.org/repos/asf/ambari/blob/b98f07f9/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index 24fc3c7..ca579ea 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -426,6 +426,7 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport {
Map<String, Map<String, String>> group2Properties = new HashMap<>();
Map<String, String> group2YarnSiteProps = new HashMap<>();
group2YarnSiteProps.put("yarn.resourcemanager.resource-tracker.address", "testhost");
+ group2YarnSiteProps.put("yarn.resourcemanager.webapp.https.address", "{{rm_host}}");
group2Properties.put("yarn-site", group2YarnSiteProps);
// host group config -> BP config -> cluster scoped config
Configuration group2BPConfiguration = new Configuration(Collections.<String, Map<String, String>>emptyMap(),
@@ -449,6 +450,8 @@ public class BlueprintConfigurationProcessorTest extends EasyMockSupport {
assertEquals("%HOSTGROUP::group1%", properties.get("yarn-site").get("yarn.resourcemanager.hostname"));
assertEquals("%HOSTGROUP::group1%",
group2Configuration.getPropertyValue("yarn-site", "yarn.resourcemanager.resource-tracker.address"));
+ assertNotNull("Placeholder property should not have been removed.",
+ group2Configuration.getPropertyValue("yarn-site", "yarn.resourcemanager.webapp.https.address"));
}
@Test
[02/50] [abbrv] ambari git commit: Merge branch 'trunk' into
branch-feature-AMBARI-12556
Posted by rl...@apache.org.
Merge branch 'trunk' into branch-feature-AMBARI-12556
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9a42d400
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9a42d400
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9a42d400
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 9a42d4003934046b74fdf6b5754d1a55b30b2bb3
Parents: 36cc11b 81f64bf
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Thu Jun 1 09:27:25 2017 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Jun 1 09:27:25 2017 -0400
----------------------------------------------------------------------
.../impl/MapFieldNameDescriptorImpl.java | 2 +-
.../ambari/logsearch/conf/ApiDocConfig.java | 35 +++++++++++---
.../logsearch/rest/AuditLogsResource.java | 2 +-
ambari-web/app/styles/alerts.less | 8 ++--
ambari-web/app/styles/application.less | 3 +-
.../app/styles/theme/bootstrap-ambari.css | 48 ++++++++++++++------
.../app/templates/main/side-menu-item.hbs | 6 +--
ambari-web/app/templates/wizard/step6.hbs | 2 +-
ambari-web/app/views/main/menu.js | 11 +++++
.../vendor/scripts/theme/bootstrap-ambari.js | 20 ++++----
10 files changed, 96 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
[43/50] [abbrv] ambari git commit: AMBARI-21054. Add ppc as a new OS
for User. (aonishuk)
Posted by rl...@apache.org.
AMBARI-21054. Add ppc as a new OS for User. (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/aa6b3308
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/aa6b3308
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/aa6b3308
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: aa6b3308c44b1e0e74edc41e96e078e3597bed75
Parents: 89797ea
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Jun 8 17:11:42 2017 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Jun 8 17:11:42 2017 +0300
----------------------------------------------------------------------
.../AmbariManagementControllerImpl.java | 2 +-
.../AmbariManagementControllerImplTest.java | 18 ++++++++++--------
2 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/aa6b3308/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 1eeb82b..2a9d6c9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -315,7 +315,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
@Inject
private StackDAO stackDAO;
@Inject
- private OsFamily osFamily;
+ protected OsFamily osFamily;
/**
* The KerberosHelper to help setup for enabling for disabling Kerberos
http://git-wip-us.apache.org/repos/asf/ambari/blob/aa6b3308/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
index 0312579..c0e3ef1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
@@ -134,7 +134,6 @@ public class AmbariManagementControllerImplTest {
private static final AmbariMetaInfo ambariMetaInfo = createMock(AmbariMetaInfo.class);
private static final Users users = createMock(Users.class);
private static final AmbariSessionManager sessionManager = createNiceMock(AmbariSessionManager.class);
- private static final OsFamily osFamily = createNiceMock(OsFamily.class);
@BeforeClass
public static void setupAuthentication() {
@@ -146,7 +145,7 @@ public class AmbariManagementControllerImplTest {
@Before
public void before() throws Exception {
- reset(ldapDataPopulator, clusters, actionDBAccessor, ambariMetaInfo, users, sessionManager, osFamily);
+ reset(ldapDataPopulator, clusters, actionDBAccessor, ambariMetaInfo, users, sessionManager);
}
@Test
@@ -1990,7 +1989,7 @@ public class AmbariManagementControllerImplTest {
@Test
public void testPopulateServicePackagesInfo() throws Exception {
Capture<AmbariManagementController> controllerCapture = EasyMock.newCapture();
- Injector injector = Guice.createInjector(Modules.override(new InMemoryDefaultTestModule()).with(new MockModule()));
+ Injector injector = createStrictMock(Injector.class);
MaintenanceStateHelper maintHelper = createNiceMock(MaintenanceStateHelper.class);
ServiceInfo serviceInfo = createNiceMock(ServiceInfo.class);
@@ -2025,15 +2024,18 @@ public class AmbariManagementControllerImplTest {
expect(injector.getInstance(Gson.class)).andReturn(null);
expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(maintHelper).anyTimes();
expect(injector.getInstance(KerberosHelper.class)).andReturn(createNiceMock(KerberosHelper.class));
+
+ OsFamily osFamilyMock = createNiceMock(OsFamily.class);
- replay(maintHelper, injector, clusters, serviceInfo);
+ EasyMock.expect(osFamilyMock.isVersionedOsFamilyExtendedByVersionedFamily("testOSFamily", "testOSFamily")).andReturn(true).times(3);
+ replay(maintHelper, injector, clusters, serviceInfo, osFamilyMock);
AmbariManagementControllerImplTest.NestedTestClass nestedTestClass = this.new NestedTestClass(null, clusters,
- injector);
+ injector, osFamilyMock);
ServiceOsSpecific serviceOsSpecific = nestedTestClass.populateServicePackagesInfo(serviceInfo, hostParams, osFamily);
- assertEquals(serviceOsSpecific.getPackages().size(), 3);
+ assertEquals(3, serviceOsSpecific.getPackages().size());
}
@Test
@@ -2200,14 +2202,14 @@ public class AmbariManagementControllerImplTest {
binder.bind(AmbariMetaInfo.class).toInstance(ambariMetaInfo);
binder.bind(Users.class).toInstance(users);
binder.bind(AmbariSessionManager.class).toInstance(sessionManager);
- binder.bind(OsFamily.class).toInstance(osFamily);
}
}
private class NestedTestClass extends AmbariManagementControllerImpl {
- public NestedTestClass(ActionManager actionManager, Clusters clusters, Injector injector) throws Exception {
+ public NestedTestClass(ActionManager actionManager, Clusters clusters, Injector injector, OsFamily osFamilyMock) throws Exception {
super(actionManager, clusters, injector);
+ this.osFamily = osFamilyMock;
}
// public ServiceOsSpecific testPopulateServicePackagesInfo(ServiceInfo serviceInfo, Map<String, String> hostParams,
[49/50] [abbrv] ambari git commit: Merge branch 'trunk' into
branch-feature-AMBARI-20859
Posted by rl...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/103dfffe/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/103dfffe/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/103dfffe/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/103dfffe/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/103dfffe/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/103dfffe/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
----------------------------------------------------------------------
[18/50] [abbrv] ambari git commit: AMBARI-21174 : Files View :
properly copying the data to output stream when downloading multiple files.
(nitirajrathore)
Posted by rl...@apache.org.
AMBARI-21174 : Files View : properly copying the data to output stream when downloading multiple files. (nitirajrathore)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/601a7cdc
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/601a7cdc
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/601a7cdc
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 601a7cdcf5a9a8c524565c54a9a36826776ab1f6
Parents: 3b5f07f
Author: Nitiraj Singh Rathore <ni...@gmail.com>
Authored: Mon Jun 5 12:39:27 2017 +0530
Committer: Nitiraj Singh Rathore <ni...@gmail.com>
Committed: Mon Jun 5 12:40:02 2017 +0530
----------------------------------------------------------------------
.../org/apache/ambari/view/filebrowser/DownloadService.java | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/601a7cdc/contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/DownloadService.java
----------------------------------------------------------------------
diff --git a/contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/DownloadService.java b/contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/DownloadService.java
index 1334c06..81ac40d 100644
--- a/contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/DownloadService.java
+++ b/contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/DownloadService.java
@@ -27,6 +27,7 @@ import org.apache.ambari.view.commons.hdfs.HdfsService;
import org.apache.ambari.view.utils.hdfs.HdfsApi;
import org.apache.ambari.view.utils.hdfs.HdfsApiException;
import org.apache.ambari.view.utils.hdfs.HdfsUtil;
+import org.apache.commons.io.IOUtils;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.security.AccessControlException;
@@ -261,11 +262,9 @@ public class DownloadService extends HdfsService {
LOG.error("Error in opening file {}. Ignoring concat of this files.", path.substring(1), ex);
continue;
}
- byte[] chunk = new byte[1024];
- while (in.read(chunk) != -1) {
- output.write(chunk);
- }
- LOG.info("concated file : {}", path);
+
+ long bytesCopied = IOUtils.copyLarge(in, output);
+ LOG.info("concated file : {}, total bytes added = {}", path, bytesCopied);
} catch (Exception ex) {
LOG.error("Error occurred : ", ex);
throw new ServiceFormattedException(ex.getMessage(), ex);
[22/50] [abbrv] ambari git commit: AMBARI-21113.
hdfs_user_nofile_limit is not picking as expected for datanode process in a
secure cluster (aonishuk)
Posted by rl...@apache.org.
AMBARI-21113. hdfs_user_nofile_limit is not picking as expected for datanode process in a secure cluster (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4dba161a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4dba161a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4dba161a
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 4dba161a6fbeab2ab5507c9ff50f524242b7f450
Parents: b3425c9
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Jun 6 13:57:00 2017 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Jun 6 13:57:00 2017 +0300
----------------------------------------------------------------------
.../server/upgrade/UpgradeCatalog250.java | 29 +++++++++++++++-----
1 file changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/4dba161a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index e911a21..1f3a99d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -801,18 +801,20 @@ public class UpgradeCatalog250 extends AbstractUpgradeCatalog {
Map<String, Cluster> clusterMap = clusters.getClusters();
Map<String, String> prop = new HashMap<>();
+
if (clusterMap != null && !clusterMap.isEmpty()) {
for (final Cluster cluster : clusterMap.values()) {
- /*
- * Append "ulimit -l" from hadoop-env.sh
- */
+
String content = null;
+ Boolean contentUpdated = false;
+
if (cluster.getDesiredConfigByType(HADOOP_ENV) != null) {
content = cluster.getDesiredConfigByType(HADOOP_ENV).getProperties().get("content");
}
- if (content != null && !content.contains("ulimit")) {
- content += "\n" +
+ if (content != null) {
+ if (!content.contains("ulimit -l")) { // Append "ulimit -l" to hadoop-env.sh
+ content += "\n" +
"{% if is_datanode_max_locked_memory_set %}\n" +
"# Fix temporary bug, when ulimit from conf files is not picked up, without full relogin. \n" +
"# Makes sense to fix only when runing DN as root \n" +
@@ -821,9 +823,22 @@ public class UpgradeCatalog250 extends AbstractUpgradeCatalog {
"fi\n" +
"{% endif %}";
- prop.put("content", content);
- updateConfigurationPropertiesForCluster(cluster, "hadoop-env",
+ contentUpdated = true;
+ }
+
+ if (!content.contains("ulimit -n")){ // Append "ulimit -n" to hadoop-env.sh
+ content += "\n" +
+ "if [ \"$command\" == \"datanode\" ] && [ \"$EUID\" -eq 0 ] && [ -n \"$HADOOP_SECURE_DN_USER\" ]; then \n" +
+ " ulimit -n {{hdfs_user_nofile_limit}}\n" +
+ "fi";
+ contentUpdated = true;
+ }
+
+ if (contentUpdated){
+ prop.put("content", content);
+ updateConfigurationPropertiesForCluster(cluster, "hadoop-env",
prop, true, false);
+ }
}
}
}
[29/50] [abbrv] ambari git commit: AMBARI-21086. Hive view 2.0 does
not work on IE 11 browser (pallavkul)
Posted by rl...@apache.org.
AMBARI-21086. Hive view 2.0 does not work on IE 11 browser (pallavkul)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/84c4e0d6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/84c4e0d6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/84c4e0d6
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 84c4e0d652db5b06f830073e9a8dc899c38daef6
Parents: 4247f69
Author: pallavkul <pa...@gmail.com>
Authored: Wed Jun 7 12:22:57 2017 +0530
Committer: pallavkul <pa...@gmail.com>
Committed: Wed Jun 7 12:22:57 2017 +0530
----------------------------------------------------------------------
.../src/main/resources/ui/ember-cli-build.js | 1 +
.../resources/ui/vendor/browser-pollyfills.js | 213 +++++++++++++++++++
2 files changed, 214 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4e0d6/contrib/views/hive20/src/main/resources/ui/ember-cli-build.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/ember-cli-build.js b/contrib/views/hive20/src/main/resources/ui/ember-cli-build.js
index 01682e7..325cc1b 100644
--- a/contrib/views/hive20/src/main/resources/ui/ember-cli-build.js
+++ b/contrib/views/hive20/src/main/resources/ui/ember-cli-build.js
@@ -60,6 +60,7 @@ module.exports = function(defaults) {
app.import('bower_components/jquery-ui/jquery-ui.js');
app.import('bower_components/jquery-ui/themes/base/jquery-ui.css');
app.import('bower_components/codemirror/addon/hint/show-hint.css');
+ app.import('vendor/browser-pollyfills.js');
/*
app.import('vendor/codemirror/codemirror-min.js');
http://git-wip-us.apache.org/repos/asf/ambari/blob/84c4e0d6/contrib/views/hive20/src/main/resources/ui/vendor/browser-pollyfills.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/vendor/browser-pollyfills.js b/contrib/views/hive20/src/main/resources/ui/vendor/browser-pollyfills.js
new file mode 100644
index 0000000..88a59c1
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/vendor/browser-pollyfills.js
@@ -0,0 +1,213 @@
+/**
+ * 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 (!String.prototype.startsWith) {
+ String.prototype.startsWith = function (searchString, position) {
+ position = position || 0;
+ return this.substr(position, searchString.length) === searchString;
+ };
+}
+
+if (!String.prototype.endsWith) {
+ String.prototype.endsWith = function (searchString, position) {
+ var subjectString = this.toString();
+ if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
+ position = subjectString.length;
+ }
+ position -= searchString.length;
+ var lastIndex = subjectString.lastIndexOf(searchString, position);
+ return lastIndex !== -1 && lastIndex === position;
+ };
+}
+
+if (typeof Object.assign != 'function') {
+ Object.assign = function (target, varArgs) { // .length of function is 2
+ 'use strict';
+ if (target == null) { // TypeError if undefined or null
+ throw new TypeError('Cannot convert undefined or null to object');
+ }
+
+ var to = Object(target);
+
+ for (var index = 1; index < arguments.length; index++) {
+ var nextSource = arguments[index];
+
+ if (nextSource != null) { // Skip over if undefined or null
+ for (var nextKey in nextSource) {
+ // Avoid bugs when hasOwnProperty is shadowed
+ if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
+ to[nextKey] = nextSource[nextKey];
+ }
+ }
+ }
+ }
+ return to;
+ };
+}
+
+
+if (!Array.from) {
+ Array.from = (function () {
+ var toStr = Object.prototype.toString;
+ var isCallable = function (fn) {
+ return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
+ };
+ var toInteger = function (value) {
+ var number = Number(value);
+ if (isNaN(number)) {
+ return 0;
+ }
+ if (number === 0 || !isFinite(number)) {
+ return number;
+ }
+ return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
+ };
+ var maxSafeInteger = Math.pow(2, 53) - 1;
+ var toLength = function (value) {
+ var len = toInteger(value);
+ return Math.min(Math.max(len, 0), maxSafeInteger);
+ };
+
+ // The length property of the from method is 1.
+ return function from(arrayLike/*, mapFn, thisArg */) {
+ // 1. Let C be the this value.
+ var C = this;
+
+ // 2. Let items be ToObject(arrayLike).
+ var items = Object(arrayLike);
+
+ // 3. ReturnIfAbrupt(items).
+ if (arrayLike == null) {
+ throw new TypeError('Array.from requires an array-like object - not null or undefined');
+ }
+
+ // 4. If mapfn is undefined, then let mapping be false.
+ var mapFn = arguments.length > 1 ? arguments[1] : void undefined;
+ var T;
+ if (typeof mapFn !== 'undefined') {
+ // 5. else
+ // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
+ if (!isCallable(mapFn)) {
+ throw new TypeError('Array.from: when provided, the second argument must be a function');
+ }
+
+ // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
+ if (arguments.length > 2) {
+ T = arguments[2];
+ }
+ }
+
+ // 10. Let lenValue be Get(items, "length").
+ // 11. Let len be ToLength(lenValue).
+ var len = toLength(items.length);
+
+ // 13. If IsConstructor(C) is true, then
+ // 13. a. Let A be the result of calling the [[Construct]] internal method
+ // of C with an argument list containing the single item len.
+ // 14. a. Else, Let A be ArrayCreate(len).
+ var A = isCallable(C) ? Object(new C(len)) : new Array(len);
+
+ // 16. Let k be 0.
+ var k = 0;
+ // 17. Repeat, while k < len… (also steps a - h)
+ var kValue;
+ while (k < len) {
+ kValue = items[k];
+ if (mapFn) {
+ A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
+ } else {
+ A[k] = kValue;
+ }
+ k += 1;
+ }
+ // 18. Let putStatus be Put(A, "length", len, true).
+ A.length = len;
+ // 20. Return A.
+ return A;
+ };
+ }());
+}
+
+Number.isNaN = Number.isNaN || function (value) {
+ return typeof value === 'number' && isNaN(value);
+ }
+
+
+if (!String.fromCodePoint) {
+ (function () {
+ var defineProperty = (function () {
+ // IE 8 only supports `Object.defineProperty` on DOM elements
+ try {
+ var object = {};
+ var $defineProperty = Object.defineProperty;
+ var result = $defineProperty(object, object, object) && $defineProperty;
+ } catch (error) {
+ }
+ return result;
+ }());
+ var stringFromCharCode = String.fromCharCode;
+ var floor = Math.floor;
+ var fromCodePoint = function () {
+ var MAX_SIZE = 0x4000;
+ var codeUnits = [];
+ var highSurrogate;
+ var lowSurrogate;
+ var index = -1;
+ var length = arguments.length;
+ if (!length) {
+ return '';
+ }
+ var result = '';
+ while (++index < length) {
+ var codePoint = Number(arguments[index]);
+ if (
+ !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
+ codePoint < 0 || // not a valid Unicode code point
+ codePoint > 0x10FFFF || // not a valid Unicode code point
+ floor(codePoint) != codePoint // not an integer
+ ) {
+ throw RangeError('Invalid code point: ' + codePoint);
+ }
+ if (codePoint <= 0xFFFF) { // BMP code point
+ codeUnits.push(codePoint);
+ } else { // Astral code point; split in surrogate halves
+ // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ codePoint -= 0x10000;
+ highSurrogate = (codePoint >> 10) + 0xD800;
+ lowSurrogate = (codePoint % 0x400) + 0xDC00;
+ codeUnits.push(highSurrogate, lowSurrogate);
+ }
+ if (index + 1 == length || codeUnits.length > MAX_SIZE) {
+ result += stringFromCharCode.apply(null, codeUnits);
+ codeUnits.length = 0;
+ }
+ }
+ return result;
+ };
+ if (defineProperty) {
+ defineProperty(String, 'fromCodePoint', {
+ 'value': fromCodePoint,
+ 'configurable': true,
+ 'writable': true
+ });
+ } else {
+ String.fromCodePoint = fromCodePoint;
+ }
+ }());
+}
[28/50] [abbrv] ambari git commit: AMBARI-21122 - Part One: Specify
the script directly in alert target for script-based alert dispatchers (Yao
Lei via jonathanhurley)
Posted by rl...@apache.org.
AMBARI-21122 - Part One: Specify the script directly in alert target for script-based alert dispatchers (Yao Lei via jonathanhurley)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4247f691
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4247f691
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4247f691
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 4247f6919c329fc3da9e4ea8a0aa62aacd4793e3
Parents: e61fea5
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Tue Jun 6 10:22:45 2017 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Tue Jun 6 10:22:45 2017 -0400
----------------------------------------------------------------------
.../server/configuration/Configuration.java | 17 +++++
.../dispatchers/AlertScriptDispatcher.java | 45 ++++++++++++-
.../dispatchers/AlertScriptDispatcherTest.java | 67 ++++++++++++++++++++
3 files changed, 127 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/4247f691/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 965b57b..fb06e6d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -2721,6 +2721,14 @@ public class Configuration {
public static final ConfigurationProperty<Integer> TLS_EPHEMERAL_DH_KEY_SIZE = new ConfigurationProperty<>(
"security.server.tls.ephemeral_dh_key_size", 2048);
+ /**
+ * The directory for scripts which are used by the alert notification dispatcher.
+ */
+ @Markdown(description = "The directory for scripts which are used by the alert notification dispatcher.")
+ public static final ConfigurationProperty<String> DISPATCH_PROPERTY_SCRIPT_DIRECTORY = new ConfigurationProperty<>(
+ "notification.dispatch.alert.script.directory",AmbariPath.getPath("/var/lib/ambari-server/resources/scripts"));
+
+
private static final Logger LOG = LoggerFactory.getLogger(
Configuration.class);
@@ -5587,6 +5595,15 @@ public class Configuration {
}
/**
+ * Gets the dispatch script directory.
+ *
+ * @return the dispatch script directory
+ */
+ public String getDispatchScriptDirectory() {
+ return getProperty(DISPATCH_PROPERTY_SCRIPT_DIRECTORY);
+ }
+
+ /**
* Generates a markdown table which includes:
* <ul>
* <li>Property key name</li>
http://git-wip-us.apache.org/repos/asf/ambari/blob/4247f691/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java b/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java
index 84bfe52..60fe4f4 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java
@@ -17,6 +17,7 @@
*/
package org.apache.ambari.server.notifications.dispatchers;
+import java.io.File;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.LinkedBlockingQueue;
@@ -74,6 +75,13 @@ public class AlertScriptDispatcher implements NotificationDispatcher {
public static final String DISPATCH_PROPERTY_SCRIPT_CONFIG_KEY = "ambari.dispatch-property.script";
/**
+ * A dispatch property that instructs this dispatcher to lookup script by filename
+ * from {@link org.apache.ambari.server.state.alert.AlertTarget}.
+ */
+ public static final String DISPATCH_PROPERTY_SCRIPT_FILENAME_KEY = "ambari.dispatch-property.script.filename";
+
+
+ /**
* Logger.
*/
private static final Logger LOG = LoggerFactory.getLogger(AlertScriptDispatcher.class);
@@ -166,8 +174,13 @@ public class AlertScriptDispatcher implements NotificationDispatcher {
*/
@Override
public void dispatch(Notification notification) {
- String scriptKey = getScriptConfigurationKey(notification);
- String script = m_configuration.getProperty(scriptKey);
+ String scriptKey = null;
+ String script = getScriptLocation(notification);
+
+ if( null == script){ // Script filename is null.
+ scriptKey = getScriptConfigurationKey(notification);
+ script = m_configuration.getProperty(scriptKey);
+ }
// this dispatcher requires a script to run
if (null == script) {
@@ -208,6 +221,34 @@ public class AlertScriptDispatcher implements NotificationDispatcher {
}
/**
+ * Gets the dispatch script location from ambari.properties and notification.
+ *
+ * @param notification
+ * @return the dispatch script location.If script filename is {@code null},
+ * {@code null} will be returned.
+ */
+
+ String getScriptLocation(Notification notification){
+ String scriptName = null;
+ String scriptDir = null;
+
+ if( null == notification || null == notification.DispatchProperties )
+ return null;
+
+ scriptName = notification.DispatchProperties.get(DISPATCH_PROPERTY_SCRIPT_FILENAME_KEY);
+ if( null == scriptName) {
+ LOG.warn("the {} configuration property was not found for dispatching notification",
+ DISPATCH_PROPERTY_SCRIPT_FILENAME_KEY);
+ return null;
+ }
+
+ scriptDir = m_configuration.getDispatchScriptDirectory();
+
+ return scriptDir + File.separator + scriptName;
+ }
+
+
+ /**
* {@inheritDoc}
* <p/>
* Returns {@code false} always.
http://git-wip-us.apache.org/repos/asf/ambari/blob/4247f691/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcherTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcherTest.java b/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcherTest.java
index f1f320d..4b1480c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcherTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcherTest.java
@@ -60,6 +60,8 @@ public class AlertScriptDispatcherTest {
private static final String SCRIPT_CONFIG_VALUE = "/foo/script.py";
+ private static final String DISPATCH_PROPERTY_SCRIPT_DIRECTORY_KEY = "notification.dispatch.alert.script.directory";
+
private Injector m_injector;
@Inject
@@ -190,6 +192,71 @@ public class AlertScriptDispatcherTest {
}
/**
+ * Tests the invocation of method getScriptLocation().
+ */
+ @Test
+ public void testGetScriptLocation() throws Exception {
+ AlertScriptDispatcher dispatcher = (AlertScriptDispatcher) m_dispatchFactory.getDispatcher(TargetType.ALERT_SCRIPT.name());
+ m_injector.injectMembers(dispatcher);
+
+ DispatchCallback callback = EasyMock.createNiceMock(DispatchCallback.class);
+ AlertNotification notification = new AlertNotification();
+ notification.Callback = callback;
+ notification.CallbackIds = Collections.singletonList(UUID.randomUUID().toString());
+ notification.DispatchProperties = new HashMap();
+
+ //1.ambari.dispatch-property.script.filename is not set in notification
+ Assert.assertEquals(dispatcher.getScriptLocation(notification),null);
+
+ //2.ambari.dispatch-property.script.filename is set in notification,but notification.dispatch.alert.script.directory not in ambari.properties
+ final String filename = "foo.py";
+ notification.DispatchProperties.put(AlertScriptDispatcher.DISPATCH_PROPERTY_SCRIPT_FILENAME_KEY,filename);
+ Assert.assertEquals(dispatcher.getScriptLocation(notification),"/var/lib/ambari-server/resources/scripts/foo.py");
+
+ //3.both properties are set
+ final String scriptDirectory = "/var/lib/ambari-server/resources/scripts/foo";
+ m_configuration.setProperty(DISPATCH_PROPERTY_SCRIPT_DIRECTORY_KEY,scriptDirectory);
+ Assert.assertEquals(dispatcher.getScriptLocation(notification),"/var/lib/ambari-server/resources/scripts/foo/foo.py");
+ }
+
+
+ /**
+ * Tests that we will pickup the correct script when script filename is specified on the notification
+ */
+ @Test
+ public void testCustomScriptConfigurationByScriptFilename() throws Exception {
+ final String filename = "foo.py";
+ final String scriptDirectory = "/var/lib/ambari-server/resources/scripts/foo";
+ m_configuration.setProperty(DISPATCH_PROPERTY_SCRIPT_DIRECTORY_KEY,scriptDirectory);
+
+ DispatchCallback callback = EasyMock.createNiceMock(DispatchCallback.class);
+ AlertNotification notification = new AlertNotification();
+ notification.Callback = callback;
+ notification.CallbackIds = Collections.singletonList(UUID.randomUUID().toString());
+
+ notification.DispatchProperties = new HashMap();
+ notification.DispatchProperties.put(AlertScriptDispatcher.DISPATCH_PROPERTY_SCRIPT_FILENAME_KEY,filename);
+
+ callback.onSuccess(notification.CallbackIds);
+ EasyMock.expectLastCall().once();
+
+ AlertScriptDispatcher dispatcher = (AlertScriptDispatcher) m_dispatchFactory.getDispatcher(TargetType.ALERT_SCRIPT.name());
+ m_injector.injectMembers(dispatcher);
+
+ ProcessBuilder powerMockProcessBuilder = m_injector.getInstance(ProcessBuilder.class);
+ EasyMock.expect(dispatcher.getProcessBuilder(dispatcher.getScriptLocation(notification), notification)).andReturn(
+ powerMockProcessBuilder).once();
+
+ EasyMock.replay(callback, dispatcher);
+
+ dispatcher.dispatch(notification);
+
+ EasyMock.verify(callback, dispatcher);
+ PowerMock.verifyAll();
+ }
+
+
+ /**
* Tests that a process with an error code of 255 causes the failure callback
* to be invoked.
*
[46/50] [abbrv] ambari git commit: AMBARI-21184. When trying to Add
Hiveserver2 service on a node, we just get a pop-up dialog box,
and then a spinning wheel. Unable to click "Confirm Add" (alexantonenko)
Posted by rl...@apache.org.
AMBARI-21184. When trying to Add Hiveserver2 service on a node, we just get a pop-up dialog box, and then a spinning wheel. Unable to click "Confirm Add" (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7e3641eb
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7e3641eb
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7e3641eb
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 7e3641eba8ce974c7768a85f65b5910bd5ff55ca
Parents: 0b6d0dc
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Jun 8 17:19:00 2017 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Jun 8 19:03:18 2017 +0300
----------------------------------------------------------------------
ambari-web/app/utils/config.js | 2 +-
ambari-web/test/utils/config_test.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/7e3641eb/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 8e6e2fd..00cc2a3 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -1251,7 +1251,7 @@ App.config = Em.Object.create({
getTempletonHiveHosts: function (value) {
var pattern = /thrift:\/\/.+:\d+/,
patternMatch = value.match(pattern);
- return patternMatch ? patternMatch[0].split('\\,') : value;
+ return patternMatch ? patternMatch[0].split('\\,') : [];
},
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/7e3641eb/ambari-web/test/utils/config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js
index 7ad8828..2c7baf9 100644
--- a/ambari-web/test/utils/config_test.js
+++ b/ambari-web/test/utils/config_test.js
@@ -1469,7 +1469,7 @@ describe('App.config', function() {
},
{
value: 'hive.metastore.local=false',
- result: 'hive.metastore.local=false',
+ result: [],
message: 'no hosts list'
}
];
[45/50] [abbrv] ambari git commit: AMBARI-20122 - Stack advisor needs
to recommend dependency for slaves and masters
Posted by rl...@apache.org.
AMBARI-20122 - Stack advisor needs to recommend dependency for slaves and masters
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0b6d0dce
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0b6d0dce
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0b6d0dce
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 0b6d0dcef10ec60c83ad055567b487104573ae62
Parents: 7dc91c5
Author: Tim Thorpe <tt...@apache.org>
Authored: Thu Jun 8 08:51:30 2017 -0700
Committer: Tim Thorpe <tt...@apache.org>
Committed: Thu Jun 8 08:51:30 2017 -0700
----------------------------------------------------------------------
.../src/main/resources/stacks/stack_advisor.py | 115 +++++++++++++-
.../stacks/2.0.6/common/test_stack_advisor.py | 153 +++++++++++++++++++
2 files changed, 263 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/0b6d0dce/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 4a81dc6..6bc8fe4 100644
--- a/ambari-server/src/main/resources/stacks/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/stack_advisor.py
@@ -756,15 +756,19 @@ class DefaultStackAdvisor(StackAdvisor):
if hostName not in hostsComponentsMap:
hostsComponentsMap[hostName] = []
+ #Sort the services so that the dependent services will be processed before those that depend on them.
+ sortedServices = self.getServicesSortedByDependencies(services)
#extend hostsComponentsMap' with MASTER components
- for service in services["services"]:
+ for service in sortedServices:
masterComponents = [component for component in service["components"] if self.isMasterComponent(component)]
serviceName = service["StackServices"]["service_name"]
serviceAdvisor = self.getServiceAdvisor(serviceName)
for component in masterComponents:
componentName = component["StackServiceComponents"]["component_name"]
advisor = serviceAdvisor if serviceAdvisor is not None else self
- hostsForComponent = advisor.getHostsForMasterComponent(services, hosts, component, hostsList)
+ #Filter the hosts such that only hosts that meet the dependencies are included (if possible)
+ filteredHosts = self.getFilteredHostsBasedOnDependencies(services, component, hostsList, hostsComponentsMap)
+ hostsForComponent = advisor.getHostsForMasterComponent(services, hosts, component, filteredHosts)
#extend 'hostsComponentsMap' with 'hostsForComponent'
for hostName in hostsForComponent:
@@ -778,7 +782,7 @@ class DefaultStackAdvisor(StackAdvisor):
utilizedHosts = [item for sublist in usedHostsListList for item in sublist]
freeHosts = [hostName for hostName in hostsList if hostName not in utilizedHosts]
- for service in services["services"]:
+ for service in sortedServices:
slaveClientComponents = [component for component in service["components"]
if self.isSlaveComponent(component) or self.isClientComponent(component)]
serviceName = service["StackServices"]["service_name"]
@@ -786,7 +790,10 @@ class DefaultStackAdvisor(StackAdvisor):
for component in slaveClientComponents:
componentName = component["StackServiceComponents"]["component_name"]
advisor = serviceAdvisor if serviceAdvisor is not None else self
- hostsForComponent = advisor.getHostsForSlaveComponent(services, hosts, component, hostsList, freeHosts)
+ #Filter the hosts and free hosts such that only hosts that meet the dependencies are included (if possible)
+ filteredHosts = self.getFilteredHostsBasedOnDependencies(services, component, hostsList, hostsComponentsMap)
+ filteredFreeHosts = self.filterList(freeHosts, filteredHosts)
+ hostsForComponent = advisor.getHostsForSlaveComponent(services, hosts, component, filteredHosts, filteredFreeHosts)
#extend 'hostsComponentsMap' with 'hostsForComponent'
for hostName in hostsForComponent:
@@ -796,7 +803,7 @@ class DefaultStackAdvisor(StackAdvisor):
hostsComponentsMap[hostName].append( { "name": componentName } )
#colocate custom services
- for service in services["services"]:
+ for service in sortedServices:
serviceName = service["StackServices"]["service_name"]
serviceAdvisor = self.getServiceAdvisor(serviceName)
if serviceAdvisor is not None:
@@ -866,6 +873,104 @@ class DefaultStackAdvisor(StackAdvisor):
return hostsForComponent
+ def getServicesSortedByDependencies(self, services):
+ """
+ Sorts the services based on their dependencies. This is limited to non-conditional host scope dependencies.
+ Services with no dependencies will go first. Services with dependencies will go after the services they are dependent on.
+ If there are circular dependencies, the services will go in the order in which they were processed.
+ """
+ processedServices = []
+ sortedServices = []
+
+ for service in services["services"]:
+ self.sortServicesByDependencies(services, service, processedServices, sortedServices)
+
+ return sortedServices
+
+ def sortServicesByDependencies(self, services, service, processedServices, sortedServices):
+ """
+ Sorts the services based on their dependencies. This is limited to non-conditional host scope dependencies.
+ Services with no dependencies will go first. Services with dependencies will go after the services they are dependent on.
+ If there are circular dependencies, the services will go in the order in which they were processed.
+ """
+ if service in processedServices:
+ return
+
+ processedServices.append(service)
+
+ for component in service["components"]:
+ dependencies = [] if "dependencies" not in component else component['dependencies']
+ for dependency in dependencies:
+ # accounts only for dependencies that are not conditional
+ conditionsPresent = "conditions" in dependency["Dependencies"] and dependency["Dependencies"]["conditions"]
+ scope = "cluster" if "scope" not in dependency["Dependencies"] else dependency["Dependencies"]["scope"]
+ if not conditionsPresent and scope == "host":
+ componentName = component["StackServiceComponents"]["component_name"]
+ requiredComponentName = dependency["Dependencies"]["component_name"]
+ requiredService = self.getServiceForComponentName(services, requiredComponentName)
+ self.sortServicesByDependencies(services, requiredService, processedServices, sortedServices)
+
+ sortedServices.append(service)
+
+ def getFilteredHostsBasedOnDependencies(self, services, component, hostsList, hostsComponentsMap):
+ """
+ Returns a list of hosts that only includes the ones which have all host scope dependencies already assigned to them.
+ If an empty list would be returned, instead the full list of hosts are returned.
+ In that case, we can't possibly return a valid recommended layout so we will at least return a fully filled layout.
+ """
+ removeHosts = []
+ dependencies = [] if "dependencies" not in component else component['dependencies']
+ for dependency in dependencies:
+ # accounts only for dependencies that are not conditional
+ conditionsPresent = "conditions" in dependency["Dependencies"] and dependency["Dependencies"]["conditions"]
+ if not conditionsPresent:
+ componentName = component["StackServiceComponents"]["component_name"]
+ requiredComponentName = dependency["Dependencies"]["component_name"]
+ requiredComponent = self.getRequiredComponent(services, requiredComponentName)
+
+ # We only deal with "host" scope.
+ if (requiredComponent is not None) and (requiredComponent["component_category"] != "CLIENT"):
+ scope = "cluster" if "scope" not in dependency["Dependencies"] else dependency["Dependencies"]["scope"]
+ if scope == "host":
+ for host, hostComponents in hostsComponentsMap.iteritems():
+ isRequiredIncluded = False
+ for component in hostComponents:
+ currentComponentName = None if "name" not in component else component["name"]
+ if requiredComponentName == currentComponentName:
+ isRequiredIncluded = True
+ if not isRequiredIncluded:
+ removeHosts.append(host)
+
+ filteredHostsList = []
+ for host in hostsList:
+ if host not in removeHosts:
+ filteredHostsList.append(host)
+ return filteredHostsList
+
+ def filterList(self, list, filter):
+ """
+ Returns the union of the two lists passed in (list and filter params).
+ """
+ filteredList = []
+ for item in list:
+ if item in filter:
+ filteredList.append(item)
+ return filteredList
+
+ def getServiceForComponentName(self, services, componentName):
+ """
+ Return service for component name
+
+ :type services dict
+ :type componentName str
+ """
+ for service in services["services"]:
+ for component in service["components"]:
+ if self.getComponentName(component) == componentName:
+ return service
+
+ return None
+
def isComponentUsingCardinalityForLayout(self, componentName):
return False
http://git-wip-us.apache.org/repos/asf/ambari/blob/0b6d0dce/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
index 41c57f6..b6f1965 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py
@@ -191,6 +191,159 @@ class TestHDP206StackAdvisor(TestCase):
]
self.assertValidationResult(expectedItems, result)
+
+ def test_handleComponentDependencies(self):
+ services = {
+ "Versions":
+ {
+ "stack_name":"HDP",
+ "stack_version":"2.0.6"
+ },
+ "services" : [
+ {
+ "StackServices" : {
+ "service_name" : "HDFS",
+ "service_version" : "2.0.6",
+ },
+ "components": [
+ {
+ "StackServiceComponents": {
+ "stack_version": "2.0.6",
+ "stack_name": "HDP",
+ "component_category": "MASTER",
+ "is_client": False,
+ "is_master": True,
+ "service_name": "HDFS",
+ "cardinality": "1-2",
+ "hostnames": [],
+ "component_name": "NAMENODE",
+ "display_name": "NameNode"
+ },
+ "dependencies": [
+ {
+ "Dependencies": {
+ "stack_name": "HDP",
+ "stack_version": "2.0.6",
+ "scope": "cluster",
+ "conditions": [
+ {
+ "configType": "hdfs-site",
+ "property": "dfs.nameservices",
+ "type": "PropertyExists",
+ }
+ ],
+ "dependent_service_name": "HDFS",
+ "dependent_component_name": "NAMENODE",
+ "component_name": "ZOOKEEPER_SERVER"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "StackServices" : {
+ "service_name" : "ZOOKEEPER",
+ "service_version" : "2.0.6",
+ },
+ "components": [
+ {
+ "StackServiceComponents": {
+ "stack_version": "2.0.6",
+ "stack_name": "HDP",
+ "component_category": "MASTER",
+ "is_client": False,
+ "is_master": True,
+ "service_name": "HDFS",
+ "cardinality": "1-2",
+ "hostnames": [],
+ "component_name": "ZOOKEEPER_SERVER",
+ "display_name": "ZooKeeper Server"
+ },
+ "dependencies": []
+ }
+ ]
+ }
+ ]
+ }
+
+ nameNodeDependencies = services["services"][0]["components"][0]["dependencies"][0]["Dependencies"]
+
+ # Tests for master component with dependencies
+
+ hosts = self.prepareHosts(["c6401.ambari.apache.org", "c6402.ambari.apache.org", "c6403.ambari.apache.org", "c6404.ambari.apache.org"])
+ services["services"][1]["components"][0]["StackServiceComponents"]["hostnames"] = ["c6402.ambari.apache.org", "c6403.ambari.apache.org"]
+ recommendations = self.stackAdvisor.createComponentLayoutRecommendations(services, hosts)
+ # Assert that dependencies are ignored when there are conditions and cluster scope
+ self.assertEquals(recommendations['blueprint']['host_groups'][3]['components'][0]['name'], 'NAMENODE')
+ self.assertEquals(len(recommendations['blueprint']['host_groups'][3]['components']), 1)
+
+ nameNodeDependencies["scope"] = "host"
+ recommendations = self.stackAdvisor.createComponentLayoutRecommendations(services, hosts)
+ # Assert that dependencies are ignored when there are conditions (even for host scope)
+ self.assertEquals(recommendations['blueprint']['host_groups'][3]['components'][0]['name'], 'NAMENODE')
+ self.assertEquals(len(recommendations['blueprint']['host_groups'][3]['components']), 1)
+
+ nameNodeDependencies["scope"] = "cluster"
+ originalConditions = nameNodeDependencies["conditions"]
+ nameNodeDependencies["conditions"] = []
+ recommendations = self.stackAdvisor.createComponentLayoutRecommendations(services, hosts)
+ # Assert that dependencies are ignored when scope is cluster
+ self.assertEquals(recommendations['blueprint']['host_groups'][3]['components'][0]['name'], 'NAMENODE')
+ self.assertEquals(len(recommendations['blueprint']['host_groups'][3]['components']), 1)
+
+ nameNodeDependencies["scope"] = "host"
+ recommendations = self.stackAdvisor.createComponentLayoutRecommendations(services, hosts)
+ # Assert that dependencies are enforced for host scope without conditions
+ #self.assertEquals(recommendations, "")
+ self.assertEquals(len(recommendations['blueprint']['host_groups'][0]['components']), 2)
+
+ services["services"][1]["components"][0]["StackServiceComponents"]["is_master"] = False
+ services["services"][1]["components"][0]["StackServiceComponents"]["component_category"] = "CLIENT"
+ recommendations = self.stackAdvisor.createComponentLayoutRecommendations(services, hosts)
+ # Assert that dependencies are ignored when depending on client components
+ self.assertEquals(recommendations['blueprint']['host_groups'][3]['components'][0]['name'], 'NAMENODE')
+ self.assertEquals(len(recommendations['blueprint']['host_groups'][3]['components']), 1)
+
+ # Tests for slave component with dependencies
+ services["services"][0]["components"][0]["StackServiceComponents"]["component_category"] = "SLAVE"
+ services["services"][0]["components"][0]["StackServiceComponents"]["is_master"] = False
+ services["services"][1]["components"][0]["StackServiceComponents"]["component_category"] = "MASTER"
+ services["services"][1]["components"][0]["StackServiceComponents"]["is_master"] = True
+
+ nameNodeDependencies["scope"] = "cluster"
+ nameNodeDependencies["conditions"] = originalConditions
+ recommendations = self.stackAdvisor.createComponentLayoutRecommendations(services, hosts)
+ # Assert that dependencies are ignored when there are conditions and cluster scope
+ self.assertEquals(recommendations['blueprint']['host_groups'][2]['components'][0]['name'], 'NAMENODE')
+ self.assertEquals(len(recommendations['blueprint']['host_groups'][2]['components']), 1)
+ self.assertEquals(recommendations['blueprint']['host_groups'][3]['components'][0]['name'], 'NAMENODE')
+ self.assertEquals(len(recommendations['blueprint']['host_groups'][3]['components']), 1)
+
+ nameNodeDependencies["scope"] = "host"
+ recommendations = self.stackAdvisor.createComponentLayoutRecommendations(services, hosts)
+ # Assert that dependencies are ignored when there are conditions (even for host scope)
+ self.assertEquals(recommendations['blueprint']['host_groups'][2]['components'][0]['name'], 'NAMENODE')
+ self.assertEquals(len(recommendations['blueprint']['host_groups'][2]['components']), 1)
+ self.assertEquals(recommendations['blueprint']['host_groups'][3]['components'][0]['name'], 'NAMENODE')
+ self.assertEquals(len(recommendations['blueprint']['host_groups'][3]['components']), 1)
+
+ nameNodeDependencies["scope"] = "cluster"
+ nameNodeDependencies["conditions"] = []
+ recommendations = self.stackAdvisor.createComponentLayoutRecommendations(services, hosts)
+ # Assert that dependencies are ignored when scope is cluster
+ self.assertEquals(recommendations['blueprint']['host_groups'][2]['components'][0]['name'], 'NAMENODE')
+ self.assertEquals(len(recommendations['blueprint']['host_groups'][2]['components']), 1)
+ self.assertEquals(recommendations['blueprint']['host_groups'][3]['components'][0]['name'], 'NAMENODE')
+ self.assertEquals(len(recommendations['blueprint']['host_groups'][3]['components']), 1)
+
+ nameNodeDependencies["scope"] = "host"
+ recommendations = self.stackAdvisor.createComponentLayoutRecommendations(services, hosts)
+ # Assert that dependencies are enforced when host scope and no conditions
+ self.assertEquals(recommendations['blueprint']['host_groups'][1]['components'][1]['name'], 'NAMENODE')
+ self.assertEquals(len(recommendations['blueprint']['host_groups'][1]['components']), 2)
+
+
def test_validateRequiredComponentsPresent(self):
services = {
"Versions":
[34/50] [abbrv] ambari git commit: AMBARI-21017. Misc tab at
Customize Services Page has 2 Livy User tags and no helper popup to identify
if its Livy/Livy2 (Bikas Saha via smohanty)
Posted by rl...@apache.org.
AMBARI-21017. Misc tab at Customize Services Page has 2 Livy User tags and no helper popup to identify if its Livy/Livy2 (Bikas Saha via smohanty)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e801b419
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e801b419
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e801b419
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: e801b4199dd8a38ea50dd5b172fa85f49ee56966
Parents: b772b4d
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Wed Jun 7 12:50:18 2017 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Wed Jun 7 12:50:27 2017 -0700
----------------------------------------------------------------------
.../stacks/HDP/2.6/services/SPARK2/configuration/livy2-env.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/e801b419/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-env.xml
index 751d005..201aac9 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-env.xml
@@ -22,7 +22,7 @@
<configuration supports_adding_forbidden="true">
<property>
<name>livy2_user</name>
- <display-name>Livy User</display-name>
+ <display-name>Livy2 User</display-name>
<value>livy</value>
<property-type>USER</property-type>
<value-attributes>
@@ -33,7 +33,7 @@
</property>
<property>
<name>livy2_group</name>
- <display-name>Livy Group</display-name>
+ <display-name>Livy2 Group</display-name>
<value>livy</value>
<property-type>GROUP</property-type>
<description>livy group</description>
[25/50] [abbrv] ambari git commit: AMBARI-21070. Race condition:
webhdfs call mkdir /tmp/druid-indexing before /tmp making tmp not writable.
(aonishuk)
Posted by rl...@apache.org.
AMBARI-21070. Race condition: webhdfs call mkdir /tmp/druid-indexing before /tmp making tmp not writable. (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0dd9fbf3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0dd9fbf3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0dd9fbf3
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 0dd9fbf34764de407d9605f4472da03bf466cad6
Parents: bc90de2
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Jun 6 13:59:28 2017 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Jun 6 13:59:28 2017 +0300
----------------------------------------------------------------------
.../DRUID/0.9.2/package/scripts/druid.py | 7 ++++++
.../DRUID/0.9.2/package/scripts/params.py | 1 +
.../test/python/stacks/2.6/DRUID/test_druid.py | 23 +++++++++++++++++++-
.../test/python/stacks/2.6/configs/default.json | 3 ++-
4 files changed, 32 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/0dd9fbf3/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 18febeb..cc02519 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
@@ -159,6 +159,13 @@ def ensure_hadoop_directories():
# Create HadoopIndexTask hadoopWorkingPath
hadoop_working_path = druid_middlemanager_config['druid.indexer.task.hadoopWorkingPath']
if hadoop_working_path is not None:
+ if hadoop_working_path.startswith(params.hdfs_tmp_dir):
+ params.HdfsResource(params.hdfs_tmp_dir,
+ type="directory",
+ action="create_on_execute",
+ owner=params.hdfs_user,
+ mode=0777,
+ )
create_hadoop_directory(hadoop_working_path)
# If HDFS is used for storing logs, create Index Task log directory
http://git-wip-us.apache.org/repos/asf/ambari/blob/0dd9fbf3/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
index b1d9472..d47e604 100644
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
@@ -125,6 +125,7 @@ hdfs_principal_name = default('/configurations/hadoop-env/hdfs_principal_name',
hdfs_site = config['configurations']['hdfs-site']
default_fs = config['configurations']['core-site']['fs.defaultFS']
dfs_type = default("/commandParams/dfs_type", "")
+hdfs_tmp_dir = config['configurations']['hadoop-env']['hdfs_tmp_dir']
# Kerberos
druid_principal_name = default('/configurations/druid-common/druid.hadoop.security.kerberos.principal',
http://git-wip-us.apache.org/repos/asf/ambari/blob/0dd9fbf3/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 f35fd8e..41b0bf5 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
@@ -622,7 +622,28 @@ class TestDruid(RMFTestCase):
dfs_type = '',
mode=0755
)
-
+ self.assertResourceCalled('HdfsResource', '/tmp',
+ security_enabled = False,
+ hadoop_bin_dir = '/usr/hdp/current/hadoop-client/bin',
+ keytab = UnknownConfigurationMock(),
+ dfs_type = '',
+ default_fs = 'hdfs://c6401.ambari.apache.org:8020',
+ hdfs_resource_ignore_file = '/var/lib/ambari-agent/data/.hdfs_resource_ignore',
+ hdfs_site = {u'a': u'b'},
+ kinit_path_local = '/usr/bin/kinit',
+ principal_name = 'missing_principal',
+ user = 'hdfs',
+ owner = 'hdfs',
+ hadoop_conf_dir = '/usr/hdp/current/hadoop-client/conf',
+ type = 'directory',
+ action = ['create_on_execute'],
+ immutable_paths = [u'/apps/hive/warehouse',
+ u'/apps/falcon',
+ u'/mr-history/done',
+ u'/app-logs',
+ u'/tmp'],
+ mode = 0777,
+ )
self.assertResourceCalled('HdfsResource', '/tmp/druid-indexing',
immutable_paths = self.DEFAULT_IMMUTABLE_PATHS,
security_enabled = False,
http://git-wip-us.apache.org/repos/asf/ambari/blob/0dd9fbf3/ambari-server/src/test/python/stacks/2.6/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/configs/default.json b/ambari-server/src/test/python/stacks/2.6/configs/default.json
index 54000e6..2570657 100644
--- a/ambari-server/src/test/python/stacks/2.6/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.6/configs/default.json
@@ -54,7 +54,8 @@
"content": "\n #\n #\n # Licensed to the Apache Software Foundation (ASF) under one\n # or more contributor license agreements. See the NOTICE file\n # distributed with this work for additional information\n # regarding copyright ownership. The ASF licenses this file\n # to you under the Apache License, Version 2.0 (the\n # \"License\"); you may not use this file except in compliance\n # with the License. You may obtain a copy of the License at\n #\n # http://www.apache.org/licenses/LICENSE-2.0\n #\n # Unless required by applicable law or agreed to in writing,\n # software distributed under the License is distributed on an\n # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n # KIND, either express or implied. See the License for the\n # specific language governing permissions a
nd limitations\n # under the License.\n #\n #\n #\n\n # Set everything to be logged to the console\n log4j.rootCategory=WARN, console\n log4j.appender.console=org.apache.log4j.ConsoleAppender\n log4j.appender.console.target=System.err\n log4j.appender.console.layout=org.apache.log4j.PatternLayout\n log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n # Settings to quiet third party logs that are too verbose\n log4j.logger.org.eclipse.jetty=WARN\n log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=WARN\n log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=WARN"
},
"hadoop-env": {
- "hdfs_user": "hdfs"
+ "hdfs_user": "hdfs",
+ "hdfs_tmp_dir": "/tmp"
},
"core-site": {
"fs.defaultFS": "hdfs://c6401.ambari.apache.org:8020"
[11/50] [abbrv] ambari git commit: Fix minor typo in ambari site.xml
Posted by rl...@apache.org.
Fix minor typo in ambari site.xml
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/201c6d01
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/201c6d01
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/201c6d01
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 201c6d01bad70aec8ebee1e2a6633bcd0062c1c6
Parents: 28e20a1
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Fri Jun 2 11:55:09 2017 -0700
Committer: Aravindan Vijayan <av...@hortonworks.com>
Committed: Fri Jun 2 11:55:09 2017 -0700
----------------------------------------------------------------------
docs/src/site/site.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/201c6d01/docs/src/site/site.xml
----------------------------------------------------------------------
diff --git a/docs/src/site/site.xml b/docs/src/site/site.xml
index db45a35..ec5de8d 100644
--- a/docs/src/site/site.xml
+++ b/docs/src/site/site.xml
@@ -109,7 +109,7 @@
<item name="API Reference" href="https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/index.md"/>
<item name="Install Guide for 2.5.1" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.5.1"/>
<item name="Install Guide for 2.5.0" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.5.0"/>
- <item name="Install Guide for 2.4.2" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.3"/>
+ <item name="Install Guide for 2.4.3" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.3"/>
<item name="Install Guide for 2.4.2" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.2"/>
<item name="Install Guide for 2.4.1" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.1"/>
<item name="Install Guide for 2.4.0" href="https://cwiki.apache.org/confluence/display/AMBARI/Installation+Guide+for+Ambari+2.4.0"/>
[14/50] [abbrv] ambari git commit: AMBARI-21142. Log more info about
heartbeat message/response when server - agent communication gets out of
sync. (stoader)
Posted by rl...@apache.org.
AMBARI-21142. Log more info about heartbeat message/response when server - agent communication gets out of sync. (stoader)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b7101f78
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b7101f78
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b7101f78
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: b7101f782be9a1291de589262f01083c70dfc935
Parents: c3c06ea
Author: Toader, Sebastian <st...@hortonworks.com>
Authored: Fri Jun 2 23:09:56 2017 +0200
Committer: Toader, Sebastian <st...@hortonworks.com>
Committed: Fri Jun 2 23:12:46 2017 +0200
----------------------------------------------------------------------
.../src/main/python/ambari_agent/Controller.py | 6 +++++-
.../ambari/server/agent/HeartBeatHandler.java | 18 ++++++++++++++----
2 files changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b7101f78/ambari-agent/src/main/python/ambari_agent/Controller.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/Controller.py b/ambari-agent/src/main/python/ambari_agent/Controller.py
index 0297f74..bc923c3 100644
--- a/ambari-agent/src/main/python/ambari_agent/Controller.py
+++ b/ambari-agent/src/main/python/ambari_agent/Controller.py
@@ -321,6 +321,7 @@ class Controller(threading.Thread):
logger.log(logging_level, "Sending Heartbeat (id = %s)", self.responseId)
response = self.sendRequest(self.heartbeatUrl, data)
+
exitStatus = 0
if 'exitstatus' in response.keys():
exitStatus = int(response['exitstatus'])
@@ -366,7 +367,9 @@ class Controller(threading.Thread):
self.restartAgent()
if serverId != self.responseId + 1:
- logger.error("Error in responseId sequence - restarting")
+ logger.error("Error in responseId sequence - received responseId={0} from server while expecting {1} - restarting..."
+ .format(serverId, self.responseId + 1))
+
self.restartAgent()
else:
self.responseId = serverId
@@ -465,6 +468,7 @@ class Controller(threading.Thread):
#randomize the heartbeat
delay = randint(0, self.max_reconnect_retry_delay)
+ logger.info("Waiting {0} seconds before reconnecting to {1}".format(delay, self.heartbeatUrl))
time.sleep(delay)
# Sleep for some time
http://git-wip-us.apache.org/repos/asf/ambari/blob/b7101f78/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
index d800bc5..fc6e7a7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
@@ -161,10 +161,20 @@ public class HeartBeatHandler {
+ ", receivedResponseId=" + heartbeat.getResponseId());
if (heartbeat.getResponseId() == currentResponseId - 1) {
- LOG.warn("Old responseId received - response was lost - returning cached response");
- return hostResponses.get(hostname);
+ HeartBeatResponse heartBeatResponse = hostResponses.get(hostname);
+
+ LOG.warn("Old responseId={} received form host {} - response was lost - returning cached response with responseId={}",
+ heartbeat.getResponseId(),
+ hostname,
+ heartBeatResponse.getResponseId());
+
+ return heartBeatResponse;
} else if (heartbeat.getResponseId() != currentResponseId) {
- LOG.error("Error in responseId sequence - sending agent restart command");
+ LOG.error("Error in responseId sequence - received responseId={} from host {} - sending agent restart command with responseId={}",
+ heartbeat.getResponseId(),
+ hostname,
+ currentResponseId);
+
return createRestartCommand(currentResponseId);
}
@@ -186,7 +196,7 @@ public class HeartBeatHandler {
if (hostObject.getState().equals(HostState.HEARTBEAT_LOST)) {
// After loosing heartbeat agent should reregister
- LOG.warn("Host is in HEARTBEAT_LOST state - sending register command");
+ LOG.warn("Host {} is in HEARTBEAT_LOST state - sending register command", hostname);
return createRegisterCommand();
}
[37/50] [abbrv] ambari git commit: AMBARI-21146. Knox JAAS
configuration file should not allow the Kerberos ticket cache to be used when
establishing its identity on startup (Attila Magyar via adoroszlai)
Posted by rl...@apache.org.
AMBARI-21146. Knox JAAS configuration file should not allow the Kerberos ticket cache to be used when establishing its identity on startup (Attila Magyar via adoroszlai)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e71f49e4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e71f49e4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e71f49e4
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: e71f49e4ef30ff720ad4f8b7fb3823d68acd48cc
Parents: 9b44b62
Author: Attila Magyar <am...@hortonworks.com>
Authored: Thu Jun 8 11:23:29 2017 +0200
Committer: Attila Doroszlai <ad...@hortonworks.com>
Committed: Thu Jun 8 11:23:29 2017 +0200
----------------------------------------------------------------------
.../KNOX/0.5.0.2.2/package/templates/krb5JAASLogin.conf.j2 | 9 +++------
.../KNOX/0.5.0.3.0/package/templates/krb5JAASLogin.conf.j2 | 9 +++------
2 files changed, 6 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/e71f49e4/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/templates/krb5JAASLogin.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/templates/krb5JAASLogin.conf.j2 b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/templates/krb5JAASLogin.conf.j2
index fa3237b..29b2179 100644
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/templates/krb5JAASLogin.conf.j2
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/templates/krb5JAASLogin.conf.j2
@@ -17,14 +17,11 @@
#}
com.sun.security.jgss.initiate {
com.sun.security.auth.module.Krb5LoginModule required
-renewTGT=true
+renewTGT=false
doNotPrompt=true
useKeyTab=true
keyTab="{{knox_keytab_path}}"
principal="{{knox_principal_name}}"
-isInitiator=true
storeKey=true
-useTicketCache=true
-client=true;
-};
-
+useTicketCache=false;
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/e71f49e4/ambari-server/src/main/resources/common-services/KNOX/0.5.0.3.0/package/templates/krb5JAASLogin.conf.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.3.0/package/templates/krb5JAASLogin.conf.j2 b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.3.0/package/templates/krb5JAASLogin.conf.j2
index fa3237b..29b2179 100644
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.3.0/package/templates/krb5JAASLogin.conf.j2
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.3.0/package/templates/krb5JAASLogin.conf.j2
@@ -17,14 +17,11 @@
#}
com.sun.security.jgss.initiate {
com.sun.security.auth.module.Krb5LoginModule required
-renewTGT=true
+renewTGT=false
doNotPrompt=true
useKeyTab=true
keyTab="{{knox_keytab_path}}"
principal="{{knox_principal_name}}"
-isInitiator=true
storeKey=true
-useTicketCache=true
-client=true;
-};
-
+useTicketCache=false;
+};
\ No newline at end of file
[10/50] [abbrv] ambari git commit: AMBARI-21156. Yarn service check
failure after moving resource manager to a different host - on wire encrypted
cluster (akovalenko)
Posted by rl...@apache.org.
AMBARI-21156. Yarn service check failure after moving resource manager to a different host - on wire encrypted cluster (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/28e20a16
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/28e20a16
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/28e20a16
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 28e20a16879a6db4b48107738891d714cd2217b9
Parents: 4283211
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Wed May 31 14:13:28 2017 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Fri Jun 2 20:56:38 2017 +0300
----------------------------------------------------------------------
.../app/controllers/main/service/reassign/step3_controller.js | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/28e20a16/ambari-web/app/controllers/main/service/reassign/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step3_controller.js b/ambari-web/app/controllers/main/service/reassign/step3_controller.js
index d4edb1e..c44c4f3 100644
--- a/ambari-web/app/controllers/main/service/reassign/step3_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step3_controller.js
@@ -58,6 +58,7 @@ App.ReassignMasterWizardStep3Controller = Em.Controller.extend({
'yarn.resourcemanager.resource-tracker.address': '<replace-value>:8025',
'yarn.resourcemanager.scheduler.address': '<replace-value>:8030',
'yarn.resourcemanager.webapp.address': '<replace-value>:8088',
+ 'yarn.resourcemanager.webapp.https.address': '<replace-value>:8090',
'yarn.resourcemanager.hostname': '<replace-value>'
}
}
[30/50] [abbrv] ambari git commit: AMBARI-21164. Remove unused import
to fix build error
Posted by rl...@apache.org.
AMBARI-21164. Remove unused import to fix build error
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1586a1a9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1586a1a9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1586a1a9
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 1586a1a9253e5c456161331a5766ed52e250ad99
Parents: 84c4e0d
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Wed Jun 7 15:34:35 2017 +0200
Committer: Attila Doroszlai <ad...@hortonworks.com>
Committed: Wed Jun 7 15:34:35 2017 +0200
----------------------------------------------------------------------
.../ambari/server/checks/ServiceCheckValidityCheckTest.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/1586a1a9/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
index 91fd72a..75970cc 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
@@ -24,7 +24,6 @@ import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import java.util.Arrays;
import java.util.Collections;
import org.apache.ambari.server.AmbariException;
@@ -231,4 +230,4 @@ public class ServiceCheckValidityCheckTest {
serviceCheckValidityCheck.perform(check, new PrereqCheckRequest(CLUSTER_NAME));
Assert.assertEquals(PrereqCheckStatus.FAIL, check.getStatus());
}
-}
\ No newline at end of file
+}
[33/50] [abbrv] ambari git commit: AMBARI-21187. Get rid deprecated
jdk install link in the Dockerfile of Log Search (oleewere)
Posted by rl...@apache.org.
AMBARI-21187. Get rid deprecated jdk install link in the Dockerfile of Log Search (oleewere)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b772b4d6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b772b4d6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b772b4d6
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: b772b4d625b9de6eaa46926ccbe3244811c9865f
Parents: 3b575fb
Author: oleewere <ol...@gmail.com>
Authored: Wed Jun 7 19:35:08 2017 +0200
Committer: oleewere <ol...@gmail.com>
Committed: Wed Jun 7 19:35:08 2017 +0200
----------------------------------------------------------------------
ambari-logsearch/docker/Dockerfile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b772b4d6/ambari-logsearch/docker/Dockerfile
----------------------------------------------------------------------
diff --git a/ambari-logsearch/docker/Dockerfile b/ambari-logsearch/docker/Dockerfile
index d399fc6..2b8fd5d 100644
--- a/ambari-logsearch/docker/Dockerfile
+++ b/ambari-logsearch/docker/Dockerfile
@@ -22,9 +22,9 @@ RUN yum -y install glibc-common
ENV HOME /root
#Install JAVA
-ENV JAVA_VERSION 8u31
-ENV BUILD_VERSION b13
-RUN wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/$JAVA_VERSION-$BUILD_VERSION/jdk-$JAVA_VERSION-linux-x64.rpm" -O jdk-8-linux-x64.rpm
+ENV JAVA_VERSION 8u131
+ENV BUILD_VERSION b11
+RUN wget --no-check-certificate --no-cookies --header "Cookie:oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/$JAVA_VERSION-$BUILD_VERSION/d54c1d3a095b4ff2b6607d096fa80163/jdk-$JAVA_VERSION-linux-x64.rpm -O jdk-8-linux-x64.rpm
RUN rpm -ivh jdk-8-linux-x64.rpm
ENV JAVA_HOME /usr/java/default/
[08/50] [abbrv] ambari git commit: AMBARI-20827 - Use
java.util.concurrent.ConcurrentHashMap instead of
org.jboss.netty.util.internal.ConcurrentHashMap (Akira Ajisaka via
jonathanhurley)
Posted by rl...@apache.org.
AMBARI-20827 - Use java.util.concurrent.ConcurrentHashMap instead of org.jboss.netty.util.internal.ConcurrentHashMap (Akira Ajisaka via jonathanhurley)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/71e384db
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/71e384db
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/71e384db
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 71e384dbbdecd66f75c48f0fae375d7bdac39b11
Parents: cb9196f
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Fri Jun 2 10:28:20 2017 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Fri Jun 2 10:28:20 2017 -0400
----------------------------------------------------------------------
.../ambari/server/events/listeners/tasks/TaskStatusListener.java | 2 +-
.../ambari/server/state/svccomphost/ServiceComponentHostImpl.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/71e384db/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/tasks/TaskStatusListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/tasks/TaskStatusListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/tasks/TaskStatusListener.java
index 61ccbc9..230b943 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/tasks/TaskStatusListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/tasks/TaskStatusListener.java
@@ -26,6 +26,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import org.apache.ambari.server.EagerSingleton;
import org.apache.ambari.server.Role;
@@ -43,7 +44,6 @@ import org.apache.ambari.server.orm.entities.RequestEntity;
import org.apache.ambari.server.orm.entities.RoleSuccessCriteriaEntity;
import org.apache.ambari.server.orm.entities.StageEntity;
import org.apache.ambari.server.orm.entities.StageEntityPK;
-import org.jboss.netty.util.internal.ConcurrentHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/ambari/blob/71e384db/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
index af82bad..bb51733 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
@@ -24,6 +24,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
@@ -79,7 +80,6 @@ import org.apache.ambari.server.state.fsm.SingleArcTransition;
import org.apache.ambari.server.state.fsm.StateMachine;
import org.apache.ambari.server.state.fsm.StateMachineFactory;
import org.apache.ambari.server.state.stack.upgrade.RepositoryVersionHelper;
-import org.jboss.netty.util.internal.ConcurrentHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
[07/50] [abbrv] ambari git commit: AMBARI-21166 Ambari 3.0:
Navigation style changes, second patch. (atkach)
Posted by rl...@apache.org.
AMBARI-21166 Ambari 3.0: Navigation style changes, second patch. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cb9196f8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cb9196f8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cb9196f8
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: cb9196f8ed2c269fe8bc6798832556aeadb6dd96
Parents: 49605da
Author: Andrii Tkach <at...@apache.org>
Authored: Fri Jun 2 15:22:38 2017 +0300
Committer: Andrii Tkach <at...@apache.org>
Committed: Fri Jun 2 15:22:38 2017 +0300
----------------------------------------------------------------------
ambari-web/app/styles/theme/bootstrap-ambari.css | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/cb9196f8/ambari-web/app/styles/theme/bootstrap-ambari.css
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/theme/bootstrap-ambari.css b/ambari-web/app/styles/theme/bootstrap-ambari.css
index 4bc7a99..f868744 100644
--- a/ambari-web/app/styles/theme/bootstrap-ambari.css
+++ b/ambari-web/app/styles/theme/bootstrap-ambari.css
@@ -28,7 +28,6 @@
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
}
.btn,
.btn:focus {
@@ -277,7 +276,6 @@
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
border-radius: 2px;
font-size: 14px;
min-width: 200px;
@@ -378,7 +376,6 @@ h2.table-title {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
margin-top: 10px;
font-size: 20px;
}
@@ -528,7 +525,6 @@ h2.table-title {
font-weight: normal;
font-style: normal;
line-height: 1;
- -webkit-font-smoothing: antialiased;
font-size: 20px;
color: #333;
margin: 15px 20px;
@@ -550,7 +546,6 @@ h2.table-title {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
font-weight: bold;
font-size: 18px;
color: #666;
@@ -561,7 +556,6 @@ h2.table-title {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
font-size: 14px;
line-height: 1.4;
color: #999;
@@ -611,7 +605,6 @@ h2.table-title {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
font-size: 14px;
color: #999;
margin-left: 30px;
@@ -625,7 +618,6 @@ h2.table-title {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
font-size: 12px;
color: #999;
margin-left: 30px;
@@ -781,6 +773,7 @@ input.radio:checked + label:after {
padding: 0;
-ms-overflow-style: none;
transition: width 0.5s ease-out;
+ -webkit-font-smoothing: antialiased;
}
.navigation-bar-container ul.nav.side-nav-header {
width: 230px;
@@ -813,7 +806,6 @@ input.radio:checked + label:after {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
font-size: 20px;
width: 55px;
display: inline;
@@ -840,7 +832,6 @@ input.radio:checked + label:after {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
font-size: 14px;
color: #666;
line-height: 1.42;
@@ -887,7 +878,6 @@ input.radio:checked + label:after {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
font-size: 14px;
color: #b8bec4;
padding-left: 8px;
@@ -951,7 +941,6 @@ input.radio:checked + label:after {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
font-size: 14px;
color: #999;
}
@@ -1242,7 +1231,6 @@ input.radio:checked + label:after {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
font-size: 16px;
}
#notifications-dropdown.dropdown-menu .notifications-body {
@@ -1265,7 +1253,6 @@ input.radio:checked + label:after {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
font-size: 12px;
color: #666;
position: relative;
@@ -1308,7 +1295,6 @@ input.radio:checked + label:after {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
line-height: 1.3;
}
#notifications-dropdown.dropdown-menu .notifications-body .table.alerts-table tbody td.content .name {
@@ -1410,7 +1396,6 @@ input.radio:checked + label:after {
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
}
.accordion .panel-group .panel .panel-heading .panel-title > a,
.wizard .wizard-body .wizard-content .accordion .panel-group .panel .panel-heading .panel-title > a {
@@ -1460,7 +1445,6 @@ body,
font-style: normal;
line-height: 1;
color: #333;
- -webkit-font-smoothing: antialiased;
font-size: 14px;
}
.description {
[24/50] [abbrv] ambari git commit: AMBARI-21054. Add ppc as a new OS
for User. (aonishuk)
Posted by rl...@apache.org.
AMBARI-21054. Add ppc as a new OS for User. (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bc90de2e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bc90de2e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bc90de2e
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: bc90de2e9843f41229d86f4dad6accbb66163500
Parents: 119d262
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Jun 6 13:58:40 2017 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Jun 6 13:58:40 2017 +0300
----------------------------------------------------------------------
.../src/main/python/ambari_commons/os_check.py | 6 ++++++
.../ambari_commons/resources/os_family.json | 10 ++++++++++
.../core/providers/__init__.py | 19 +++++++++++++------
.../libraries/providers/__init__.py | 3 ---
.../AmbariManagementControllerImpl.java | 16 ++++++++++++----
.../ambari/server/state/stack/OsFamily.java | 12 ++++++++++++
.../resources/stacks/HDP/2.6/repos/repoinfo.xml | 14 ++++++++++++++
7 files changed, 67 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/bc90de2e/ambari-common/src/main/python/ambari_commons/os_check.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/os_check.py b/ambari-common/src/main/python/ambari_commons/os_check.py
index b430c86..0416584 100644
--- a/ambari-common/src/main/python/ambari_commons/os_check.py
+++ b/ambari-common/src/main/python/ambari_commons/os_check.py
@@ -86,6 +86,9 @@ def _is_oracle_linux():
def _is_redhat_linux():
return _IS_REDHAT_LINUX
+def _is_powerpc():
+ return platform.processor() == 'powerpc' or platform.machine().startswith('ppc')
+
def advanced_check(distribution):
distribution = list(distribution)
if os.path.exists(SYSTEM_RELEASE_FILE):
@@ -255,6 +258,9 @@ class OSCheck:
if operatingSystem == '':
raise Exception("Cannot detect os type. Exiting...")
+
+ if _is_powerpc():
+ operatingSystem += '-ppc'
return operatingSystem
http://git-wip-us.apache.org/repos/asf/ambari/blob/bc90de2e/ambari-common/src/main/python/ambari_commons/resources/os_family.json
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/resources/os_family.json b/ambari-common/src/main/python/ambari_commons/resources/os_family.json
index 859ce56..b9cdbf6 100644
--- a/ambari-common/src/main/python/ambari_commons/resources/os_family.json
+++ b/ambari-common/src/main/python/ambari_commons/resources/os_family.json
@@ -22,6 +22,16 @@
7
]
},
+ "redhat-ppc": {
+ "extends" : "redhat",
+ "distro": [
+ "redhat-ppc",
+ "centos-ppc"
+ ],
+ "versions": [
+ 6
+ ]
+ },
"debian": {
"extends" : "ubuntu",
"distro": [
http://git-wip-us.apache.org/repos/asf/ambari/blob/bc90de2e/ambari-common/src/main/python/resource_management/core/providers/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/providers/__init__.py b/ambari-common/src/main/python/resource_management/core/providers/__init__.py
index 21ae0d5..ac6ee16 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/__init__.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/__init__.py
@@ -24,7 +24,7 @@ __all__ = ["Provider", "find_provider"]
from resource_management.core.exceptions import Fail
from resource_management.libraries.providers import PROVIDERS as LIBRARY_PROVIDERS
-
+from ambari_commons.os_check import OSCheck
class Provider(object):
def __init__(self, resource):
@@ -53,9 +53,6 @@ PROVIDERS = dict(
ubuntu=dict(
Package="resource_management.core.providers.package.apt.AptProvider",
),
- debian=dict(
- Package="resource_management.core.providers.package.apt.AptProvider",
- ),
winsrv=dict(
Service="resource_management.core.providers.windows.service.ServiceProvider",
ServiceConfig="resource_management.core.providers.windows.service.ServiceConfigProvider",
@@ -82,9 +79,19 @@ PROVIDERS = dict(
def find_provider(env, resource, class_path=None):
if not class_path:
providers = [PROVIDERS, LIBRARY_PROVIDERS]
+
for provider in providers:
- if resource in provider[env.system.os_family]:
- class_path = provider[env.system.os_family][resource]
+
+ if env.system.os_family in provider:
+ os_family_provider = provider[env.system.os_family]
+ else:
+ # take care of os extensions
+ for family in provider:
+ if OSCheck.is_in_family(env.system.os_family, family):
+ os_family_provider = provider[family]
+
+ if resource in os_family_provider:
+ class_path = os_family_provider[resource]
break
if resource in provider["default"]:
class_path = provider["default"][resource]
http://git-wip-us.apache.org/repos/asf/ambari/blob/bc90de2e/ambari-common/src/main/python/resource_management/libraries/providers/__init__.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/providers/__init__.py b/ambari-common/src/main/python/resource_management/libraries/providers/__init__.py
index bd7c98a..770f9b5 100644
--- a/ambari-common/src/main/python/resource_management/libraries/providers/__init__.py
+++ b/ambari-common/src/main/python/resource_management/libraries/providers/__init__.py
@@ -33,9 +33,6 @@ PROVIDERS = dict(
ubuntu=dict(
Repository="resource_management.libraries.providers.repository.UbuntuRepositoryProvider",
),
- debian=dict(
- Repository="resource_management.libraries.providers.repository.UbuntuRepositoryProvider",
- ),
winsrv=dict(
Msi="resource_management.libraries.providers.msi.MsiProvider"
),
http://git-wip-us.apache.org/repos/asf/ambari/blob/bc90de2e/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 186a19e..b67b45b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -187,6 +187,7 @@ import org.apache.ambari.server.state.quicklinksprofile.QuickLinkVisibilityContr
import org.apache.ambari.server.state.quicklinksprofile.QuickLinksProfile;
import org.apache.ambari.server.state.repository.VersionDefinitionXml;
import org.apache.ambari.server.state.scheduler.RequestExecutionFactory;
+import org.apache.ambari.server.state.stack.OsFamily;
import org.apache.ambari.server.state.stack.RepositoryXml;
import org.apache.ambari.server.state.stack.WidgetLayout;
import org.apache.ambari.server.state.stack.WidgetLayoutInfo;
@@ -313,6 +314,8 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
private ExtensionLinkDAO linkDAO;
@Inject
private StackDAO stackDAO;
+ @Inject
+ private OsFamily osFamily;
/**
* The KerberosHelper to help setup for enabling for disabling Kerberos
@@ -2621,13 +2624,18 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
}
private List<ServiceOsSpecific> getOSSpecificsByFamily(Map<String, ServiceOsSpecific> osSpecifics, String osFamily) {
- List<ServiceOsSpecific> foundedOSSpecifics = new ArrayList<>();
+ List<ServiceOsSpecific> foundOSSpecifics = new ArrayList<>();
for (Entry<String, ServiceOsSpecific> osSpecific : osSpecifics.entrySet()) {
- if (osSpecific.getKey().contains(osFamily)) {
- foundedOSSpecifics.add(osSpecific.getValue());
+ String[] osFamilyNames = osSpecific.getKey().split("\\s*,\\s*");
+
+ for(String osFamilyName:osFamilyNames) {
+ if (this.osFamily.isVersionedOsFamilyExtendedByVersionedFamily(osFamily, osFamilyName)) {
+ foundOSSpecifics.add(osSpecific.getValue());
+ break;
+ }
}
}
- return foundedOSSpecifics;
+ return foundOSSpecifics;
}
private ActionExecutionContext getActionExecutionContext
http://git-wip-us.apache.org/repos/asf/ambari/blob/bc90de2e/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
index bd89be0..b0d961c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/OsFamily.java
@@ -208,6 +208,18 @@ public class OsFamily {
return (currentFamily.equals(family) || getOsFamilyParent(currentFamily)!=null && isFamilyExtendedByFamily(getOsFamilyParent(currentFamily), family));
}
+ public boolean isVersionedOsFamilyExtendedByVersionedFamily(String currentVersionedFamily, String versionedFamily) {
+ Map<String,String> pos = this.parse_os(currentVersionedFamily);
+ String currentFamily = pos.get(OS_DISTRO);
+ String currentFamilyVersion = pos.get(OS_VERSION);
+
+ pos = this.parse_os(versionedFamily);
+ String family = pos.get(OS_DISTRO);
+ String familyVersion = pos.get(OS_VERSION);
+
+ return currentFamilyVersion.equals(familyVersion) && isFamilyExtendedByFamily(currentFamily, family);
+ }
+
private String getOsFamilyParent(String osFamily) {
return osMap.get(osFamily).getExtendsFamily();
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/bc90de2e/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
index 81a70a5..23441f5 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/repos/repoinfo.xml
@@ -31,6 +31,20 @@
<unique>false</unique>
</repo>
</os>
+ <os family="redhat-ppc6">
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.6.0.3</baseurl>
+ <repoid>HDP-2.6</repoid>
+ <reponame>HDP</reponame>
+ <unique>true</unique>
+ </repo>
+ <repo>
+ <baseurl>http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos6</baseurl>
+ <repoid>HDP-UTILS-1.1.0.21</repoid>
+ <reponame>HDP-UTILS</reponame>
+ <unique>false</unique>
+ </repo>
+ </os>
<os family="redhat7">
<repo>
<baseurl>http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.0.3</baseurl>
[20/50] [abbrv] ambari git commit: AMBARI-21138. Incorrect setting of
java path for druid service (slim bouguerra via smohanty)
Posted by rl...@apache.org.
AMBARI-21138. Incorrect setting of java path for druid service (slim bouguerra via smohanty)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/499814af
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/499814af
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/499814af
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 499814af75d3adfa7c5afcd1564ed79e16cb30a0
Parents: b916e37
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Mon Jun 5 15:57:09 2017 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Mon Jun 5 15:57:09 2017 -0700
----------------------------------------------------------------------
.../common-services/DRUID/0.9.2/configuration/druid-env.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/499814af/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 539ef0c..23b82e3 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
@@ -226,7 +226,7 @@
# The java implementation to use.
export JAVA_HOME={{java8_home}}
- export PATH=$PATH:$JAVA_HOME/bin
+ export PATH=$JAVA_HOME/bin:$PATH
export DRUID_PID_DIR={{druid_pid_dir}}
export DRUID_LOG_DIR={{druid_log_dir}}
export DRUID_CONF_DIR={{druid_conf_dir}}
[38/50] [abbrv] ambari git commit: AMBARI-21185. False positive
unused import for nested class referenced only in Javadoc
Posted by rl...@apache.org.
AMBARI-21185. False positive unused import for nested class referenced only in Javadoc
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2ff48a00
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2ff48a00
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2ff48a00
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 2ff48a00b155a65ac0daa55ac8f8be00774b158f
Parents: e71f49e
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Tue Jun 6 17:05:21 2017 +0200
Committer: Attila Doroszlai <ad...@hortonworks.com>
Committed: Thu Jun 8 11:35:49 2017 +0200
----------------------------------------------------------------------
.../controller/AmbariCustomCommandExecutionHelper.java | 7 +++----
.../apache/ambari/server/controller/KerberosHelperImpl.java | 2 --
.../server/controller/internal/UpgradeResourceProvider.java | 5 -----
.../listeners/upgrade/HostVersionOutOfSyncListener.java | 2 --
.../org/apache/ambari/server/orm/dao/HostVersionDAO.java | 6 ++----
.../org/apache/ambari/server/orm/dao/ServiceConfigDAO.java | 1 -
.../server/serveraction/upgrades/FinalizeUpgradeAction.java | 2 --
.../main/java/org/apache/ambari/server/state/Cluster.java | 6 +-----
.../java/org/apache/ambari/server/state/ConfigFactory.java | 8 --------
.../java/org/apache/ambari/server/state/UpgradeContext.java | 2 --
.../java/org/apache/ambari/server/state/alert/AlertUri.java | 2 +-
.../server/state/stack/upgrade/RepositoryVersionHelper.java | 4 +---
.../internal/StackUpgradeConfigurationMergeTest.java | 3 +--
.../controller/internal/UpgradeResourceProviderTest.java | 2 +-
.../java/org/apache/ambari/server/orm/OrmTestHelper.java | 2 --
.../server/serveraction/upgrades/ConfigureActionTest.java | 5 -----
.../server/serveraction/upgrades/UpgradeActionTest.java | 5 -----
.../org/apache/ambari/server/state/cluster/ClusterTest.java | 4 ++--
.../apache/ambari/server/upgrade/UpgradeCatalogHelper.java | 7 -------
19 files changed, 12 insertions(+), 63 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index cabb9d6..554ae1d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -1180,7 +1180,7 @@ public class AmbariCustomCommandExecutionHelper {
*
* @return the repo info
*
- * @deprecated use {@link #getCommandRepository(Cluster, Host)} instead.
+ * @deprecated use {@link #getCommandRepository(Cluster, ServiceComponent, Host)} instead.
* @throws AmbariException if the repository information can not be obtained
*/
@Deprecated
@@ -1305,7 +1305,7 @@ public class AmbariCustomCommandExecutionHelper {
/**
* Executed by two different representations of repos. When we are comfortable with the new
- * implemenation, this may be removed and called inline in {@link #getCommandRepository(Cluster, Host)}
+ * implementation, this may be removed and called inline in {@link #getCommandRepository(Cluster, ServiceComponent, Host)}
*
* @param cluster the cluster to isolate the stack
* @param component the component
@@ -1390,9 +1390,8 @@ public class AmbariCustomCommandExecutionHelper {
*
* @param actionExecContext the context
* @param cluster the cluster for the command
- * @param stackId the effective stack id to use.
*
- * @return a wrapper of the imporant JSON structures to add to a stage
+ * @return a wrapper of the important JSON structures to add to a stage
*/
public ExecuteCommandJson getCommandJson(ActionExecutionContext actionExecContext,
Cluster cluster, RepositoryVersionEntity repositoryVersion) throws AmbariException {
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
index 7b6ac7e..87c826d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
@@ -2205,7 +2205,6 @@ public class KerberosHelperImpl implements KerberosHelper {
* @param cluster the relevant Cluster
* @param requestId the relevant request Id
* @param requestContext a String describing the stage
- * @param clusterHostInfo JSON-encoded clusterHostInfo structure
* @param commandParams JSON-encoded command parameters
* @param hostParams JSON-encoded host parameters
* @return a newly created Stage
@@ -2233,7 +2232,6 @@ public class KerberosHelperImpl implements KerberosHelper {
* @param cluster the relevant Cluster
* @param requestId the relevant request Id
* @param requestContext a String describing the stage
- * @param clusterHostInfo JSON-encoded clusterHostInfo structure
* @param commandParams JSON-encoded command parameters
* @param hostParams JSON-encoded host parameters
* @param actionClass The ServeAction class that implements the action to invoke
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index f8f8faa..60665f7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -1089,8 +1089,6 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
* @param request upgrade request
* @param entity a single of upgrade
* @param task server-side task (if any)
- * @param skippable if user can skip stage on failure
- * @param allowRetry if user can retry running stage on failure
* @param configUpgradePack a runtime-generated config upgrade pack that
* contains all config change definitions from all stacks involved into
* upgrade
@@ -1453,9 +1451,6 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
/**
* Constructor.
- *
- * @param from
- * @param target
*/
public RepositoryVersions(RepositoryVersionEntity from, RepositoryVersionEntity to) {
fromRepositoryId = from.getId();
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
index 5536ef9..2eb89a2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
@@ -64,8 +64,6 @@ import com.google.inject.persist.Transactional;
* handles {@link org.apache.ambari.server.events.ServiceInstalledEvent} and
* {@link org.apache.ambari.server.events.ServiceComponentInstalledEvent}
* to update {@link org.apache.ambari.server.state.RepositoryVersionState}
- *
- * @see org.apache.ambari.server.state.Cluster#recalculateClusterVersionState(RepositoryVersionEntity)
*/
@Singleton
@EagerSingleton
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java
index ad34ec7..c05b06d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostVersionDAO.java
@@ -40,7 +40,7 @@ import com.google.inject.persist.Transactional;
* The {@link org.apache.ambari.server.orm.dao.HostVersionDAO} class manages the {@link org.apache.ambari.server.orm.entities.HostVersionEntity}
* instances associated with a host. Each host can have multiple stack versions in {@link org.apache.ambari.server.state.RepositoryVersionState#INSTALLED}
* which are installed, exactly one stack version that is either {@link org.apache.ambari.server.state.RepositoryVersionState#CURRENT} or
- * {@link org.apache.ambari.server.state.RepositoryVersionState#UPGRADING}.
+ * {@link org.apache.ambari.server.state.RepositoryVersionState#INSTALLING}.
*/
@Singleton
public class HostVersionDAO extends CrudDAO<HostVersionEntity, Long> {
@@ -150,9 +150,7 @@ public class HostVersionDAO extends CrudDAO<HostVersionEntity, Long> {
/**
* Retrieve the single host version for the given cluster, stack name, stack
* version, and host name. <br/>
- * This query is slow and not suitable for frequent use. <br/>
- * Please, use {@link HostVersionDAO#findByClusterStackVersionAndHost(long, org.apache.ambari.server.state.StackId, java.lang.String, long)} <br/>
- * It is ~50 times faster
+ * This query is slow and not suitable for frequent use.
*
* @param clusterName
* Cluster name
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java
index 72666e5..6bfad54 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceConfigDAO.java
@@ -153,7 +153,6 @@ public class ServiceConfigDAO {
* the cluster (not {@code null}).
* @param stackId
* the stack (not {@code null}).
- * @param service
* @return all service configurations for the cluster and stack.
*/
@RequiresSession
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
index 475a8c9..db0da9c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/FinalizeUpgradeAction.java
@@ -95,8 +95,6 @@ public class FinalizeUpgradeAction extends AbstractUpgradeServerAction {
/**
* Execution path for upgrade.
- * @param clusterName the name of the cluster the upgrade is for
- * @param version the target version of the upgrade
* @return the command report
*/
private CommandReport finalizeUpgrade(UpgradeContext upgradeContext)
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java b/ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java
index 4fddd8d..b4ebcd8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/Cluster.java
@@ -179,11 +179,7 @@ public interface Cluster {
* hosts into the correct state (which may not be
* {@link RepositoryVersionState#INSTALLING}).
* <p/>
- * The difference between this method compared to
- * {@link Cluster#mapHostVersions} is that it affects all hosts (not only
- * missing hosts).
- * <p/>
- * Hosts that are in maintenance mode will be transititioned directly into
+ * Hosts that are in maintenance mode will be transitioned directly into
* {@link RepositoryVersionState#OUT_OF_SYNC} instead. Hosts which do not need
* the version distributed to them will move into the
* {@link RepositoryVersionState#NOT_REQUIRED} state.
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigFactory.java
index dda5c9c..2879345 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigFactory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigFactory.java
@@ -32,14 +32,6 @@ public interface ConfigFactory {
/**
* Creates a new {@link Config} object using provided values.
- *
- * @param cluster
- * @param stackId
- * @param type
- * @param tag
- * @param map
- * @param mapAttributes
- * @return
*/
@Experimental(feature = ExperimentalFeature.MULTI_SERVICE,
comment = "This constructor is only used for test compatibility and should be removed")
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java b/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java
index 67ffefd..3ecf64d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/UpgradeContext.java
@@ -397,8 +397,6 @@ public class UpgradeContext {
* the cluster that the upgrade is for
* @param upgradeEntity
* the upgrade entity
- * @param repoVersionDAO
- * the repository version DAO.
*/
@AssistedInject
public UpgradeContext(@Assisted Cluster cluster, @Assisted UpgradeEntity upgradeEntity,
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
index 2df1dae..8223db5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
@@ -83,7 +83,7 @@ public class AlertUri {
/**
* If present, then the component supports HA mode and the properties
* contained within need to be checked to see if an HA URI is required to be
- * constructed instead of using {@link #m_httpProperty} and
+ * constructed instead of using {@link #m_httpUri}, {@link #m_httpsUri} and
* {@link #m_httpsProperty}.
*/
@SerializedName("high_availability")
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
index 802c876..471e30f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/upgrade/RepositoryVersionHelper.java
@@ -244,10 +244,8 @@ public class RepositoryVersionHelper {
* @param amc the management controller. Tests don't use the same instance that gets injected.
* @param repoVersion the repository version
* @param osFamily the os family
- * @param services the set of services to check for packages
- * @param repos the list of individual repositories
+ * @param servicesOnHost the set of services to check for packages
* @return a Map<String, String> to use in
- * @throws SystemException
*/
public Map<String, String> buildRoleParams(AmbariManagementController amc, RepositoryVersionEntity repoVersion, String osFamily, Set<String> servicesOnHost)
throws SystemException {
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackUpgradeConfigurationMergeTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackUpgradeConfigurationMergeTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackUpgradeConfigurationMergeTest.java
index 97b94c3..a37e4f5 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackUpgradeConfigurationMergeTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackUpgradeConfigurationMergeTest.java
@@ -69,7 +69,6 @@ import org.apache.ambari.server.state.UpgradeHelper;
import org.apache.ambari.server.state.configgroup.ConfigGroupFactory;
import org.apache.ambari.server.state.scheduler.RequestExecutionFactory;
import org.apache.ambari.server.state.stack.OsFamily;
-import org.apache.ambari.server.state.stack.UpgradePack;
import org.apache.ambari.server.state.stack.upgrade.Direction;
import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
import org.easymock.Capture;
@@ -91,7 +90,7 @@ import com.google.inject.assistedinject.FactoryModuleBuilder;
/**
* Tests that
- * {@link UpgradeResourceProvider#applyStackAndProcessConfigurations(String, Cluster, String, Direction, UpgradePack, String)}
+ * {@link UpgradeHelper#updateDesiredRepositoriesAndConfigs}
* works correctly.
*/
public class StackUpgradeConfigurationMergeTest extends EasyMockSupport {
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
index 8f59c07..014ab42 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
@@ -1658,7 +1658,7 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
}
/**
- * Tests that commands created for {@link StageWrapper.Type#RU_TASKS} set the
+ * Tests that commands created for {@link org.apache.ambari.server.state.stack.upgrade.StageWrapper.Type#RU_TASKS} set the
* service and component on the {@link ExecutionCommand}.
* <p/>
* Without this, commands of this type would not be able to determine which
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java
index eff6a9a..550cc9f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java
@@ -618,8 +618,6 @@ public class OrmTestHelper {
* Convenient method to create or to get repository version for given cluster. The repository
* version string is based on the cluster's stack version.
*
- * @param stackId stack object
- * @param version stack version
* @return repository version
*/
public RepositoryVersionEntity getOrCreateRepositoryVersion(Cluster cluster) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ConfigureActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ConfigureActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ConfigureActionTest.java
index 478b126..8ebff2c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ConfigureActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ConfigureActionTest.java
@@ -1793,11 +1793,6 @@ public class ConfigureActionTest {
/**
* Creates an upgrade and associates it with the cluster.
- *
- * @param cluster
- * @param sourceRepo
- * @param targetRepo
- * @throws Exception
*/
private UpgradeEntity createUpgrade(Cluster cluster, RepositoryVersionEntity repositoryVersion)
throws Exception {
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
index b6fa6d2..115b25f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
@@ -565,11 +565,6 @@ public class UpgradeActionTest {
/**
* Creates an upgrade and associates it with the cluster.
- *
- * @param cluster
- * @param sourceRepo
- * @param targetRepo
- * @throws Exception
*/
private UpgradeEntity createUpgrade(Cluster cluster, RepositoryVersionEntity repositoryVersion)
throws Exception {
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
index 336db36..6423164 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
@@ -1519,7 +1519,7 @@ public class ClusterTest {
* Tests that hosts can be correctly transitioned into the "INSTALLING" state.
* This method also tests that hosts in MM will not be transitioned, as per
* the contract of
- * {@link Cluster#transitionHostsToInstalling(ClusterVersionEntity, RepositoryVersionEntity, org.apache.ambari.server.state.repository.VersionDefinitionXml, boolean)}.
+ * {@link Cluster#transitionHostsToInstalling(RepositoryVersionEntity, org.apache.ambari.server.state.repository.VersionDefinitionXml, boolean)}.
*
* @throws Exception
*/
@@ -2072,7 +2072,7 @@ public class ClusterTest {
}
/**
- * Tests that {@link Cluster#applyLatestConfigurations(StackId)} sets the
+ * Tests that {@link Cluster#applyLatestConfigurations(StackId, String)} sets the
* right configs to enabled when setting them to a prior stack which has
* several configs.
*
http://git-wip-us.apache.org/repos/asf/ambari/blob/2ff48a00/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalogHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalogHelper.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalogHelper.java
index 1a9eed4..58d4c3e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalogHelper.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalogHelper.java
@@ -168,13 +168,6 @@ public class UpgradeCatalogHelper {
/**
* Adds a host component for a given service and host.
- *
- * @param injector
- * @param clusterEntity
- * @param clusterServiceEntity
- * @param hostEntity
- * @param componentName
- * @param repositoryversion
*/
@Transactional
protected void addComponent(Injector injector, ClusterEntity clusterEntity,
[19/50] [abbrv] ambari git commit: AMBARI-21151. Hiveserver2
authentication mode NOSASL not available in drop down list but appearing in
tooltip description (smohanty)
Posted by rl...@apache.org.
AMBARI-21151. Hiveserver2 authentication mode NOSASL not available in drop down list but appearing in tooltip description (smohanty)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b916e372
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b916e372
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b916e372
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: b916e372227f0859edcc51340f902886aaad0fd0
Parents: 601a7cd
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Mon Jun 5 14:51:05 2017 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Mon Jun 5 14:56:35 2017 -0700
----------------------------------------------------------------------
.../common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml | 2 +-
.../stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b916e372/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml
index e48d069..ab5c279 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/configuration/hive-site.xml
@@ -221,7 +221,7 @@ limitations under the License.
</property>
<property>
<name>hive.server2.authentication</name>
- <description>Authentication mode, default NONE. Options are NONE, NOSASL, KERBEROS, LDAP, PAM and CUSTOM</description>
+ <description>Authentication mode, default NONE. Options are NONE, KERBEROS, LDAP, PAM and CUSTOM</description>
<value>NONE</value>
<on-ambari-upgrade add="true"/>
</property>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b916e372/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
index 39ba8874..2073832 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
@@ -1173,7 +1173,7 @@ limitations under the License.
</property>
<property>
<name>hive.server2.authentication</name>
- <description>Authentication mode, default NONE. Options are NONE, NOSASL, KERBEROS, LDAP, PAM and CUSTOM</description>
+ <description>Authentication mode, default NONE. Options are NONE, KERBEROS, LDAP, PAM and CUSTOM</description>
<value>NONE</value>
<display-name>HiveServer2 Authentication</display-name>
<value-attributes>
[05/50] [abbrv] ambari git commit: AMBARI-21132 - Export cluster_name
in the cluster template file (Amruta Borkar via sangeetar)
Posted by rl...@apache.org.
AMBARI-21132 - Export cluster_name in the cluster template file (Amruta Borkar via sangeetar)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dfb5d392
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dfb5d392
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dfb5d392
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: dfb5d392067a581df27b59c0f5077729f483e1db
Parents: 7a0eda7
Author: Sangeeta Ravindran <sa...@apache.org>
Authored: Thu Jun 1 11:17:31 2017 -0700
Committer: Sangeeta Ravindran <sa...@apache.org>
Committed: Thu Jun 1 11:17:31 2017 -0700
----------------------------------------------------------------------
ambari-web/app/controllers/wizard/step8_controller.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/dfb5d392/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 6f65953..fa44a24 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -2028,7 +2028,8 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
"config_recommendation_strategy" : "NEVER_APPLY",
"provision_action" : "INSTALL_AND_START",
"configurations": [],
- "host_groups": cluster_template_host_groups.filter(function (item) { return item.hosts.length > 0; })
+ "host_groups": cluster_template_host_groups.filter(function (item) { return item.hosts.length > 0; }),
+ "Clusters": {'cluster_name': App.clusterStatus.clusterName}
};
fileUtils.downloadTextFile(JSON.stringify(cluster_template), 'json', 'clustertemplate.json')
},
[15/50] [abbrv] ambari git commit: AMBARI-21096. Provide additional
logging for config audit log (alejandro)
Posted by rl...@apache.org.
AMBARI-21096. Provide additional logging for config audit log (alejandro)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/57f4461b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/57f4461b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/57f4461b
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 57f4461bd002d998796168a00e51113927262ab8
Parents: b7101f7
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Fri Jun 2 14:53:54 2017 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Fri Jun 2 14:53:54 2017 -0700
----------------------------------------------------------------------
.../AmbariManagementControllerImpl.java | 126 ++++++++++++++++++-
.../internal/ConfigGroupResourceProvider.java | 41 ++++--
.../internal/HostResourceProvider.java | 2 +-
.../server/state/cluster/ClusterImpl.java | 13 +-
4 files changed, 155 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/57f4461b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 881ef1a..186a19e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -57,6 +57,7 @@ import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
@@ -223,6 +224,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
private final static Logger LOG =
LoggerFactory.getLogger(AmbariManagementControllerImpl.class);
+ private final static Logger configChangeLog = LoggerFactory.getLogger("configchange");
/**
* Property name of request context.
@@ -1520,6 +1522,100 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
return response;
}
+ /**
+ * Get a dictionary of all config differences between existingConfig and newConfigValues where the key is the config name and the action is one of "changed", "added", or "deleted".
+ * @param existingConfig
+ * @param newConfigValues
+ * @return Delta of configs
+ */
+ private Map<String, String> getConfigKeyDeltaToAction(Config existingConfig, Map<String, String> newConfigValues) {
+ Map<String, String> configsChanged = new HashMap<>();
+
+ if (null != existingConfig) {
+ Map<String, String> existingConfigValues = existingConfig.getProperties();
+
+ Iterator it = existingConfigValues.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<String, String> pair = (Map.Entry) it.next();
+ // Check the value if both keys exist
+ if (newConfigValues.containsKey(pair.getKey())) {
+ if (!newConfigValues.get((String) pair.getKey()).equals(pair.getValue())) {
+ configsChanged.put(pair.getKey(), "changed");
+ }
+ } else {
+ // Deleted
+ configsChanged.put(pair.getKey(), "deleted");
+ }
+ }
+
+ it = newConfigValues.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<String, String> pair = (Map.Entry) it.next();
+ if (!existingConfigValues.keySet().contains(pair.getKey())) {
+ configsChanged.put(pair.getKey(), "added");
+ }
+ }
+ } else {
+ // All of the configs in this config type are new.
+ for (String key : newConfigValues.keySet()) {
+ configsChanged.put(key, "added");
+ }
+ }
+ return configsChanged;
+ }
+
+ /**
+ * Inverse a HashMap of the form key_i: value_j to value_j: [key_a, ..., key_z]
+ * for all keys that contain that value.
+ * This is useful for printing config deltas.
+ * @param configKeyToAction Original dictionary
+ * @return Inverse of the dictionary.
+ */
+ private Map<String, List<String>> inverseMapByValue(Map<String, String> configKeyToAction) {
+ Map<String, List<String>> mapByValue = new HashMap<>();
+
+ Iterator it = configKeyToAction.entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry<String, String> pair = (Map.Entry) it.next();
+ // Key is the config name, Value is the action (added, deleted, changed)
+ if (mapByValue.containsKey(pair.getValue())) {
+ mapByValue.get(pair.getValue()).add(pair.getKey());
+ } else {
+ List<String> configListForAction = new ArrayList<>();
+ configListForAction.add(pair.getKey());
+ mapByValue.put(pair.getValue(), configListForAction);
+ }
+ }
+ return mapByValue;
+ }
+
+ /**
+ * Get a string that represents config keys that are changed, added, or deleted.
+ * @param actionToConfigKeyList Dictionary from the action to a list of configs in that category.
+ * @return String that represents config keys that are changed, added, or deleted.
+ */
+ private String getActionToConfigListAsString(Map<String, List<String>> actionToConfigKeyList) {
+ String output = "";
+
+ String[] actions = {"added", "deleted", "changed"};
+ int i = 0;
+ for (String action : actions) {
+ i++;
+ output += action + ": [";
+ if (actionToConfigKeyList.containsKey(action)) {
+ List<String> values = actionToConfigKeyList.get(action);
+ output += StringUtils.join(values, ", ");
+
+ }
+ if (i < actions.length) {
+ output += "], ";
+ } else {
+ output += "]";
+ }
+ }
+ return output;
+ }
+
private synchronized RequestStatusResponse updateCluster(ClusterRequest request, Map<String, String> requestProperties)
throws AmbariException, AuthorizationException {
@@ -1681,15 +1777,33 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
configs.add(cluster.getConfig(configType, cr.getVersionTag()));
}
if (!configs.isEmpty()) {
+ Map<String, Config> existingConfigTypeToConfig = new HashMap();
+ for (Config config : configs) {
+ Config existingConfig = cluster.getDesiredConfigByType(config.getType());
+ existingConfigTypeToConfig.put(config.getType(), existingConfig);
+ }
+
String authName = getAuthName();
serviceConfigVersionResponse = cluster.addDesiredConfig(authName, configs, note);
if (serviceConfigVersionResponse != null) {
- Logger logger = LoggerFactory.getLogger("configchange");
+ List<String> hosts = serviceConfigVersionResponse.getHosts();
+ int numAffectedHosts = null != hosts ? hosts.size() : 0;
+ configChangeLog.info("(configchange) Changing default config. cluster: '{}', changed by: '{}', service_name: '{}', config_group: '{}', num affected hosts during creation: '{}', note: '{}'",
+ request.getClusterName(), authName, serviceConfigVersionResponse.getServiceName(),
+ serviceConfigVersionResponse.getGroupName(), numAffectedHosts, serviceConfigVersionResponse.getNote());
+
for (Config config : configs) {
- logger.info("cluster '" + request.getClusterName() + "' "
- + "changed by: '" + authName + "'; "
- + "type='" + config.getType() + "' "
- + "tag='" + config.getTag() + "'");
+ config.getVersion();
+ serviceConfigVersionResponse.getNote();
+ configChangeLog.info("(configchange) type: '{}', tag: '{}', version: '{}'", config.getType(), config.getTag(), config.getVersion());
+
+ Map<String, String> configKeyToAction = getConfigKeyDeltaToAction(existingConfigTypeToConfig.get(config.getType()), config.getProperties());
+ Map<String, List<String>> actionToListConfigKeys = inverseMapByValue(configKeyToAction);
+
+ if (!actionToListConfigKeys.isEmpty()) {
+ String configOutput = getActionToConfigListAsString(actionToListConfigKeys);
+ configChangeLog.info("(configchange) Config type '{}' was modified with the following keys, {}", config.getType(), configOutput);
+ }
}
}
}
@@ -1739,7 +1853,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
if (!isStateTransitionValid) {
LOG.warn(
- "Invalid cluster provisioning 2state {} cannot be set on the cluster {} because the current state is {}",
+ "Invalid cluster provisioning state {} cannot be set on the cluster {} because the current state is {}",
provisioningState, request.getClusterName(), oldProvisioningState);
throw new AmbariException("Invalid transition for"
http://git-wip-us.apache.org/repos/asf/ambari/blob/57f4461b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
index 1c103f0..d2b4a84 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
@@ -19,6 +19,7 @@ package org.apache.ambari.server.controller.internal;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
@@ -452,11 +453,6 @@ public class ConfigGroupResourceProvider extends
"Attempted to delete a config group from a cluster which doesn't " +
"exist", e);
}
-
- configLogger.info("User {} is deleting configuration group {} for tag {} in cluster {}",
- getManagementController().getAuthName(), request.getGroupName(), request.getTag(),
- cluster.getClusterName());
-
ConfigGroup configGroup = cluster.getConfigGroups().get(request.getId());
if (configGroup == null) {
@@ -475,6 +471,9 @@ public class ConfigGroupResourceProvider extends
}
}
+ configLogger.info("(configchange) Deleting configuration group. cluster: '{}', changed by: '{}', config group: '{}', config group id: '{}'",
+ cluster.getClusterName(), getManagementController().getAuthName(), configGroup.getName(), request.getId());
+
cluster.deleteConfigGroup(request.getId());
}
@@ -573,9 +572,8 @@ public class ConfigGroupResourceProvider extends
}
}
- configLogger.info("User {} is creating new configuration group {} for tag {} in cluster {}",
- getManagementController().getAuthName(), request.getGroupName(), request.getTag(),
- cluster.getClusterName());
+ configLogger.info("(configchange) Creating new configuration group. cluster: '{}', changed by: '{}', config group: '{}', tag: '{}'",
+ cluster.getClusterName(), getManagementController().getAuthName(), request.getGroupName(), request.getTag());
verifyConfigs(request.getConfigs(), cluster.getClusterName());
@@ -635,12 +633,9 @@ public class ConfigGroupResourceProvider extends
+ ", groupId = " + request.getId());
}
- configLogger.info("User {} is updating configuration group {} for tag {} in cluster {}",
- getManagementController().getAuthName(), request.getGroupName(), request.getTag(),
- cluster.getClusterName());
-
String serviceName = configGroup.getServiceName();
String requestServiceName = cluster.getServiceForConfigTypes(request.getConfigs().keySet());
+
if (StringUtils.isEmpty(serviceName) && StringUtils.isEmpty(requestServiceName)) {
if (!AuthorizationHelper.isAuthorized(ResourceType.CLUSTER, cluster.getResourceId(),
RoleAuthorization.CLUSTER_MANAGE_CONFIG_GROUPS)) {
@@ -652,7 +647,8 @@ public class ConfigGroupResourceProvider extends
throw new AuthorizationException("The authenticated user is not authorized to update config groups");
}
}
- if (serviceName != null && requestServiceName !=null && !StringUtils.equals(serviceName, requestServiceName)) {
+
+ if (serviceName != null && requestServiceName != null && !StringUtils.equals(serviceName, requestServiceName)) {
throw new IllegalArgumentException("Config group " + configGroup.getId() +
" is mapped to service " + serviceName + ", " +
"but request contain configs from service " + requestServiceName);
@@ -661,6 +657,25 @@ public class ConfigGroupResourceProvider extends
serviceName = requestServiceName;
}
+ configLogger.info("(configchange) Updating configuration group host membership or config value. cluster: '{}', changed by: '{}', " +
+ "service_name: '{}', config group: '{}', tag: '{}', num hosts in config group: '{}', note: '{}'",
+ cluster.getClusterName(), getManagementController().getAuthName(),
+ serviceName, request.getGroupName(), request.getTag(), configGroup.getHosts().size(), request.getServiceConfigVersionNote());
+
+ if (!request.getConfigs().isEmpty()) {
+ List<String> affectedConfigTypeList = new ArrayList(request.getConfigs().keySet());
+ Collections.sort(affectedConfigTypeList);
+ String affectedConfigTypesString = "(" + StringUtils.join(affectedConfigTypeList, ", ") + ")";
+ configLogger.info("(configchange) Affected configs: {}", affectedConfigTypesString);
+
+ for (Config config : request.getConfigs().values()) {
+ List<String> sortedConfigKeys = new ArrayList(config.getProperties().keySet());
+ Collections.sort(sortedConfigKeys);
+ String sortedConfigKeysString = StringUtils.join(sortedConfigKeys, ", ");
+ configLogger.info("(configchange) Config type '{}' was modified with the following keys, {}", config.getType(), sortedConfigKeysString);
+ }
+ }
+
// Update hosts
Map<Long, Host> hosts = new HashMap<>();
if (request.getHosts() != null && !request.getHosts().isEmpty()) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/57f4461b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
index 65ebb11..a3216eb 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java
@@ -766,7 +766,7 @@ public class HostResourceProvider extends AbstractControllerResourceProvider {
if (host.addDesiredConfig(clusterId, cr.isSelected(), authName, baseConfig)) {
Logger logger = LoggerFactory.getLogger("configchange");
- logger.info("cluster '" + cluster.getClusterName() + "', "
+ logger.info("(configchange) cluster '" + cluster.getClusterName() + "', "
+ "host '" + host.getHostName() + "' "
+ "changed by: '" + authName + "'; "
+ "type='" + baseConfig.getType() + "' "
http://git-wip-us.apache.org/repos/asf/ambari/blob/57f4461b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 81b4647..8f33f1a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -1554,13 +1554,12 @@ public class ClusterImpl implements Cluster {
clusterGlobalLock.writeLock().unlock();
}
- configChangeLog.info("Cluster '{}' changed by: '{}'; service_name='{}' config_group='{}' config_group_id='{}' " +
- "version='{}'", getClusterName(), user, serviceName,
- configGroup == null ? ServiceConfigVersionResponse.DEFAULT_CONFIG_GROUP_NAME : configGroup.getName(),
- configGroup == null ? "-1" : configGroup.getId(),
- serviceConfigEntity.getVersion());
-
- String configGroupName = configGroup != null ? configGroup.getName() : ServiceConfigVersionResponse.DEFAULT_CONFIG_GROUP_NAME;
+ String configGroupName = configGroup == null ? ServiceConfigVersionResponse.DEFAULT_CONFIG_GROUP_NAME : configGroup.getName();
+ configChangeLog.info("(configchange) Creating config version. cluster: '{}', changed by: '{}', " +
+ "service_name: '{}', config_group: '{}', config_group_id: '{}', version: '{}', create_timestamp: '{}', note: '{}'",
+ getClusterName(), user, serviceName, configGroupName,
+ configGroup == null ? "null" : configGroup.getId(), serviceConfigEntity.getVersion(), serviceConfigEntity.getCreateTimestamp(),
+ serviceConfigEntity.getNote());
ServiceConfigVersionResponse response = new ServiceConfigVersionResponse(
serviceConfigEntity, configGroupName);
[13/50] [abbrv] ambari git commit: AMBARI-20938. LDAPS connections to
an Active Directory when enabling Kerberos should validate the server's SSL
certificate (rlevas)
Posted by rl...@apache.org.
AMBARI-20938. LDAPS connections to an Active Directory when enabling Kerberos should validate the server's SSL certificate (rlevas)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c3c06ea9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c3c06ea9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c3c06ea9
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: c3c06ea9889e0a462d67e8a765b41d0a4aead9b2
Parents: 9acb7a6
Author: Robert Levas <rl...@hortonworks.com>
Authored: Fri Jun 2 15:43:43 2017 -0400
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Fri Jun 2 15:43:43 2017 -0400
----------------------------------------------------------------------
ambari-server/conf/unix/ambari.properties | 4 +
ambari-server/docs/configuration/index.md | 5 +-
.../server/configuration/Configuration.java | 20 +++-
.../server/controller/KerberosHelperImpl.java | 6 +
.../security/InternalSSLSocketFactory.java | 112 +++++++++++++++++++
.../InternalSSLSocketFactoryNonTrusting.java | 49 ++++++++
.../InternalSSLSocketFactoryTrusting.java | 48 ++++++++
.../kerberos/ADKerberosOperationHandler.java | 34 ++++--
.../KerberosKDCSSLConnectionException.java | 45 ++++++++
.../kerberos/TrustingSSLSocketFactory.java | 101 -----------------
.../ADKerberosOperationHandlerTest.java | 96 +++++++++++++++-
11 files changed, 403 insertions(+), 117 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/c3c06ea9/ambari-server/conf/unix/ambari.properties
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/ambari.properties b/ambari-server/conf/unix/ambari.properties
index b8b645d..212591f 100644
--- a/ambari-server/conf/unix/ambari.properties
+++ b/ambari-server/conf/unix/ambari.properties
@@ -80,6 +80,10 @@ server.execution.scheduler.misfire.toleration.minutes=480
# Kerberos settings
kerberos.keytab.cache.dir = $ROOT/var/lib/ambari-server/data/cache
+# Validate trust when communicating with the KDC (via SSL) when performing Kerberos-related
+# operations, if applicable
+kerberos.operation.verify.kdc.trust = true
+
# Default timeout in seconds before task is killed
agent.task.timeout=900
# Default timeout in seconds before package installation task is killed
http://git-wip-us.apache.org/repos/asf/ambari/blob/c3c06ea9/ambari-server/docs/configuration/index.md
----------------------------------------------------------------------
diff --git a/ambari-server/docs/configuration/index.md b/ambari-server/docs/configuration/index.md
index ff9ce54..2394264 100644
--- a/ambari-server/docs/configuration/index.md
+++ b/ambari-server/docs/configuration/index.md
@@ -148,8 +148,9 @@ The following are the properties which can be used to configure Ambari.
| kdcserver.connection.check.timeout | The timeout, in milliseconds, to wait when communicating with a Kerberos Key Distribution Center. |`10000` |
| kerberos.check.jaas.configuration | Determines whether Kerberos-enabled Ambari deployments should use JAAS to validate login credentials. |`false` |
| kerberos.keytab.cache.dir | The location on the Ambari Server where Kerberos keytabs are cached. |`/var/lib/ambari-server/data/cache` |
-| kerberos.operation.retries | The number of times failed kerberos operations should be retried to execute. |`3` |
-| kerberos.operation.retry.timeout | The time to wait (in seconds) between failed kerberos operations retries. |`10` |
+| kerberos.operation.retries | The number of times failed Kerberos operations should be retried to execute. |`3` |
+| kerberos.operation.retry.timeout | The time to wait (in seconds) between failed Kerberos operations retries. |`10` |
+| kerberos.operation.verify.kdc.trust | Validate the trust of the SSL certificate provided by the KDC when performing Kerberos operations over SSL. |`true` |
| ldap.sync.username.collision.behavior | Determines how to handle username collision while updating from LDAP.<br/><br/>The following are examples of valid values:<ul><li>`skip`<li>`convert`</ul> |`convert` |
| log4j.monitor.delay | Indicates the delay, in milliseconds, for the log4j monitor to check for changes |`300000` |
| logsearch.metadata.cache.expire.timeout | The time, in hours, that the Ambari Server will hold Log File metadata in its internal cache before making a request to the LogSearch Portal to get the latest metadata. |`24` |
http://git-wip-us.apache.org/repos/asf/ambari/blob/c3c06ea9/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index d3b8cc5..965b57b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -1451,13 +1451,25 @@ public class Configuration {
* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
- @Markdown(description = "The number of times failed kerberos operations should be retried to execute.")
+ @Markdown(description = "The number of times failed Kerberos operations should be retried to execute.")
public static final ConfigurationProperty<Integer> KERBEROS_OPERATION_RETRIES = new ConfigurationProperty<>(
"kerberos.operation.retries", 3);
- @Markdown(description = "The time to wait (in seconds) between failed kerberos operations retries.")
+ @Markdown(description = "The time to wait (in seconds) between failed Kerberos operations retries.")
public static final ConfigurationProperty<Integer> KERBEROS_OPERATION_RETRY_TIMEOUT = new ConfigurationProperty<>(
"kerberos.operation.retry.timeout", 10);
+
+ /**
+ * A flag indicating whether to validate the trust of an SSL certificate provided by a KDC when
+ * performing Kerberos operations.
+ *
+ * For example, when communicating with an Active Directory using
+ * LDAPS. The default behavior is to validate the trust.
+ */
+ @Markdown(description = "Validate the trust of the SSL certificate provided by the KDC when performing Kerberos operations over SSL.")
+ public static final ConfigurationProperty<Boolean> KERBEROS_OPERATION_VERIFY_KDC_TRUST = new ConfigurationProperty<>(
+ "kerberos.operation.verify.kdc.trust", Boolean.TRUE);
+
/**
* The type of connection pool to use with JDBC connections to the database.
*/
@@ -6080,6 +6092,10 @@ public class Configuration {
return Integer.valueOf(getProperty(KERBEROS_OPERATION_RETRY_TIMEOUT));
}
+ public boolean validateKerberosOperationSSLCertTrust() {
+ return Boolean.parseBoolean(getProperty(KERBEROS_OPERATION_VERIFY_KDC_TRUST));
+ }
+
/**
* Return configured acceptors for agent api connector. Default = null
*/
http://git-wip-us.apache.org/repos/asf/ambari/blob/c3c06ea9/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
index 10df7a2..7b6ac7e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
@@ -75,6 +75,7 @@ import org.apache.ambari.server.serveraction.kerberos.KerberosIdentityDataFileWr
import org.apache.ambari.server.serveraction.kerberos.KerberosIdentityDataFileWriterFactory;
import org.apache.ambari.server.serveraction.kerberos.KerberosInvalidConfigurationException;
import org.apache.ambari.server.serveraction.kerberos.KerberosKDCConnectionException;
+import org.apache.ambari.server.serveraction.kerberos.KerberosKDCSSLConnectionException;
import org.apache.ambari.server.serveraction.kerberos.KerberosLDAPContainerException;
import org.apache.ambari.server.serveraction.kerberos.KerberosMissingAdminCredentialsException;
import org.apache.ambari.server.serveraction.kerberos.KerberosOperationException;
@@ -1579,6 +1580,11 @@ public class KerberosHelperImpl implements KerberosHelper {
"Failed to connect to KDC - " + e.getMessage() + "\n" +
"Update the KDC settings in krb5-conf and kerberos-env configurations to correct this issue.",
e);
+ } catch (KerberosKDCSSLConnectionException e) {
+ throw new KerberosInvalidConfigurationException(
+ "Failed to connect to KDC - " + e.getMessage() + "\n" +
+ "Make sure the server's SSL certificate or CA certificates have been imported into Ambari's truststore.",
+ e);
} catch (KerberosRealmException e) {
throw new KerberosInvalidConfigurationException(
"Failed to find a KDC for the specified realm - " + e.getMessage() + "\n" +
http://git-wip-us.apache.org/repos/asf/ambari/blob/c3c06ea9/ambari-server/src/main/java/org/apache/ambari/server/security/InternalSSLSocketFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/InternalSSLSocketFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/security/InternalSSLSocketFactory.java
new file mode 100644
index 0000000..9ecf5d1
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/InternalSSLSocketFactory.java
@@ -0,0 +1,112 @@
+/*
+ * 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.security;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.security.SecureRandom;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+/**
+ * InternalSSLSocketFactory is an abstract class implementing a SSLSocketFactory.
+ * <p>
+ * Implementers of this class need to specific the SSLContext protocol and whether the server's SSL
+ * certificates should be trusted or validated.
+ */
+public class InternalSSLSocketFactory extends SSLSocketFactory {
+ private SSLSocketFactory socketFactory;
+
+ InternalSSLSocketFactory(String protocol, boolean trusting) {
+ try {
+ SSLContext ctx = SSLContext.getInstance(protocol);
+
+ // If trusting, install our own TrustManager to accept certificates without validating the
+ // trust chain; else, use the default TrustManager, which validates the certificate's trust chain.
+ TrustManager[] trustManagers = (trusting)
+ ? new TrustManager[]{new LenientTrustManager()}
+ : null;
+
+ ctx.init(null, trustManagers, new SecureRandom());
+ socketFactory = ctx.getSocketFactory();
+ } catch (Exception ex) {
+ ex.printStackTrace(System.err); /* handle exception */
+ }
+ }
+
+ @Override
+ public String[] getDefaultCipherSuites() {
+ return socketFactory.getDefaultCipherSuites();
+ }
+
+ @Override
+ public String[] getSupportedCipherSuites() {
+ return socketFactory.getSupportedCipherSuites();
+ }
+
+ @Override
+ public Socket createSocket(Socket socket, String string, int i, boolean bln) throws IOException {
+ return socketFactory.createSocket(socket, string, i, bln);
+ }
+
+ @Override
+ public Socket createSocket(String string, int i) throws IOException {
+ return socketFactory.createSocket(string, i);
+ }
+
+ @Override
+ public Socket createSocket(String string, int i, InetAddress ia, int i1) throws IOException {
+ return socketFactory.createSocket(string, i, ia, i1);
+ }
+
+ @Override
+ public Socket createSocket(InetAddress ia, int i) throws IOException {
+ return socketFactory.createSocket(ia, i);
+ }
+
+ @Override
+ public Socket createSocket(InetAddress ia, int i, InetAddress ia1, int i1) throws IOException {
+ return socketFactory.createSocket(ia, i, ia1, i1);
+ }
+
+
+ /**
+ * LenientTrustManager is a TrustManager that accepts all certificates without validating the
+ * chain of trust.
+ */
+ public static class LenientTrustManager implements X509TrustManager {
+ public void checkClientTrusted(X509Certificate[] xcs, String string) throws CertificateException {
+ // do nothing
+ }
+
+ public void checkServerTrusted(X509Certificate[] xcs, String string) throws CertificateException {
+ // do nothing
+ }
+
+ public X509Certificate[] getAcceptedIssuers() {
+ return new X509Certificate[0];
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/c3c06ea9/ambari-server/src/main/java/org/apache/ambari/server/security/InternalSSLSocketFactoryNonTrusting.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/InternalSSLSocketFactoryNonTrusting.java b/ambari-server/src/main/java/org/apache/ambari/server/security/InternalSSLSocketFactoryNonTrusting.java
new file mode 100644
index 0000000..84eada8
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/InternalSSLSocketFactoryNonTrusting.java
@@ -0,0 +1,49 @@
+/*
+ * 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.security;
+
+import javax.net.SocketFactory;
+import javax.net.ssl.SSLSocketFactory;
+
+/**
+ * InternalSSLSocketFactoryNonTrusting is a non-trusting {@link SSLSocketFactory} implementation
+ * using the TLSv1.2 protocol.
+ * <p>
+ * This SSL socket factory should allow for at least the following SSL protocols:
+ * <ul>
+ * <li>TLSv1.2</li>
+ * <li>TLSv1.1</li>
+ * <li>TLSv1</li>
+ * </ul>
+ * <p>
+ * However, the actual set of enabled SSL protocols is dependent on the underlying JVM.
+ * <p>
+ * This SSL socket factory creates non-trusting connections, meaning that the server's SSL certificate
+ * will be validated using the JVM-specific internal {@link javax.net.ssl.TrustManager}
+ */
+public class InternalSSLSocketFactoryNonTrusting extends InternalSSLSocketFactory {
+
+ public InternalSSLSocketFactoryNonTrusting() {
+ super("TLSv1.2", false);
+ }
+
+ public static SocketFactory getDefault() {
+ return new InternalSSLSocketFactoryNonTrusting();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/c3c06ea9/ambari-server/src/main/java/org/apache/ambari/server/security/InternalSSLSocketFactoryTrusting.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/InternalSSLSocketFactoryTrusting.java b/ambari-server/src/main/java/org/apache/ambari/server/security/InternalSSLSocketFactoryTrusting.java
new file mode 100644
index 0000000..4bb3604
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/InternalSSLSocketFactoryTrusting.java
@@ -0,0 +1,48 @@
+/*
+ * 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.security;
+
+import javax.net.SocketFactory;
+import javax.net.ssl.SSLSocketFactory;
+
+/**
+ * InternalSSLSocketFactoryTrusting is a trusting {@link SSLSocketFactory} implementation
+ * using the TLSv1.2 protocol.
+ * <p>
+ * This SSL socket factory should allow for at least the following SSL protocols:
+ * <ul>
+ * <li>TLSv1.2</li>
+ * <li>TLSv1.1</li>
+ * <li>TLSv1</li>
+ * </ul>
+ * <p>
+ * However, the actual set of enabled SSL protocols is dependent on the underlying JVM.
+ * <p>
+ * This SSL socket factory creates trusting connections, meaning that the server's SSL certificate
+ * will not be tested to see if it is trusted.
+ */
+public class InternalSSLSocketFactoryTrusting extends InternalSSLSocketFactory {
+ public InternalSSLSocketFactoryTrusting() {
+ super("TLSv1.2", true);
+ }
+
+ public static SocketFactory getDefault() {
+ return new InternalSSLSocketFactoryTrusting();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/c3c06ea9/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java
index b2dbd5e..8903fa1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandler.java
@@ -46,7 +46,11 @@ import javax.naming.ldap.InitialLdapContext;
import javax.naming.ldap.LdapContext;
import javax.naming.ldap.LdapName;
import javax.naming.ldap.Rdn;
+import javax.net.ssl.SSLHandshakeException;
+import org.apache.ambari.server.configuration.Configuration;
+import org.apache.ambari.server.security.InternalSSLSocketFactoryNonTrusting;
+import org.apache.ambari.server.security.InternalSSLSocketFactoryTrusting;
import org.apache.ambari.server.security.credential.PrincipalKeyCredential;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang.StringUtils;
@@ -60,6 +64,7 @@ import org.apache.velocity.exception.ResourceNotFoundException;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
+import com.google.inject.Inject;
/**
* Implementation of <code>KerberosOperationHandler</code> to created principal in Active Directory
@@ -107,7 +112,11 @@ public class ADKerberosOperationHandler extends KerberosOperationHandler {
* The Gson instance to use to convert the template-generated JSON structure to a Map of attribute
* names to values.
*/
- private Gson gson = new Gson();
+ @Inject
+ private Gson gson;
+
+ @Inject
+ private Configuration configuration;
/**
* Prepares and creates resources to be used by this KerberosOperationHandler
@@ -175,8 +184,6 @@ public class ADKerberosOperationHandler extends KerberosOperationHandler {
this.createTemplate = kerberosConfiguration.get(KERBEROS_ENV_AD_CREATE_ATTRIBUTES_TEMPLATE);
- this.gson = new Gson();
-
setOpen(true);
}
@@ -189,8 +196,6 @@ public class ADKerberosOperationHandler extends KerberosOperationHandler {
public void close() throws KerberosOperationException {
this.searchControls = null;
- this.gson = null;
-
if (this.ldapContext != null) {
try {
this.ldapContext.close();
@@ -447,14 +452,29 @@ public class ADKerberosOperationHandler extends KerberosOperationHandler {
properties.put(Context.SECURITY_CREDENTIALS, String.valueOf(administratorCredential.getKey()));
properties.put(Context.SECURITY_AUTHENTICATION, "simple");
properties.put(Context.REFERRAL, "follow");
- properties.put("java.naming.ldap.factory.socket", TrustingSSLSocketFactory.class.getName());
+
+ if (ldapUrl.startsWith("ldaps")) {
+ if (configuration.validateKerberosOperationSSLCertTrust()) {
+ properties.put("java.naming.ldap.factory.socket", InternalSSLSocketFactoryNonTrusting.class.getName());
+ } else {
+ properties.put("java.naming.ldap.factory.socket", InternalSSLSocketFactoryTrusting.class.getName());
+ }
+ }
try {
return createInitialLdapContext(properties, null);
} catch (CommunicationException e) {
+ Throwable rootCause = e.getRootCause();
+
String message = String.format("Failed to communicate with the Active Directory at %s: %s", ldapUrl, e.getMessage());
LOG.warn(message, e);
- throw new KerberosKDCConnectionException(message, e);
+
+ if(rootCause instanceof SSLHandshakeException) {
+ throw new KerberosKDCSSLConnectionException(message, e);
+ }
+ else {
+ throw new KerberosKDCConnectionException(message, e);
+ }
} catch (AuthenticationException e) {
String message = String.format("Failed to authenticate with the Active Directory at %s: %s", ldapUrl, e.getMessage());
LOG.warn(message, e);
http://git-wip-us.apache.org/repos/asf/ambari/blob/c3c06ea9/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosKDCSSLConnectionException.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosKDCSSLConnectionException.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosKDCSSLConnectionException.java
new file mode 100644
index 0000000..1e588c5
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosKDCSSLConnectionException.java
@@ -0,0 +1,45 @@
+/*
+ * 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.serveraction.kerberos;
+
+/**
+ * KerberosKDCSSLConnectionException is a KerberosOperationException thrown in the event a connection
+ * to the KDC was not able to be made due to an SSL issue.
+ */
+public class KerberosKDCSSLConnectionException extends KerberosOperationException {
+
+ /**
+ * Creates a new KerberosKDCSSLConnectionException with a message
+ *
+ * @param message a String containing the message indicating the reason for this exception
+ */
+ public KerberosKDCSSLConnectionException(String message) {
+ super(message);
+ }
+
+ /**
+ * Creates a new KerberosKDCSSLConnectionException with a message and a cause
+ *
+ * @param message a String containing the message indicating the reason for this exception
+ * @param cause a Throwable declaring the previously thrown Throwable that led to this exception
+ */
+ public KerberosKDCSSLConnectionException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/c3c06ea9/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/TrustingSSLSocketFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/TrustingSSLSocketFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/TrustingSSLSocketFactory.java
deleted file mode 100644
index 52b3703..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/TrustingSSLSocketFactory.java
+++ /dev/null
@@ -1,101 +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.
- */
-
-package org.apache.ambari.server.serveraction.kerberos;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import java.security.SecureRandom;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import javax.net.SocketFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-public class TrustingSSLSocketFactory extends SSLSocketFactory {
- private SSLSocketFactory socketFactory;
-
- public TrustingSSLSocketFactory() {
- try {
- SSLContext ctx = SSLContext.getInstance("TLS");
- ctx.init(null, new TrustManager[]{new LenientTrustManager()}, new SecureRandom());
- socketFactory = ctx.getSocketFactory();
- } catch (Exception ex) {
- ex.printStackTrace(System.err); /* handle exception */
- }
- }
-
- public static SocketFactory getDefault() {
- return new TrustingSSLSocketFactory();
- }
-
- @Override
- public String[] getDefaultCipherSuites() {
- return socketFactory.getDefaultCipherSuites();
- }
-
- @Override
- public String[] getSupportedCipherSuites() {
- return socketFactory.getSupportedCipherSuites();
- }
-
- @Override
- public Socket createSocket(Socket socket, String string, int i, boolean bln) throws IOException {
- return socketFactory.createSocket(socket, string, i, bln);
- }
-
- @Override
- public Socket createSocket(String string, int i) throws IOException, UnknownHostException {
- return socketFactory.createSocket(string, i);
- }
-
- @Override
- public Socket createSocket(String string, int i, InetAddress ia, int i1) throws IOException, UnknownHostException {
- return socketFactory.createSocket(string, i, ia, i1);
- }
-
- @Override
- public Socket createSocket(InetAddress ia, int i) throws IOException {
- return socketFactory.createSocket(ia, i);
- }
-
- @Override
- public Socket createSocket(InetAddress ia, int i, InetAddress ia1, int i1) throws IOException {
- return socketFactory.createSocket(ia, i, ia1, i1);
- }
-
-
- public static class LenientTrustManager implements X509TrustManager {
- public void checkClientTrusted(X509Certificate[] xcs, String string) throws CertificateException {
- // do nothing
- }
-
- public void checkServerTrusted(X509Certificate[] xcs, String string) throws CertificateException {
- // do nothing
- }
-
- public X509Certificate[] getAcceptedIssuers() {
- return new java.security.cert.X509Certificate[0];
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/c3c06ea9/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandlerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandlerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandlerTest.java
index 603f744..49f8d56 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandlerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/ADKerberosOperationHandlerTest.java
@@ -41,13 +41,22 @@ import javax.naming.directory.SearchResult;
import javax.naming.ldap.Control;
import javax.naming.ldap.LdapContext;
+import org.apache.ambari.server.configuration.Configuration;
+import org.apache.ambari.server.security.InternalSSLSocketFactoryNonTrusting;
+import org.apache.ambari.server.security.InternalSSLSocketFactoryTrusting;
import org.apache.ambari.server.security.credential.PrincipalKeyCredential;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.stack.OsFamily;
import org.easymock.Capture;
import org.easymock.CaptureType;
import org.easymock.IAnswer;
import org.junit.Ignore;
import org.junit.Test;
+import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+
import junit.framework.Assert;
public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest {
@@ -112,6 +121,8 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
@Test(expected = KerberosAdminAuthenticationException.class)
public void testTestAdministratorCredentialsIncorrectAdminPassword() throws Exception {
+ Injector injector = getInjector();
+
PrincipalKeyCredential kc = new PrincipalKeyCredential(DEFAULT_ADMIN_PRINCIPAL, "wrong");
Map<String, String> kerberosEnvMap = new HashMap<String, String>() {
{
@@ -123,6 +134,7 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
ADKerberosOperationHandler handler = createMockBuilder(ADKerberosOperationHandler.class)
.addMockedMethod(ADKerberosOperationHandler.class.getDeclaredMethod("createInitialLdapContext", Properties.class, Control[].class))
.createNiceMock();
+ injector.injectMembers(handler);
expect(handler.createInitialLdapContext(anyObject(Properties.class), anyObject(Control[].class))).andAnswer(new IAnswer<LdapContext>() {
@Override
@@ -140,6 +152,8 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
@Test(expected = KerberosAdminAuthenticationException.class)
public void testTestAdministratorCredentialsIncorrectAdminPrincipal() throws Exception {
+ Injector injector = getInjector();
+
PrincipalKeyCredential kc = new PrincipalKeyCredential("wrong", DEFAULT_ADMIN_PASSWORD);
Map<String, String> kerberosEnvMap = new HashMap<String, String>() {
{
@@ -151,6 +165,7 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
ADKerberosOperationHandler handler = createMockBuilder(ADKerberosOperationHandler.class)
.addMockedMethod(ADKerberosOperationHandler.class.getDeclaredMethod("createInitialLdapContext", Properties.class, Control[].class))
.createNiceMock();
+ injector.injectMembers(handler);
expect(handler.createInitialLdapContext(anyObject(Properties.class), anyObject(Control[].class))).andAnswer(new IAnswer<LdapContext>() {
@Override
@@ -197,6 +212,8 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
@Test
public void testTestAdministratorCredentialsSuccess() throws Exception {
+ Injector injector = getInjector();
+
PrincipalKeyCredential kc = new PrincipalKeyCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD);
Map<String, String> kerberosEnvMap = new HashMap<String, String>() {
{
@@ -209,6 +226,7 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
.addMockedMethod(ADKerberosOperationHandler.class.getDeclaredMethod("createInitialLdapContext", Properties.class, Control[].class))
.addMockedMethod(ADKerberosOperationHandler.class.getDeclaredMethod("createSearchControls"))
.createNiceMock();
+ injector.injectMembers(handler);
expect(handler.createInitialLdapContext(anyObject(Properties.class), anyObject(Control[].class)))
.andAnswer(new IAnswer<LdapContext>() {
@@ -250,6 +268,8 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
@Test
public void testProcessCreateTemplateDefault() throws Exception {
+ Injector injector = getInjector();
+
PrincipalKeyCredential kc = new PrincipalKeyCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD);
Map<String, String> kerberosEnvMap = new HashMap<String, String>() {
{
@@ -265,6 +285,7 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
.addMockedMethod(ADKerberosOperationHandler.class.getDeclaredMethod("createInitialLdapContext", Properties.class, Control[].class))
.addMockedMethod(ADKerberosOperationHandler.class.getDeclaredMethod("createSearchControls"))
.createNiceMock();
+ injector.injectMembers(handler);
@SuppressWarnings("unchecked")
NamingEnumeration<SearchResult> searchResult = createNiceMock(NamingEnumeration.class);
@@ -360,6 +381,8 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
@Test
public void testProcessCreateTemplateCustom() throws Exception {
+ Injector injector = getInjector();
+
PrincipalKeyCredential kc = new PrincipalKeyCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD);
Map<String, String> kerberosEnvMap = new HashMap<String, String>() {
{
@@ -394,6 +417,7 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
.addMockedMethod(ADKerberosOperationHandler.class.getDeclaredMethod("createInitialLdapContext", Properties.class, Control[].class))
.addMockedMethod(ADKerberosOperationHandler.class.getDeclaredMethod("createSearchControls"))
.createNiceMock();
+ injector.injectMembers(handler);
@SuppressWarnings("unchecked")
NamingEnumeration<SearchResult> searchResult = createNiceMock(NamingEnumeration.class);
@@ -464,16 +488,18 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
@Test
public void testDigests() throws Exception {
+ Injector injector = getInjector();
+
PrincipalKeyCredential kc = new PrincipalKeyCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD);
Map<String, String> kerberosEnvMap = new HashMap<>();
kerberosEnvMap.put(ADKerberosOperationHandler.KERBEROS_ENV_LDAP_URL, DEFAULT_LDAP_URL);
kerberosEnvMap.put(ADKerberosOperationHandler.KERBEROS_ENV_PRINCIPAL_CONTAINER_DN, DEFAULT_PRINCIPAL_CONTAINER_DN);
kerberosEnvMap.put(ADKerberosOperationHandler.KERBEROS_ENV_AD_CREATE_ATTRIBUTES_TEMPLATE, "" +
- "{" +
- "\"principal_digest\": \"$principal_digest\"," +
- "\"principal_digest_256\": \"$principal_digest_256\"," +
- "\"principal_digest_512\": \"$principal_digest_512\"" +
- "}"
+ "{" +
+ "\"principal_digest\": \"$principal_digest\"," +
+ "\"principal_digest_256\": \"$principal_digest_256\"," +
+ "\"principal_digest_512\": \"$principal_digest_512\"" +
+ "}"
);
Capture<Attributes> capturedAttributes = newCapture();
@@ -482,6 +508,7 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
.addMockedMethod(ADKerberosOperationHandler.class.getDeclaredMethod("createInitialLdapContext", Properties.class, Control[].class))
.addMockedMethod(ADKerberosOperationHandler.class.getDeclaredMethod("createSearchControls"))
.createNiceMock();
+ injector.injectMembers(handler);
@SuppressWarnings("unchecked")
NamingEnumeration<SearchResult> searchResult = createNiceMock(NamingEnumeration.class);
@@ -628,4 +655,63 @@ public class ADKerberosOperationHandlerTest extends KerberosOperationHandlerTest
handler.close();
}
+
+ @Test
+ public void testCreateLdapContextSSLSocketFactoryTrusting() throws Exception {
+ testCreateLdapContextSSLSocketFactory(true);
+ }
+
+ @Test
+ public void testCreateLdapContextSSLSocketFactoryNonTrusting() throws Exception {
+ testCreateLdapContextSSLSocketFactory(false);
+ }
+
+ private void testCreateLdapContextSSLSocketFactory(boolean trusting) throws Exception {
+ Injector injector = getInjector();
+
+ Configuration configuration = injector.getInstance(Configuration.class);
+ expect(configuration.validateKerberosOperationSSLCertTrust()).andReturn(!trusting).once();
+
+ LdapContext initialContext = createNiceMock(LdapContext.class);
+
+ Capture<? extends Properties> capturedProperties = newCapture(CaptureType.FIRST);
+
+ ADKerberosOperationHandler handler = createMockBuilder(ADKerberosOperationHandler.class)
+ .addMockedMethod(ADKerberosOperationHandler.class.getDeclaredMethod("createInitialLdapContext", Properties.class, Control[].class))
+ .createNiceMock();
+ injector.injectMembers(handler);
+
+ expect(handler.createInitialLdapContext(capture(capturedProperties), anyObject(Control[].class)))
+ .andReturn(initialContext)
+ .once();
+
+ replayAll();
+
+ Map<String, String> kerberosConfiguration = new HashMap<String, String>();
+ kerberosConfiguration.put(ADKerberosOperationHandler.KERBEROS_ENV_LDAP_URL, DEFAULT_LDAP_URL);
+ kerberosConfiguration.put(ADKerberosOperationHandler.KERBEROS_ENV_PRINCIPAL_CONTAINER_DN, DEFAULT_PRINCIPAL_CONTAINER_DN);
+
+ handler.open(new PrincipalKeyCredential("principal", "key"), "EXAMPLE.COM", kerberosConfiguration);
+
+ Properties properties = capturedProperties.getValue();
+ Assert.assertNotNull(properties);
+
+ String socketFactoryClassName = properties.getProperty("java.naming.ldap.factory.socket");
+ if (trusting) {
+ Assert.assertEquals(InternalSSLSocketFactoryTrusting.class.getName(), socketFactoryClassName);
+ } else {
+ Assert.assertEquals(InternalSSLSocketFactoryNonTrusting.class.getName(), socketFactoryClassName);
+ }
+ }
+
+ private Injector getInjector() {
+ return Guice.createInjector(new AbstractModule() {
+ @Override
+ protected void configure() {
+ bind(Clusters.class).toInstance(createNiceMock(Clusters.class));
+ bind(Configuration.class).toInstance(createNiceMock(Configuration.class));
+ bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
+ }
+ });
+ }
}
\ No newline at end of file
[36/50] [abbrv] ambari git commit: AMBARI-21195. Enforce Maven
version 3.3.9+
Posted by rl...@apache.org.
AMBARI-21195. Enforce Maven version 3.3.9+
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9b44b62f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9b44b62f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9b44b62f
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 9b44b62f638c56c913b3977683a19ea89e39b4ec
Parents: bdadb70
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Wed Jun 7 18:43:17 2017 +0200
Committer: Attila Doroszlai <ad...@hortonworks.com>
Committed: Thu Jun 8 11:09:29 2017 +0200
----------------------------------------------------------------------
ambari-project/pom.xml | 5 +++++
ambari-server/pom.xml | 20 ++++++++++++++++++++
2 files changed, 25 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9b44b62f/ambari-project/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml
index 98da9f4..64d1416 100644
--- a/ambari-project/pom.xml
+++ b/ambari-project/pom.xml
@@ -497,6 +497,11 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.4.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<configuration>
http://git-wip-us.apache.org/repos/asf/ambari/blob/9b44b62f/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index c0aed7b..669f90f 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -391,6 +391,26 @@
</executions>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-maven</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireMavenVersion>
+ <version>[3.3.9,)</version>
+ </requireMavenVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>com.github.kongchen</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<version>3.1.4</version>
[41/50] [abbrv] ambari git commit: AMBARI-21054. Add ppc as a new OS
for User. (aonishuk)
Posted by rl...@apache.org.
AMBARI-21054. Add ppc as a new OS for User. (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e2fbd0f0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e2fbd0f0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e2fbd0f0
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: e2fbd0f0675d68e54765d83a07a2ea825e2d3821
Parents: d21d434
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Jun 8 15:23:29 2017 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Jun 8 15:23:29 2017 +0300
----------------------------------------------------------------------
.../server/controller/AmbariManagementControllerImplTest.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/e2fbd0f0/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
index fde9260..0312579 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
@@ -101,6 +101,7 @@ import org.apache.ambari.server.state.ServiceOsSpecific;
import org.apache.ambari.server.state.StackId;
import org.apache.ambari.server.state.StackInfo;
import org.apache.ambari.server.state.State;
+import org.apache.ambari.server.state.stack.OsFamily;
import org.easymock.Capture;
import org.easymock.EasyMock;
import org.junit.Before;
@@ -133,6 +134,7 @@ public class AmbariManagementControllerImplTest {
private static final AmbariMetaInfo ambariMetaInfo = createMock(AmbariMetaInfo.class);
private static final Users users = createMock(Users.class);
private static final AmbariSessionManager sessionManager = createNiceMock(AmbariSessionManager.class);
+ private static final OsFamily osFamily = createNiceMock(OsFamily.class);
@BeforeClass
public static void setupAuthentication() {
@@ -144,7 +146,7 @@ public class AmbariManagementControllerImplTest {
@Before
public void before() throws Exception {
- reset(ldapDataPopulator, clusters, actionDBAccessor, ambariMetaInfo, users, sessionManager);
+ reset(ldapDataPopulator, clusters, actionDBAccessor, ambariMetaInfo, users, sessionManager, osFamily);
}
@Test
@@ -1988,7 +1990,7 @@ public class AmbariManagementControllerImplTest {
@Test
public void testPopulateServicePackagesInfo() throws Exception {
Capture<AmbariManagementController> controllerCapture = EasyMock.newCapture();
- Injector injector = createStrictMock(Injector.class);
+ Injector injector = Guice.createInjector(Modules.override(new InMemoryDefaultTestModule()).with(new MockModule()));
MaintenanceStateHelper maintHelper = createNiceMock(MaintenanceStateHelper.class);
ServiceInfo serviceInfo = createNiceMock(ServiceInfo.class);
@@ -2198,6 +2200,7 @@ public class AmbariManagementControllerImplTest {
binder.bind(AmbariMetaInfo.class).toInstance(ambariMetaInfo);
binder.bind(Users.class).toInstance(users);
binder.bind(AmbariSessionManager.class).toInstance(sessionManager);
+ binder.bind(OsFamily.class).toInstance(osFamily);
}
}
[32/50] [abbrv] ambari git commit: AMBARI-21177. Ambari 3.0:
Outstanding dashboard issues. (Ishan via Jaimin)
Posted by rl...@apache.org.
AMBARI-21177. Ambari 3.0: Outstanding dashboard issues. (Ishan via Jaimin)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3b575fb9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3b575fb9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3b575fb9
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 3b575fb917a559ffcbde3bb6ae114c71aa9f2b4f
Parents: acb2f98
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Wed Jun 7 10:01:31 2017 -0700
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Wed Jun 7 10:01:31 2017 -0700
----------------------------------------------------------------------
ambari-web/app/config.js | 3 +-
ambari-web/app/messages.js | 4 +-
ambari-web/app/styles/application.less | 11 ++
ambari-web/app/styles/bootstrap_overrides.less | 49 ++++++++
ambari-web/app/styles/dashboard.less | 115 ++++++++++++-------
.../templates/common/export_metrics_menu.hbs | 16 ++-
ambari-web/app/templates/main/dashboard.hbs | 2 +-
.../main/dashboard/widgets/cluster_metrics.hbs | 12 +-
.../main/dashboard/widgets/hbase_links.hbs | 15 ++-
.../main/dashboard/widgets/hdfs_links.hbs | 17 ++-
.../main/dashboard/widgets/pie_chart.hbs | 21 ++--
.../main/dashboard/widgets/simple_text.hbs | 21 ++--
.../templates/main/dashboard/widgets/uptime.hbs | 16 ++-
.../main/dashboard/widgets/yarn_links.hbs | 18 +--
ambari-web/app/views/common/chart/pie.js | 10 +-
.../dashboard/widgets/cluster_metrics_widget.js | 3 -
.../main/dashboard/widgets/pie_chart_widget.js | 23 ++--
17 files changed, 241 insertions(+), 115 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index de4b52a..e7190be 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -55,7 +55,8 @@ App.isManagedMySQLForHiveEnabled = false;
App.isStormMetricsSupported = true;
App.healthStatusRed = '#EF6162';
App.healthStatusGreen = '#1EB475';
-App.healthStatusOrange = '#E98A41';
+App.healthStatusOrange = '#E98A40';
+App.widgetContentColor = '#666666';
App.inactivityRemainTime = 60; // in seconds
App.enableLogger = true;
App.stackVersionsAvailable = true;
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 02a54f7..6f317a3 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -313,8 +313,8 @@ Em.I18n.translations = {
'common.testing': 'Testing',
'common.noData': 'No Data',
'common.export': 'Export',
- 'common.csv': 'CSV',
- 'common.json': 'JSON',
+ 'common.csv': 'Save as CSV',
+ 'common.json': 'Save as JSON',
'common.timestamp': 'Timestamp',
'common.timezone': 'Timezone',
'common.loading.eclipses': 'Loading...',
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 71a9183..8ae11b5 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -2691,3 +2691,14 @@ a.abort-icon:hover {
}
}
+.ellipsis-menu:after {
+ content: '\2807';
+ color: #999999;
+ font-size: 22px;
+}
+
+.button-border {
+ padding: 0px;
+ border: none;
+ background: none;
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/styles/bootstrap_overrides.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/bootstrap_overrides.less b/ambari-web/app/styles/bootstrap_overrides.less
index aabf6f2..0960a52 100644
--- a/ambari-web/app/styles/bootstrap_overrides.less
+++ b/ambari-web/app/styles/bootstrap_overrides.less
@@ -374,6 +374,55 @@ select.form-control {
}
}
+
+@media (min-width: 1500px) {
+
+ .row {
+ *zoom: 1;
+ }
+
+ .row:before,
+ .row:after {
+ line-height: 0;
+ }
+
+ .row:after {
+ clear: both;
+ }
+
+ .navbar-fixed-top .container,
+ .navbar-fixed-bottom .container {
+ width: 1300px;
+ }
+
+ .main-container {
+ width: 1340px;
+ }
+
+ .contribview .main-container {
+ width: auto;
+ }
+
+ .contribview .navbar .main-container {
+ width: 1340px;
+ margin: 0 auto;
+ }
+
+ .thumbnails {
+ margin-left: -30px;
+ }
+
+ .thumbnails > li {
+ margin-left: 30px;
+ }
+
+ .row .thumbnails {
+ margin-left: 0;
+ margin-right: 0;
+ }
+}
+
+
.wizard .wizard-body {
padding: 0 !important;
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/styles/dashboard.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/dashboard.less b/ambari-web/app/styles/dashboard.less
index 53e55b1..913fc35 100644
--- a/ambari-web/app/styles/dashboard.less
+++ b/ambari-web/app/styles/dashboard.less
@@ -19,6 +19,20 @@
@import 'common.less';
#dashboard-widgets-container{
+ .tabs-left {
+ float: left;
+ }
+ .btn-toolbar {
+ float: right;
+ padding-top: 5px;
+ margin-bottom: 20px;
+ }
+ .dashboard-widgets-box {
+ clear: both;
+ display: inline-block;
+ padding: 10px;
+ background-color: #ececec;
+ }
#widgets-options-menu {
.add-widgets-text .dropdown-menu {
overflow: auto;
@@ -46,23 +60,41 @@
}
.span2p4 {
float: left;
- width: 19.60%;
- *width: 19.60%;
+ width: 22.70%;
+ *width: 22.70%;
}
.thumbnails > div {
- margin: 0 3px 3px 0;
- height: 163px;
+ margin: 10px;
+ height: 160px;
}
.thumbnails li {
- height: 160px;
+ height: 157px;
width: 100%;
margin: 3px 3px 0 0;
+ border-radius: 2px;
+ -webkit-box-shadow: 0px 1px 1px 0px rgba(51, 51, 51, 0.15);
+ -moz-box-shadow: 0px 1px 1px 0px rgba(51, 51, 51, 0.15);
+ box-shadow: 0px 1px 1px 0px rgba(51, 51, 51, 0.15);
}
.img-thumbnail .corner-icon {
- display: none;
position: relative;
- padding: 7px 0;
+ color: #999999;
+ font-size: 14px;
+ padding: 10px 15px 20px 15px;
+ float: right;
+ ul {
+ top: inherit;
+ margin-left: 20px;
+ }
+ li{
+ padding: 2.5px 0 2.5px 5px;
+ height: auto;
+ box-shadow: none;
+ }
+ li:hover {
+ background-color: #f5f5f5;
+ }
.glyphicon-remove-sign{
color: #000;
text-shadow: #fff 0 0 15px;
@@ -82,10 +114,11 @@
}
}
.img-thumbnail .hidden-info-general{
- color: #555;
+ background-color: #ffffff;
+ opacity: 0.9;
+ color: #666666;
font-size: 12px;
- font-weight: bold;
- text-align: center;
+ text-align: left;
text-decoration: none;
display: none;
position: relative;
@@ -110,16 +143,16 @@
}
}
.img-thumbnail .caption {
- padding: 7px 5px;
- color: #555;
- font-weight:bold;
- font-size: 12px;
+ padding: 10px 15px 20px 15px ;
+ color: #666666;
+ font-size: 14px;
text-align: left;
position: relative;
+ float: left;
}
.img-thumbnail .widget-content{
text-align: center;
- font-size: 35px;
+ font-size: 30px;
padding-top: 40px; //svg
position: relative;
.disabled-hdfs-link {
@@ -139,10 +172,9 @@
}
.img-thumbnail .widget-content-isNA{ // for pie chart n\a
text-align: center;
- font-size: 35px;
- color: #D6DDDF;
+ font-size: 30px;
+ color: #999999;
padding-top: 70px;
- font-weight: bold;
position: relative;
}
.img-thumbnail{
@@ -165,8 +197,7 @@
display: block;
}
.caption{
- margin-left: -14.5px;
- z-index: 7;
+ z-index: 9;
}
.slots-caption{
margin-left: -13px;
@@ -178,7 +209,7 @@
z-index: 5;
}
.widget-content, .widget-content-isNA {
- .content-mx(-104px);
+ .content-mx(-114px);
}
.uptime-content{
top: -116px;
@@ -228,19 +259,18 @@
text-decoration: none;
z-index: 9;
}
- .caption {
- margin-left: -14.5px;
- }
}
}
.links .img-thumbnail{
li{
height:24px;
+ box-shadow: none;
}
.link-button{
- float: right;
margin-top: 5px;
+ padding-left: 15px;
+ font-size: 12px;
.disabled-hdfs-quick-link {
pointer-events: none;
color: #808080;
@@ -256,12 +286,11 @@
text-align: center;
font-size: 11px;
color: #555;
- padding-top: 40px;
+ padding: 40px 0 0 15px;
table{
vertical-position: center;
- text-align: center;
- margin-left:auto;
- margin-right:auto;
+ text-align: left;
+ font-size: 12px;
}
td{
padding-top: 2px;
@@ -275,9 +304,6 @@
text-decoration: none;
z-index: 9;
}
- .caption{
- margin-left: -14.5px;
- }
}
.img-thumbnail .widget-content .svg {
position: relative;
@@ -286,7 +312,6 @@
.widget-cn(@color) {
color: @color;
padding-top: 70px;
- font-weight: bold;
}
.is-red{
.widget-content {
@@ -300,16 +325,24 @@
}
.is-green {
.widget-content {
- .widget-cn(@health-status-green);
+ .widget-cn(#666666);
}
}
.is-na {
position: relative;
.widget-content {
- .widget-cn(#D6DDDF);
+ .widget-cn(#999999);
text-shadow: none;
}
}
+ .corner-icon:hover {
+ .ellipsis-menu::after {
+ color: #666666;
+ }
+ ul {
+ display:block;
+ }
+ }
}
}
@@ -320,23 +353,19 @@
#dashboard-widgets {
.span2p4 {
float: left;
- width: 19.47%;
- *width: 19.47%;
- }
- .thumbnails > div {
- margin-right: 5px;
+ width: 22.3%;
+ *width: 22.3%;
}
.img-thumbnail {
- .caption, .hidden-info-two-line, .hidden-info-three-line {
+ .caption {
font-size: 14px;
}
- .hidden-info-five-line, .hidden-info-six-line {
+ .hidden-info-two-line, .hidden-info-three-line, .hidden-info-five-line, .hidden-info-six-line {
font-size: 12px;
}
}
.links .img-thumbnail {
.widget-content {
- font-weight: bold;
font-size: 12px;
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/templates/common/export_metrics_menu.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/export_metrics_menu.hbs b/ambari-web/app/templates/common/export_metrics_menu.hbs
index c48065a..0d4ead9 100644
--- a/ambari-web/app/templates/common/export_metrics_menu.hbs
+++ b/ambari-web/app/templates/common/export_metrics_menu.hbs
@@ -16,7 +16,17 @@
* limitations under the License.
}}
-<ul class="export-graph-list pull-right dropdown-menu">
- <li><a {{action exportGraphData view.parentView.exportToCSVArgument target="view.parentView"}}>{{t common.csv}}</a></li>
- <li><a {{action exportGraphData target="view.parentView"}}>{{t common.json}}</a></li>
+<ul class="dropdown-menu">
+ <li><button {{action exportGraphData view.parentView.exportToCSVArgument target="view.parentView"}}
+ class="button-border">
+ <i class="icon-file-text"></i> {{t common.csv}}</button>
+ </li>
+ <li><button {{action exportGraphData target="view.parentView"}}
+ class="button-border">
+ <i class="icon-file-text-alt"></i> {{t common.json}}</button>
+ </li>
+ <li><button {{action deleteWidget target="view.parentView"}} href="#"
+ class="button-border">
+ <i class="icon-trash"></i> {{t common.delete}}</button>
+ </li>
</ul>
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/templates/main/dashboard.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard.hbs b/ambari-web/app/templates/main/dashboard.hbs
index 4b174cc..0226626 100644
--- a/ambari-web/app/templates/main/dashboard.hbs
+++ b/ambari-web/app/templates/main/dashboard.hbs
@@ -18,7 +18,7 @@
<div class="row">
<div class="summary-width col-md-12" id="dashboard-widgets-container">
- <ul class="nav nav-tabs background-text">
+ <ul class="nav nav-tabs background-text tabs-left">
{{#each category in view.categories}}
{{#view view.NavItemView itemBinding="category.name" }}
<a href="#" {{action "goToDashboardView" category.url}} >{{category.label}}</a>
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs b/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
index f22b9f7..18f2201 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/cluster_metrics.hbs
@@ -19,16 +19,14 @@
<div class="cluster-metrics">
<ul class="list-unstyled">
<li class="img-thumbnail row">
- <a {{bindAttr class=":corner-icon :col-md-1 view.parentView.isMoving:hidden"}} href="#" {{action deleteWidget target="view"}}>
- <i class="glyphicon-remove-sign glyphicon glyphicon-large"></i>
- </a>
<div class="caption col-md-10">{{view.title}}</div>
+ <div class="corner-icon col-md-1">
+ <button class="dropdown-toggle ellipsis-menu button-border" data-toggle="dropdown" href="#"
+ {{action toggleFormatsList target="view"}}></button>
+ {{view view.exportMetricsMenuView}}
+ </div>
{{#if view.isDataLoaded}}
{{#if view.childViews.lastObject.hasData}}
- <a {{bindAttr class="view.isExportButtonHidden:hidden :corner-icon :col-md-1"}} href="#" {{action toggleFormatsList target="view"}}>
- <i class="glyphicon glyphicon-save"></i>
- </a>
- {{view view.exportMetricsMenuView}}
{{/if}}
{{/if}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
index e96ed23..0ee9af2 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/hbase_links.hbs
@@ -19,10 +19,17 @@
<div class="links">
<ul class="list-unstyled">
<li class="img-thumbnail row">
- <a {{bindAttr class=":corner-icon :col-md-1 view.parentView.isMoving:hidden"}}
- href="#" {{action deleteWidget target="view"}}><i class="glyphicon-remove-sign glyphicon glyphicon-large"></i></a>
<div class="caption col-md-10"> {{view.title}}</div>
+ <div class="corner-icon col-md-1">
+ <button class="dropdown-toggle ellipsis-menu button-border" data-toggle="dropdown" href="#"></button>
+ <ul class="dropdown-menu">
+ <li><button type="button" href="#" class="button-border"
+ {{action deleteWidget target="view"}}>
+ <i class="icon-trash"></i> {{t common.delete}}</button>
+ </li>
+ </ul>
+ </div>
{{#if view.isDataLoaded}}
<div class="widget-content">
<table>
@@ -60,10 +67,10 @@
{{#if view.model.quickLinks.length}}
{{#view App.QuickLinksView contentBinding="view.model"}}
<div class="btn-group">
- <button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" href="#">
+ <a class="dropdown-toggle" data-toggle="dropdown" href="#">
{{t common.more}}
<span class="caret"></span>
- </button>
+ </a>
<ul class="dropdown-menu">
{{#if view.isLoaded}}
{{#if view.quickLinksArray}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
index 2feb1b0..8790ac1 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/hdfs_links.hbs
@@ -19,11 +19,16 @@
<div class="links">
<ul class="list-unstyled">
<li class="img-thumbnail row">
- <a {{bindAttr class=":corner-icon :col-md-1 view.parentView.isMoving:hidden"}} href="#" {{action deleteWidget target="view"}}>
- <i class="glyphicon-remove-sign glyphicon glyphicon-large"></i>
- </a>
<div class="caption col-md-10"> {{view.title}}</div>
-
+ <div class="corner-icon col-md-1">
+ <button class="dropdown-toggle ellipsis-menu button-border" data-toggle="dropdown" href="#"></button>
+ <ul class="dropdown-menu">
+ <li><button type="button" href="#" class="button-border"
+ {{action deleteWidget target="view"}}>
+ <i class="icon-trash"></i> {{t common.delete}}</button>
+ </li>
+ </ul>
+ </div>
<div class="widget-content" >
{{#if view.isHAEnabled }}
<table>
@@ -81,10 +86,10 @@
{{#if view.model.quickLinks.length}}
{{#view App.QuickLinksView contentBinding="view.model"}}
<div class="btn-group">
- <button class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">
+ <a class="dropdown-toggle" data-toggle="dropdown" href="#">
{{t common.more}}
<span class="caret"></span>
- </button>
+ </a>
<ul class="dropdown-menu">
{{#if view.isLoaded}}
{{#if view.quickLinksArray}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs b/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs
index d13ddb4..a383a8b 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/pie_chart.hbs
@@ -19,17 +19,22 @@
<div class="has-hidden-info">
<ul class="list-unstyled">
<li class="img-thumbnail row">
- <a {{bindAttr class=":corner-icon :col-md-1 view.parentView.isMoving:hidden"}}
- href="#" {{action deleteWidget target="view"}}>
- <i class="glyphicon-remove-sign glyphicon glyphicon-large"></i>
- </a>
<div class="caption col-md-10">{{view.title}}</div>
+ <div class="corner-icon col-md-1">
+ <button class="dropdown-toggle ellipsis-menu button-border" data-toggle="dropdown" href="#"></button>
+ <ul class="dropdown-menu">
+ <li><button type="button" href="#" class="button-border"
+ {{action editWidget target="view"}}>
+ <i class="icon-pencil"></i> {{t common.edit}}</button>
+ </li>
+ <li><button type="button" href="#" class="button-border"
+ {{action deleteWidget target="view"}}>
+ <i class="icon-trash"></i> {{t common.delete}}</button>
+ </li>
+ </ul>
+ </div>
{{#if view.isDataLoaded}}
- <a class="corner-icon col-md-1" href="#" {{action editWidget target="view"}}>
- <i class="glyphicon glyphicon-edit"></i>
- </a>
-
<div {{bindAttr class=":hidden-info-general view.hiddenInfoClass" }}>
<table align="center">
{{#each line in view.hiddenInfo}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs b/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs
index f10ca19..606fef2 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs
@@ -19,17 +19,22 @@
<div class="has-hidden-info">
<ul class="list-unstyled">
<li class="img-thumbnail row">
- <a {{bindAttr class=":corner-icon :col-md-1 view.parentView.isMoving:hidden"}}
- href="#" {{action deleteWidget target="view"}}>
- <i class="glyphicon-remove-sign glyphicon glyphicon-large"></i>
- </a>
<div class="caption col-md-10"> {{view.title}}</div>
+ <div class="corner-icon col-md-1">
+ <button class="dropdown-toggle ellipsis-menu button-border" data-toggle="dropdown" href="#"></button>
+ <ul class="dropdown-menu">
+ <li><button type="button" href="#" class="button-border"
+ {{action editWidget target="view"}}>
+ <i class="icon-pencil"></i> {{t common.edit}}</button>
+ </li>
+ <li><button type="button" href="#" class="button-border"
+ {{action deleteWidget target="view"}}>
+ <i class="icon-trash"></i> {{t common.delete}}</button>
+ </li>
+ </ul>
+ </div>
{{#if view.isDataLoaded}}
- <a class="corner-icon col-md-1" href="#" {{action editWidget target="view"}}>
- <i class="glyphicon glyphicon-edit"></i>
- </a>
-
<div {{bindAttr class=":hidden-info-general view.hiddenInfoClass" }}>
<table align="center">
{{#each line in view.hiddenInfo}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs b/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs
index 5a66ba5..befc9da 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/uptime.hbs
@@ -19,12 +19,16 @@
<div class="has-hidden-info">
<ul class="list-unstyled">
<li class="img-thumbnail row">
- <a {{bindAttr class=":corner-icon :col-md-1 view.parentView.isMoving:hidden"}}
- href="#" {{action deleteWidget target="view"}}>
- <i class="glyphicon-remove-sign glyphicon glyphicon-large"></i>
- </a>
-
- <div class="caption col-md-11"> {{view.title}} </div>
+ <div class="caption col-md-10"> {{view.title}} </div>
+ <div class="corner-icon col-md-1">
+ <button class="dropdown-toggle ellipsis-menu button-border" data-toggle="dropdown" href="#"></button>
+ <ul class="dropdown-menu">
+ <li><button type="button" href="#" class="button-border"
+ {{action deleteWidget target="view"}}>
+ <i class="icon-trash"></i> {{t common.delete}}</button>
+ </li>
+ </ul>
+ </div>
{{#if view.isDataLoaded}}
<div {{bindAttr class=":hidden-info-general view.hiddenInfoClass"}}>
<table align="center">
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/templates/main/dashboard/widgets/yarn_links.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/widgets/yarn_links.hbs b/ambari-web/app/templates/main/dashboard/widgets/yarn_links.hbs
index a8612f7..2700a19 100644
--- a/ambari-web/app/templates/main/dashboard/widgets/yarn_links.hbs
+++ b/ambari-web/app/templates/main/dashboard/widgets/yarn_links.hbs
@@ -19,12 +19,16 @@
<div class="links">
<ul class="list-unstyled">
<li class="img-thumbnail row">
- <a {{bindAttr class=":corner-icon :col-md-1 view.parentView.isMoving:hidden"}}
- href="#" {{action deleteWidget target="view"}}>
- <i class="glyphicon-remove-sign glyphicon glyphicon-large"></i>
- </a>
-
<div class="caption col-md-10"> {{view.title}}</div>
+ <div class="corner-icon col-md-1">
+ <button class="dropdown-toggle ellipsis-menu button-border" data-toggle="dropdown" href="#"></button>
+ <ul class="dropdown-menu">
+ <li><button type="button" href="#" class="button-border"
+ {{action deleteWidget target="view"}}>
+ <i class="icon-trash"></i> {{t common.delete}}</button>
+ </li>
+ </ul>
+ </div>
{{#if view.isDataLoaded}}
<div class="widget-content">
<table>
@@ -48,10 +52,10 @@
{{#if view.model.quickLinks.length}}
{{#view App.QuickLinksView contentBinding="view.model"}}
<div class="btn-group">
- <button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" href="#">
+ <a class="dropdown-toggle" data-toggle="dropdown" href="#">
{{t common.more}}
<span class="caret"></span>
- </button>
+ </a>
<ul class="dropdown-menu">
{{#if view.isLoaded}}
{{#if view.quickLinksArray}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/views/common/chart/pie.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/chart/pie.js b/ambari-web/app/views/common/chart/pie.js
index ce9bda4..f4c402a 100644
--- a/ambari-web/app/views/common/chart/pie.js
+++ b/ambari-web/app/views/common/chart/pie.js
@@ -19,13 +19,13 @@
var App = require('app');
App.ChartPieView = Em.View.extend({
- w:90,
- h:90,
+ w:100,
+ h:100,
data:[300, 500],
id:null,
palette: new Rickshaw.Color.Palette({ scheme: 'munin'}),
stroke: 'black',
- strokeWidth: 2,
+ strokeWidth: 1,
donut:d3.layout.pie().sort(null),
existCenterText: false,
centerTextColor: 'black',
@@ -69,8 +69,8 @@ App.ChartPieView = Em.View.extend({
.append("svg:text")
.style('fill', thisChart.get('centerTextColor'))
.attr("stroke", thisChart.get('centerTextColor'))
- .attr("font-size", 17)
- .attr("transform", "translate(" + thisChart.get('w') / 2 + "," + ((thisChart.get('h') / 2) + 3) + ")")
+ .attr("font-size", 24)
+ .attr("transform", "translate(" + thisChart.get('w') / 2 + "," + ((thisChart.get('h') / 2) + 8) + ")")
.attr("text-anchor", "middle")
.text(function(d) {
return thisChart.get('data')[0] + '%';
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/views/main/dashboard/widgets/cluster_metrics_widget.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets/cluster_metrics_widget.js b/ambari-web/app/views/main/dashboard/widgets/cluster_metrics_widget.js
index 384a898..fbf6d21 100644
--- a/ambari-web/app/views/main/dashboard/widgets/cluster_metrics_widget.js
+++ b/ambari-web/app/views/main/dashboard/widgets/cluster_metrics_widget.js
@@ -28,9 +28,6 @@ App.ClusterMetricsDashboardWidgetView = App.DashboardWidgetView.extend(App.Expor
didInsertElement: function () {
var self = this;
- this.$().on('mouseleave', function () {
- self.set('isExportMenuHidden', true);
- });
App.tooltip(this.$('.corner-icon > .glyphicon-save'), {
title: Em.I18n.t('common.export')
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b575fb9/ambari-web/app/views/main/dashboard/widgets/pie_chart_widget.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets/pie_chart_widget.js b/ambari-web/app/views/main/dashboard/widgets/pie_chart_widget.js
index 5dd85d1..34809b8 100644
--- a/ambari-web/app/views/main/dashboard/widgets/pie_chart_widget.js
+++ b/ambari-web/app/views/main/dashboard/widgets/pie_chart_widget.js
@@ -84,10 +84,10 @@ App.PieChartDashboardWidgetView = App.DashboardWidgetView.extend({
content: App.ChartPieView.extend({
model: null, //data bind here
id: Em.computed.alias('parentView.widgetHtmlId'), // html id
- stroke: '#D6DDDF', //light grey
+ stroke: 'transparent',
thresholdMin: null, //bind from parent
thresholdMax: null,
- innerR: 25,
+ innerR: 40,
existCenterText: true,
centerTextColor: Em.computed.alias('contentColor'),
@@ -111,20 +111,21 @@ App.PieChartDashboardWidgetView = App.DashboardWidgetView.extend({
var thresholdMax = parseFloat(this.get('thresholdMax'));
if (used <= thresholdMin) {
this.set('palette', new Rickshaw.Color.Palette({
- scheme: ['#FFFFFF', App.healthStatusGreen].reverse()
+ scheme: ['#DDDDDD', App.healthStatusGreen].reverse()
}));
- return App.healthStatusGreen;
}
- if (used <= thresholdMax) {
+ else if (used <= thresholdMax) {
this.set('palette', new Rickshaw.Color.Palette({
- scheme: ['#FFFFFF', App.healthStatusOrange].reverse()
+ scheme: ['#DDDDDD', App.healthStatusOrange].reverse()
}));
- return App.healthStatusOrange;
}
- this.set('palette', new Rickshaw.Color.Palette({
- scheme: ['#FFFFFF', App.healthStatusRed].reverse()
- }));
- return App.healthStatusRed;
+ else {
+ this.set('palette', new Rickshaw.Color.Palette({
+ scheme: ['#DDDDDD', App.healthStatusRed].reverse()
+ }));
+ }
+ return App.widgetContentColor;
+
}.property('data', 'thresholdMin', 'thresholdMax'),
// refresh text and color when data in model changed
[23/50] [abbrv] ambari git commit: AMBARI-21182. Agent Host Disk
Usage Alert Hardcodes the Stack Directory (aonishuk)
Posted by rl...@apache.org.
AMBARI-21182. Agent Host Disk Usage Alert Hardcodes the Stack Directory (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/119d2624
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/119d2624
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/119d2624
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 119d2624f96d66c9a4d5d559ca436de73adae444
Parents: 4dba161
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Jun 6 13:57:52 2017 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Jun 6 13:57:52 2017 +0300
----------------------------------------------------------------------
.../resources/host_scripts/alert_disk_space.py | 22 +++++++-------------
1 file changed, 8 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/119d2624/ambari-server/src/main/resources/host_scripts/alert_disk_space.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/host_scripts/alert_disk_space.py b/ambari-server/src/main/resources/host_scripts/alert_disk_space.py
index d2b4f36..4c5834f 100644
--- a/ambari-server/src/main/resources/host_scripts/alert_disk_space.py
+++ b/ambari-server/src/main/resources/host_scripts/alert_disk_space.py
@@ -36,18 +36,14 @@ MIN_FREE_SPACE_DEFAULT = 5000000000L
PERCENT_USED_WARNING_DEFAULT = 50
PERCENT_USED_CRITICAL_DEFAULT = 80
-# the location where HDP installs components when using HDP 2.2+
-STACK_HOME_DIR = "/usr/hdp"
-
-# the location where HDP installs components when using HDP 2.0 to 2.1
-STACK_HOME_LEGACY_DIR = "/usr/lib"
+STACK_ROOT = '{{cluster-env/stack_root}}'
def get_tokens():
"""
Returns a tuple of tokens in the format {{site/property}} that will be used
to build the dictionary passed into execute
"""
- return None
+ return (STACK_ROOT, )
@OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
@@ -65,15 +61,13 @@ def execute(configurations={}, parameters={}, host_name=None):
host_name (string): the name of this host where the alert is running
"""
- # determine the location of HDP home
- stack_home = None
- if os.path.isdir(STACK_HOME_DIR):
- stack_home = STACK_HOME_DIR
- elif os.path.isdir(STACK_HOME_LEGACY_DIR):
- stack_home = STACK_HOME_LEGACY_DIR
+ if configurations is None:
+ return (('UNKNOWN', ['There were no configurations supplied to the script.']))
+
+ if not STACK_ROOT in configurations:
+ return (('STACK_ROOT', ['cluster-env/stack_root is not specified']))
- # if stack home was found, use it; otherwise default to None
- path = stack_home if stack_home is not None else None
+ path = configurations[STACK_ROOT]
try:
disk_usage = _get_disk_usage(path)
[35/50] [abbrv] ambari git commit: AMBARI-21096. ADDENDUM. Provide
additional logging for config audit log (alejandro)
Posted by rl...@apache.org.
AMBARI-21096. ADDENDUM. Provide additional logging for config audit log (alejandro)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bdadb704
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bdadb704
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bdadb704
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: bdadb704b8982915575ea65d3c42447abcb75d6e
Parents: e801b41
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Wed Jun 7 11:28:46 2017 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Wed Jun 7 15:15:38 2017 -0700
----------------------------------------------------------------------
.../server/controller/AmbariManagementControllerImpl.java | 5 ++++-
.../server/controller/internal/ConfigGroupResourceProvider.java | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/bdadb704/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index b67b45b..1eeb82b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -1777,7 +1777,10 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
}
}
note = cr.getServiceConfigVersionNote();
- configs.add(cluster.getConfig(configType, cr.getVersionTag()));
+ Config config = cluster.getConfig(configType, cr.getVersionTag());
+ if (null != config) {
+ configs.add(config);
+ }
}
if (!configs.isEmpty()) {
Map<String, Config> existingConfigTypeToConfig = new HashMap();
http://git-wip-us.apache.org/repos/asf/ambari/blob/bdadb704/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
index d2b4a84..cc23177 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
@@ -657,10 +657,11 @@ public class ConfigGroupResourceProvider extends
serviceName = requestServiceName;
}
+ int numHosts = (null != configGroup.getHosts()) ? configGroup.getHosts().size() : 0;
configLogger.info("(configchange) Updating configuration group host membership or config value. cluster: '{}', changed by: '{}', " +
"service_name: '{}', config group: '{}', tag: '{}', num hosts in config group: '{}', note: '{}'",
cluster.getClusterName(), getManagementController().getAuthName(),
- serviceName, request.getGroupName(), request.getTag(), configGroup.getHosts().size(), request.getServiceConfigVersionNote());
+ serviceName, request.getGroupName(), request.getTag(), numHosts, request.getServiceConfigVersionNote());
if (!request.getConfigs().isEmpty()) {
List<String> affectedConfigTypeList = new ArrayList(request.getConfigs().keySet());
[42/50] [abbrv] ambari git commit: AMBARI-20877.Custom RM principal
causes zookeeper HA state store to be inaccessible. (Attila Magyar via
stoader)
Posted by rl...@apache.org.
AMBARI-20877.Custom RM principal causes zookeeper HA state store to be inaccessible. (Attila Magyar via stoader)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/89797ea2
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/89797ea2
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/89797ea2
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 89797ea2c56ae0387899890756527e1019ffd3f3
Parents: e2fbd0f
Author: Attila Magyar <am...@hortonworks.com>
Authored: Thu Jun 8 15:46:51 2017 +0200
Committer: Toader, Sebastian <st...@hortonworks.com>
Committed: Thu Jun 8 15:46:51 2017 +0200
----------------------------------------------------------------------
.../security/kerberos/kerberos_descriptor.md | 5 +-
.../server/controller/KerberosHelperImpl.java | 19 ++-
.../state/kerberos/KerberosDescriptor.java | 51 ++++++++
.../kerberos/VariableReplacementHelper.java | 23 +++-
.../YARN/3.0.0.3.0/kerberos.json | 4 +-
.../stacks/HDP/2.6/services/YARN/kerberos.json | 4 +-
.../server/controller/KerberosHelperTest.java | 129 +++++++++---------
.../state/kerberos/KerberosDescriptorTest.java | 9 ++
.../kerberos/VariableReplacementHelperTest.java | 130 +++++++++++--------
9 files changed, 242 insertions(+), 132 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/89797ea2/ambari-server/docs/security/kerberos/kerberos_descriptor.md
----------------------------------------------------------------------
diff --git a/ambari-server/docs/security/kerberos/kerberos_descriptor.md b/ambari-server/docs/security/kerberos/kerberos_descriptor.md
index 54af50f..a59564c 100644
--- a/ambari-server/docs/security/kerberos/kerberos_descriptor.md
+++ b/ambari-server/docs/security/kerberos/kerberos_descriptor.md
@@ -288,8 +288,9 @@ the configuration type and containing values for each relevant property.
Each property name and value may be a concrete value or contain variables to be replaced using values
from the stack-level `properties` block or any available configuration. Properties from the `properties`
-block are referenced by name (`${property_name}`) and configuration properties are reference by
-configuration specification (`${config-type/property_name}`).
+block are referenced by name (`${property_name}`), configuration properties are reference by
+configuration specification (`${config-type/property_name}`) and kerberos principals are referenced by the principal path
+(`principals/SERVICE/COMPONENT/principal_name`).
```
"configurations" : [
http://git-wip-us.apache.org/repos/asf/ambari/blob/89797ea2/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
index 87c826d..61674cf 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java
@@ -1241,10 +1241,21 @@ public class KerberosHelperImpl implements KerberosHelper {
@Override
public Map<String, Map<String, String>> calculateConfigurations(Cluster cluster, String hostname,
Map<String, String> kerberosDescriptorProperties)
- throws AmbariException {
- return addAdditionalConfigurations(cluster,
- calculateExistingConfigurations(cluster, hostname),
- hostname, kerberosDescriptorProperties);
+ throws AmbariException
+ {
+ Map<String, Map<String, String>> configuration = addAdditionalConfigurations(cluster,
+ calculateExistingConfigurations(cluster, hostname),
+ hostname, kerberosDescriptorProperties);
+ configuration.put("principals", principalNames(cluster, configuration));
+ return configuration;
+ }
+
+ private Map<String, String> principalNames(Cluster cluster, Map<String, Map<String, String>> configuration) throws AmbariException {
+ Map<String, String> result = new HashMap<>();
+ for (Map.Entry<String, String> each : getKerberosDescriptor(cluster).principals().entrySet()) {
+ result.put(each.getKey(), variableReplacementHelper.replaceVariables(each.getValue(), configuration));
+ }
+ return result;
}
@Override
http://git-wip-us.apache.org/repos/asf/ambari/blob/89797ea2/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
index a1b9e5c..f9dfa4a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java
@@ -20,12 +20,16 @@ package org.apache.ambari.server.state.kerberos;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
+import org.apache.ambari.server.AmbariException;
+import org.apache.commons.lang.StringUtils;
+
/**
* KerberosDescriptor is an implementation of an AbstractKerberosDescriptorContainer that
* encapsulates an entire Kerberos descriptor hierarchy.
@@ -418,4 +422,51 @@ public class KerberosDescriptor extends AbstractKerberosDescriptorContainer {
return authToLocalProperties;
}
+
+ /**
+ * Get a map of principals, where the key is the principal path (SERVICE/COMPONENT/principal_name or SERVICE/principal_name) and the value is the principal.
+ *
+ * For example if the kerberos principal of the HISTORYSERVER is defined in the kerberos.json:
+ * "name": "history_server_jhs",
+ * "principal": {
+ * "value": "jhs/_HOST@${realm}",
+ * "type" : "service",
+ * },
+ * Then "jhs/_HOST@EXAMPLE.COM" will be put into the map under the "MAPREDUCE2/HISTORYSERVER/history_server_jhs" key.
+ */
+ public Map<String, String> principals() throws AmbariException {
+ Map<String,String> result = new HashMap<>();
+ for (AbstractKerberosDescriptorContainer each : nullToEmpty(getChildContainers())) {
+ if ((each instanceof KerberosServiceDescriptor)) {
+ collectFromComponents(each.getName(), nullToEmpty(((KerberosServiceDescriptor) each).getComponents()).values(), result);
+ collectFromIdentities(each.getName(), "", nullToEmpty(each.getIdentities()), result);
+ }
+ }
+ return result;
+ }
+
+ private static void collectFromComponents(String service, Collection<KerberosComponentDescriptor> components, Map<String, String> result) {
+ for (KerberosComponentDescriptor each : components) {
+ collectFromIdentities(service, each.getName(), nullToEmpty(each.getIdentities()), result);
+ }
+ }
+
+ private static void collectFromIdentities(String service, String component, Collection<KerberosIdentityDescriptor> identities, Map<String, String> result) {
+ for (KerberosIdentityDescriptor each : identities) {
+ if (each.getPrincipalDescriptor() != null && !each.getReferencedServiceName().isPresent() && !each.getName().startsWith("/")) {
+ String path = StringUtils.isBlank(component)
+ ? String.format("%s/%s", service, each.getName())
+ : String.format("%s/%s/%s", service, component, each.getName());
+ result.put(path, each.getPrincipalDescriptor().getName());
+ }
+ }
+ }
+
+ private static <T> Collection<T> nullToEmpty(Collection<T> collection) {
+ return collection == null ? Collections.<T>emptyList() : collection;
+ }
+
+ private static <K,V> Map<K,V> nullToEmpty(Map<K,V> collection) {
+ return collection == null ? Collections.<K,V>emptyMap() : collection;
+ }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/89797ea2/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelper.java
index b9e2841..a83f080 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelper.java
@@ -43,7 +43,7 @@ public class VariableReplacementHelper {
/**
* a regular expression Pattern used to find "variable" placeholders in strings
*/
- private static final Pattern PATTERN_VARIABLE = Pattern.compile("\\$\\{(?:([\\w\\-\\.]+)/)?([\\w\\-\\.]+)(?:\\s*\\|\\s*(.+?))?\\}");
+ private static final Pattern PATTERN_VARIABLE = Pattern.compile("\\$\\{(?:([\\w\\-\\.]+)/)?([\\w\\-\\./]+)(?:\\s*\\|\\s*(.+?))?\\}");
/**
* a regular expression Pattern used to parse "function" declarations: name(arg1, arg2, ...)
@@ -59,6 +59,7 @@ public class VariableReplacementHelper {
put("toLower", new ToLowerFunction());
put("replace", new ReplaceValue());
put("append", new AppendFunction());
+ put("principalPrimary", new PrincipalPrimary());
}
};
@@ -411,4 +412,24 @@ public class VariableReplacementHelper {
return sourceData;
}
}
+
+ /**
+ * Get the primary part of a Kerberos principal.
+ * The format of a typical Kerberos principal is primary/instance@REALM.
+ */
+ private static class PrincipalPrimary implements Function {
+ @Override
+ public String perform(String[] args, String data, Map<String, Map<String, String>> replacementsMap) {
+ if (data == null) {
+ return null;
+ }
+ if (data.contains("/")) {
+ return data.split("/")[0];
+ } else if (data.contains("@")) {
+ return data.split("@")[0];
+ } else {
+ return data;
+ }
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/89797ea2/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/kerberos.json b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/kerberos.json
index ae4db4f..b1501b8 100644
--- a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/kerberos.json
+++ b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/kerberos.json
@@ -32,9 +32,9 @@
"yarn.resourcemanager.proxyuser.*.hosts": "",
"yarn.resourcemanager.proxyuser.*.users": "",
"yarn.resourcemanager.proxy-user-privileges.enabled": "true",
- "yarn.resourcemanager.zk-acl" : "sasl:rm:rwcda",
+ "yarn.resourcemanager.zk-acl" : "sasl:${principals/YARN/RESOURCEMANAGER/resource_manager_rm|principalPrimary()}:rwcda",
"hadoop.registry.secure" : "true",
- "hadoop.registry.system.accounts" : "sasl:yarn,sasl:mapred,sasl:hadoop,sasl:hdfs,sasl:rm,sasl:hive",
+ "hadoop.registry.system.accounts" : "sasl:${principals/YARN/APP_TIMELINE_SERVER/app_timeline_server_yarn|principalPrimary()},sasl:${principals/MAPREDUCE2/HISTORYSERVER/history_server_jhs|principalPrimary()},sasl:${principals/HDFS/NAMENODE/hdfs|principalPrimary()},sasl:${principals/YARN/RESOURCEMANAGER/resource_manager_rm|principalPrimary()},sasl:${principals/HIVE/HIVE_SERVER/hive_server_hive|principalPrimary()}",
"hadoop.registry.client.auth" : "kerberos",
"hadoop.registry.jaas.context" : "Client"
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/89797ea2/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/kerberos.json b/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/kerberos.json
index ae4db4f..b1501b8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/kerberos.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/kerberos.json
@@ -32,9 +32,9 @@
"yarn.resourcemanager.proxyuser.*.hosts": "",
"yarn.resourcemanager.proxyuser.*.users": "",
"yarn.resourcemanager.proxy-user-privileges.enabled": "true",
- "yarn.resourcemanager.zk-acl" : "sasl:rm:rwcda",
+ "yarn.resourcemanager.zk-acl" : "sasl:${principals/YARN/RESOURCEMANAGER/resource_manager_rm|principalPrimary()}:rwcda",
"hadoop.registry.secure" : "true",
- "hadoop.registry.system.accounts" : "sasl:yarn,sasl:mapred,sasl:hadoop,sasl:hdfs,sasl:rm,sasl:hive",
+ "hadoop.registry.system.accounts" : "sasl:${principals/YARN/APP_TIMELINE_SERVER/app_timeline_server_yarn|principalPrimary()},sasl:${principals/MAPREDUCE2/HISTORYSERVER/history_server_jhs|principalPrimary()},sasl:${principals/HDFS/NAMENODE/hdfs|principalPrimary()},sasl:${principals/YARN/RESOURCEMANAGER/resource_manager_rm|principalPrimary()},sasl:${principals/HIVE/HIVE_SERVER/hive_server_hive|principalPrimary()}",
"hadoop.registry.client.auth" : "kerberos",
"hadoop.registry.jaas.context" : "Client"
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/89797ea2/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
index 98241eb..18a6754 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
@@ -1001,30 +1001,30 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(serviceComponentKerberosClient.getName()).andReturn(Role.KERBEROS_CLIENT.name()).anyTimes();
expect(serviceComponentKerberosClient.getServiceComponentHosts()).andReturn(Collections.singletonMap("host1", schKerberosClient)).anyTimes();
- final Service serviceKerberos = createStrictMock(Service.class);
+ final Service serviceKerberos = createNiceMock(Service.class);
expect(serviceKerberos.getDesiredStackId()).andReturn(stackId).anyTimes();
expect(serviceKerberos.getName()).andReturn(Service.Type.KERBEROS.name()).anyTimes();
expect(serviceKerberos.getServiceComponents())
.andReturn(Collections.singletonMap(Role.KERBEROS_CLIENT.name(), serviceComponentKerberosClient))
- .times(1);
+ .anyTimes();
serviceKerberos.setSecurityState(SecurityState.SECURED_KERBEROS);
expectLastCall().once();
- final Service service1 = createStrictMock(Service.class);
+ final Service service1 = createNiceMock(Service.class);
expect(service1.getDesiredStackId()).andReturn(stackId).anyTimes();
expect(service1.getName()).andReturn("SERVICE1").anyTimes();
expect(service1.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
- .times(1);
+ .anyTimes();
service1.setSecurityState(SecurityState.SECURED_KERBEROS);
expectLastCall().once();
- final Service service2 = createStrictMock(Service.class);
+ final Service service2 = createNiceMock(Service.class);
expect(service2.getName()).andReturn("SERVICE2").anyTimes();
expect(service2.getDesiredStackId()).andReturn(stackId).anyTimes();
expect(service2.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
- .times(1);
+ .anyTimes();
service2.setSecurityState(SecurityState.SECURED_KERBEROS);
expectLastCall().once();
@@ -1090,7 +1090,7 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(kerberosDescriptor.getService("SERVICE1")).andReturn(serviceDescriptor1).once();
expect(kerberosDescriptor.getService("SERVICE2")).andReturn(serviceDescriptor2).once();
- setupKerberosDescriptor(kerberosDescriptor, 1);
+ setupKerberosDescriptor(kerberosDescriptor);
setupStageFactory();
// This is a STRICT mock to help ensure that the end result is what we want.
@@ -1203,7 +1203,7 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(serviceComponentKerberosClient.getServiceComponentHosts()).andReturn(Collections.singletonMap("host1", schKerberosClient)).anyTimes();
final Service serviceKerberos = createNiceMock(Service.class);
- expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(serviceKerberos.getName()).andReturn(Service.Type.KERBEROS.name()).anyTimes();
expect(serviceKerberos.getServiceComponents())
.andReturn(Collections.singletonMap(Role.KERBEROS_CLIENT.name(), serviceComponentKerberosClient))
@@ -1212,7 +1212,7 @@ public class KerberosHelperTest extends EasyMockSupport {
expectLastCall().once();
final Service service1 = createNiceMock(Service.class);
- expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service1.getName()).andReturn("SERVICE1").anyTimes();
expect(service1.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
@@ -1221,7 +1221,7 @@ public class KerberosHelperTest extends EasyMockSupport {
expectLastCall().once();
final Service service2 = createNiceMock(Service.class);
- expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service2.getName()).andReturn("SERVICE2").anyTimes();
expect(service2.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
@@ -1287,7 +1287,7 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(kerberosDescriptor.getService("SERVICE1")).andReturn(serviceDescriptor1).atLeastOnce();
expect(kerberosDescriptor.getService("SERVICE2")).andReturn(serviceDescriptor2).atLeastOnce();
- setupKerberosDescriptor(kerberosDescriptor, 1);
+ setupKerberosDescriptor(kerberosDescriptor);
setupStageFactory();
// This is a STRICT mock to help ensure that the end result is what we want.
@@ -1426,25 +1426,25 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(serviceComponentKerberosClient.getServiceComponentHosts()).andReturn(map).anyTimes();
final Service serviceKerberos = createStrictMock(Service.class);
- expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(serviceKerberos.getName()).andReturn(Service.Type.KERBEROS.name()).anyTimes();
expect(serviceKerberos.getServiceComponents())
.andReturn(Collections.singletonMap(Role.KERBEROS_CLIENT.name(), serviceComponentKerberosClient))
- .times(1);
+ .anyTimes();
final Service service1 = createStrictMock(Service.class);
- expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service1.getName()).andReturn("SERVICE1").anyTimes();
expect(service1.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
- .times(1);
+ .anyTimes();
final Service service2 = createStrictMock(Service.class);
- expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service2.getName()).andReturn("SERVICE2").anyTimes();
expect(service2.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
- .times(1);
+ .anyTimes();
final Map<String, String> kerberosEnvProperties = createMock(Map.class);
expect(kerberosEnvProperties.get("kdc_type")).andReturn("mit-kdc").anyTimes();
@@ -1509,7 +1509,7 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(kerberosDescriptor.getService("SERVICE1")).andReturn(serviceDescriptor1).atLeastOnce();
expect(kerberosDescriptor.getService("SERVICE2")).andReturn(serviceDescriptor2).atLeastOnce();
- setupKerberosDescriptor(kerberosDescriptor, 1);
+ setupKerberosDescriptor(kerberosDescriptor);
setupStageFactory();
final RequestStageContainer requestStageContainer;
@@ -2050,7 +2050,7 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(kerberosDescriptor.getIdentities(eq(true), EasyMock.<Map<String, Object>>anyObject())).andReturn(null).atLeastOnce();
expect(kerberosDescriptor.getAuthToLocalProperties()).andReturn(Collections.singleton("core-site/auth.to.local")).atLeastOnce();
- setupKerberosDescriptor(kerberosDescriptor, 2);
+ setupKerberosDescriptor(kerberosDescriptor);
RecommendationResponse.BlueprintConfigurations coreSiteRecommendation = createNiceMock(RecommendationResponse
.BlueprintConfigurations.class);
@@ -2485,7 +2485,7 @@ public class KerberosHelperTest extends EasyMockSupport {
expectLastCall().once();
}
- setupKerberosDescriptor(kerberosDescriptor, 1);
+ setupKerberosDescriptor(kerberosDescriptor);
Map<String, Map<String, String>> existingConfigurations = new HashMap<>();
existingConfigurations.put("kerberos-env", propertiesKerberosEnv);
@@ -2612,7 +2612,7 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(kerberosDescriptor.getProperties()).andReturn(kerberosDescriptorProperties);
expect(kerberosDescriptor.getService("SERVICE1")).andReturn(service1KerberosDescriptor).times(1);
- setupKerberosDescriptor(kerberosDescriptor, 1);
+ setupKerberosDescriptor(kerberosDescriptor);
Map<String, Map<String, String>> existingConfigurations = new HashMap<>();
existingConfigurations.put("kerberos-env", propertiesKerberosEnv);
@@ -2648,9 +2648,10 @@ public class KerberosHelperTest extends EasyMockSupport {
assertEquals(0, capturedPrincipalsForKeytab.size());
}
- private void setupKerberosDescriptor(KerberosDescriptor kerberosDescriptor, int expectedCalls) throws Exception {
+ private void setupKerberosDescriptor(KerberosDescriptor kerberosDescriptor) throws Exception {
// cluster.getCurrentStackVersion expectation is already specified in main test method
- expect(metaInfo.getKerberosDescriptor("HDP", "2.2")).andReturn(kerberosDescriptor).times(expectedCalls);
+ expect(metaInfo.getKerberosDescriptor("HDP", "2.2")).andReturn(kerberosDescriptor).anyTimes();
+ expect(kerberosDescriptor.principals()).andReturn(Collections.<String, String>emptyMap()).anyTimes();
}
private void setupStageFactory() {
@@ -2736,25 +2737,25 @@ public class KerberosHelperTest extends EasyMockSupport {
).anyTimes();
final Service serviceKerberos = createStrictMock(Service.class);
- expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(serviceKerberos.getName()).andReturn(Service.Type.KERBEROS.name()).anyTimes();
expect(serviceKerberos.getServiceComponents())
.andReturn(Collections.singletonMap(Role.KERBEROS_CLIENT.name(), serviceComponentKerberosClient))
- .times(1);
+ .anyTimes();
final Service service1 = createStrictMock(Service.class);
- expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service1.getName()).andReturn("SERVICE1").anyTimes();
expect(service1.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
- .times(1);
+ .anyTimes();
final Service service2 = createStrictMock(Service.class);
- expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service2.getName()).andReturn("SERVICE2").anyTimes();
expect(service2.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
- .times(1);
+ .anyTimes();
final Map<String, String> kerberosEnvProperties = createMock(Map.class);
expect(kerberosEnvProperties.get("kdc_type")).andReturn("mit-kdc").anyTimes();
@@ -2904,7 +2905,7 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(kerberosDescriptor.getService("SERVICE1")).andReturn(serviceDescriptor1).times(1);
}
- setupKerberosDescriptor(kerberosDescriptor, 1);
+ setupKerberosDescriptor(kerberosDescriptor);
setupStageFactory();
// This is a STRICT mock to help ensure that the end result is what we want.
@@ -2995,25 +2996,25 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(serviceComponentKerberosClient.getServiceComponentHosts()).andReturn(Collections.singletonMap("host1", schKerberosClient)).anyTimes();
final Service serviceKerberos = createStrictMock(Service.class);
- expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(serviceKerberos.getName()).andReturn(Service.Type.KERBEROS.name()).anyTimes();
expect(serviceKerberos.getServiceComponents())
.andReturn(Collections.singletonMap(Role.KERBEROS_CLIENT.name(), serviceComponentKerberosClient))
- .times(1);
+ .anyTimes();
final Service service1 = createStrictMock(Service.class);
- expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service1.getName()).andReturn("SERVICE1").anyTimes();
expect(service1.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
- .times(1);
+ .anyTimes();
final Service service2 = createStrictMock(Service.class);
- expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service2.getName()).andReturn("SERVICE2").anyTimes();
expect(service2.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
- .times(1);
+ .anyTimes();
final Map<String, String> kerberosEnvProperties = createMock(Map.class);
expect(kerberosEnvProperties.get("kdc_type")).andReturn("mit-kdc").anyTimes();
@@ -3110,7 +3111,7 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(kerberosDescriptor.getService("SERVICE1")).andReturn(serviceDescriptor1).times(1);
expect(kerberosDescriptor.getService("SERVICE3")).andReturn(serviceDescriptor3).times(1);
- setupKerberosDescriptor(kerberosDescriptor, 1);
+ setupKerberosDescriptor(kerberosDescriptor);
setupStageFactory();
// This is a STRICT mock to help ensure that the end result is what we want.
@@ -3210,26 +3211,26 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(serviceComponentKerberosClient.getName()).andReturn(Role.KERBEROS_CLIENT.name()).anyTimes();
expect(serviceComponentKerberosClient.getServiceComponentHosts()).andReturn(Collections.singletonMap("host1", schKerberosClient)).anyTimes();
- final Service serviceKerberos = createStrictMock(Service.class);
- expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ final Service serviceKerberos = createNiceMock(Service.class);
+ expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(serviceKerberos.getName()).andReturn(Service.Type.KERBEROS.name()).anyTimes();
expect(serviceKerberos.getServiceComponents())
.andReturn(Collections.singletonMap(Role.KERBEROS_CLIENT.name(), serviceComponentKerberosClient))
- .times(2);
+ .anyTimes();
- final Service service1 = createStrictMock(Service.class);
- expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ final Service service1 = createNiceMock(Service.class);
+ expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service1.getName()).andReturn("SERVICE1").anyTimes();
expect(service1.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
- .times(2);
+ .anyTimes();
- final Service service2 = createStrictMock(Service.class);
- expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ final Service service2 = createNiceMock(Service.class);
+ expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service2.getName()).andReturn("SERVICE2").anyTimes();
expect(service2.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
- .times(2);
+ .anyTimes();
expect(cluster.getClusterName()).andReturn("c1").anyTimes();
@@ -3291,7 +3292,7 @@ public class KerberosHelperTest extends EasyMockSupport {
final KerberosDescriptor kerberosDescriptor = createStrictMock(KerberosDescriptor.class);
expect(kerberosDescriptor.getProperties()).andReturn(null).once();
- setupKerberosDescriptor(kerberosDescriptor, 1);
+ setupKerberosDescriptor(kerberosDescriptor);
setupStageFactory();
// Preparation Stage
@@ -3384,26 +3385,26 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(serviceComponentKerberosClient.getName()).andReturn(Role.KERBEROS_CLIENT.name()).anyTimes();
expect(serviceComponentKerberosClient.getServiceComponentHosts()).andReturn(Collections.singletonMap("host1", schKerberosClient)).anyTimes();
- final Service serviceKerberos = createStrictMock(Service.class);
- expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ final Service serviceKerberos = createNiceMock(Service.class);
+ expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(serviceKerberos.getName()).andReturn(Service.Type.KERBEROS.name()).anyTimes();
expect(serviceKerberos.getServiceComponents())
.andReturn(Collections.singletonMap(Role.KERBEROS_CLIENT.name(), serviceComponentKerberosClient))
- .times(2);
+ .anyTimes();
- final Service service1 = createStrictMock(Service.class);
- expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ final Service service1 = createNiceMock(Service.class);
+ expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service1.getName()).andReturn("SERVICE1").anyTimes();
expect(service1.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
- .times(2);
+ .anyTimes();
- final Service service2 = createStrictMock(Service.class);
- expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ final Service service2 = createNiceMock(Service.class);
+ expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service2.getName()).andReturn("SERVICE2").anyTimes();
expect(service2.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
- .times(2);
+ .anyTimes();
final Map<String, String> kerberosEnvProperties = createMock(Map.class);
expect(kerberosEnvProperties.get("kdc_type")).andReturn("mit-kdc").anyTimes();
@@ -3466,7 +3467,7 @@ public class KerberosHelperTest extends EasyMockSupport {
final KerberosDescriptor kerberosDescriptor = createStrictMock(KerberosDescriptor.class);
expect(kerberosDescriptor.getProperties()).andReturn(null).once();
- setupKerberosDescriptor(kerberosDescriptor, 1);
+ setupKerberosDescriptor(kerberosDescriptor);
setupStageFactory();
// This is a STRICT mock to help ensure that the end result is what we want.
@@ -3558,22 +3559,22 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(serviceComponentKerberosClient.getName()).andReturn(Role.KERBEROS_CLIENT.name()).anyTimes();
expect(serviceComponentKerberosClient.getServiceComponentHosts()).andReturn(Collections.singletonMap("host1", schKerberosClient1)).anyTimes();
- final Service serviceKerberos = createStrictMock(Service.class);
- expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ final Service serviceKerberos = createNiceMock(Service.class);
+ expect(serviceKerberos.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(serviceKerberos.getName()).andReturn(Service.Type.KERBEROS.name()).anyTimes();
expect(serviceKerberos.getServiceComponents())
.andReturn(Collections.singletonMap(Role.KERBEROS_CLIENT.name(), serviceComponentKerberosClient))
.anyTimes();
- final Service service1 = createStrictMock(Service.class);
- expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ final Service service1 = createNiceMock(Service.class);
+ expect(service1.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service1.getName()).andReturn("SERVICE1").anyTimes();
expect(service1.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
.anyTimes();
- final Service service2 = createStrictMock(Service.class);
- expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2"));
+ final Service service2 = createNiceMock(Service.class);
+ expect(service2.getDesiredStackId()).andReturn(new StackId("HDP-2.2")).anyTimes();
expect(service2.getName()).andReturn("SERVICE2").anyTimes();
expect(service2.getServiceComponents())
.andReturn(Collections.<String, ServiceComponent>emptyMap())
@@ -3779,7 +3780,7 @@ public class KerberosHelperTest extends EasyMockSupport {
expect(kerberosDescriptor.getService("SERVICE1")).andReturn(serviceDescriptor1).anyTimes();
expect(kerberosDescriptor.getService("SERVICE2")).andReturn(serviceDescriptor2).anyTimes();
- setupKerberosDescriptor(kerberosDescriptor, 1);
+ setupKerberosDescriptor(kerberosDescriptor);
replayAll();
http://git-wip-us.apache.org/repos/asf/ambari/blob/89797ea2/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
index a63da61..7fb5624 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/KerberosDescriptorTest.java
@@ -493,4 +493,13 @@ public class KerberosDescriptorTest {
}});
Assert.assertEquals(1, identities.size());
}
+
+ @Test
+ public void testCollectPrincipalNames() throws Exception {
+ URL systemResourceURL = ClassLoader.getSystemResource("kerberos/test_get_referenced_identity_descriptor.json");
+ KerberosDescriptor descriptor = KERBEROS_DESCRIPTOR_FACTORY.createInstance(new File(systemResourceURL.getFile()));
+ Map<String, String> principalsPerComponent = descriptor.principals();
+ Assert.assertEquals("service2_component1@${realm}", principalsPerComponent.get("SERVICE2/SERVICE2_COMPONENT1/service2_component1_identity"));
+ Assert.assertEquals("service1@${realm}", principalsPerComponent.get("SERVICE1/service1_identity"));
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/89797ea2/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java
index f00f694..e46294a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelperTest.java
@@ -18,6 +18,8 @@
package org.apache.ambari.server.state.kerberos;
+import static junit.framework.Assert.assertEquals;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
@@ -72,63 +74,63 @@ public class VariableReplacementHelperTest {
}
};
- Assert.assertEquals("concrete",
- helper.replaceVariables("concrete", configurations));
+ assertEquals("concrete",
+ helper.replaceVariables("concrete", configurations));
- Assert.assertEquals("Hello World",
- helper.replaceVariables("${global_variable}", configurations));
+ assertEquals("Hello World",
+ helper.replaceVariables("${global_variable}", configurations));
- Assert.assertEquals("Replacement1",
- helper.replaceVariables("${config-type/variable.name}", configurations));
+ assertEquals("Replacement1",
+ helper.replaceVariables("${config-type/variable.name}", configurations));
- Assert.assertEquals("Replacement1|Replacement2",
- helper.replaceVariables("${config-type/variable.name}|${config-type2/variable.name}", configurations));
+ assertEquals("Replacement1|Replacement2",
+ helper.replaceVariables("${config-type/variable.name}|${config-type2/variable.name}", configurations));
- Assert.assertEquals("Replacement1|Replacement2|${config-type3/variable.name}",
- helper.replaceVariables("${config-type/variable.name}|${config-type2/variable.name}|${config-type3/variable.name}", configurations));
+ assertEquals("Replacement1|Replacement2|${config-type3/variable.name}",
+ helper.replaceVariables("${config-type/variable.name}|${config-type2/variable.name}|${config-type3/variable.name}", configurations));
- Assert.assertEquals("Replacement2|Replacement2",
- helper.replaceVariables("${config-type/variable.name1}|${config-type2/variable.name}", configurations));
+ assertEquals("Replacement2|Replacement2",
+ helper.replaceVariables("${config-type/variable.name1}|${config-type2/variable.name}", configurations));
- Assert.assertEquals("Replacement1_reference",
- helper.replaceVariables("${config-type/variable.name}_reference", configurations));
+ assertEquals("Replacement1_reference",
+ helper.replaceVariables("${config-type/variable.name}_reference", configurations));
- Assert.assertEquals("dash",
- helper.replaceVariables("${variable-name}", configurations));
+ assertEquals("dash",
+ helper.replaceVariables("${variable-name}", configurations));
- Assert.assertEquals("underscore",
- helper.replaceVariables("${variable_name}", configurations));
+ assertEquals("underscore",
+ helper.replaceVariables("${variable_name}", configurations));
- Assert.assertEquals("config_type_dot",
- helper.replaceVariables("${config_type/variable.name}", configurations));
+ assertEquals("config_type_dot",
+ helper.replaceVariables("${config_type/variable.name}", configurations));
- Assert.assertEquals("config_type_dash",
- helper.replaceVariables("${config_type/variable-name}", configurations));
+ assertEquals("config_type_dash",
+ helper.replaceVariables("${config_type/variable-name}", configurations));
- Assert.assertEquals("config_type_underscore",
- helper.replaceVariables("${config_type/variable_name}", configurations));
+ assertEquals("config_type_underscore",
+ helper.replaceVariables("${config_type/variable_name}", configurations));
- Assert.assertEquals("config.type_dot",
- helper.replaceVariables("${config.type/variable.name}", configurations));
+ assertEquals("config.type_dot",
+ helper.replaceVariables("${config.type/variable.name}", configurations));
- Assert.assertEquals("config.type_dash",
- helper.replaceVariables("${config.type/variable-name}", configurations));
+ assertEquals("config.type_dash",
+ helper.replaceVariables("${config.type/variable-name}", configurations));
- Assert.assertEquals("config.type_underscore",
- helper.replaceVariables("${config.type/variable_name}", configurations));
+ assertEquals("config.type_underscore",
+ helper.replaceVariables("${config.type/variable_name}", configurations));
- Assert.assertEquals("dot",
- helper.replaceVariables("${variable.name}", configurations));
+ assertEquals("dot",
+ helper.replaceVariables("${variable.name}", configurations));
// Replacement yields an empty string
- Assert.assertEquals("",
- helper.replaceVariables("${config-type/variable.name2}", configurations));
+ assertEquals("",
+ helper.replaceVariables("${config-type/variable.name2}", configurations));
// This might cause an infinite loop... we assume protection is in place...
try {
- Assert.assertEquals("${config-type2/self_reference}",
- helper.replaceVariables("${config-type2/self_reference}", configurations));
+ assertEquals("${config-type2/self_reference}",
+ helper.replaceVariables("${config-type2/self_reference}", configurations));
Assert.fail(String.format("%s expected to be thrown", AmbariException.class.getName()));
} catch (AmbariException e) {
// This is expected...
@@ -146,14 +148,14 @@ public class VariableReplacementHelperTest {
}
};
- Assert.assertEquals("hive.metastore.local=false,hive.metastore.uris=thrift://c6401.ambari.apache.org:9083,hive.metastore.sasl.enabled=true,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse,hive.exec.mode.local.auto=false,hive.metastore.kerberos.principal=hive/_HOST@EXAMPLE.COM",
- helper.replaceVariables("hive.metastore.local=false,hive.metastore.uris=thrift://${host}:9083,hive.metastore.sasl.enabled=true,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse,hive.exec.mode.local.auto=false,hive.metastore.kerberos.principal=hive/_HOST@${realm}", configurations));
+ assertEquals("hive.metastore.local=false,hive.metastore.uris=thrift://c6401.ambari.apache.org:9083,hive.metastore.sasl.enabled=true,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse,hive.exec.mode.local.auto=false,hive.metastore.kerberos.principal=hive/_HOST@EXAMPLE.COM",
+ helper.replaceVariables("hive.metastore.local=false,hive.metastore.uris=thrift://${host}:9083,hive.metastore.sasl.enabled=true,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse,hive.exec.mode.local.auto=false,hive.metastore.kerberos.principal=hive/_HOST@${realm}", configurations));
- Assert.assertEquals("Hello my realm is {EXAMPLE.COM}",
- helper.replaceVariables("Hello my realm is {${realm}}", configurations));
+ assertEquals("Hello my realm is {EXAMPLE.COM}",
+ helper.replaceVariables("Hello my realm is {${realm}}", configurations));
- Assert.assertEquals("$c6401.ambari.apache.org",
- helper.replaceVariables("$${host}", configurations));
+ assertEquals("$c6401.ambari.apache.org",
+ helper.replaceVariables("$${host}", configurations));
}
@Test
@@ -168,7 +170,7 @@ public class VariableReplacementHelperTest {
put("kafka-broker", new HashMap<String, String>() {{
put("listeners", "PLAINTEXT://localhost:6667");
}});
-
+
put("clusterHostInfo", new HashMap<String, String>() {{
put("hive_metastore_host", "host1.unit.test, host2.unit.test , host3.unit.test"); // spaces are there on purpose.
}});
@@ -182,11 +184,11 @@ public class VariableReplacementHelperTest {
}
};
- Assert.assertEquals("test=thrift://one:9083\\,thrift://two:9083\\,thrift://three:9083\\,thrift://four:9083",
- helper.replaceVariables("test=${delimited.data|each(thrift://%s:9083, \\\\,, \\s*\\,\\s*)}", configurations));
+ assertEquals("test=thrift://one:9083\\,thrift://two:9083\\,thrift://three:9083\\,thrift://four:9083",
+ helper.replaceVariables("test=${delimited.data|each(thrift://%s:9083, \\\\,, \\s*\\,\\s*)}", configurations));
- Assert.assertEquals("hive.metastore.local=false,hive.metastore.uris=thrift://host1.unit.test:9083\\,thrift://host2.unit.test:9083\\,thrift://host3.unit.test:9083,hive.metastore.sasl.enabled=true,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse,hive.exec.mode.local.auto=false,hive.metastore.kerberos.principal=hive/_HOST@UNIT.TEST",
- helper.replaceVariables("hive.metastore.local=false,hive.metastore.uris=${clusterHostInfo/hive_metastore_host | each(thrift://%s:9083, \\\\,, \\s*\\,\\s*)},hive.metastore.sasl.enabled=true,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse,hive.exec.mode.local.auto=false,hive.metastore.kerberos.principal=hive/_HOST@${realm}", configurations));
+ assertEquals("hive.metastore.local=false,hive.metastore.uris=thrift://host1.unit.test:9083\\,thrift://host2.unit.test:9083\\,thrift://host3.unit.test:9083,hive.metastore.sasl.enabled=true,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse,hive.exec.mode.local.auto=false,hive.metastore.kerberos.principal=hive/_HOST@UNIT.TEST",
+ helper.replaceVariables("hive.metastore.local=false,hive.metastore.uris=${clusterHostInfo/hive_metastore_host | each(thrift://%s:9083, \\\\,, \\s*\\,\\s*)},hive.metastore.sasl.enabled=true,hive.metastore.execute.setugi=true,hive.metastore.warehouse.dir=/apps/hive/warehouse,hive.exec.mode.local.auto=false,hive.metastore.kerberos.principal=hive/_HOST@${realm}", configurations));
List<String> expected;
List<String> actual;
@@ -195,38 +197,52 @@ public class VariableReplacementHelperTest {
actual = new LinkedList<>(Arrays.asList(helper.replaceVariables("${foobar-site/hello | append(foobar-site/data, \\,, true)}", configurations).split(",")));
Collections.sort(expected);
Collections.sort(actual);
- Assert.assertEquals(expected, actual);
+ assertEquals(expected, actual);
expected = new LinkedList<>(Arrays.asList("four", "hello", "one", "there", "three", "two"));
actual = new LinkedList<>(Arrays.asList(helper.replaceVariables("${foobar-site/hello_there | append(foobar-site/data, \\,, true)}", configurations).split(",")));
Collections.sort(expected);
Collections.sort(actual);
- Assert.assertEquals(expected, actual);
+ assertEquals(expected, actual);
expected = new LinkedList<>(Arrays.asList("four", "hello", "one", "there", "three", "two"));
actual = new LinkedList<>(Arrays.asList(helper.replaceVariables("${foobar-site/hello_there_one | append(foobar-site/data, \\,, true)}", configurations).split(",")));
Collections.sort(expected);
Collections.sort(actual);
- Assert.assertEquals(expected, actual);
+ assertEquals(expected, actual);
expected = new LinkedList<>(Arrays.asList("four", "hello", "one", "one", "there", "three", "two"));
actual = new LinkedList<>(Arrays.asList(helper.replaceVariables("${foobar-site/hello_there_one | append(foobar-site/data, \\,, false)}", configurations).split(",")));
Collections.sort(expected);
Collections.sort(actual);
- Assert.assertEquals(expected, actual);
+ assertEquals(expected, actual);
// Test invalid number of arguments.
try {
helper.replaceVariables("${foobar-site/hello_there_one | append(foobar-site/data, \\,)}", configurations);
Assert.fail("Expected IllegalArgumentException");
- }
- catch (IllegalArgumentException e) {
+ } catch (IllegalArgumentException e) {
// Ignore this is expected.
}
- Assert.assertEquals("test=unit.test", helper.replaceVariables("test=${realm|toLower()}", configurations));
-
- Assert.assertEquals("PLAINTEXTSASL://localhost:6667", helper.replaceVariables("${kafka-broker/listeners|replace(\\bPLAINTEXT\\b,PLAINTEXTSASL)}", configurations));
+ assertEquals("test=unit.test", helper.replaceVariables("test=${realm|toLower()}", configurations));
+
+ assertEquals("PLAINTEXTSASL://localhost:6667", helper.replaceVariables("${kafka-broker/listeners|replace(\\bPLAINTEXT\\b,PLAINTEXTSASL)}", configurations));
}
-}
+ @Test
+ public void testReplacePrincipalWithPrimary() throws AmbariException {
+ Map<String, Map<String, String>> config = new HashMap<String, Map<String, String>>() {
+ {
+ put("principals", new HashMap<String, String>() {{
+ put("resource_manager_rm", "rm/HOST@EXAMPLE.COM");
+ put("hive_server_hive", "hive@EXAMPLE.COM");
+ put("hdfs", "hdfs");
+ }});
+ }
+ };
+ assertEquals("hdfs", helper.replaceVariables("${principals/hdfs|principalPrimary()}", config));
+ assertEquals("rm", helper.replaceVariables("${principals/resource_manager_rm|principalPrimary()}", config));
+ assertEquals("hive", helper.replaceVariables("${principals/hive_server_hive|principalPrimary()}", config));
+ }
+}
\ No newline at end of file
[44/50] [abbrv] ambari git commit: AMBARI-21202 - YARN service
advisor has spelling error in yarn-site
Posted by rl...@apache.org.
AMBARI-21202 - YARN service advisor has spelling error in yarn-site
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7dc91c5a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7dc91c5a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7dc91c5a
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 7dc91c5a8e75966f642a4890ed7a5750687b5928
Parents: aa6b330
Author: Tim Thorpe <tt...@apache.org>
Authored: Thu Jun 8 08:49:32 2017 -0700
Committer: Tim Thorpe <tt...@apache.org>
Committed: Thu Jun 8 08:49:32 2017 -0700
----------------------------------------------------------------------
.../resources/common-services/YARN/3.0.0.3.0/service_advisor.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/7dc91c5a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py
index 3dd39e5..0fb538d 100644
--- a/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py
+++ b/ambari-server/src/main/resources/common-services/YARN/3.0.0.3.0/service_advisor.py
@@ -1796,7 +1796,7 @@ class YARNValidator(service_advisor.ServiceAdvisor):
self.validators = [("yarn-site", self.validateYARNSiteConfigurationsFromHDP206),
("yarn-site", self.validateYARNSiteConfigurationsFromHDP25),
- ("yarn-ste" , self.validateYarnSiteConfigurationsFromHDP26),
+ ("yarn-site" , self.validateYARNSiteConfigurationsFromHDP26),
("yarn-env", self.validateYARNEnvConfigurationsFromHDP206),
("yarn-env", self.validateYARNEnvConfigurationsFromHDP22),
("ranger-yarn-plugin-properties", self.validateYARNRangerPluginConfigurationsFromHDP22)]
@@ -1853,7 +1853,7 @@ class YARNValidator(service_advisor.ServiceAdvisor):
validationProblems = self.toConfigurationValidationProblems(validationItems, "yarn-site")
return validationProblems
- def validateYarnSiteConfigurationsFromHDP26(self, properties, recommendedDefaults, configurations, services, hosts):
+ def validateYARNSiteConfigurationsFromHDP26(self, properties, recommendedDefaults, configurations, services, hosts):
validationItems = []
siteProperties = services["configurations"]["yarn-site"]["properties"]
if services["configurations"]["yarn-site"]["properties"]["yarn.http.policy"] == 'HTTP_ONLY':
[27/50] [abbrv] ambari git commit: AMBARI-20884. Compilation error
due to import from relocated package
Posted by rl...@apache.org.
AMBARI-20884. Compilation error due to import from relocated package
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e61fea51
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e61fea51
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e61fea51
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: e61fea51b5ffb9c74f746810713a7d9f1f27184f
Parents: d8d5868
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Tue Jun 6 13:08:21 2017 +0200
Committer: Attila Doroszlai <ad...@hortonworks.com>
Committed: Tue Jun 6 13:09:50 2017 +0200
----------------------------------------------------------------------
.../java/org/apache/ambari/server/orm/entities/UpgradeEntity.java | 3 ++-
.../apache/ambari/server/orm/entities/UpgradeHistoryEntity.java | 3 ++-
.../ambari/server/serveraction/upgrades/UpgradeActionTest.java | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/e61fea51/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java
index 975d6a6..43b2e08 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeEntity.java
@@ -41,7 +41,8 @@ import org.apache.ambari.server.actionmanager.HostRoleStatus;
import org.apache.ambari.server.state.stack.upgrade.Direction;
import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.hadoop.metrics2.sink.relocated.google.common.base.Objects;
+
+import com.google.common.base.Objects;
/**
* Models the data representation of an upgrade
http://git-wip-us.apache.org/repos/asf/ambari/blob/e61fea51/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeHistoryEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeHistoryEntity.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeHistoryEntity.java
index 8bfafd3..0f7ac72 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeHistoryEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/UpgradeHistoryEntity.java
@@ -31,7 +31,8 @@ import javax.persistence.TableGenerator;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.hadoop.metrics2.sink.relocated.google.common.base.Objects;
+
+import com.google.common.base.Objects;
/**
* The {@link UpgradeHistoryEntity} represents the version history of components
http://git-wip-us.apache.org/repos/asf/ambari/blob/e61fea51/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
index 35fffda..b6fa6d2 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
@@ -79,7 +79,7 @@ import org.apache.ambari.server.state.UpgradeState;
import org.apache.ambari.server.state.stack.UpgradePack;
import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
import org.apache.ambari.server.utils.EventBusSynchronizer;
-import org.apache.hadoop.metrics2.sink.relocated.commons.lang.StringUtils;
+import org.apache.commons.lang.StringUtils;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
[12/50] [abbrv] ambari git commit: AMBARI-21176. Oozie server start
failed during cluster deploy with "NameError: global name "out" is not
defined".(vbrodetskyi)
Posted by rl...@apache.org.
AMBARI-21176. Oozie server start failed during cluster deploy with "NameError: global name "out" is not defined".(vbrodetskyi)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9acb7a64
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9acb7a64
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9acb7a64
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 9acb7a64444d5cc1e0ebc648f0e6413f6f949ac1
Parents: 201c6d0
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Fri Jun 2 22:01:12 2017 +0300
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Fri Jun 2 22:03:22 2017 +0300
----------------------------------------------------------------------
.../OOZIE/4.0.0.2.0/package/scripts/oozie.py | 9 ++-------
.../OOZIE/4.2.0.3.0/package/scripts/oozie.py | 9 ++-------
2 files changed, 4 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9acb7a64/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
index def0545..d916d3b 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
@@ -38,7 +38,7 @@ from resource_management.libraries.resources.xml_config import XmlConfig
from resource_management.libraries.script.script import Script
from resource_management.libraries.functions.security_commons import update_credential_provider_path
from resource_management.core.resources.packaging import Package
-from resource_management.core.shell import as_user, as_sudo, call
+from resource_management.core.shell import as_user, as_sudo, call, checked_call
from resource_management.core.exceptions import Fail
from resource_management.libraries.functions.setup_atlas_hook import has_atlas_in_cluster, setup_atlas_hook
@@ -409,12 +409,7 @@ def copy_atlas_hive_hook_to_dfs_share_lib(upgrade_type=None, upgrade_direction=N
# This can return over 100 files, so take the first 5 lines after "Available ShareLib"
# Use -oozie http(s):localhost:{oozie_server_admin_port}/oozie as oozie-env does not export OOZIE_URL
command = format(r'source {conf_dir}/oozie-env.sh ; oozie admin -oozie {oozie_base_url} -shareliblist hive | grep "\[Available ShareLib\]" -A 5')
- Execute(command,
- user=params.oozie_user,
- tries=10,
- try_sleep=5,
- logoutput=True,
- )
+ code, out = checked_call(command, user=params.oozie_user, tries=10, try_sleep=5, logoutput=True)
hive_sharelib_dir = __parse_sharelib_from_output(out)
http://git-wip-us.apache.org/repos/asf/ambari/blob/9acb7a64/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py b/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py
index def0545..d916d3b 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.2.0.3.0/package/scripts/oozie.py
@@ -38,7 +38,7 @@ from resource_management.libraries.resources.xml_config import XmlConfig
from resource_management.libraries.script.script import Script
from resource_management.libraries.functions.security_commons import update_credential_provider_path
from resource_management.core.resources.packaging import Package
-from resource_management.core.shell import as_user, as_sudo, call
+from resource_management.core.shell import as_user, as_sudo, call, checked_call
from resource_management.core.exceptions import Fail
from resource_management.libraries.functions.setup_atlas_hook import has_atlas_in_cluster, setup_atlas_hook
@@ -409,12 +409,7 @@ def copy_atlas_hive_hook_to_dfs_share_lib(upgrade_type=None, upgrade_direction=N
# This can return over 100 files, so take the first 5 lines after "Available ShareLib"
# Use -oozie http(s):localhost:{oozie_server_admin_port}/oozie as oozie-env does not export OOZIE_URL
command = format(r'source {conf_dir}/oozie-env.sh ; oozie admin -oozie {oozie_base_url} -shareliblist hive | grep "\[Available ShareLib\]" -A 5')
- Execute(command,
- user=params.oozie_user,
- tries=10,
- try_sleep=5,
- logoutput=True,
- )
+ code, out = checked_call(command, user=params.oozie_user, tries=10, try_sleep=5, logoutput=True)
hive_sharelib_dir = __parse_sharelib_from_output(out)
[04/50] [abbrv] ambari git commit: AMBARI-21120: Roles below Cluster
Administrator should not be allowed to edit repositories and install stack
versions (sangeetar)
Posted by rl...@apache.org.
AMBARI-21120: Roles below Cluster Administrator should not be allowed to edit repositories and install stack versions (sangeetar)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7a0eda7e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7a0eda7e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7a0eda7e
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 7a0eda7ec99882fd40bdd6b036e2301f6e0486da
Parents: 851c857
Author: Sangeeta Ravindran <sa...@apache.org>
Authored: Thu Jun 1 10:47:29 2017 -0700
Committer: Sangeeta Ravindran <sa...@apache.org>
Committed: Thu Jun 1 10:47:29 2017 -0700
----------------------------------------------------------------------
.../views/main/admin/stack_upgrade/upgrade_version_box_view.js | 4 ++--
.../main/admin/stack_upgrade/upgrade_version_box_view_test.js | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/7a0eda7e/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
index f102402..bb0cc81 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
@@ -61,7 +61,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
}.property('App.upgradeState', 'content.displayName', 'controller.upgradeVersion'),
isRepoUrlsEditDisabled: function () {
- return ['INSTALLING', 'UPGRADING'].contains(this.get('content.status')) || this.get('isUpgrading') || (!App.isAuthorized('AMBARI.MANAGE_STACK_VERSIONS') && this.get('content.status') === 'CURRENT');
+ return ['INSTALLING', 'UPGRADING'].contains(this.get('content.status')) || this.get('isUpgrading') || (!App.isAuthorized('AMBARI.MANAGE_STACK_VERSIONS'));
}.property('content.status', 'isUpgrading'),
/**
@@ -231,7 +231,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
element.set('isDisabled', this.get('controller.requestInProgress'));
}
//For restricted upgrade wizard should be disabled in any state
- if (this.get('controller.isWizardRestricted')) {
+ if (this.get('controller.isWizardRestricted') || (!App.isAuthorized('CLUSTER.UPGRADE_DOWNGRADE_STACK'))) {
element.set('isDisabled', true);
}
return element;
http://git-wip-us.apache.org/repos/asf/ambari/blob/7a0eda7e/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
index 153b66f..31aa796 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
@@ -465,7 +465,7 @@ describe('App.UpgradeVersionBoxView', function () {
status: 'INIT',
isButton: true,
buttons: [],
- isDisabled: false
+ isDisabled: true
},
title: 'INIT state, no admin access, no requests in progress'
},
@@ -962,7 +962,7 @@ describe('App.UpgradeVersionBoxView', function () {
isButton: true,
action: 'resumeUpgrade',
text: Em.I18n.t('admin.stackUpgrade.dialog.resume'),
- isDisabled: false
+ isDisabled: true
},
title: 'upgrade suspended'
},
[16/50] [abbrv] ambari git commit: AMBARI-21129. Nimbus fails to
start when Ambari is upgraded to 2.5.1, EU to HDP 2.6.1,
and cluster is then Kerberized (alejandro)
Posted by rl...@apache.org.
AMBARI-21129. Nimbus fails to start when Ambari is upgraded to 2.5.1, EU to HDP 2.6.1, and cluster is then Kerberized (alejandro)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3f908852
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3f908852
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3f908852
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 3f9088524e276671fb0ea8252ce7c1f7ea149cda
Parents: 57f4461
Author: Alejandro Fernandez <af...@hortonworks.com>
Authored: Fri Jun 2 15:33:09 2017 -0700
Committer: Alejandro Fernandez <af...@hortonworks.com>
Committed: Fri Jun 2 15:33:09 2017 -0700
----------------------------------------------------------------------
.../server/upgrade/UpgradeCatalog251.java | 45 +++++++++++++++++++-
.../internal/UpgradeResourceProviderTest.java | 1 -
.../server/upgrade/UpgradeCatalog251Test.java | 13 ++++--
3 files changed, 53 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/3f908852/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java
index 9255daf..119d9ce 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java
@@ -1,4 +1,4 @@
-/*
+/**
* 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
@@ -19,6 +19,7 @@ package org.apache.ambari.server.upgrade;
import java.sql.SQLException;
import java.util.Collections;
+import java.util.HashMap;
import java.util.Map;
import java.util.Set;
@@ -50,6 +51,7 @@ public class UpgradeCatalog251 extends AbstractUpgradeCatalog {
private static final String REQUEST_TABLE = "request";
private static final String CLUSTER_HOST_INFO_COLUMN = "cluster_host_info";
private static final String REQUEST_ID_COLUMN = "request_id";
+ protected static final String STORM_ENV_CONFIG = "storm-env";
/**
@@ -106,6 +108,7 @@ public class UpgradeCatalog251 extends AbstractUpgradeCatalog {
protected void executeDMLUpdates() throws AmbariException, SQLException {
addNewConfigurationsFromXml();
updateKAFKAConfigs();
+ updateSTORMConfigs();
}
/**
@@ -166,4 +169,44 @@ public class UpgradeCatalog251 extends AbstractUpgradeCatalog {
dbAccessor.moveColumnToAnotherTable(STAGE_TABLE, sourceColumn, REQUEST_ID_COLUMN, REQUEST_TABLE, targetColumn,
REQUEST_ID_COLUMN, false);
}
+
+ /**
+ * Make sure storm-env changes are applied to anyone upgrading to HDP-2.6.1 Storm
+ * If the base version was before Ambari 2.5.0, this method should wind up doing nothing.
+ * @throws AmbariException
+ */
+ protected void updateSTORMConfigs() throws AmbariException {
+ AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class);
+ Clusters clusters = ambariManagementController.getClusters();
+ if (clusters != null) {
+ Map<String, Cluster> clusterMap = getCheckedClusterMap(clusters);
+ if (clusterMap != null && !clusterMap.isEmpty()) {
+ for (final Cluster cluster : clusterMap.values()) {
+ Set<String> installedServices = cluster.getServices().keySet();
+
+ // Technically, this should be added when the cluster is Kerberized on HDP 2.6.1, but is safe to add even
+ // without security or on an older stack version (such as HDP 2.5)
+ // The problem is that Kerberizing a cluster does not invoke Stack Advisor and has no easy way of setting
+ // these configs, so instead, add them as long as Storm is present.
+ if (installedServices.contains("STORM")) {
+ Config stormEnv = cluster.getDesiredConfigByType(STORM_ENV_CONFIG);
+ String content = stormEnv.getProperties().get("content");
+ if (content != null && !content.contains("STORM_AUTOCREDS_LIB_DIR")) {
+ Map<String, String> newProperties = new HashMap<>();
+ String stormEnvConfigs = "\n# set storm-auto creds\n" +
+ "# check if storm_jaas.conf in config, only enable storm_auto_creds in secure mode.\n" +
+ "STORM_JAAS_CONF=$STORM_HOME/conf/storm_jaas.conf\n" +
+ "STORM_AUTOCREDS_LIB_DIR=$STORM_HOME/external/storm-autocreds\n" +
+ "if [ -f $STORM_JAAS_CONF ] && [ -d $STORM_AUTOCREDS_LIB_DIR ]; then\n" +
+ " export STORM_EXT_CLASSPATH=$STORM_AUTOCREDS_LIB_DIR\n" +
+ "fi\n";
+ content += stormEnvConfigs;
+ newProperties.put("content", content);
+ updateConfigurationPropertiesForCluster(cluster, "storm-env", newProperties, true, false);
+ }
+ }
+ }
+ }
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3f908852/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
index a4f5e9a..8f59c07 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
@@ -96,7 +96,6 @@ import org.apache.ambari.server.state.UpgradeContext;
import org.apache.ambari.server.state.UpgradeHelper;
import org.apache.ambari.server.state.UpgradeState;
import org.apache.ambari.server.state.stack.upgrade.Direction;
-import org.apache.ambari.server.state.stack.upgrade.StageWrapper;
import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
import org.apache.ambari.server.topology.TopologyManager;
import org.apache.ambari.server.utils.StageUtils;
http://git-wip-us.apache.org/repos/asf/ambari/blob/3f908852/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog251Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog251Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog251Test.java
index fda5f0e..5750e04 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog251Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog251Test.java
@@ -178,13 +178,15 @@ public class UpgradeCatalog251Test {
@Test
public void testExecuteDMLUpdates() throws Exception {
- Method updateKAFKAConfigs = UpgradeCatalog251.class.getDeclaredMethod("updateKAFKAConfigs");
Method addNewConfigurationsFromXml = AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml");
+ Method updateKAFKAConfigs = UpgradeCatalog251.class.getDeclaredMethod("updateKAFKAConfigs");
+ Method updateSTORMConfigs = UpgradeCatalog251.class.getDeclaredMethod("updateSTORMConfigs");
UpgradeCatalog251 upgradeCatalog251 = createMockBuilder(UpgradeCatalog251.class)
- .addMockedMethod(updateKAFKAConfigs)
- .addMockedMethod(addNewConfigurationsFromXml)
- .createMock();
+ .addMockedMethod(addNewConfigurationsFromXml)
+ .addMockedMethod(updateKAFKAConfigs)
+ .addMockedMethod(updateSTORMConfigs)
+ .createMock();
upgradeCatalog251.addNewConfigurationsFromXml();
expectLastCall().once();
@@ -194,6 +196,9 @@ public class UpgradeCatalog251Test {
upgradeCatalog251.updateKAFKAConfigs();
expectLastCall().once();
+
+ upgradeCatalog251.updateSTORMConfigs();
+ expectLastCall().once();
replay(upgradeCatalog251, dbAccessor);
[40/50] [abbrv] ambari git commit: AMBARI-21182. Agent Host Disk
Usage Alert Hardcodes the Stack Directory (aonishuk)
Posted by rl...@apache.org.
AMBARI-21182. Agent Host Disk Usage Alert Hardcodes the Stack Directory (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d21d434a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d21d434a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d21d434a
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: d21d434a16ec3078f9c2098327b559476bab8bb1
Parents: 3146a19
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Jun 8 15:14:17 2017 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Jun 8 15:14:17 2017 +0300
----------------------------------------------------------------------
.../src/test/python/host_scripts/TestAlertDiskSpace.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/d21d434a/ambari-server/src/test/python/host_scripts/TestAlertDiskSpace.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/host_scripts/TestAlertDiskSpace.py b/ambari-server/src/test/python/host_scripts/TestAlertDiskSpace.py
index 90a5a1e..0d47061 100644
--- a/ambari-server/src/test/python/host_scripts/TestAlertDiskSpace.py
+++ b/ambari-server/src/test/python/host_scripts/TestAlertDiskSpace.py
@@ -41,7 +41,7 @@ class TestAlertDiskSpace(RMFTestCase):
total = 21673930752L, used = 5695861760L,
free = 15978068992L, path="/")
- res = alert_disk_space.execute()
+ res = alert_disk_space.execute(configurations={'{{cluster-env/stack_root}}': '/usr/hdp'})
self.assertEqual(res,
('OK', ['Capacity Used: [26.28%, 5.7 GB], Capacity Total: [21.7 GB], path=/']))
@@ -50,7 +50,7 @@ class TestAlertDiskSpace(RMFTestCase):
total = 21673930752L, used = 14521533603L,
free = 7152397149L, path="/")
- res = alert_disk_space.execute()
+ res = alert_disk_space.execute(configurations={'{{cluster-env/stack_root}}': '/usr/hdp'})
self.assertEqual(res, (
'WARNING',
['Capacity Used: [67.00%, 14.5 GB], Capacity Total: [21.7 GB], path=/']))
@@ -60,7 +60,7 @@ class TestAlertDiskSpace(RMFTestCase):
total = 21673930752L, used = 20590234214L,
free = 1083696538, path="/")
- res = alert_disk_space.execute()
+ res = alert_disk_space.execute(configurations={'{{cluster-env/stack_root}}': '/usr/hdp'})
self.assertEqual(res, ('CRITICAL',
['Capacity Used: [95.00%, 20.6 GB], Capacity Total: [21.7 GB], path=/']))
@@ -69,7 +69,7 @@ class TestAlertDiskSpace(RMFTestCase):
total = 5418482688L, used = 1625544806L,
free = 3792937882L, path="/")
- res = alert_disk_space.execute()
+ res = alert_disk_space.execute(configurations={'{{cluster-env/stack_root}}': '/usr/hdp'})
self.assertEqual(res, ('WARNING', [
'Capacity Used: [30.00%, 1.6 GB], Capacity Total: [5.4 GB], path=/. Total free space is less than 5.0 GB']))
@@ -81,7 +81,7 @@ class TestAlertDiskSpace(RMFTestCase):
total = 21673930752L, used = 5695861760L,
free = 15978068992L, path="/usr/hdp")
- res = alert_disk_space.execute()
+ res = alert_disk_space.execute(configurations={'{{cluster-env/stack_root}}': '/usr/hdp'})
self.assertEqual(res,
('OK', ['Capacity Used: [26.28%, 5.7 GB], Capacity Total: [21.7 GB], path=/usr/hdp']))
@@ -90,6 +90,6 @@ class TestAlertDiskSpace(RMFTestCase):
total = 5418482688L, used = 1625544806L,
free = 3792937882L, path="/usr/hdp")
- res = alert_disk_space.execute()
+ res = alert_disk_space.execute(configurations={'{{cluster-env/stack_root}}': '/usr/hdp'})
self.assertEqual(res, (
'WARNING', ["Capacity Used: [30.00%, 1.6 GB], Capacity Total: [5.4 GB], path=/usr/hdp. Total free space is less than 5.0 GB"]))
[21/50] [abbrv] ambari git commit: AMBARI-21164. Upgrades (RU/EU) :
"stack.upgrade.bypass.prechecks" config is not honored while doing upgrades
with bad entries in "execution_command" table. (aonishuk)
Posted by rl...@apache.org.
AMBARI-21164. Upgrades (RU/EU) : "stack.upgrade.bypass.prechecks" config is not honored while doing upgrades with bad entries in "execution_command" table. (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b3425c98
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b3425c98
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b3425c98
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: b3425c9841b4153b1cf3b15dc6f55e67f1754f3b
Parents: 499814a
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue Jun 6 13:39:20 2017 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue Jun 6 13:39:20 2017 +0300
----------------------------------------------------------------------
.../server/checks/AbstractCheckDescriptor.java | 7 ----
.../checks/ServiceCheckValidityCheck.java | 9 +++--
.../PreUpgradeCheckResourceProvider.java | 6 ++-
.../apache/ambari/server/state/CheckHelper.java | 37 ++++++++-----------
.../checks/ServiceCheckValidityCheckTest.java | 39 +++++++++++++++++++-
.../PreUpgradeCheckResourceProviderTest.java | 15 +++++++-
.../sample/checks/SampleServiceCheck.java | 4 --
.../ambari/server/state/CheckHelperTest.java | 36 ++++++++++++------
8 files changed, 104 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/b3425c98/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java b/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
index a0affd0..fddded7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
@@ -335,11 +335,4 @@ public abstract class AbstractCheckDescriptor {
return false;
}
- /**
- * Return a boolean indicating whether or not configs allow bypassing errors during the RU/EU PreChecks.
- * @return
- */
- public boolean isStackUpgradeAllowedToBypassPreChecks() {
- return config.isUpgradePrecheckBypass();
- }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b3425c98/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java
index 750b25e..ad68a2c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java
@@ -78,8 +78,10 @@ public class ServiceCheckValidityCheck extends AbstractCheckDescriptor {
private static SortRequest sortRequest = new SortRequestImpl(sortRequestProperties);
private static final PageRequestImpl PAGE_REQUEST = new PageRequestImpl(PageRequest.StartingPoint.End, 1000, 0, null, null);
private static final RequestImpl REQUEST = new RequestImpl(null, null, null, null, sortRequest, PAGE_REQUEST);
- private static final Predicate PREDICATE = new PredicateBuilder().property(TaskResourceProvider.TASK_COMMAND_PROPERTY_ID)
- .equals(RoleCommand.SERVICE_CHECK.name()).toPredicate();
+ private static final Predicate PREDICATE = new PredicateBuilder()
+ .property(TaskResourceProvider.TASK_COMMAND_PROPERTY_ID).equals(RoleCommand.SERVICE_CHECK.name())
+ .and().property(TaskResourceProvider.TASK_START_TIME_PROPERTY_ID).greaterThan(-1)
+ .toPredicate();
@@ -89,6 +91,7 @@ public class ServiceCheckValidityCheck extends AbstractCheckDescriptor {
@Inject
Provider<HostRoleCommandDAO> hostRoleCommandDAOProvider;
+
/**
* Constructor.
*/
@@ -147,7 +150,7 @@ public class ServiceCheckValidityCheck extends AbstractCheckDescriptor {
boolean serviceCheckWasExecuted = false;
for (HostRoleCommandEntity command : latestTimestamps.values()) {
- if (command.getCommandDetail().contains(serviceName)) {
+ if (null != command.getCommandDetail() && command.getCommandDetail().contains(serviceName)) {
serviceCheckWasExecuted = true;
Long serviceCheckTimestamp = command.getStartTime();
http://git-wip-us.apache.org/repos/asf/ambari/blob/b3425c98/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
index afbd981..8f00456 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
@@ -29,6 +29,7 @@ import org.apache.ambari.server.ParentObjectNotFoundException;
import org.apache.ambari.server.StaticallyInject;
import org.apache.ambari.server.checks.AbstractCheckDescriptor;
import org.apache.ambari.server.checks.UpgradeCheckRegistry;
+import org.apache.ambari.server.configuration.Configuration;
import org.apache.ambari.server.controller.AmbariManagementController;
import org.apache.ambari.server.controller.PrereqCheckRequest;
import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
@@ -95,6 +96,9 @@ public class PreUpgradeCheckResourceProvider extends ReadOnlyResourceProvider {
private static Provider<UpgradeHelper> upgradeHelper;
@Inject
+ private static Provider<Configuration> config;
+
+ @Inject
private static CheckHelper checkHelper;
private static Set<String> pkPropertyIds = Collections.singleton(UPGRADE_CHECK_ID_PROPERTY_ID);
@@ -206,7 +210,7 @@ public class PreUpgradeCheckResourceProvider extends ReadOnlyResourceProvider {
LOG.error("Failed to register custom prechecks for the services", e);
}
- for (PrerequisiteCheck prerequisiteCheck : checkHelper.performChecks(upgradeCheckRequest, upgradeChecksToRun)) {
+ for (PrerequisiteCheck prerequisiteCheck : checkHelper.performChecks(upgradeCheckRequest, upgradeChecksToRun, config.get())) {
final Resource resource = new ResourceImpl(Resource.Type.PreUpgradeCheck);
setResourceProperty(resource, UPGRADE_CHECK_ID_PROPERTY_ID, prerequisiteCheck.getId(), requestedIds);
setResourceProperty(resource, UPGRADE_CHECK_CHECK_PROPERTY_ID, prerequisiteCheck.getDescription(), requestedIds);
http://git-wip-us.apache.org/repos/asf/ambari/blob/b3425c98/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java
index 5ea039c..f3fbc63 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/CheckHelper.java
@@ -23,6 +23,7 @@ import java.util.List;
import org.apache.ambari.server.ClusterNotFoundException;
import org.apache.ambari.server.checks.AbstractCheckDescriptor;
+import org.apache.ambari.server.configuration.Configuration;
import org.apache.ambari.server.controller.PrereqCheckRequest;
import org.apache.ambari.server.state.stack.PrereqCheckStatus;
import org.apache.ambari.server.state.stack.PrerequisiteCheck;
@@ -86,44 +87,38 @@ public class CheckHelper {
* @return list of pre-requisite check results
*/
public List<PrerequisiteCheck> performChecks(PrereqCheckRequest request,
- List<AbstractCheckDescriptor> checksRegistry) {
+ List<AbstractCheckDescriptor> checksRegistry, Configuration config) {
final String clusterName = request.getClusterName();
final List<PrerequisiteCheck> prerequisiteCheckResults = new ArrayList<>();
+ final boolean canBypassPreChecks = config.isUpgradePrecheckBypass();
List<DescriptorPreCheck> applicablePreChecks = getApplicablePrerequisiteChecks(request, checksRegistry);
+
for (DescriptorPreCheck descriptorPreCheck : applicablePreChecks) {
AbstractCheckDescriptor checkDescriptor = descriptorPreCheck.descriptor;
PrerequisiteCheck prerequisiteCheck = descriptorPreCheck.check;
try {
checkDescriptor.perform(prerequisiteCheck, request);
-
- boolean canBypassPreChecks = checkDescriptor.isStackUpgradeAllowedToBypassPreChecks();
-
- if (prerequisiteCheck.getStatus() == PrereqCheckStatus.FAIL && canBypassPreChecks) {
- LOG.error("Check {} failed but stack upgrade is allowed to bypass failures. Error to bypass: {}. Failed on: {}",
- checkDescriptor.getDescription().name(),
- prerequisiteCheck.getFailReason(),
- StringUtils.join(prerequisiteCheck.getFailedOn(), ", "));
- prerequisiteCheck.setStatus(PrereqCheckStatus.BYPASS);
- }
- prerequisiteCheckResults.add(prerequisiteCheck);
-
- request.addResult(checkDescriptor.getDescription(), prerequisiteCheck.getStatus());
} catch (ClusterNotFoundException ex) {
- prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
prerequisiteCheck.setFailReason("Cluster with name " + clusterName + " doesn't exists");
- prerequisiteCheckResults.add(prerequisiteCheck);
-
- request.addResult(checkDescriptor.getDescription(), prerequisiteCheck.getStatus());
+ prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
} catch (Exception ex) {
LOG.error("Check " + checkDescriptor.getDescription().name() + " failed", ex);
- prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
prerequisiteCheck.setFailReason("Unexpected server error happened");
- prerequisiteCheckResults.add(prerequisiteCheck);
+ prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
+ }
- request.addResult(checkDescriptor.getDescription(), prerequisiteCheck.getStatus());
+ if (prerequisiteCheck.getStatus() == PrereqCheckStatus.FAIL && canBypassPreChecks) {
+ LOG.error("Check {} failed but stack upgrade is allowed to bypass failures. Error to bypass: {}. Failed on: {}",
+ checkDescriptor.getDescription().name(),
+ prerequisiteCheck.getFailReason(),
+ StringUtils.join(prerequisiteCheck.getFailedOn(), ", "));
+ prerequisiteCheck.setStatus(PrereqCheckStatus.BYPASS);
}
+
+ prerequisiteCheckResults.add(prerequisiteCheck);
+ request.addResult(checkDescriptor.getDescription(), prerequisiteCheck.getStatus());
}
return prerequisiteCheckResults;
http://git-wip-us.apache.org/repos/asf/ambari/blob/b3425c98/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
index 4d8a109..91fd72a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServiceCheckValidityCheckTest.java
@@ -17,6 +17,7 @@
*/
package org.apache.ambari.server.checks;
+import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
@@ -117,6 +118,42 @@ public class ServiceCheckValidityCheckTest {
}
@Test
+ public void testWithNullCommandDetailAtCommand() throws AmbariException {
+ ServiceComponent serviceComponent = mock(ServiceComponent.class);
+ when(serviceComponent.isVersionAdvertised()).thenReturn(true);
+
+ when(service.getMaintenanceState()).thenReturn(MaintenanceState.OFF);
+ when(service.getServiceComponents()).thenReturn(ImmutableMap.of(SERVICE_COMPONENT_NAME, serviceComponent));
+
+ ServiceConfigEntity serviceConfigEntity = new ServiceConfigEntity();
+ serviceConfigEntity.setServiceName(SERVICE_NAME);
+ serviceConfigEntity.setCreateTimestamp(CONFIG_CREATE_TIMESTAMP);
+
+ HostRoleCommandEntity hostRoleCommandEntity1 = new HostRoleCommandEntity();
+ hostRoleCommandEntity1.setRoleCommand(RoleCommand.SERVICE_CHECK);
+ hostRoleCommandEntity1.setCommandDetail(null);
+ hostRoleCommandEntity1.setStartTime(SERVICE_CHECK_START_TIME);
+ hostRoleCommandEntity1.setRole(Role.ZOOKEEPER_SERVER);
+
+ HostRoleCommandEntity hostRoleCommandEntity2 = new HostRoleCommandEntity();
+ hostRoleCommandEntity2.setRoleCommand(RoleCommand.SERVICE_CHECK);
+ hostRoleCommandEntity2.setCommandDetail(COMMAND_DETAIL);
+ hostRoleCommandEntity2.setStartTime(SERVICE_CHECK_START_TIME);
+ hostRoleCommandEntity2.setRole(Role.HDFS_SERVICE_CHECK);
+
+ when(serviceConfigDAO.getLastServiceConfig(eq(CLUSTER_ID), eq(SERVICE_NAME))).thenReturn(serviceConfigEntity);
+ when(hostRoleCommandDAO.findAll(any(Request.class), any(Predicate.class))).thenReturn(asList(hostRoleCommandEntity1, hostRoleCommandEntity2));
+
+ PrerequisiteCheck check = new PrerequisiteCheck(null, CLUSTER_NAME);
+ try {
+ serviceCheckValidityCheck.perform(check, new PrereqCheckRequest(CLUSTER_NAME));
+ } catch (NullPointerException ex){
+ Assert.fail("serviceCheckValidityCheck failed due to null at start_time were not handled");
+ }
+ Assert.assertEquals(PrereqCheckStatus.FAIL, check.getStatus());
+ }
+
+ @Test
public void testFailWhenServiceWithOutdatedServiceCheckExists() throws AmbariException {
ServiceComponent serviceComponent = mock(ServiceComponent.class);
when(serviceComponent.isVersionAdvertised()).thenReturn(true);
@@ -188,7 +225,7 @@ public class ServiceCheckValidityCheckTest {
hostRoleCommandEntity2.setRole(Role.HDFS_SERVICE_CHECK);
when(serviceConfigDAO.getLastServiceConfig(eq(CLUSTER_ID), eq(SERVICE_NAME))).thenReturn(serviceConfigEntity);
- when(hostRoleCommandDAO.findAll(any(Request.class), any(Predicate.class))).thenReturn(Arrays.asList(hostRoleCommandEntity1, hostRoleCommandEntity2));
+ when(hostRoleCommandDAO.findAll(any(Request.class), any(Predicate.class))).thenReturn(asList(hostRoleCommandEntity1, hostRoleCommandEntity2));
PrerequisiteCheck check = new PrerequisiteCheck(null, CLUSTER_NAME);
serviceCheckValidityCheck.perform(check, new PrereqCheckRequest(CLUSTER_NAME));
http://git-wip-us.apache.org/repos/asf/ambari/blob/b3425c98/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProviderTest.java
index 5287c4d..2a48fa6 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProviderTest.java
@@ -38,6 +38,7 @@ import org.apache.ambari.server.AmbariException;
import org.apache.ambari.server.api.services.AmbariMetaInfo;
import org.apache.ambari.server.checks.AbstractCheckDescriptor;
import org.apache.ambari.server.checks.UpgradeCheckRegistry;
+import org.apache.ambari.server.configuration.Configuration;
import org.apache.ambari.server.controller.AmbariManagementController;
import org.apache.ambari.server.controller.spi.Predicate;
import org.apache.ambari.server.controller.spi.Request;
@@ -84,6 +85,7 @@ public class PreUpgradeCheckResourceProviderTest {
Clusters clusters = injector.getInstance(Clusters.class);
UpgradeHelper upgradeHelper = injector.getInstance(UpgradeHelper.class);
+ Configuration configuration = injector.getInstance(Configuration.class);
RepositoryVersionDAO repoDao = injector.getInstance(RepositoryVersionDAO.class);
RepositoryVersionEntity repo = createNiceMock(RepositoryVersionEntity.class);
@@ -104,6 +106,7 @@ public class PreUpgradeCheckResourceProviderTest {
Map<String, ServiceInfo> allServiceInfoMap = new HashMap<>();
allServiceInfoMap.put("Service100", serviceInfo);
+ expect(configuration.isUpgradePrecheckBypass()).andReturn(false).anyTimes();
// set expectations
expect(managementController.getClusters()).andReturn(clusters).anyTimes();
expect(managementController.getAmbariMetaInfo()).andReturn(ambariMetaInfo).anyTimes();
@@ -135,7 +138,7 @@ public class PreUpgradeCheckResourceProviderTest {
// replay
replay(managementController, clusters, cluster, service, serviceInfo, repoDao, repo, upgradeHelper,
- ambariMetaInfo, upgradePack, config, currentStackId, targetStackId, serviceFactory);
+ ambariMetaInfo, upgradePack, config, currentStackId, targetStackId, serviceFactory, configuration);
ResourceProvider provider = getPreUpgradeCheckResourceProvider(managementController, injector);
// create the request
@@ -198,6 +201,15 @@ public class PreUpgradeCheckResourceProviderTest {
}
}
+ static class TestConfigurationProvider implements Provider<Configuration> {
+ private static Configuration configuration = createNiceMock(Configuration.class);
+
+ @Override
+ public Configuration get(){
+ return configuration;
+ }
+ }
+
static class TestUpgradeHelperProvider implements Provider<UpgradeHelper> {
private static UpgradeHelper upgradeHelper = createNiceMock(UpgradeHelper.class);
@@ -216,6 +228,7 @@ public class PreUpgradeCheckResourceProviderTest {
CheckHelper checkHelper = new CheckHelper();
UpgradeCheckRegistry registry = new UpgradeCheckRegistry();
+ bind(Configuration.class).toProvider(TestConfigurationProvider.class);
bind(AmbariManagementController.class).toInstance(createNiceMock(AmbariManagementController.class));
bind(CheckHelper.class).toInstance(checkHelper);
bind(Clusters.class).toProvider(TestClustersProvider.class);
http://git-wip-us.apache.org/repos/asf/ambari/blob/b3425c98/ambari-server/src/test/java/org/apache/ambari/server/sample/checks/SampleServiceCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/sample/checks/SampleServiceCheck.java b/ambari-server/src/test/java/org/apache/ambari/server/sample/checks/SampleServiceCheck.java
index 1c16040..3a07928 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/sample/checks/SampleServiceCheck.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/sample/checks/SampleServiceCheck.java
@@ -44,9 +44,5 @@ public class SampleServiceCheck extends AbstractCheckDescriptor {
prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
}
- @Override
- public boolean isStackUpgradeAllowedToBypassPreChecks() {
- return false;
- }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b3425c98/ambari-server/src/test/java/org/apache/ambari/server/state/CheckHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/CheckHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/CheckHelperTest.java
index 02e84df..a25ad08 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/CheckHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/CheckHelperTest.java
@@ -28,6 +28,7 @@ import org.apache.ambari.server.api.services.AmbariMetaInfo;
import org.apache.ambari.server.checks.AbstractCheckDescriptor;
import org.apache.ambari.server.checks.CheckDescription;
import org.apache.ambari.server.checks.ServicesUpCheck;
+import org.apache.ambari.server.configuration.Configuration;
import org.apache.ambari.server.controller.PrereqCheckRequest;
import org.apache.ambari.server.orm.dao.HostVersionDAO;
import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
@@ -63,15 +64,18 @@ public class CheckHelperTest {
@Test
public void testPreUpgradeCheck() throws Exception {
final CheckHelper helper = new CheckHelper();
+ Configuration configuration = EasyMock.createNiceMock(Configuration.class);
List<AbstractCheckDescriptor> updateChecksRegistry = new ArrayList<>();
AbstractCheckDescriptor descriptor = EasyMock.createNiceMock(AbstractCheckDescriptor.class);
+
+ EasyMock.expect(configuration.isUpgradePrecheckBypass()).andReturn(false);
descriptor.perform(EasyMock.<PrerequisiteCheck> anyObject(), EasyMock.<PrereqCheckRequest> anyObject());
EasyMock.expectLastCall().times(1);
EasyMock.expect(descriptor.isApplicable(EasyMock.<PrereqCheckRequest> anyObject())).andReturn(true);
- EasyMock.replay(descriptor);
+ EasyMock.replay(descriptor, configuration);
updateChecksRegistry.add(descriptor);
- helper.performChecks(new PrereqCheckRequest("cluster"), updateChecksRegistry);
+ helper.performChecks(new PrereqCheckRequest("cluster"), updateChecksRegistry, configuration);
EasyMock.verify(descriptor);
}
@@ -81,12 +85,14 @@ public class CheckHelperTest {
@Test
public void testPreUpgradeCheckNotApplicable() throws Exception {
final CheckHelper helper = new CheckHelper();
+ Configuration configuration = EasyMock.createNiceMock(Configuration.class);
List<AbstractCheckDescriptor> updateChecksRegistry = new ArrayList<>();
AbstractCheckDescriptor descriptor = EasyMock.createNiceMock(AbstractCheckDescriptor.class);
+ EasyMock.expect(configuration.isUpgradePrecheckBypass()).andReturn(false);
EasyMock.expect(descriptor.isApplicable(EasyMock.<PrereqCheckRequest> anyObject())).andReturn(false);
- EasyMock.replay(descriptor);
+ EasyMock.replay(descriptor, configuration);
updateChecksRegistry.add(descriptor);
- helper.performChecks(new PrereqCheckRequest("cluster"), updateChecksRegistry);
+ helper.performChecks(new PrereqCheckRequest("cluster"), updateChecksRegistry, configuration);
EasyMock.verify(descriptor);
}
@@ -98,14 +104,16 @@ public class CheckHelperTest {
final CheckHelper helper = new CheckHelper();
List<AbstractCheckDescriptor> updateChecksRegistry = new ArrayList<>();
AbstractCheckDescriptor descriptor = EasyMock.createNiceMock(AbstractCheckDescriptor.class);
+ Configuration configuration = EasyMock.createNiceMock(Configuration.class);
+ EasyMock.expect(configuration.isUpgradePrecheckBypass()).andReturn(false);
descriptor.perform(EasyMock.<PrerequisiteCheck> anyObject(), EasyMock.<PrereqCheckRequest> anyObject());
EasyMock.expectLastCall().andThrow(new AmbariException("error"));
EasyMock.expect(descriptor.isApplicable(EasyMock.<PrereqCheckRequest> anyObject())).andReturn(true);
EasyMock.expect(descriptor.getDescription()).andReturn(CheckDescription.HOSTS_HEARTBEAT).anyTimes();
- EasyMock.replay(descriptor);
+ EasyMock.replay(descriptor, configuration);
updateChecksRegistry.add(descriptor);
- final List<PrerequisiteCheck> upgradeChecks = helper.performChecks(new PrereqCheckRequest("cluster"), updateChecksRegistry);
+ final List<PrerequisiteCheck> upgradeChecks = helper.performChecks(new PrereqCheckRequest("cluster"), updateChecksRegistry, configuration);
EasyMock.verify(descriptor);
Assert.assertEquals(PrereqCheckStatus.FAIL, upgradeChecks.get(0).getStatus());
}
@@ -118,13 +126,15 @@ public class CheckHelperTest {
// This mock class extends CheckHelper and overrides the getPrerequisiteChecks method in order to return
// a PrerequisiteCheck object whose status is FAIL.
final CheckHelperMock helper = new CheckHelperMock();
+ Configuration configuration = EasyMock.createNiceMock(Configuration.class);
List<AbstractCheckDescriptor> updateChecksRegistry = new ArrayList<>();
PrereqCheckRequest checkRequest = EasyMock.createNiceMock(PrereqCheckRequest.class);
+ EasyMock.expect(configuration.isUpgradePrecheckBypass()).andReturn(true);
EasyMock.expect(checkRequest.getClusterName()).andReturn("c1").anyTimes();
- EasyMock.replay(checkRequest);
+ EasyMock.replay(checkRequest, configuration);
- final List<PrerequisiteCheck> upgradeChecks = helper.performChecks(checkRequest, updateChecksRegistry);
+ final List<PrerequisiteCheck> upgradeChecks = helper.performChecks(checkRequest, updateChecksRegistry, configuration);
Assert.assertEquals(1, upgradeChecks.size());
Assert.assertEquals(PrereqCheckStatus.BYPASS, upgradeChecks.get(0).getStatus());
}
@@ -132,6 +142,7 @@ public class CheckHelperTest {
@Test
public void testPreUpgradeCheckClusterMissing() throws Exception {
final Clusters clusters = Mockito.mock(Clusters.class);
+ Configuration configuration = EasyMock.createNiceMock(Configuration.class);
Mockito.when(clusters.getCluster(Mockito.anyString())).thenAnswer(new Answer<Cluster>() {
@Override
public Cluster answer(InvocationOnMock invocation) throws Throwable {
@@ -164,11 +175,15 @@ public class CheckHelperTest {
final CheckHelper helper = injector.getInstance(CheckHelper.class);
List<AbstractCheckDescriptor> updateChecksRegistry = new ArrayList<>();
+ EasyMock.expect(configuration.isUpgradePrecheckBypass()).andReturn(false);
+
+ EasyMock.replay(configuration);
+
// mocked Cluster has no services, so the check should always be PASS
updateChecksRegistry.add(injector.getInstance(ServicesUpCheck.class));
- List<PrerequisiteCheck> upgradeChecks = helper.performChecks(new PrereqCheckRequest("existing"), updateChecksRegistry);
+ List<PrerequisiteCheck> upgradeChecks = helper.performChecks(new PrereqCheckRequest("existing"), updateChecksRegistry, configuration);
Assert.assertEquals(PrereqCheckStatus.PASS, upgradeChecks.get(0).getStatus());
- upgradeChecks = helper.performChecks(new PrereqCheckRequest("non-existing"), updateChecksRegistry);
+ upgradeChecks = helper.performChecks(new PrereqCheckRequest("non-existing"), updateChecksRegistry, configuration);
Assert.assertEquals(PrereqCheckStatus.FAIL, upgradeChecks.get(0).getStatus());
//non existing cluster is an expected error
Assert.assertTrue(!upgradeChecks.get(0).getFailReason().equals("Unexpected server error happened"));
@@ -191,7 +206,6 @@ public class CheckHelperTest {
EasyMock.expect(descriptor.getDescription()).andReturn(description).anyTimes();
// Allow bypassing failures
- EasyMock.expect(descriptor.isStackUpgradeAllowedToBypassPreChecks()).andReturn(true);
EasyMock.replay(descriptor);
applicablePreChecks.add(new DescriptorPreCheck(descriptor, check));
[09/50] [abbrv] ambari git commit: AMBARI-21000. Ambari does not work
with PGBouncer/PostgreSQL. (Robert Yokota via swagle)
Posted by rl...@apache.org.
AMBARI-21000. Ambari does not work with PGBouncer/PostgreSQL. (Robert Yokota via swagle)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/42832115
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/42832115
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/42832115
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 4283211592c6813e02d74b7ef801da39711042cb
Parents: 71e384d
Author: Siddharth Wagle <sw...@hortonworks.com>
Authored: Fri Jun 2 10:47:09 2017 -0700
Committer: Siddharth Wagle <sw...@hortonworks.com>
Committed: Fri Jun 2 10:47:09 2017 -0700
----------------------------------------------------------------------
.../ambari/server/configuration/Configuration.java | 11 +++++++++++
.../ambari/server/scheduler/ExecutionSchedulerImpl.java | 2 ++
2 files changed, 13 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/42832115/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 114046f..d3b8cc5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -1741,6 +1741,13 @@ public class Configuration {
"server.execution.scheduler.maxDbConnections", "5");
/**
+ * The maximum number of prepared statements cached per database connection.
+ */
+ @Markdown(description = "The maximum number of prepared statements cached per database connection.")
+ public static final ConfigurationProperty<String> EXECUTION_SCHEDULER_MAX_STATEMENTS_PER_CONNECTION = new ConfigurationProperty<>(
+ "server.execution.scheduler.maxStatementsPerConnection", "120");
+
+ /**
* The tolerance, in {@link TimeUnit#MINUTES}, that Quartz will allow a misfired job to run.
*/
@Markdown(description = "The time, in minutes, that a scheduled job can be run after its missed scheduled execution time.")
@@ -4554,6 +4561,10 @@ public class Configuration {
return getProperty(EXECUTION_SCHEDULER_CONNECTIONS);
}
+ public String getExecutionSchedulerMaxStatementsPerConnection() {
+ return getProperty(EXECUTION_SCHEDULER_MAX_STATEMENTS_PER_CONNECTION);
+ }
+
public Long getExecutionSchedulerMisfireToleration() {
return Long.parseLong(getProperty(EXECUTION_SCHEDULER_MISFIRE_TOLERATION));
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/42832115/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java
index cd210b5..6dae349 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/scheduler/ExecutionSchedulerImpl.java
@@ -117,6 +117,8 @@ public class ExecutionSchedulerImpl implements ExecutionScheduler {
configuration.getDatabasePassword());
properties.setProperty("org.quartz.dataSource.myDS.maxConnections",
configuration.getExecutionSchedulerConnections());
+ properties.setProperty("org.quartz.dataSource.myDS.maxCachedStatementsPerConnection",
+ configuration.getExecutionSchedulerMaxStatementsPerConnection());
properties.setProperty("org.quartz.dataSource.myDS.validationQuery",
subProps[1]);
[17/50] [abbrv] ambari git commit: AMBARI-21163 : fixed : Hive view
1.5 and 2.0 not exporting/downloading the worksheet with entire number of
rows to csv (nitirajrathore)
Posted by rl...@apache.org.
AMBARI-21163 : fixed : Hive view 1.5 and 2.0 not exporting/downloading the worksheet with entire number of rows to csv (nitirajrathore)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3b5f07f4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3b5f07f4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3b5f07f4
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 3b5f07f43f7c8914b3ff9aaa1b5504273f1ae59c
Parents: 3f90885
Author: Nitiraj Singh Rathore <ni...@gmail.com>
Authored: Mon Jun 5 12:33:46 2017 +0530
Committer: Nitiraj Singh Rathore <ni...@gmail.com>
Committed: Mon Jun 5 12:34:26 2017 +0530
----------------------------------------------------------------------
.../java/org/apache/ambari/view/hive2/actor/DeathWatch.java | 5 +++--
.../apache/ambari/view/hive2/client/NonPersistentCursor.java | 4 ++--
.../java/org/apache/ambari/view/hive20/actor/DeathWatch.java | 7 ++++---
.../apache/ambari/view/hive20/client/NonPersistentCursor.java | 4 ++--
4 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b5f07f4/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/DeathWatch.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/DeathWatch.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/DeathWatch.java
index dbb6c3d..d72eb29 100644
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/DeathWatch.java
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/DeathWatch.java
@@ -41,13 +41,14 @@ public class DeathWatch extends HiveActor {
this.getContext().watch(actorRef);
LOG.info("Registered new actor "+ actorRef);
LOG.info("Registration for {} at {}", actorRef,new Date());
- }
- if(message instanceof Terminated){
+ }else if(message instanceof Terminated){
Terminated terminated = (Terminated) message;
ActorRef actor = terminated.actor();
LOG.info("Received terminate for actor "+ actor);
LOG.info("Termination for {} at {}", actor,new Date());
+ }else{
+ LOG.info("received unknown message : {}", hiveMessage);
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b5f07f4/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java
index 0be2683..13cab33 100644
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java
@@ -55,13 +55,14 @@ public class NonPersistentCursor implements Cursor<Row, ColumnDescription> {
private final List<ColumnDescription> descriptions = Lists.newLinkedList();
private int offSet = 0;
private boolean endReached = false;
-
+ private Inbox inbox;
public NonPersistentCursor(ViewContext context, ActorSystem system, ActorRef actorRef) {
this.context = context;
this.system = system;
this.actorRef = actorRef;
actorConfiguration = new HiveActorConfiguration(context);
+ inbox = Inbox.create(system);
}
@Override
@@ -120,7 +121,6 @@ public class NonPersistentCursor implements Cursor<Row, ColumnDescription> {
}
private void getNextRows() {
- Inbox inbox = Inbox.create(system);
inbox.send(actorRef, new Next());
Object receive;
try {
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b5f07f4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DeathWatch.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DeathWatch.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DeathWatch.java
index 58cefcd..17b491c 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DeathWatch.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/actor/DeathWatch.java
@@ -41,13 +41,14 @@ public class DeathWatch extends HiveActor {
this.getContext().watch(actorRef);
LOG.info("Registered new actor "+ actorRef);
LOG.info("Registration for {} at {}", actorRef,new Date());
- }
- if(message instanceof Terminated){
+ }else if(message instanceof Terminated){
Terminated terminated = (Terminated) message;
ActorRef actor = terminated.actor();
- LOG.info("Received terminate for actor "+ actor);
+ LOG.info("Received terminate for actor {} with message : {}", actor, terminated);
LOG.info("Termination for {} at {}", actor,new Date());
+ }else{
+ LOG.info("received unknown message : {}", hiveMessage);
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3b5f07f4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/client/NonPersistentCursor.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/client/NonPersistentCursor.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/client/NonPersistentCursor.java
index 1d76e9c..80ffe79 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/client/NonPersistentCursor.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/client/NonPersistentCursor.java
@@ -55,13 +55,14 @@ public class NonPersistentCursor implements Cursor<Row, ColumnDescription> {
private final List<ColumnDescription> descriptions = Lists.newLinkedList();
private int offSet = 0;
private boolean endReached = false;
-
+ private Inbox inbox;
public NonPersistentCursor(ViewContext context, ActorSystem system, ActorRef actorRef) {
this.context = context;
this.system = system;
this.actorRef = actorRef;
actorConfiguration = new HiveActorConfiguration(context);
+ inbox = Inbox.create(system);
}
@Override
@@ -120,7 +121,6 @@ public class NonPersistentCursor implements Cursor<Row, ColumnDescription> {
}
private void getNextRows() {
- Inbox inbox = Inbox.create(system);
inbox.send(actorRef, new Next());
Object receive;
try {
[31/50] [abbrv] ambari git commit: AMBARI-21161 Able to safe guard
Ambari server against circular dependencies in role command order (dili)
Posted by rl...@apache.org.
AMBARI-21161 Able to safe guard Ambari server against circular dependencies in role command order (dili)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/acb2f989
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/acb2f989
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/acb2f989
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: acb2f9896e55db202f5b054565d09c0e598011ed
Parents: 1586a1a
Author: Di Li <di...@apache.org>
Authored: Wed Jun 7 12:26:47 2017 -0400
Committer: Di Li <di...@apache.org>
Committed: Wed Jun 7 12:26:47 2017 -0400
----------------------------------------------------------------------
.../ambari/server/stageplanner/RoleGraph.java | 49 ++++-
.../server/stageplanner/TestStagePlanner.java | 197 +++++++++++++++++--
.../stacks/HDP/2.0.6.1/role_command_order.json | 101 ++--------
3 files changed, 241 insertions(+), 106 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/acb2f989/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java b/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
index 024a5e1..d6d26c9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stageplanner/RoleGraph.java
@@ -19,10 +19,12 @@ package org.apache.ambari.server.stageplanner;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
+import org.apache.ambari.server.AmbariException;
import org.apache.ambari.server.Role;
import org.apache.ambari.server.RoleCommand;
import org.apache.ambari.server.actionmanager.CommandExecutionType;
@@ -165,10 +167,15 @@ public class RoleGraph {
* Returns a list of stages that need to be executed one after another
* to execute the DAG generated in the last {@link #build(Stage)} call.
*/
- public List<Stage> getStages() {
+ public List<Stage> getStages() throws AmbariException {
long initialStageId = initialStage.getStageId();
List<Stage> stageList = new ArrayList<>();
List<RoleGraphNode> firstStageNodes = new ArrayList<>();
+ if(!graph.isEmpty()){
+ LOG.info("Detecting cycle graphs");
+ LOG.info(stringifyGraph());
+ breakCycleGraph();
+ }
while (!graph.isEmpty()) {
if (LOG.isDebugEnabled()) {
LOG.debug(stringifyGraph());
@@ -313,4 +320,44 @@ public class RoleGraph {
}
return builder.toString();
}
+
+ /**
+ * Cycle graphs indicate circular dependencies such as the following example
+ * that can cause Ambari enter an infinite loop while building stages.
+ * (DATANODE, START, 2) --> (NAMENODE, START, 2) --> (SECONDARY_NAMENODE, START, 3)
+ * (HDFS_CLIENT, INSTALL, 0) --> (DATANODE, START, 2) --> (NAMENODE, START, 2) --> (SECONDARY_NAMENODE, START, 3)
+ * (NAMENODE, START, 2) --> (DATANODE, START, 2) --> (SECONDARY_NAMENODE, START, 3)
+ * (SECONDARY_NAMENODE, START, 3)
+ * It is important to safe guard against cycle graphs,
+ * when Ambari supports mpacks, custom services and service level role command order.
+ * */
+ public void breakCycleGraph() throws AmbariException{
+ List<String> edges = new ArrayList<String>();
+ for (String role : graph.keySet()){
+ RoleGraphNode fromNode = graph.get(role);
+ String fnRole = fromNode.getRole().name();
+ String fnCommand = fromNode.getCommand().name();
+
+ Iterator<RoleGraphNode> it = fromNode.getEdges().iterator();
+ while(it.hasNext()){
+ RoleGraphNode toNode = it.next();
+ String tnRole = toNode.getRole().name();
+ String tnCommand = toNode.getCommand().name();
+ //Check if the reversed edge exists in the list already
+ //If the edit exists, print an error message and break the edge
+ String format = "%s:%s --> %s:%s";
+ String edge = String.format(format, fnRole, fnCommand, tnRole, tnCommand);
+ String reversedEdge = String.format(format, tnRole, tnCommand, fnRole, fnCommand);
+ if (edges.contains(reversedEdge)){
+ String msg = String.format(
+ "Circular dependencies detected between %s and %s for %s. "
+ + "%s already exists in the role command order.", fnRole, tnRole, edge, reversedEdge);
+ LOG.error(msg);
+ throw new AmbariException(msg);
+ } else {
+ edges.add(edge);
+ }
+ }
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/acb2f989/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java b/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
index 271ee89..ae3b316 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
@@ -44,13 +44,18 @@ import org.apache.ambari.server.utils.StageUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.common.collect.ImmutableMap;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
+import junit.framework.Assert;
+
public class TestStagePlanner {
+ private static final Logger log = LoggerFactory.getLogger(TestStagePlanner.class);
private Injector injector;
@@ -88,7 +93,7 @@ public class TestStagePlanner {
rg.build(stage);
List<Stage> outStages = rg.getStages();
for (Stage s: outStages) {
- System.out.println(s.toString());
+ log.info(s.toString());
}
assertEquals(1, outStages.size());
assertEquals(stage.getExecutionCommands(hostname), outStages.get(0)
@@ -96,7 +101,165 @@ public class TestStagePlanner {
}
@Test
- public void testMultiStagePlan() {
+ public void testSCCInGraphDetectedShort() {
+ ClusterImpl cluster = mock(ClusterImpl.class);
+ when(cluster.getCurrentStackVersion()).thenReturn(new StackId("HDP-2.0.6.1"));
+
+ Service hbaseService = mock(Service.class);
+ when(hbaseService.getDesiredStackId()).thenReturn(new StackId("HDP-2.0.6.1"));
+ Service zkService = mock(Service.class);
+ when(zkService.getDesiredStackId()).thenReturn(new StackId("HDP-2.0.6.1"));
+
+ when(cluster.getServices()).thenReturn(ImmutableMap.<String, Service>builder()
+ .put("HBASE", hbaseService)
+ .put("ZOOKEEPER", zkService)
+ .build());
+
+ RoleCommandOrder rco = roleCommandOrderProvider.getRoleCommandOrder(cluster);
+ RoleGraph rg = roleGraphFactory.createNew(rco);
+ long now = System.currentTimeMillis();
+ Stage stage = StageUtils.getATestStage(1, 1, "host1", "", "");
+ stage.addHostRoleExecutionCommand("host2", Role.HBASE_MASTER,
+ RoleCommand.START, new ServiceComponentHostStartEvent("HBASE_MASTER",
+ "host2", now), "cluster1", "HBASE", false, false);
+ stage.addHostRoleExecutionCommand("host3", Role.ZOOKEEPER_SERVER,
+ RoleCommand.START, new ServiceComponentHostStartEvent("ZOOKEEPER_SERVER",
+ "host3", now), "cluster1", "ZOOKEEPER", false, false);
+ log.info("Build and ready to detect circular dependencies - short chain");
+ rg.build(stage);
+ boolean exceptionThrown = false;
+ try {
+ List<Stage> outStages = rg.getStages();
+ } catch (AmbariException e) {
+ exceptionThrown = true;
+ }
+ Assert.assertTrue(exceptionThrown);
+ }
+
+ @Test
+ public void testSCCInGraphDetectedLong() {
+ ClusterImpl cluster = mock(ClusterImpl.class);
+ when(cluster.getCurrentStackVersion()).thenReturn(new StackId("HDP-2.0.6.1"));
+
+ Service hbaseService = mock(Service.class);
+ when(hbaseService.getDesiredStackId()).thenReturn(new StackId("HDP-2.0.6.1"));
+ Service zkService = mock(Service.class);
+ when(zkService.getDesiredStackId()).thenReturn(new StackId("HDP-2.0.6.1"));
+ Service yarnService = mock(Service.class);
+ when(yarnService.getDesiredStackId()).thenReturn(new StackId("HDP-2.0.6.1"));
+
+ when(cluster.getServices()).thenReturn(ImmutableMap.<String, Service>builder()
+ .put("HBASE", hbaseService)
+ .put("ZOOKEEPER", zkService)
+ .put("YARN", yarnService)
+ .build());
+
+ RoleCommandOrder rco = roleCommandOrderProvider.getRoleCommandOrder(cluster);
+ RoleGraph rg = roleGraphFactory.createNew(rco);
+ long now = System.currentTimeMillis();
+ Stage stage = StageUtils.getATestStage(1, 1, "host1", "", "");
+ stage.addHostRoleExecutionCommand("host2", Role.HBASE_MASTER,
+ RoleCommand.STOP, new ServiceComponentHostStartEvent("HBASE_MASTER",
+ "host2", now), "cluster1", "HBASE", false, false);
+ stage.addHostRoleExecutionCommand("host3", Role.ZOOKEEPER_SERVER,
+ RoleCommand.STOP, new ServiceComponentHostStartEvent("ZOOKEEPER_SERVER",
+ "host3", now), "cluster1", "ZOOKEEPER", false, false);
+ stage.addHostRoleExecutionCommand("host2", Role.RESOURCEMANAGER,
+ RoleCommand.STOP, new ServiceComponentHostStartEvent("RESOURCEMANAGER",
+ "host4", now), "cluster1", "YARN", false, false);
+
+ log.info("Build and ready to detect circular dependencies - long chain");
+ rg.build(stage);
+ boolean exceptionThrown = false;
+ try {
+ List<Stage> outStages = rg.getStages();
+ } catch (AmbariException e) {
+ exceptionThrown = true;
+ }
+ Assert.assertTrue(exceptionThrown);
+ }
+
+ @Test
+ public void testSCCInGraphDetectedLongTwo() {
+ ClusterImpl cluster = mock(ClusterImpl.class);
+ when(cluster.getCurrentStackVersion()).thenReturn(new StackId("HDP-2.0.6.1"));
+
+ Service hbaseService = mock(Service.class);
+ when(hbaseService.getDesiredStackId()).thenReturn(new StackId("HDP-2.0.6.1"));
+ Service zkService = mock(Service.class);
+ when(zkService.getDesiredStackId()).thenReturn(new StackId("HDP-2.0.6.1"));
+
+ when(cluster.getServices()).thenReturn(ImmutableMap.<String, Service>builder()
+ .put("HBASE", hbaseService)
+ .put("ZOOKEEPER", zkService)
+ .build());
+
+ RoleCommandOrder rco = roleCommandOrderProvider.getRoleCommandOrder(cluster);
+ RoleGraph rg = roleGraphFactory.createNew(rco);
+ long now = System.currentTimeMillis();
+ Stage stage = StageUtils.getATestStage(1, 1, "host1", "", "");
+ stage.addHostRoleExecutionCommand("host2", Role.HBASE_MASTER,
+ RoleCommand.UPGRADE, new ServiceComponentHostStartEvent("HBASE_MASTER",
+ "host2", now), "cluster1", "HBASE", false, false);
+ stage.addHostRoleExecutionCommand("host3", Role.ZOOKEEPER_SERVER,
+ RoleCommand.UPGRADE, new ServiceComponentHostStartEvent("ZOOKEEPER_SERVER",
+ "host3", now), "cluster1", "ZOOKEEPER", false, false);
+ stage.addHostRoleExecutionCommand("host2", Role.HBASE_REGIONSERVER,
+ RoleCommand.UPGRADE, new ServiceComponentHostStartEvent("HBASE_REGIONSERVER",
+ "host4", now), "cluster1", "HBASE", false, false);
+
+ log.info("Build and ready to detect circular dependencies - long chain");
+ rg.build(stage);
+ boolean exceptionThrown = false;
+ try {
+ List<Stage> outStages = rg.getStages();
+ } catch (AmbariException e) {
+ exceptionThrown = true;
+ }
+ Assert.assertTrue(exceptionThrown);
+ }
+
+ @Test
+ public void testNoSCCInGraphDetected() {
+ ClusterImpl cluster = mock(ClusterImpl.class);
+ when(cluster.getCurrentStackVersion()).thenReturn(new StackId("HDP-2.0.6"));
+
+ Service hbaseService = mock(Service.class);
+ when(hbaseService.getDesiredStackId()).thenReturn(new StackId("HDP-2.0.6"));
+ Service zkService = mock(Service.class);
+ when(zkService.getDesiredStackId()).thenReturn(new StackId("HDP-2.0.6"));
+
+ when(cluster.getServices()).thenReturn(ImmutableMap.<String, Service>builder()
+ .put("HBASE", hbaseService)
+ .put("ZOOKEEPER", zkService)
+ .build());
+
+ RoleCommandOrder rco = roleCommandOrderProvider.getRoleCommandOrder(cluster);
+ RoleGraph rg = roleGraphFactory.createNew(rco);
+ long now = System.currentTimeMillis();
+ Stage stage = StageUtils.getATestStage(1, 1, "host1", "", "");
+ stage.addHostRoleExecutionCommand("host2", Role.HBASE_MASTER,
+ RoleCommand.STOP, new ServiceComponentHostStartEvent("HBASE_MASTER",
+ "host2", now), "cluster1", "HBASE", false, false);
+ stage.addHostRoleExecutionCommand("host3", Role.ZOOKEEPER_SERVER,
+ RoleCommand.STOP, new ServiceComponentHostStartEvent("ZOOKEEPER_SERVER",
+ "host3", now), "cluster1", "ZOOKEEPER", false, false);
+ stage.addHostRoleExecutionCommand("host2", Role.HBASE_REGIONSERVER,
+ RoleCommand.STOP, new ServiceComponentHostStartEvent("HBASE_REGIONSERVER",
+ "host4", now), "cluster1", "HBASE", false, false);
+ log.info("Build and ready to detect circular dependencies");
+ rg.build(stage);
+ boolean exceptionThrown = false;
+ try {
+ List<Stage> outStages = rg.getStages();
+ } catch (AmbariException e) {
+ exceptionThrown = true;
+ }
+ Assert.assertFalse(exceptionThrown);
+ }
+
+ @Test
+ public void testMultiStagePlan() throws Throwable {
ClusterImpl cluster = mock(ClusterImpl.class);
when(cluster.getCurrentStackVersion()).thenReturn(new StackId("HDP-2.0.6"));
@@ -121,19 +284,19 @@ public class TestStagePlanner {
stage.addHostRoleExecutionCommand("host3", Role.ZOOKEEPER_SERVER,
RoleCommand.START, new ServiceComponentHostStartEvent("ZOOKEEPER_SERVER",
"host3", now), "cluster1", "ZOOKEEPER", false, false);
- System.out.println(stage.toString());
+ log.info(stage.toString());
rg.build(stage);
- System.out.println(rg.stringifyGraph());
+ log.info(rg.stringifyGraph());
List<Stage> outStages = rg.getStages();
for (Stage s: outStages) {
- System.out.println(s.toString());
+ log.info(s.toString());
}
assertEquals(3, outStages.size());
}
@Test
- public void testRestartStagePlan() {
+ public void testRestartStagePlan() throws Throwable {
ClusterImpl cluster = mock(ClusterImpl.class);
when(cluster.getCurrentStackVersion()).thenReturn(new StackId("HDP-2.0.6"));
@@ -158,19 +321,19 @@ public class TestStagePlanner {
RoleCommand.CUSTOM_COMMAND, "cluster1",
new ServiceComponentHostServerActionEvent("host2", System.currentTimeMillis()),
null, "command detail", null, null, false, false);
- System.out.println(stage.toString());
+ log.info(stage.toString());
rg.build(stage);
- System.out.println(rg.stringifyGraph());
+ log.info(rg.stringifyGraph());
List<Stage> outStages = rg.getStages();
for (Stage s: outStages) {
- System.out.println(s.toString());
+ log.info(s.toString());
}
assertEquals(2, outStages.size());
}
@Test
- public void testManyStages() {
+ public void testManyStages() throws Throwable {
ClusterImpl cluster = mock(ClusterImpl.class);
when(cluster.getCurrentStackVersion()).thenReturn(new StackId("HDP-2.0.6"));
@@ -244,18 +407,18 @@ public class TestStagePlanner {
RoleCommand.START, new ServiceComponentHostStartEvent("GANGLIA_SERVER",
"host9", now), "cluster1", "GANGLIA", false, false);
- System.out.println(stage.toString());
+ log.info(stage.toString());
rg.build(stage);
- System.out.println(rg.stringifyGraph());
+ log.info(rg.stringifyGraph());
List<Stage> outStages = rg.getStages();
for (Stage s : outStages) {
- System.out.println(s.toString());
+ log.info(s.toString());
}
assertEquals(4, outStages.size());
}
@Test
- public void testDependencyOrderedStageCreate() {
+ public void testDependencyOrderedStageCreate() throws Throwable {
ClusterImpl cluster = mock(ClusterImpl.class);
when(cluster.getCurrentStackVersion()).thenReturn(new StackId("HDP-2.0.6"));
RoleCommandOrder rco = roleCommandOrderProvider.getRoleCommandOrder(cluster);
@@ -296,12 +459,12 @@ public class TestStagePlanner {
stage.addHostRoleExecutionCommand("host9", Role.GANGLIA_SERVER,
RoleCommand.START, new ServiceComponentHostStartEvent("GANGLIA_SERVER",
"host9", now), "cluster1", "GANGLIA", false, false);
- System.out.println(stage.toString());
+ log.info(stage.toString());
rg.build(stage);
- System.out.println(rg.stringifyGraph());
+ log.info(rg.stringifyGraph());
List<Stage> outStages = rg.getStages();
for (Stage s : outStages) {
- System.out.println(s.toString());
+ log.info(s.toString());
}
assertEquals(1, outStages.size());
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/acb2f989/ambari-server/src/test/resources/stacks/HDP/2.0.6.1/role_command_order.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.0.6.1/role_command_order.json b/ambari-server/src/test/resources/stacks/HDP/2.0.6.1/role_command_order.json
index 6154004..4d63fe3 100644
--- a/ambari-server/src/test/resources/stacks/HDP/2.0.6.1/role_command_order.json
+++ b/ambari-server/src/test/resources/stacks/HDP/2.0.6.1/role_command_order.json
@@ -1,92 +1,17 @@
{
- "_comment" : "Record format:",
- "_comment" : "blockedRole-blockedCommand: [blockerRole1-blockerCommand1, blockerRole2-blockerCommand2, ...]",
"general_deps" : {
- "_comment" : "dependencies for all cases",
+ "_comment" : "circular dependencies, short link",
"HBASE_MASTER-START": ["ZOOKEEPER_SERVER-START"],
- "HBASE_REGIONSERVER-START": ["HBASE_MASTER-START"],
- "OOZIE_SERVER-START": ["JOBTRACKER-START", "TASKTRACKER-START"],
- "WEBHCAT_SERVER-START": ["TASKTRACKER-START", "HIVE_SERVER-START"],
- "HIVE_METASTORE-START": ["MYSQL_SERVER-START"],
- "HIVE_SERVER-START": ["TASKTRACKER-START", "MYSQL_SERVER-START"],
- "HUE_SERVER-START": ["HIVE_SERVER-START", "HCAT-START", "OOZIE_SERVER-START"],
- "FLUME_HANDLER-START": ["OOZIE_SERVER-START"],
- "MAPREDUCE_SERVICE_CHECK-SERVICE_CHECK": ["JOBTRACKER-START", "TASKTRACKER-START"],
- "OOZIE_SERVICE_CHECK-SERVICE_CHECK": ["OOZIE_SERVER-START", "MAPREDUCE2_SERVICE_CHECK-SERVICE_CHECK"],
- "WEBHCAT_SERVICE_CHECK-SERVICE_CHECK": ["WEBHCAT_SERVER-START"],
- "HBASE_SERVICE_CHECK-SERVICE_CHECK": ["HBASE_MASTER-START", "HBASE_REGIONSERVER-START"],
- "HIVE_SERVICE_CHECK-SERVICE_CHECK": ["HIVE_SERVER-START", "HIVE_METASTORE-START"],
- "HCAT_SERVICE_CHECK-SERVICE_CHECK": ["HIVE_SERVER-START"],
- "PIG_SERVICE_CHECK-SERVICE_CHECK": ["JOBTRACKER-START", "TASKTRACKER-START"],
- "SQOOP_SERVICE_CHECK-SERVICE_CHECK": ["JOBTRACKER-START", "TASKTRACKER-START"],
- "ZOOKEEPER_SERVICE_CHECK-SERVICE_CHECK": ["ZOOKEEPER_SERVER-START"],
- "ZOOKEEPER_QUORUM_SERVICE_CHECK-SERVICE_CHECK": ["ZOOKEEPER_SERVER-START"],
- "ZOOKEEPER_SERVER-STOP" : ["HBASE_MASTER-STOP", "HBASE_REGIONSERVER-STOP"],
- "HBASE_MASTER-STOP": ["HBASE_REGIONSERVER-STOP"],
- "TASKTRACKER-UPGRADE": ["JOBTRACKER-UPGRADE"],
- "MAPREDUCE_CLIENT-UPGRADE": ["TASKTRACKER-UPGRADE", "JOBTRACKER-UPGRADE"],
- "ZOOKEEPER_SERVER-UPGRADE": ["MAPREDUCE_CLIENT-UPGRADE"],
- "ZOOKEEPER_CLIENT-UPGRADE": ["ZOOKEEPER_SERVER-UPGRADE"],
- "HBASE_MASTER-UPGRADE": ["ZOOKEEPER_CLIENT-UPGRADE"],
- "HBASE_REGIONSERVER-UPGRADE": ["HBASE_MASTER-UPGRADE"],
- "HBASE_CLIENT-UPGRADE": ["HBASE_REGIONSERVER-UPGRADE"],
- "HIVE_SERVER-UPGRADE" : ["HBASE_CLIENT-UPGRADE"],
- "HIVE_METASTORE-UPGRADE" : ["HIVE_SERVER-UPGRADE"],
- "MYSQL_SERVER-UPGRADE": ["HIVE_METASTORE-UPGRADE"],
- "HIVE_CLIENT-UPGRADE": ["MYSQL_SERVER-UPGRADE"],
- "HCAT-UPGRADE": ["HIVE_CLIENT-UPGRADE"],
- "OOZIE_SERVER-UPGRADE" : ["HCAT-UPGRADE"],
- "OOZIE_CLIENT-UPGRADE" : ["OOZIE_SERVER-UPGRADE"],
- "WEBHCAT_SERVER-UPGRADE" : ["OOZIE_CLIENT-UPGRADE"],
- "PIG-UPGRADE" : ["WEBHCAT_SERVER-UPGRADE"],
- "SQOOP-UPGRADE" : ["PIG-UPGRADE"],
- "GANGLIA_SERVER-UPGRADE" : ["SQOOP-UPGRADE"],
- "GANGLIA_MONITOR-UPGRADE" : ["GANGLIA_SERVER-UPGRADE"]
- },
- "_comment" : "GLUSTERFS-specific dependencies",
- "optional_glusterfs": {
- "HBASE_MASTER-START": ["PEERSTATUS-START"],
- "JOBTRACKER-START": ["PEERSTATUS-START"],
- "TASKTRACKER-START": ["PEERSTATUS-START"],
- "GLUSTERFS_SERVICE_CHECK-SERVICE_CHECK": ["PEERSTATUS-START"],
- "JOBTRACKER-UPGRADE": ["GLUSTERFS_CLIENT-UPGRADE"]
- },
- "_comment" : "Dependencies that are used when GLUSTERFS is not present in cluster",
- "optional_no_glusterfs": {
- "SECONDARY_NAMENODE-START": ["NAMENODE-START"],
- "RESOURCEMANAGER-START": ["NAMENODE-START", "DATANODE-START"],
- "NODEMANAGER-START": ["NAMENODE-START", "DATANODE-START", "RESOURCEMANAGER-START"],
- "HISTORYSERVER-START": ["NAMENODE-START", "DATANODE-START"],
- "HBASE_MASTER-START": ["NAMENODE-START", "DATANODE-START"],
- "JOBTRACKER-START": ["NAMENODE-START", "DATANODE-START"],
- "TASKTRACKER-START": ["NAMENODE-START", "DATANODE-START"],
- "HIVE_SERVER-START": ["DATANODE-START"],
- "WEBHCAT_SERVER-START": ["DATANODE-START"],
- "HDFS_SERVICE_CHECK-SERVICE_CHECK": ["NAMENODE-START", "DATANODE-START",
- "SECONDARY_NAMENODE-START"],
- "MAPREDUCE2_SERVICE_CHECK-SERVICE_CHECK": ["NODEMANAGER-START",
- "RESOURCEMANAGER-START", "HISTORYSERVER-START", "YARN_SERVICE_CHECK-SERVICE_CHECK"],
- "YARN_SERVICE_CHECK-SERVICE_CHECK": ["NODEMANAGER-START", "RESOURCEMANAGER-START"],
- "RESOURCEMANAGER_SERVICE_CHECK-SERVICE_CHECK": ["RESOURCEMANAGER-START"],
- "PIG_SERVICE_CHECK-SERVICE_CHECK": ["RESOURCEMANAGER-START", "NODEMANAGER-START"],
- "NAMENODE-STOP": ["JOBTRACKER-STOP", "TASKTRACKER-STOP", "RESOURCEMANAGER-STOP",
- "NODEMANAGER-STOP", "HISTORYSERVER-STOP", "HBASE_MASTER-STOP"],
- "DATANODE-STOP": ["JOBTRACKER-STOP", "TASKTRACKER-STOP", "RESOURCEMANAGER-STOP",
- "NODEMANAGER-STOP", "HISTORYSERVER-STOP", "HBASE_MASTER-STOP"],
- "SECONDARY_NAMENODE-UPGRADE": ["NAMENODE-UPGRADE"],
- "DATANODE-UPGRADE": ["SECONDARY_NAMENODE-UPGRADE"],
- "HDFS_CLIENT-UPGRADE": ["DATANODE-UPGRADE"],
- "JOBTRACKER-UPGRADE": ["HDFS_CLIENT-UPGRADE"]
- },
- "_comment" : "Dependencies that are used in HA NameNode cluster",
- "namenode_optional_ha": {
- "NAMENODE-START": ["JOURNALNODE-START", "ZOOKEEPER_SERVER-START"],
- "ZKFC-START": ["NAMENODE-START"],
- "HDFS_SERVICE_CHECK-SERVICE_CHECK": ["ZKFC-START"]
- },
- "_comment" : "Dependencies that are used in ResourceManager HA cluster",
- "resourcemanager_optional_ha" : {
- "RESOURCEMANAGER-START": ["ZOOKEEPER_SERVER-START"]
- }
-}
+ "ZOOKEEPER_SERVER-START": ["HBASE_MASTER-START"],
+
+ "_comment" : "circular dependencies, long link",
+ "ZOOKEEPER_SERVER-STOP" : ["HBASE_MASTER-STOP"],
+ "HBASE_MASTER-STOP": ["RESOURCEMANAGER-STOP"],
+ "RESOURCEMANAGER-STOP": ["ZOOKEEPER_SERVER-STOP"],
+ "_comment" : "circular dependencies, long link",
+ "ZOOKEEPER_SERVER-UPGRADE" : ["HBASE_MASTER-UPGRADE"],
+ "HBASE_MASTER-UPGRADE": ["HBASE_REGIONSERVER-UPGRADE"],
+ "HBASE_REGIONSERVER-UPGRADE": ["ZOOKEEPER_SERVER-UPGRADE"]
+ }
+}
\ No newline at end of file
[50/50] [abbrv] ambari git commit: Merge branch 'trunk' into
branch-feature-AMBARI-20859
Posted by rl...@apache.org.
Merge branch 'trunk' into branch-feature-AMBARI-20859
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/103dfffe
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/103dfffe
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/103dfffe
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 103dfffe772b24226d0faa0037edae6971389e73
Parents: 7460ceb b98f07f
Author: Robert Levas <rl...@hortonworks.com>
Authored: Thu Jun 8 15:21:19 2017 -0400
Committer: Robert Levas <rl...@hortonworks.com>
Committed: Thu Jun 8 15:21:19 2017 -0400
----------------------------------------------------------------------
LICENSE.txt | 17 +
.../main/resources/ui/admin-web/app/index.html | 2 +-
.../stackVersions/StackVersionsCreateCtrl.js | 1 -
.../scripts/controllers/users/UsersShowCtrl.js | 13 +
.../ui/admin-web/app/scripts/i18n.config.js | 2 +-
.../ui/admin-web/app/scripts/services/Stack.js | 32 +-
.../resources/ui/admin-web/app/styles/main.css | 7 +-
.../admin-web/app/views/ambariViews/edit.html | 2 +-
.../views/stackVersions/stackVersionPage.html | 4 +-
.../ui/admin-web/app/views/users/show.html | 5 +-
.../StackVersionsCreateCtrl_test.js | 6 +-
.../src/main/python/ambari_agent/Controller.py | 6 +-
.../main/python/ambari_commons/inet_utils.py | 12 +
.../src/main/python/ambari_commons/os_check.py | 6 +
.../ambari_commons/resources/os_family.json | 10 +
.../core/providers/__init__.py | 19 +-
.../libraries/functions/conf_select.py | 13 +-
.../libraries/functions/decorator.py | 22 +-
.../libraries/functions/repository_util.py | 127 +
.../libraries/functions/stack_features.py | 3 +-
.../libraries/functions/version.py | 31 +-
.../libraries/providers/__init__.py | 3 -
.../libraries/script/script.py | 20 +-
.../upgrades/upgrade_nonrolling_new_stack.xml | 2 +-
ambari-infra/ambari-infra-assembly/pom.xml | 6 +-
ambari-infra/ambari-infra-manager/README.md | 96 +-
ambari-infra/ambari-infra-manager/build.xml | 1 +
.../ambari-infra-manager/docker/Dockerfile | 52 +
.../ambari-infra-manager/docker/bin/start.sh | 21 +
.../docker/infra-manager-docker.sh | 85 +
.../ambari-infra-manager/docs/api/swagger.yaml | 784 +
.../docs/images/batch-1.png | Bin 0 -> 20521 bytes
.../docs/images/batch-2.png | Bin 0 -> 29388 bytes
.../docs/images/batch-3.png | Bin 0 -> 14105 bytes
.../docs/images/batch-4.png | Bin 0 -> 23277 bytes
.../org/apache/ambari/infra/InfraManager.java | 30 +-
.../infra/common/InfraManagerConstants.java | 2 +
.../infra/conf/InfraManagerApiDocConfig.java | 35 +-
.../conf/batch/InfraManagerBatchConfig.java | 63 +-
.../ambari/infra/job/dummy/DummyItemWriter.java | 13 +
.../infra/job/dummy/DummyJobListener.java | 39 +
.../infra/job/dummy/DummyStepListener.java | 41 +
.../apache/ambari/infra/manager/JobManager.java | 274 +
.../infra/model/ExecutionContextResponse.java | 40 +
.../ambari/infra/model/JobDetailsResponse.java | 53 +
.../model/JobExecutionDetailsResponse.java | 49 +
.../infra/model/JobExecutionInfoResponse.java | 141 +
.../ambari/infra/model/JobExecutionRequest.java | 46 +
.../infra/model/JobExecutionRestartRequest.java | 52 +
.../infra/model/JobExecutionStopRequest.java | 50 +
.../infra/model/JobInstanceDetailsResponse.java | 54 +
.../infra/model/JobInstanceStartRequest.java | 49 +
.../ambari/infra/model/JobOperationParams.java | 31 +
.../apache/ambari/infra/model/JobRequest.java | 37 +
.../apache/ambari/infra/model/PageRequest.java | 49 +
.../model/StepExecutionContextResponse.java | 58 +
.../infra/model/StepExecutionInfoResponse.java | 115 +
.../model/StepExecutionProgressResponse.java | 53 +
.../infra/model/StepExecutionRequest.java | 49 +
.../infra/model/wrapper/JobExecutionData.java | 118 +
.../infra/model/wrapper/StepExecutionData.java | 133 +
.../ambari/infra/rest/JobExceptionMapper.java | 110 +
.../apache/ambari/infra/rest/JobResource.java | 151 +-
.../src/main/resources/infra-manager-env.sh | 18 +
.../src/main/resources/infraManager.sh | 2 +-
.../InfraKerberosHostValidator.java | 54 -
.../InfraRuleBasedAuthorizationPlugin.java | 542 -
.../InfraUserRolesLookupStrategy.java | 49 -
.../security/InfraKerberosHostValidator.java | 54 +
.../InfraRuleBasedAuthorizationPlugin.java | 542 +
.../security/InfraUserRolesLookupStrategy.java | 49 +
.../ambari-logsearch-appender/pom.xml | 3 +-
.../ambari-logsearch-config-api/pom.xml | 14 +-
.../config/api/InputConfigMonitor.java | 13 +-
.../logsearch/config/api/LogSearchConfig.java | 3 +-
.../config/api/LogSearchConfigFactory.java | 10 +-
.../api/model/inputconfig/Conditions.java | 24 +
.../config/api/model/inputconfig/Fields.java | 26 +
.../api/model/inputconfig/FilterDescriptor.java | 39 +
.../model/inputconfig/FilterGrokDescriptor.java | 28 +
.../model/inputconfig/FilterJsonDescriptor.java | 23 +
.../inputconfig/FilterKeyValueDescriptor.java | 28 +
.../api/model/inputconfig/InputConfig.java | 28 +
.../api/model/inputconfig/InputDescriptor.java | 52 +
.../inputconfig/InputFileBaseDescriptor.java | 28 +
.../model/inputconfig/InputFileDescriptor.java | 23 +
.../inputconfig/InputS3FileDescriptor.java | 26 +
.../model/inputconfig/MapDateDescriptor.java | 26 +
.../inputconfig/MapFieldCopyDescriptor.java | 24 +
.../model/inputconfig/MapFieldDescriptor.java | 24 +
.../inputconfig/MapFieldNameDescriptor.java | 24 +
.../inputconfig/MapFieldValueDescriptor.java | 26 +
.../api/model/inputconfig/PostMapValues.java | 26 +
.../config/api/LogSearchConfigClass1.java | 3 +-
.../config/api/LogSearchConfigClass2.java | 3 +-
.../config/api/LogSearchConfigFactoryTest.java | 16 +-
.../ambari-logsearch-config-zookeeper/pom.xml | 6 +
.../config/zookeeper/LogSearchConfigZK.java | 72 +-
.../model/inputconfig/impl/ConditionsImpl.java | 37 +
.../model/inputconfig/impl/FieldsImpl.java | 39 +
.../model/inputconfig/impl/FilterAdapter.java | 42 +
.../inputconfig/impl/FilterDescriptorImpl.java | 113 +
.../impl/FilterGrokDescriptorImpl.java | 66 +
.../impl/FilterJsonDescriptorImpl.java | 25 +
.../impl/FilterKeyValueDescriptorImpl.java | 63 +
.../model/inputconfig/impl/InputAdapter.java | 58 +
.../model/inputconfig/impl/InputConfigGson.java | 46 +
.../model/inputconfig/impl/InputConfigImpl.java | 54 +
.../inputconfig/impl/InputDescriptorImpl.java | 192 +
.../impl/InputFileBaseDescriptorImpl.java | 66 +
.../impl/InputFileDescriptorImpl.java | 25 +
.../impl/InputS3FileDescriptorImpl.java | 53 +
.../inputconfig/impl/MapDateDescriptorImpl.java | 58 +
.../impl/MapFieldCopyDescriptorImpl.java | 45 +
.../impl/MapFieldNameDescriptorImpl.java | 45 +
.../impl/MapFieldValueDescriptorImpl.java | 58 +
.../inputconfig/impl/PostMapValuesAdapter.java | 99 +
.../inputconfig/impl/PostMapValuesImpl.java | 40 +
.../logsearch/steps/LogSearchApiSteps.java | 6 +-
.../ambari-logsearch-logfeeder/README.md | 28 +-
.../ambari-logsearch-logfeeder/docs/filter.md | 59 +
.../ambari-logsearch-logfeeder/docs/input.md | 63 +
.../docs/inputConfig.md | 29 +
.../docs/postMapValues.md | 61 +
.../ambari-logsearch-logfeeder/pom.xml | 2 -
.../org/apache/ambari/logfeeder/LogFeeder.java | 2 +-
.../ambari/logfeeder/common/ConfigBlock.java | 107 +-
.../ambari/logfeeder/common/ConfigHandler.java | 126 +-
.../ambari/logfeeder/common/ConfigItem.java | 97 +
.../apache/ambari/logfeeder/filter/Filter.java | 53 +-
.../ambari/logfeeder/filter/FilterGrok.java | 11 +-
.../ambari/logfeeder/filter/FilterJSON.java | 3 -
.../ambari/logfeeder/filter/FilterKeyValue.java | 12 +-
.../logfeeder/input/AbstractInputFile.java | 23 +-
.../apache/ambari/logfeeder/input/Input.java | 112 +-
.../ambari/logfeeder/input/InputFile.java | 6 +-
.../ambari/logfeeder/input/InputS3File.java | 5 +-
.../ambari/logfeeder/input/InputSimulate.java | 23 +-
.../logfeeder/loglevelfilter/FilterLogData.java | 2 +-
.../apache/ambari/logfeeder/mapper/Mapper.java | 4 +-
.../ambari/logfeeder/mapper/MapperDate.java | 17 +-
.../logfeeder/mapper/MapperFieldCopy.java | 13 +-
.../logfeeder/mapper/MapperFieldName.java | 14 +-
.../logfeeder/mapper/MapperFieldValue.java | 14 +-
.../apache/ambari/logfeeder/output/Output.java | 3 -
.../logfeeder/output/OutputLineFilter.java | 2 +-
.../ambari/logfeeder/output/OutputManager.java | 8 +-
.../ambari/logfeeder/output/OutputS3File.java | 96 +-
.../ambari/logfeeder/util/LogFeederUtil.java | 51 -
.../src/main/resources/log4j.xml | 3 +-
.../ambari/logfeeder/filter/FilterGrokTest.java | 37 +-
.../ambari/logfeeder/filter/FilterJSONTest.java | 14 +-
.../logfeeder/filter/FilterKeyValueTest.java | 41 +-
.../ambari/logfeeder/input/InputFileTest.java | 21 +-
.../logconfig/LogConfigHandlerTest.java | 18 +-
.../ambari/logfeeder/mapper/MapperDateTest.java | 44 +-
.../logfeeder/mapper/MapperFieldCopyTest.java | 19 +-
.../logfeeder/mapper/MapperFieldNameTest.java | 19 +-
.../logfeeder/mapper/MapperFieldValueTest.java | 29 +-
.../logfeeder/output/OutputLineFilterTest.java | 22 +-
.../logfeeder/output/OutputManagerTest.java | 10 +-
.../logfeeder/output/OutputS3FileTest.java | 17 +-
.../resources/samples/config/config_audit.json | 339 +-
.../samples/config/config_service.json | 79 +-
.../ambari-logsearch-server/pom.xml | 2 -
.../ambari/logsearch/conf/ApiDocConfig.java | 35 +-
.../AbstractLogRequestFacetQueryConverter.java | 2 +
.../handler/ListCollectionHandler.java | 1 +
.../logsearch/manager/AuditLogsManager.java | 11 +-
.../ambari/logsearch/manager/ManagerBase.java | 5 +-
.../logsearch/manager/ServiceLogsManager.java | 62 +-
.../logsearch/manager/ShipperConfigManager.java | 17 +-
.../model/common/LSServerConditions.java | 48 +
.../logsearch/model/common/LSServerFields.java | 49 +
.../logsearch/model/common/LSServerFilter.java | 137 +
.../common/LSServerFilterDeserializer.java | 60 +
.../model/common/LSServerFilterGrok.java | 79 +
.../model/common/LSServerFilterJson.java | 33 +
.../model/common/LSServerFilterKeyValue.java | 73 +
.../logsearch/model/common/LSServerInput.java | 148 +
.../model/common/LSServerInputConfig.java | 100 +
.../model/common/LSServerInputDeserializer.java | 62 +
.../model/common/LSServerInputFile.java | 33 +
.../model/common/LSServerInputFileBase.java | 74 +
.../model/common/LSServerInputS3File.java | 65 +
.../model/common/LSServerLogLevelFilter.java | 24 +-
.../model/common/LSServerLogLevelFilterMap.java | 5 +
.../logsearch/model/common/LSServerMapDate.java | 66 +
.../model/common/LSServerMapField.java | 30 +
.../model/common/LSServerMapFieldCopy.java | 54 +
.../model/common/LSServerMapFieldName.java | 54 +
.../model/common/LSServerMapFieldValue.java | 67 +
.../model/common/LSServerPostMapValues.java | 73 +
.../model/common/LSServerPostMapValuesList.java | 59 +
.../LSServerPostMapValuesListDeserializer.java | 79 +
.../LSServerPostMapValuesListSerializer.java | 44 +
.../logsearch/rest/AuditLogsResource.java | 2 +-
.../logsearch/rest/ShipperConfigResource.java | 23 +-
.../LogsearchAuthSuccessHandler.java | 4 -
.../web/filters/LogsearchKrbFilter.java | 62 +-
.../web/model/JWTAuthenticationToken.java | 2 +-
.../src/main/resources/log4j.xml | 158 +-
ambari-logsearch/docker/Dockerfile | 6 +-
.../test-config/logfeeder/logfeeder.properties | 1 +
.../logfeeder/shipper-conf/global.config.json | 5 +-
.../test-config/logsearch/logsearch.properties | 4 -
.../timeline/HadoopTimelineMetricsSink.java | 2 +-
.../timeline/HadoopTimelineMetricsSinkTest.java | 2 +-
.../ambari-metrics-host-aggregator/pom.xml | 4 +-
.../kafka/KafkaTimelineMetricsReporter.java | 4 +-
.../storm/StormTimelineMetricsReporter.java | 6 +-
.../sink/storm/StormTimelineMetricsSink.java | 2 +-
.../sink/storm/StormTimelineMetricsSink.java | 2 +-
ambari-project/pom.xml | 5 +
ambari-server/checkstyle.xml | 1 +
ambari-server/conf/unix/ambari-env.sh | 2 +-
ambari-server/conf/unix/ambari.properties | 4 +
ambari-server/docs/api/generated/index.html | 56183 +++++++++++++++++
ambari-server/docs/api/generated/swagger.json | 9285 +++
ambari-server/docs/configuration/index.md | 5 +-
.../security/kerberos/kerberos_descriptor.md | 5 +-
ambari-server/pom.xml | 141 +-
ambari-server/src/main/assemblies/server.xml | 2 +-
.../persist/jpa/AmbariJpaPersistModule.java | 2 +-
.../persist/jpa/AmbariJpaPersistService.java | 2 +-
.../apache/ambari/annotations/Experimental.java | 7 +-
.../ambari/annotations/ExperimentalFeature.java | 9 +-
.../org/apache/ambari/annotations/Markdown.java | 2 +-
.../ambari/annotations/TransactionalLock.java | 2 +-
.../apache/ambari/server/AmbariException.java | 2 +-
.../org/apache/ambari/server/AmbariService.java | 2 +-
.../ambari/server/ClusterNotFoundException.java | 2 +-
.../server/ConfigGroupNotFoundException.java | 2 +-
.../ambari/server/DBConnectionVerification.java | 2 +-
.../server/DuplicateResourceException.java | 2 +-
.../apache/ambari/server/EagerSingleton.java | 2 +-
.../ambari/server/HostNotFoundException.java | 2 +-
.../server/KdcServerConnectionVerification.java | 2 +-
.../ambari/server/ObjectNotFoundException.java | 2 +-
.../server/ParentObjectNotFoundException.java | 2 +-
.../java/org/apache/ambari/server/Role.java | 2 +-
.../org/apache/ambari/server/RoleCommand.java | 2 +-
.../ServiceComponentHostNotFoundException.java | 2 +-
.../ServiceComponentNotFoundException.java | 2 +-
.../ambari/server/ServiceNotFoundException.java | 2 +-
.../ambari/server/StackAccessException.java | 2 +-
.../ambari/server/StateRecoveryManager.java | 32 +-
.../apache/ambari/server/StaticallyInject.java | 2 +-
.../server/actionmanager/ActionDBAccessor.java | 2 +-
.../actionmanager/ActionDBAccessorImpl.java | 2 +-
.../server/actionmanager/ActionManager.java | 6 +-
.../server/actionmanager/ActionScheduler.java | 27 +-
.../ambari/server/actionmanager/ActionType.java | 2 +-
.../actionmanager/ExecutionCommandWrapper.java | 42 +
.../ExecutionCommandWrapperFactory.java | 2 +-
.../server/actionmanager/HostRoleCommand.java | 2 +-
.../server/actionmanager/HostRoleStatus.java | 2 +-
.../ambari/server/actionmanager/Request.java | 26 +-
.../server/actionmanager/RequestFactory.java | 4 +-
.../server/actionmanager/RequestStatus.java | 2 +-
.../ServiceComponentHostEventWrapper.java | 6 +-
.../ambari/server/actionmanager/Stage.java | 20 +-
.../server/actionmanager/StageFactory.java | 1 -
.../server/actionmanager/StageFactoryImpl.java | 4 +-
.../server/actionmanager/TargetHostType.java | 2 +-
.../apache/ambari/server/agent/ActionQueue.java | 2 +-
.../ambari/server/agent/AgentCommand.java | 2 +-
.../apache/ambari/server/agent/AgentEnv.java | 2 +-
.../ambari/server/agent/AgentRequests.java | 2 +-
.../server/agent/AlertDefinitionCommand.java | 2 +-
.../server/agent/AlertExecutionCommand.java | 2 +-
.../ambari/server/agent/CancelCommand.java | 2 +-
.../ambari/server/agent/CommandReport.java | 2 +-
.../ambari/server/agent/CommandRepository.java | 184 +
.../server/agent/ComponentRecoveryReport.java | 2 +-
.../ambari/server/agent/ComponentStatus.java | 2 +-
.../ambari/server/agent/ComponentsResponse.java | 2 +-
.../apache/ambari/server/agent/DiskInfo.java | 2 +-
.../ambari/server/agent/ExecutionCommand.java | 64 +-
.../apache/ambari/server/agent/HeartBeat.java | 2 +-
.../ambari/server/agent/HeartBeatHandler.java | 65 +-
.../ambari/server/agent/HeartBeatResponse.java | 2 +-
.../ambari/server/agent/HeartbeatMonitor.java | 6 +-
.../ambari/server/agent/HeartbeatProcessor.java | 21 +-
.../apache/ambari/server/agent/HostInfo.java | 2 +-
.../apache/ambari/server/agent/HostStatus.java | 2 +-
.../ambari/server/agent/RecoveryConfig.java | 2 +-
.../server/agent/RecoveryConfigHelper.java | 4 +-
.../ambari/server/agent/RecoveryReport.java | 2 +-
.../apache/ambari/server/agent/Register.java | 2 +-
.../server/agent/RegistrationCommand.java | 2 +-
.../server/agent/RegistrationResponse.java | 2 +-
.../ambari/server/agent/RegistrationStatus.java | 2 +-
.../ambari/server/agent/StatusCommand.java | 2 +-
.../ambari/server/agent/rest/AgentResource.java | 2 +-
.../alerts/AgentHeartbeatAlertRunnable.java | 2 +-
.../ambari/server/alerts/AlertRunnable.java | 2 +-
.../alerts/AmbariPerformanceRunnable.java | 2 +-
.../alerts/ComponentVersionAlertRunnable.java | 55 +-
.../server/alerts/StaleAlertRunnable.java | 2 +-
.../ambari/server/api/GsonJsonProvider.java | 2 +-
.../server/api/UserNameOverrideFilter.java | 2 +-
.../api/handlers/BaseManagementHandler.java | 2 +-
.../server/api/handlers/CreateHandler.java | 2 +-
.../server/api/handlers/DeleteHandler.java | 2 +-
.../server/api/handlers/QueryCreateHandler.java | 2 +-
.../ambari/server/api/handlers/ReadHandler.java | 2 +-
.../server/api/handlers/RequestHandler.java | 2 +-
.../server/api/handlers/UpdateHandler.java | 6 +-
.../api/predicate/InvalidQueryException.java | 2 +-
.../server/api/predicate/PredicateCompiler.java | 2 +-
.../ambari/server/api/predicate/QueryLexer.java | 6 +-
.../server/api/predicate/QueryParser.java | 2 +-
.../ambari/server/api/predicate/Token.java | 2 +-
.../expressions/AbstractExpression.java | 2 +-
.../api/predicate/expressions/Expression.java | 2 +-
.../expressions/LogicalExpression.java | 2 +-
.../expressions/LogicalExpressionFactory.java | 2 +-
.../expressions/NotLogicalExpression.java | 2 +-
.../expressions/RelationalExpression.java | 2 +-
.../predicate/operators/AbstractOperator.java | 2 +-
.../api/predicate/operators/AndOperator.java | 2 +-
.../api/predicate/operators/EqualsOperator.java | 2 +-
.../api/predicate/operators/FilterOperator.java | 2 +-
.../operators/GreaterEqualsOperator.java | 2 +-
.../predicate/operators/GreaterOperator.java | 2 +-
.../api/predicate/operators/InOperator.java | 2 +-
.../predicate/operators/IsEmptyOperator.java | 2 +-
.../predicate/operators/LessEqualsOperator.java | 2 +-
.../api/predicate/operators/LessOperator.java | 2 +-
.../predicate/operators/LogicalOperator.java | 2 +-
.../operators/LogicalOperatorFactory.java | 2 +-
.../predicate/operators/NotEqualsOperator.java | 2 +-
.../api/predicate/operators/NotOperator.java | 2 +-
.../api/predicate/operators/Operator.java | 2 +-
.../api/predicate/operators/OrOperator.java | 2 +-
.../predicate/operators/RelationalOperator.java | 2 +-
.../operators/RelationalOperatorFactory.java | 2 +-
.../query/ExtendedResourcePredicateVisitor.java | 2 +-
.../server/api/query/JpaPredicateVisitor.java | 4 +-
.../ambari/server/api/query/JpaSortBuilder.java | 2 +-
.../api/query/ProcessingPredicateVisitor.java | 2 +-
.../apache/ambari/server/api/query/Query.java | 2 +-
.../ambari/server/api/query/QueryImpl.java | 2 +-
.../ambari/server/api/query/QueryInfo.java | 2 +-
.../api/query/SubResourcePredicateVisitor.java | 2 +-
.../api/query/render/AlertStateSummary.java | 4 +-
.../api/query/render/AlertStateValues.java | 4 +-
.../render/AlertSummaryGroupedRenderer.java | 2 +-
.../api/query/render/AlertSummaryRenderer.java | 2 +-
.../server/api/query/render/BaseRenderer.java | 2 +-
.../query/render/ClusterBlueprintRenderer.java | 7 +-
.../api/query/render/DefaultRenderer.java | 2 +-
.../query/render/MetricsPaddingRenderer.java | 2 +-
.../api/query/render/MinimalRenderer.java | 2 +-
.../server/api/query/render/Renderer.java | 2 +-
.../api/resources/ActionResourceDefinition.java | 2 +-
.../ActiveWidgetLayoutResourceDefinition.java | 2 +-
.../resources/AlertDefResourceDefinition.java | 2 +-
.../resources/AlertGroupResourceDefinition.java | 2 +-
.../AlertHistoryResourceDefinition.java | 2 +-
.../AlertNoticeResourceDefinition.java | 2 +-
.../api/resources/AlertResourceDefinition.java | 2 +-
.../AlertTargetResourceDefinition.java | 2 +-
.../api/resources/BaseResourceDefinition.java | 2 +-
.../resources/BlueprintResourceDefinition.java | 2 +-
.../ClientConfigResourceDefinition.java | 2 +-
.../resources/ClusterResourceDefinition.java | 2 +-
.../resources/ComponentResourceDefinition.java | 2 +-
...ComponentStackVersionResourceDefinition.java | 2 +-
.../ConfigGroupResourceDefinition.java | 2 +-
.../ConfigurationResourceDefinition.java | 2 +-
.../DetachedHostResourceDefinition.java | 2 +-
.../ExtensionLinkResourceDefinition.java | 2 +-
.../resources/ExtensionResourceDefinition.java | 2 +-
.../ExtensionVersionResourceDefinition.java | 2 +-
.../api/resources/FeedResourceDefinition.java | 2 +-
.../api/resources/GroupResourceDefinition.java | 2 +-
.../HostComponentProcessResourceDefinition.java | 2 +-
.../HostComponentResourceDefinition.java | 2 +-
.../api/resources/HostResourceDefinition.java | 2 +-
.../resources/InstanceResourceDefinition.java | 2 +-
.../api/resources/JobResourceDefinition.java | 2 +-
.../LdapSyncEventResourceDefinition.java | 2 +-
.../resources/LoggingResourceDefinition.java | 2 +-
.../api/resources/MemberResourceDefinition.java | 2 +-
.../OperatingSystemResourceDefinition.java | 2 +-
.../resources/PermissionResourceDefinition.java | 2 +-
.../resources/PrivilegeResourceDefinition.java | 2 +-
.../RecommendationResourceDefinition.java | 2 +-
.../RemoteClusterResourceDefinition.java | 2 +-
.../resources/RepositoryResourceDefinition.java | 2 +-
.../RepositoryVersionResourceDefinition.java | 2 +-
.../resources/RequestResourceDefinition.java | 2 +-
.../RequestScheduleResourceDefinition.java | 2 +-
.../api/resources/ResourceDefinition.java | 2 +-
.../server/api/resources/ResourceInstance.java | 2 +-
.../api/resources/ResourceInstanceFactory.java | 2 +-
.../resources/ResourceInstanceFactoryImpl.java | 6 +-
.../RootServiceComponentResourceDefinition.java | 2 +-
...tServiceHostComponentResourceDefinition.java | 2 +-
.../RootServiceResourceDefinition.java | 2 +-
.../resources/ServiceResourceDefinition.java | 2 +-
.../api/resources/SimpleResourceDefinition.java | 4 +-
...nfigurationDependencyResourceDefinition.java | 2 +-
.../StackConfigurationResourceDefinition.java | 2 +-
.../StackDependencyResourceDefinition.java | 2 +-
...ackLevelConfigurationResourceDefinition.java | 2 +-
.../api/resources/StackResourceDefinition.java | 4 +-
...StackServiceComponentResourceDefinition.java | 2 +-
.../StackServiceResourceDefinition.java | 2 +-
.../StackVersionResourceDefinition.java | 2 +-
.../api/resources/SubResourceDefinition.java | 2 +-
.../TargetClusterResourceDefinition.java | 2 +-
.../TaskAttemptResourceDefinition.java | 2 +-
.../api/resources/TaskResourceDefinition.java | 4 +-
.../resources/UpgradeResourceDefinition.java | 2 +-
.../api/resources/UserResourceDefinition.java | 2 +-
.../resources/ValidationResourceDefinition.java | 2 +-
.../VersionDefinitionResourceDefinition.java | 2 +-
.../ViewExternalSubResourceDefinition.java | 2 +-
.../ViewInstanceResourceDefinition.java | 2 +-
.../ViewPermissionResourceDefinition.java | 2 +-
.../api/resources/ViewResourceDefinition.java | 2 +-
.../resources/ViewUrlResourceDefinition.java | 2 +-
.../ViewVersionResourceDefinition.java | 2 +-
.../WidgetLayoutResourceDefinition.java | 2 +-
.../api/resources/WidgetResourceDefinition.java | 3 +-
.../resources/WorkflowResourceDefinition.java | 2 +-
.../server/api/rest/BootStrapResource.java | 2 +-
.../ambari/server/api/rest/HealthCheck.java | 2 +-
.../api/rest/KdcServerReachabilityCheck.java | 2 +-
.../server/api/services/ActionService.java | 100 +-
.../api/services/ActiveWidgetLayoutService.java | 76 -
.../api/services/AlertDefinitionService.java | 2 +-
.../server/api/services/AlertGroupService.java | 2 +-
.../api/services/AlertHistoryService.java | 2 +-
.../server/api/services/AlertNoticeService.java | 2 +-
.../server/api/services/AlertService.java | 2 +-
.../server/api/services/AlertTargetService.java | 4 +-
.../server/api/services/AmbariMetaInfo.java | 79 +-
.../api/services/AmbariPrivilegeService.java | 2 +-
.../ambari/server/api/services/BaseRequest.java | 2 +-
.../ambari/server/api/services/BaseService.java | 43 +-
.../server/api/services/BlueprintService.java | 107 +-
.../api/services/ClusterPrivilegeService.java | 2 +-
.../api/services/ClusterRequestSwagger.java | 30 +
.../server/api/services/ClusterService.java | 305 +-
.../services/ClusterStackVersionService.java | 2 +-
.../CompatibleRepositoryVersionService.java | 2 +-
.../server/api/services/ComponentService.java | 2 +-
.../server/api/services/ConfigGroupService.java | 2 +-
.../api/services/ConfigurationService.java | 2 +-
.../server/api/services/DeleteRequest.java | 2 +-
.../api/services/DeleteResultMetadata.java | 2 +-
.../api/services/ExtensionLinksService.java | 2 +-
.../server/api/services/ExtensionsService.java | 2 +-
.../ambari/server/api/services/FeedService.java | 2 +-
.../ambari/server/api/services/GetRequest.java | 2 +-
.../api/services/GroupPrivilegeService.java | 77 -
.../server/api/services/GroupService.java | 155 -
.../api/services/HostComponentService.java | 2 +-
.../ambari/server/api/services/HostService.java | 190 +-
.../api/services/HostStackVersionService.java | 2 +-
.../server/api/services/InstanceService.java | 2 +-
.../ambari/server/api/services/JobService.java | 2 +-
.../api/services/LdapSyncEventService.java | 2 +-
.../server/api/services/LocalUriInfo.java | 2 +-
.../server/api/services/LoggingService.java | 2 +-
.../server/api/services/MemberService.java | 163 -
.../server/api/services/NamedPropertySet.java | 2 +-
.../api/services/OperatingSystemService.java | 19 +-
.../server/api/services/PermissionService.java | 2 +-
.../api/services/PersistKeyValueImpl.java | 2 +-
.../api/services/PersistKeyValueService.java | 2 +-
.../ambari/server/api/services/PostRequest.java | 2 +-
.../api/services/PreUpgradeCheckService.java | 2 +-
.../server/api/services/PrivilegeService.java | 2 +-
.../ambari/server/api/services/PutRequest.java | 2 +-
.../server/api/services/QueryPostRequest.java | 2 +-
.../api/services/RecommendationService.java | 2 +-
.../api/services/RemoteClustersService.java | 2 +-
.../server/api/services/RepositoryService.java | 19 +-
.../api/services/RepositoryVersionService.java | 2 +-
.../ambari/server/api/services/Request.java | 2 +-
.../ambari/server/api/services/RequestBody.java | 2 +-
.../server/api/services/RequestFactory.java | 2 +-
.../api/services/RequestScheduleService.java | 2 +-
.../server/api/services/RequestService.java | 107 +-
.../ambari/server/api/services/Result.java | 2 +-
.../ambari/server/api/services/ResultImpl.java | 2 +-
.../server/api/services/ResultMetadata.java | 2 +-
.../api/services/ResultPostProcessor.java | 2 +-
.../api/services/ResultPostProcessorImpl.java | 2 +-
.../server/api/services/ResultStatus.java | 2 +-
.../server/api/services/RootServiceService.java | 363 +-
.../server/api/services/ServiceService.java | 293 +-
.../api/services/SettingRequestSwagger.java | 30 +
.../server/api/services/SettingService.java | 126 +-
.../server/api/services/StacksService.java | 732 +-
.../server/api/services/StageService.java | 2 +-
.../api/services/TargetClusterService.java | 2 +-
.../server/api/services/TaskAttemptService.java | 2 +-
.../ambari/server/api/services/TaskService.java | 2 +-
.../api/services/UpgradeGroupService.java | 2 +-
.../server/api/services/UpgradeItemService.java | 2 +-
.../server/api/services/UpgradeService.java | 2 +-
.../api/services/UpgradeSummaryService.java | 4 +-
.../api/services/UserAuthorizationService.java | 103 -
.../api/services/UserPrivilegeService.java | 79 -
.../ambari/server/api/services/UserService.java | 175 -
.../server/api/services/ValidationService.java | 2 +-
.../api/services/VersionDefinitionService.java | 2 +-
.../api/services/ViewDataMigrationService.java | 122 -
.../ViewExternalSubResourceService.java | 146 -
.../api/services/ViewInstanceService.java | 282 -
.../api/services/ViewPermissionService.java | 186 -
.../api/services/ViewPrivilegeService.java | 55 -
.../ambari/server/api/services/ViewService.java | 162 -
.../api/services/ViewSubResourceService.java | 134 -
.../server/api/services/ViewUrlsService.java | 2 +-
.../server/api/services/ViewVersionService.java | 199 -
.../api/services/WidgetLayoutService.java | 2 +-
.../server/api/services/WidgetService.java | 2 +-
.../server/api/services/WorkflowService.java | 2 +-
.../services/groups/GroupPrivilegeService.java | 113 +
.../api/services/groups/GroupService.java | 177 +
.../api/services/groups/MemberService.java | 200 +
.../services/parsers/BodyParseException.java | 2 +-
.../services/parsers/JsonRequestBodyParser.java | 2 +-
.../api/services/parsers/RequestBodyParser.java | 2 +-
.../persistence/PersistenceManager.java | 2 +-
.../persistence/PersistenceManagerImpl.java | 2 +-
.../services/serializers/JsonSerializer.java | 2 +-
.../services/serializers/ResultSerializer.java | 2 +-
.../stackadvisor/StackAdvisorException.java | 2 +-
.../stackadvisor/StackAdvisorHelper.java | 2 +-
.../stackadvisor/StackAdvisorRequest.java | 2 +-
.../StackAdvisorRequestException.java | 2 +-
.../stackadvisor/StackAdvisorResponse.java | 2 +-
.../stackadvisor/StackAdvisorRunner.java | 2 +-
.../ComponentLayoutRecommendationCommand.java | 2 +-
.../ComponentLayoutValidationCommand.java | 2 +-
...rationDependenciesRecommendationCommand.java | 2 +-
.../ConfigurationRecommendationCommand.java | 2 +-
.../ConfigurationValidationCommand.java | 2 +-
.../commands/StackAdvisorCommand.java | 8 +-
.../commands/StackAdvisorCommandType.java | 2 +-
.../recommendations/RecommendationResponse.java | 2 +-
.../validations/ValidationResponse.java | 2 +-
.../users/ActiveWidgetLayoutService.java | 111 +
.../users/UserAuthorizationService.java | 120 +
.../services/users/UserPrivilegeService.java | 113 +
.../server/api/services/users/UserService.java | 193 +
.../views/ViewDataMigrationService.java | 113 +
.../views/ViewExternalSubResourceService.java | 148 +
.../api/services/views/ViewInstanceService.java | 313 +
.../services/views/ViewPermissionService.java | 208 +
.../services/views/ViewPrivilegeService.java | 268 +
.../server/api/services/views/ViewService.java | 181 +
.../services/views/ViewSubResourceService.java | 136 +
.../api/services/views/ViewVersionService.java | 208 +
.../apache/ambari/server/api/util/TreeNode.java | 2 +-
.../ambari/server/api/util/TreeNodeImpl.java | 2 +-
.../ambari/server/audit/AsyncAuditLogger.java | 2 +-
.../apache/ambari/server/audit/AuditLogger.java | 2 +-
.../server/audit/AuditLoggerDefaultImpl.java | 2 +-
.../ambari/server/audit/AuditLoggerModule.java | 2 +-
.../request/AddUpgradeRequestAuditEvent.java | 10 +-
.../eventcreator/DefaultEventCreator.java | 2 +-
.../request/eventcreator/HostEventCreator.java | 4 +-
.../eventcreator/UpgradeEventCreator.java | 2 +-
.../ambari/server/bootstrap/BSHostStatus.java | 2 +-
.../server/bootstrap/BSHostStatusCollector.java | 2 +-
.../ambari/server/bootstrap/BSResponse.java | 2 +-
.../ambari/server/bootstrap/BSRunner.java | 2 +-
.../ambari/server/bootstrap/BootStrapImpl.java | 2 +-
.../server/bootstrap/BootStrapPostStatus.java | 2 +-
.../server/bootstrap/BootStrapStatus.java | 2 +-
.../DistributeRepositoriesStructuredOutput.java | 14 +-
.../server/bootstrap/FifoLinkedHashMap.java | 2 +-
.../ambari/server/bootstrap/SshHostInfo.java | 2 +-
.../server/checks/AbstractCheckDescriptor.java | 39 +-
.../server/checks/AtlasPresenceCheck.java | 2 +-
.../ambari/server/checks/CheckDescription.java | 2 +-
.../checks/ComponentsInstallationCheck.java | 3 -
.../server/checks/ConfigurationMergeCheck.java | 2 +-
.../checks/DatabaseConsistencyCheckHelper.java | 11 +-
.../HardcodedStackVersionPropertiesCheck.java | 57 +-
.../checks/HostsMasterMaintenanceCheck.java | 2 +-
.../checks/HostsRepositoryVersionCheck.java | 4 +-
.../server/checks/InstallPackagesCheck.java | 16 +-
.../server/checks/PreviousUpgradeCompleted.java | 7 +-
.../server/checks/RangerAuditDbCheck.java | 2 +-
.../server/checks/RangerPasswordCheck.java | 8 +-
.../server/checks/RangerSSLConfigCheck.java | 3 +-
.../checks/ServiceCheckValidityCheck.java | 11 +-
.../server/checks/ServicePresenceCheck.java | 2 +-
.../ambari/server/checks/ServicesUpCheck.java | 3 +-
.../ambari/server/checks/UpgradeCheck.java | 2 +-
.../ambari/server/checks/UpgradeCheckGroup.java | 2 +-
.../server/checks/UpgradeCheckRegistry.java | 2 +-
.../server/checks/VersionMismatchCheck.java | 2 +-
.../YarnTimelineServerStatePreservingCheck.java | 8 +-
.../server/cleanup/ClasspathScannerUtils.java | 2 +-
.../server/cleanup/TimeBasedCleanupPolicy.java | 5 +-
.../ComponentSSLConfiguration.java | 2 +-
.../server/configuration/Configuration.java | 48 +-
.../AbstractRootServiceResponseFactory.java | 2 +-
.../controller/ActionExecutionContext.java | 37 +-
.../ambari/server/controller/ActionRequest.java | 21 +-
.../server/controller/ActionRequestSwagger.java | 31 +
.../server/controller/ActionResponse.java | 22 +-
.../controller/ActiveWidgetLayoutRequest.java | 66 +
.../controller/ActiveWidgetLayoutResponse.java | 142 +
.../server/controller/AlertCurrentRequest.java | 2 +-
.../controller/AlertDefinitionResponse.java | 2 +-
.../server/controller/AlertHistoryRequest.java | 2 +-
.../server/controller/AlertNoticeRequest.java | 2 +-
.../controller/AmbariActionExecutionHelper.java | 92 +-
.../AmbariCustomCommandExecutionHelper.java | 387 +-
.../server/controller/AmbariHandlerList.java | 2 +-
.../controller/AmbariManagementController.java | 3 +-
.../AmbariManagementControllerImpl.java | 548 +-
.../server/controller/AmbariSessionManager.java | 2 +-
.../ambari/server/controller/ApiModel.java | 28 +
.../server/controller/BlueprintSwagger.java | 91 +
.../controller/ClusterArtifactRequest.java | 46 +
.../controller/ClusterArtifactResponse.java | 49 +
.../server/controller/ClusterRequest.java | 113 +-
.../server/controller/ClusterResponse.java | 106 +-
.../ClusterServiceArtifactRequest.java | 46 +
.../ClusterServiceArtifactResponse.java | 52 +
.../controller/ComponentDependencyResponse.java | 64 +
.../server/controller/ConfigGroupRequest.java | 2 +-
.../server/controller/ConfigGroupResponse.java | 2 +-
.../server/controller/ConfigurationRequest.java | 2 +-
.../controller/ConfigurationResponse.java | 2 +-
.../server/controller/ControllerRequest.java | 2 +-
.../server/controller/ControllerResponse.java | 2 +-
.../server/controller/ExecuteActionRequest.java | 2 +-
.../server/controller/ExecuteCommandJson.java | 6 +-
.../server/controller/ExtensionLinkRequest.java | 2 +-
.../controller/ExtensionLinkResponse.java | 139 +-
.../server/controller/ExtensionRequest.java | 2 +-
.../server/controller/ExtensionResponse.java | 2 +-
.../controller/ExtensionVersionRequest.java | 2 +-
.../controller/ExtensionVersionResponse.java | 2 +-
.../controller/GroupPrivilegeResponse.java | 61 +
.../ambari/server/controller/GroupRequest.java | 7 +-
.../ambari/server/controller/GroupResponse.java | 9 +-
.../HostComponentProcessResponse.java | 2 +-
.../ambari/server/controller/HostRequest.java | 74 +-
.../ambari/server/controller/HostResponse.java | 289 +-
.../ambari/server/controller/HostsMap.java | 2 +-
.../server/controller/KerberosHelperImpl.java | 192 +-
.../server/controller/LdapSyncRequest.java | 2 +-
.../controller/MaintenanceStateHelper.java | 2 +-
.../ambari/server/controller/MemberRequest.java | 6 +-
.../server/controller/MemberResponse.java | 8 +-
.../controller/OperatingSystemRequest.java | 2 +-
.../controller/OperatingSystemResponse.java | 2 +-
.../server/controller/PrivilegeResponse.java | 175 +
.../server/controller/QuickLinksResponse.java | 56 +
.../server/controller/RepositoryRequest.java | 2 +-
.../server/controller/RepositoryResponse.java | 2 +-
.../server/controller/RequestPostRequest.java | 96 +
.../server/controller/RequestPostResponse.java | 43 +
.../server/controller/RequestPutRequest.java | 33 +
.../server/controller/RequestRequest.java | 8 +-
.../server/controller/RequestResponse.java | 100 +
.../controller/RequestScheduleRequest.java | 2 +-
.../controller/RequestScheduleResponse.java | 2 +-
.../controller/RequestStatusResponse.java | 2 +-
.../controller/ResourceProviderFactory.java | 10 +-
.../controller/RootServiceComponentRequest.java | 2 +-
.../RootServiceComponentResponse.java | 58 +-
.../RootServiceHostComponentRequest.java | 2 +-
.../RootServiceHostComponentResponse.java | 72 +-
.../server/controller/RootServiceRequest.java | 2 +-
.../server/controller/RootServiceResponse.java | 24 +-
.../controller/RootServiceResponseFactory.java | 31 +-
.../controller/ServiceComponentHostRequest.java | 21 +-
.../ServiceComponentHostResponse.java | 41 +-
.../controller/ServiceComponentRequest.java | 2 +-
.../controller/ServiceComponentResponse.java | 43 +-
.../server/controller/ServiceRequest.java | 52 +-
.../controller/ServiceRequestSwagger.java | 31 +
.../server/controller/ServiceResponse.java | 80 +-
.../server/controller/SettingRequest.java | 69 +
.../server/controller/SettingResponse.java | 90 +
.../controller/StackArtifactResponse.java | 52 +
.../StackConfigurationDependencyRequest.java | 2 +-
.../StackConfigurationDependencyResponse.java | 19 +-
.../controller/StackConfigurationRequest.java | 2 +-
.../controller/StackConfigurationResponse.java | 28 +-
.../StackLevelConfigurationRequest.java | 2 +-
.../StackLevelConfigurationResponse.java | 2 +-
.../ambari/server/controller/StackRequest.java | 2 +-
.../ambari/server/controller/StackResponse.java | 14 +-
.../StackServiceArtifactResponse.java | 53 +
.../StackServiceComponentRequest.java | 2 +-
.../StackServiceComponentResponse.java | 29 +-
.../server/controller/StackServiceRequest.java | 2 +-
.../server/controller/StackServiceResponse.java | 33 +-
.../server/controller/StackVersionRequest.java | 2 +-
.../server/controller/StackVersionResponse.java | 61 +-
.../ambari/server/controller/ThemeResponse.java | 56 +
.../controller/UserAuthorizationResponse.java | 153 +
.../controller/UserPrivilegeResponse.java | 61 +
.../ambari/server/controller/UserRequest.java | 19 +-
.../ambari/server/controller/UserResponse.java | 50 +-
.../server/controller/ViewInstanceRequest.java | 209 +
.../server/controller/ViewInstanceResponse.java | 198 +
.../controller/ViewPermissionResponse.java | 122 +
.../server/controller/ViewPrivilegeRequest.java | 79 +
.../controller/ViewPrivilegeResponse.java | 55 +
.../ambari/server/controller/ViewResponse.java | 82 +
.../server/controller/ViewVersionResponse.java | 234 +
.../server/controller/WidgetResponse.java | 2 +-
.../AbstractAuthorizedResourceProvider.java | 21 +
.../AbstractControllerResourceProvider.java | 31 +-
.../internal/AbstractDRResourceProvider.java | 2 +-
.../internal/AbstractPropertyProvider.java | 2 +-
.../internal/AbstractProviderModule.java | 2 +-
.../internal/AbstractResourceProvider.java | 2 +-
.../internal/ActionResourceProvider.java | 2 +-
.../ActiveWidgetLayoutResourceProvider.java | 61 +-
.../internal/AlertHistoryResourceProvider.java | 2 +-
.../internal/AlertNoticeResourceProvider.java | 2 +-
.../internal/AlertResourceProvider.java | 2 +-
.../internal/AlertSummaryPropertyProvider.java | 2 +-
.../controller/internal/AppCookieManager.java | 2 +-
.../internal/ArtifactResourceProvider.java | 33 +-
.../AtlasServerHttpPropertyRequest.java | 4 +-
.../controller/internal/BaseClusterRequest.java | 2 +-
.../controller/internal/BaseProvider.java | 2 +-
.../BlueprintConfigurationProcessor.java | 25 +-
.../internal/BlueprintResourceProvider.java | 2 +-
.../controller/internal/CalculatedStatus.java | 2 +-
.../internal/ClientConfigResourceProvider.java | 12 +-
.../internal/ClusterControllerImpl.java | 2 +-
.../internal/ClusterResourceProvider.java | 90 +-
.../ClusterStackVersionResourceProvider.java | 466 +-
.../internal/CompatibleRepositoryVersion.java | 2 +-
...atibleRepositoryVersionResourceProvider.java | 19 +-
.../internal/ComponentResourceProvider.java | 76 +-
.../internal/ConfigGroupResourceProvider.java | 48 +-
.../ConfigurationTopologyException.java | 2 +-
.../internal/DefaultProviderModule.java | 2 +-
.../DefaultResourcePredicateEvaluator.java | 2 +-
.../internal/DefaultTrimmingStrategy.java | 2 +-
.../DeleteSpacesAtTheEndTrimmingStrategy.java | 2 +-
.../internal/DeleteStatusMetaData.java | 2 +-
.../internal/DirectoriesTrimmingStrategy.java | 2 +-
.../internal/ExportBlueprintRequest.java | 2 +-
.../server/controller/internal/Extension.java | 2 +-
.../internal/ExtensionLinkResourceProvider.java | 2 +-
.../internal/ExtensionResourceProvider.java | 2 +-
.../ExtensionVersionResourceProvider.java | 2 +-
.../internal/FeedResourceProvider.java | 2 +-
.../GroupPrivilegeResourceProvider.java | 80 +-
.../internal/GroupResourceProvider.java | 2 +-
.../HostComponentProcessResourceProvider.java | 2 +-
.../internal/HostComponentResourceProvider.java | 29 +-
.../internal/HostResourceProvider.java | 211 +-
.../HostStackVersionResourceProvider.java | 77 +-
.../controller/internal/HostStatusHelper.java | 7 +-
.../internal/HttpPropertyProvider.java | 2 +-
.../internal/InstanceResourceProvider.java | 2 +-
.../internal/JobResourceProvider.java | 2 +-
.../internal/JsonHttpPropertyRequest.java | 4 +-
.../internal/LdapSyncEventResourceProvider.java | 2 +-
.../internal/LoggingResourceProvider.java | 2 +-
.../internal/MemberResourceProvider.java | 2 +-
.../internal/ObservableResourceProvider.java | 2 +-
.../OperatingSystemResourceProvider.java | 2 +-
.../controller/internal/PageRequestImpl.java | 2 +-
.../controller/internal/PageResponseImpl.java | 2 +-
.../internal/PasswordTrimmingStrategy.java | 2 +-
.../internal/PermissionResourceProvider.java | 2 +-
.../PreUpgradeCheckResourceProvider.java | 8 +-
.../controller/internal/PropertyInfo.java | 4 +-
.../internal/PropertyPredicateVisitor.java | 2 +-
.../PropertyValueTrimmingStrategyDefiner.java | 2 +-
.../controller/internal/ProvisionAction.java | 2 +-
.../internal/ProvisionClusterRequest.java | 6 +-
.../internal/ReadOnlyResourceProvider.java | 22 +-
.../RecommendationResourceProvider.java | 2 +-
.../internal/RemoteClusterResourceProvider.java | 2 +-
.../internal/RepositoryResourceProvider.java | 4 +-
.../RepositoryVersionResourceProvider.java | 77 +-
.../server/controller/internal/RequestImpl.java | 2 +-
.../internal/RequestResourceFilter.java | 5 +-
.../internal/RequestResourceProvider.java | 81 +-
.../RequestScheduleResourceProvider.java | 2 +-
.../internal/RequestStageContainer.java | 13 +-
.../controller/internal/RequestStatusImpl.java | 2 +-
.../controller/internal/ResourceImpl.java | 2 +-
.../ResourceManagerHttpPropertyRequest.java | 2 +-
.../internal/ResourceProviderEvent.java | 2 +-
.../internal/ResourceProviderObserver.java | 2 +-
.../RootServiceComponentResourceProvider.java | 65 +-
...ootServiceHostComponentResourceProvider.java | 74 +-
.../internal/RootServiceResourceProvider.java | 22 +-
.../internal/ScaleClusterRequest.java | 12 +-
.../server/controller/internal/SchemaImpl.java | 2 +-
.../internal/ServiceResourceProvider.java | 181 +-
.../internal/SettingResourceProvider.java | 64 +-
.../internal/SimplifyingPredicateVisitor.java | 2 +-
.../controller/internal/SortRequestImpl.java | 2 +-
.../server/controller/internal/Stack.java | 2 +-
.../internal/StackAdvisorResourceProvider.java | 2 +-
.../internal/StackArtifactResourceProvider.java | 6 +-
...ConfigurationDependencyResourceProvider.java | 2 +-
.../StackConfigurationResourceProvider.java | 2 +-
.../internal/StackDefinedPropertyProvider.java | 20 +-
.../StackDependencyResourceProvider.java | 8 +-
...StackLevelConfigurationResourceProvider.java | 2 +-
.../internal/StackResourceProvider.java | 2 +-
.../StackServiceComponentResourceProvider.java | 2 +-
.../internal/StackServiceResourceProvider.java | 2 +-
.../internal/StackVersionResourceProvider.java | 2 +-
.../internal/StageResourceProvider.java | 10 +-
.../internal/TargetClusterResourceProvider.java | 2 +-
.../internal/TaskAttemptResourceProvider.java | 2 +-
.../internal/TaskResourceProvider.java | 2 +-
.../controller/internal/TemporalInfoImpl.java | 2 +-
.../controller/internal/TrimmingStrategy.java | 2 +-
.../controller/internal/URLStreamProvider.java | 2 +-
.../internal/UpgradeGroupResourceProvider.java | 2 +-
.../internal/UpgradeItemResourceProvider.java | 2 +-
.../internal/UpgradeResourceProvider.java | 1106 +-
.../controller/internal/UpgradeSummary.java | 4 +-
.../UpgradeSummaryResourceProvider.java | 4 +-
.../UserAuthorizationResourceProvider.java | 64 +-
.../internal/UserPrivilegeResourceProvider.java | 82 +-
.../internal/UserResourceProvider.java | 2 +-
.../internal/ValidationResourceProvider.java | 4 +-
.../VersionDefinitionResourceProvider.java | 4 +-
.../internal/ViewInstanceResourceProvider.java | 2 +-
.../ViewPermissionResourceProvider.java | 46 +-
.../internal/ViewResourceProvider.java | 2 +-
.../internal/ViewURLResourceProvider.java | 2 +-
.../internal/ViewVersionResourceProvider.java | 63 +-
.../internal/WidgetLayoutResourceProvider.java | 2 +-
.../internal/WidgetResourceProvider.java | 2 +-
.../internal/WorkflowResourceProvider.java | 2 +-
.../ambari/server/controller/ivory/Cluster.java | 2 +-
.../ambari/server/controller/ivory/Feed.java | 2 +-
.../server/controller/ivory/Instance.java | 2 +-
.../server/controller/ivory/IvoryService.java | 2 +-
.../controller/jdbc/ConnectionFactory.java | 2 +-
.../controller/jdbc/JDBCResourceProvider.java | 2 +-
.../JobHistoryPostgresConnectionFactory.java | 2 +-
.../controller/jdbc/SQLPredicateVisitor.java | 2 +-
.../server/controller/jmx/JMXHostProvider.java | 2 +-
.../server/controller/jmx/JMXMetricHolder.java | 2 +-
.../controller/jmx/JMXPropertyProvider.java | 2 +-
.../logging/HostComponentLoggingInfo.java | 2 +-
.../logging/LogFileDefinitionInfo.java | 2 +-
.../server/controller/logging/LogFileType.java | 2 +-
.../logging/LogLevelQueryResponse.java | 2 +-
.../controller/logging/LogLineResult.java | 2 +-
.../controller/logging/LogQueryResponse.java | 2 +-
.../logging/LogSearchDataRetrievalService.java | 2 +-
.../LoggingRequestHelperFactoryImpl.java | 2 +-
.../logging/LoggingRequestHelperImpl.java | 2 +-
.../logging/LoggingSearchPropertyProvider.java | 14 +-
.../controller/logging/NameValuePair.java | 2 +-
.../ambari/server/controller/logging/Utils.java | 2 +-
.../controller/metrics/MetricHostProvider.java | 2 +-
.../metrics/MetricPropertyProviderFactory.java | 2 +-
.../metrics/MetricReportingAdapter.java | 2 +-
.../metrics/MetricsDataTransferMethod.java | 2 +-
.../MetricsDataTransferMethodFactory.java | 2 +-
.../metrics/MetricsDownsamplingMethod.java | 2 +-
.../MetricsDownsamplingMethodFactory.java | 2 +-
.../metrics/MetricsPaddingMethod.java | 2 +-
.../metrics/MetricsPropertyProvider.java | 2 +-
.../metrics/MetricsPropertyProviderProxy.java | 2 +-
.../metrics/MetricsReportPropertyProvider.java | 2 +-
.../MetricsReportPropertyProviderProxy.java | 2 +-
.../metrics/MetricsServiceProvider.java | 2 +-
.../metrics/RestMetricsPropertyProvider.java | 2 +-
.../ThreadPoolEnabledPropertyProvider.java | 2 +-
.../GangliaComponentPropertyProvider.java | 2 +-
.../GangliaHostComponentPropertyProvider.java | 2 +-
.../ganglia/GangliaHostPropertyProvider.java | 2 +-
.../metrics/ganglia/GangliaMetric.java | 5 +-
.../ganglia/GangliaPropertyProvider.java | 2 +-
.../ganglia/GangliaReportPropertyProvider.java | 2 +-
.../timeline/AMSComponentPropertyProvider.java | 2 +-
.../AMSHostComponentPropertyProvider.java | 2 +-
.../timeline/AMSHostPropertyProvider.java | 2 +-
.../metrics/timeline/AMSPropertyProvider.java | 11 +-
.../timeline/AMSReportPropertyProvider.java | 2 +-
.../metrics/timeline/MetricsRequestHelper.java | 2 +-
.../cache/TimelineAppMetricCacheKey.java | 2 +-
.../timeline/cache/TimelineMetricCache.java | 2 +-
.../cache/TimelineMetricCacheEntryFactory.java | 2 +-
.../cache/TimelineMetricCacheProvider.java | 2 +-
.../cache/TimelineMetricsCacheSizeOfEngine.java | 2 +-
.../cache/TimelineMetricsCacheValue.java | 2 +-
.../controller/predicate/AlwaysPredicate.java | 5 +-
.../controller/predicate/AndPredicate.java | 2 +-
.../controller/predicate/ArrayPredicate.java | 2 +-
.../controller/predicate/BasePredicate.java | 2 +-
.../predicate/CategoryIsEmptyPredicate.java | 2 +-
.../controller/predicate/CategoryPredicate.java | 2 +-
.../predicate/ComparisonPredicate.java | 2 +-
.../controller/predicate/EqualsPredicate.java | 2 +-
.../controller/predicate/FilterPredicate.java | 2 +-
.../predicate/GreaterEqualsPredicate.java | 2 +-
.../controller/predicate/GreaterPredicate.java | 2 +-
.../predicate/LessEqualsPredicate.java | 2 +-
.../controller/predicate/LessPredicate.java | 2 +-
.../controller/predicate/NotPredicate.java | 2 +-
.../controller/predicate/OrPredicate.java | 2 +-
.../controller/predicate/PredicateVisitor.java | 2 +-
.../predicate/PredicateVisitorAcceptor.java | 2 +-
.../controller/predicate/PropertyPredicate.java | 2 +-
.../controller/predicate/UnaryPredicate.java | 2 +-
.../controller/spi/ClusterController.java | 2 +-
.../spi/NoSuchParentResourceException.java | 2 +-
.../controller/spi/NoSuchResourceException.java | 2 +-
.../server/controller/spi/PageRequest.java | 2 +-
.../server/controller/spi/PageResponse.java | 2 +-
.../ambari/server/controller/spi/Predicate.java | 2 +-
.../server/controller/spi/PropertyProvider.java | 2 +-
.../server/controller/spi/ProviderModule.java | 2 +-
.../ambari/server/controller/spi/Request.java | 2 +-
.../server/controller/spi/RequestStatus.java | 2 +-
.../controller/spi/RequestStatusMetaData.java | 2 +-
.../ambari/server/controller/spi/Resource.java | 2 +-
.../spi/ResourceAlreadyExistsException.java | 2 +-
.../spi/ResourcePredicateEvaluator.java | 2 +-
.../server/controller/spi/ResourceProvider.java | 2 +-
.../ambari/server/controller/spi/Schema.java | 2 +-
.../server/controller/spi/SchemaFactory.java | 2 +-
.../server/controller/spi/SortRequest.java | 2 +-
.../controller/spi/SortRequestProperty.java | 2 +-
.../server/controller/spi/SystemException.java | 2 +-
.../server/controller/spi/TemporalInfo.java | 2 +-
.../spi/UnsupportedPropertyException.java | 2 +-
...eredThreadPoolExecutorCompletionService.java | 2 +-
.../utilities/ClusterControllerHelper.java | 2 +-
.../controller/utilities/DatabaseChecker.java | 2 +-
.../controller/utilities/PredicateBuilder.java | 2 +-
.../controller/utilities/PredicateHelper.java | 2 +-
.../controller/utilities/PropertyHelper.java | 12 +-
.../utilities/ScalingThreadPoolExecutor.java | 2 +-
.../ServiceCalculatedStateFactory.java | 2 +-
.../controller/utilities/StreamProvider.java | 2 +-
.../state/DefaultServiceCalculatedState.java | 7 +-
.../state/FlumeServiceCalculatedState.java | 4 +-
.../state/HBaseServiceCalculatedState.java | 6 +-
.../state/HDFSServiceCalculatedState.java | 6 +-
.../state/HiveServiceCalculatedState.java | 9 +-
.../state/OozieServiceCalculatedState.java | 7 +-
.../utilities/state/ServiceCalculatedState.java | 2 +-
.../state/YARNServiceCalculatedState.java | 7 +-
.../server/customactions/ActionDefinition.java | 2 +-
.../customactions/ActionDefinitionManager.java | 2 +-
.../customactions/ActionDefinitionSpec.java | 2 +-
.../customactions/ActionDefinitionXml.java | 2 +-
.../events/ActionFinalReportReceivedEvent.java | 2 +-
.../events/AggregateAlertRecalculateEvent.java | 2 +-
.../events/AlertDefinitionChangedEvent.java | 2 +-
.../events/AlertDefinitionDeleteEvent.java | 2 +-
.../events/AlertDefinitionDisabledEvent.java | 2 +-
.../AlertDefinitionRegistrationEvent.java | 2 +-
.../apache/ambari/server/events/AlertEvent.java | 2 +-
.../events/AlertHashInvalidationEvent.java | 2 +-
.../server/events/AlertReceivedEvent.java | 2 +-
.../server/events/AlertStateChangeEvent.java | 2 +-
.../ambari/server/events/AmbariEvent.java | 2 +-
.../events/ClusterConfigChangedEvent.java | 2 +-
.../events/ClusterConfigFinishedEvent.java | 2 +-
.../ambari/server/events/ClusterEvent.java | 2 +-
.../HostComponentVersionAdvertisedEvent.java | 2 +-
.../apache/ambari/server/events/HostEvent.java | 2 +-
.../server/events/HostRegisteredEvent.java | 2 +-
.../ambari/server/events/HostsAddedEvent.java | 2 +-
.../ambari/server/events/HostsRemovedEvent.java | 2 +-
.../ambari/server/events/InitialAlertEvent.java | 2 +-
.../server/events/MaintenanceModeEvent.java | 2 +-
.../events/ServiceComponentInstalledEvent.java | 2 +-
.../ServiceComponentRecoveryChangedEvent.java | 2 +-
.../ServiceComponentUninstalledEvent.java | 2 +-
.../ambari/server/events/ServiceEvent.java | 2 +-
.../server/events/ServiceInstalledEvent.java | 2 +-
.../server/events/ServiceRemovedEvent.java | 2 +-
.../server/events/StackUpgradeFinishEvent.java | 4 +-
.../ambari/server/events/TaskCreateEvent.java | 4 +-
.../apache/ambari/server/events/TaskEvent.java | 4 +-
.../ambari/server/events/TaskUpdateEvent.java | 4 +-
.../EntityManagerCacheInvalidationEvent.java | 2 +-
.../ambari/server/events/jpa/JPAEvent.java | 2 +-
.../alerts/AlertAggregateListener.java | 2 +-
.../alerts/AlertDefinitionDisabledListener.java | 2 +-
.../alerts/AlertHashInvalidationListener.java | 2 +-
.../listeners/alerts/AlertHostListener.java | 2 +-
.../alerts/AlertLifecycleListener.java | 2 +-
.../alerts/AlertMaintenanceModeListener.java | 2 +-
.../listeners/alerts/AlertReceivedListener.java | 2 +-
.../AlertServiceComponentHostListener.java | 2 +-
.../alerts/AlertServiceStateListener.java | 2 +-
.../alerts/AlertStateChangedListener.java | 2 +-
.../listeners/tasks/TaskStatusListener.java | 5 +-
.../DistributeRepositoriesActionListener.java | 21 +-
.../upgrade/HostVersionOutOfSyncListener.java | 99 +-
.../upgrade/StackUpgradeFinishListener.java | 2 +-
.../listeners/upgrade/StackVersionListener.java | 162 +-
.../events/publishers/AlertEventPublisher.java | 2 +-
.../events/publishers/AmbariEventPublisher.java | 2 +-
.../events/publishers/JPAEventPublisher.java | 2 +-
.../events/publishers/TaskEventPublisher.java | 2 +-
.../publishers/VersionEventPublisher.java | 2 +-
.../ambari/server/hooks/AmbariEventFactory.java | 2 +-
.../apache/ambari/server/hooks/HookContext.java | 2 +-
.../ambari/server/hooks/HookContextFactory.java | 2 +-
.../apache/ambari/server/hooks/HookService.java | 2 +-
.../users/PostUserCreationHookContext.java | 2 +-
.../server/hooks/users/UserCreatedEvent.java | 2 +-
.../server/hooks/users/UserHookParams.java | 2 +-
.../server/hooks/users/UserHookService.java | 5 +-
.../server/logging/EclipseLinkLogger.java | 2 +-
.../metadata/AmbariServiceAlertDefinitions.java | 2 +-
.../CachedRoleCommandOrderProvider.java | 2 +-
.../server/metadata/RoleCommandOrder.java | 36 +-
.../metadata/RoleCommandOrderProvider.java | 2 +-
.../ambari/server/metadata/RoleCommandPair.java | 2 +-
.../server/metrics/system/MetricsService.java | 2 +-
.../server/metrics/system/MetricsSink.java | 2 +-
.../server/metrics/system/MetricsSource.java | 4 +-
.../server/metrics/system/SingleMetric.java | 2 +-
.../system/impl/AbstractMetricsSource.java | 4 +-
.../system/impl/AmbariMetricSinkImpl.java | 3 +-
.../system/impl/AmbariPerformanceMonitor.java | 2 +-
.../system/impl/DatabaseMetricsSource.java | 4 +-
.../metrics/system/impl/JvmMetricsSource.java | 2 +-
.../system/impl/MetricsConfiguration.java | 2 +-
.../metrics/system/impl/MetricsServiceImpl.java | 2 +-
.../server/notifications/DispatchCallback.java | 2 +-
.../notifications/DispatchCredentials.java | 2 +-
.../server/notifications/DispatchFactory.java | 2 +-
.../server/notifications/DispatchRunnable.java | 4 +-
.../server/notifications/Notification.java | 2 +-
.../notifications/NotificationDispatcher.java | 2 +-
.../ambari/server/notifications/Recipient.java | 2 +-
.../TargetConfigurationResult.java | 4 +-
.../dispatchers/AlertScriptDispatcher.java | 47 +-
.../dispatchers/AmbariSNMPDispatcher.java | 2 +-
.../dispatchers/EmailDispatcher.java | 2 +-
.../dispatchers/SNMPDispatcher.java | 2 +-
.../orm/AmbariLocalSessionInterceptor.java | 2 +-
.../apache/ambari/server/orm/DBAccessor.java | 24 +
.../ambari/server/orm/DBAccessorImpl.java | 46 +-
.../orm/EclipseLinkSessionCustomizer.java | 2 +-
.../ambari/server/orm/GuiceJpaInitializer.java | 2 +-
.../ambari/server/orm/PersistenceType.java | 2 +-
.../ambari/server/orm/TransactionalLocks.java | 4 +-
.../orm/cache/ConfigGroupHostMapping.java | 2 +-
.../orm/cache/ConfigGroupHostMappingImpl.java | 2 +-
.../server/orm/cache/HostConfigMapping.java | 2 +-
.../server/orm/cache/HostConfigMappingImpl.java | 2 +-
.../server/orm/dao/AlertDefinitionDAO.java | 2 +-
.../ambari/server/orm/dao/AlertDispatchDAO.java | 2 +-
.../server/orm/dao/AlertHostSummaryDTO.java | 2 +-
.../ambari/server/orm/dao/AlertSummaryDTO.java | 2 +-
.../apache/ambari/server/orm/dao/AlertsDAO.java | 2 +-
.../ambari/server/orm/dao/ArtifactDAO.java | 2 +-
.../ambari/server/orm/dao/BlueprintDAO.java | 2 +-
.../ambari/server/orm/dao/ClusterDAO.java | 4 +-
.../server/orm/dao/ClusterServiceDAO.java | 2 +-
.../ambari/server/orm/dao/ClusterStateDAO.java | 2 +-
.../server/orm/dao/ClusterVersionDAO.java | 233 -
.../orm/dao/ConfigGroupConfigMappingDAO.java | 2 +-
.../ambari/server/orm/dao/ConfigGroupDAO.java | 2 +-
.../orm/dao/ConfigGroupHostMappingDAO.java | 2 +-
.../apache/ambari/server/orm/dao/CrudDAO.java | 2 +-
.../ambari/server/orm/dao/ExtensionDAO.java | 2 +-
.../ambari/server/orm/dao/ExtensionLinkDAO.java | 2 +-
.../apache/ambari/server/orm/dao/GroupDAO.java | 2 +-
.../server/orm/dao/HostAlertSummaryDTO.java | 2 +-
.../orm/dao/HostComponentDesiredStateDAO.java | 2 +-
.../server/orm/dao/HostComponentStateDAO.java | 33 +-
.../server/orm/dao/HostConfigMappingDAO.java | 2 +-
.../apache/ambari/server/orm/dao/HostDAO.java | 2 +-
.../dao/HostRoleCommandStatusSummaryDTO.java | 2 +-
.../ambari/server/orm/dao/HostStateDAO.java | 2 +-
.../ambari/server/orm/dao/HostVersionDAO.java | 179 +-
.../server/orm/dao/KerberosDescriptorDAO.java | 34 +-
.../apache/ambari/server/orm/dao/MemberDAO.java | 2 +-
.../ambari/server/orm/dao/PrivilegeDAO.java | 2 +-
.../server/orm/dao/RemoteAmbariClusterDAO.java | 2 +-
.../server/orm/dao/RepositoryVersionDAO.java | 25 +-
.../orm/dao/RequestOperationLevelDAO.java | 2 +-
.../orm/dao/RequestScheduleBatchRequestDAO.java | 2 +-
.../server/orm/dao/RequestScheduleDAO.java | 2 +-
.../ambari/server/orm/dao/ResourceDAO.java | 2 +-
.../ambari/server/orm/dao/ResourceTypeDAO.java | 2 +-
.../dao/ServiceComponentDesiredStateDAO.java | 54 +-
.../ambari/server/orm/dao/ServiceConfigDAO.java | 17 +-
.../server/orm/dao/ServiceDesiredStateDAO.java | 2 +-
.../ambari/server/orm/dao/SettingDAO.java | 2 +-
.../apache/ambari/server/orm/dao/StackDAO.java | 16 +-
.../server/orm/dao/TopologyHostGroupDAO.java | 2 +-
.../server/orm/dao/TopologyHostRequestDAO.java | 2 +-
.../server/orm/dao/TopologyHostTaskDAO.java | 2 +-
.../orm/dao/TopologyLogicalRequestDAO.java | 2 +-
.../server/orm/dao/TopologyLogicalTaskDAO.java | 2 +-
.../server/orm/dao/TopologyRequestDAO.java | 2 +-
.../ambari/server/orm/dao/UpgradeDAO.java | 2 +-
.../apache/ambari/server/orm/dao/UserDAO.java | 2 +-
.../apache/ambari/server/orm/dao/ViewDAO.java | 2 +-
.../ambari/server/orm/dao/ViewInstanceDAO.java | 2 +-
.../ambari/server/orm/dao/ViewURLDAO.java | 2 +-
.../apache/ambari/server/orm/dao/WidgetDAO.java | 2 +-
.../ambari/server/orm/dao/WidgetLayoutDAO.java | 2 +-
.../server/orm/entities/AlertCurrentEntity.java | 2 +-
.../orm/entities/AlertDefinitionEntity.java | 2 +-
.../server/orm/entities/AlertGroupEntity.java | 4 +-
.../server/orm/entities/AlertHistoryEntity.java | 4 +-
.../server/orm/entities/AlertNoticeEntity.java | 2 +-
.../server/orm/entities/AlertTargetEntity.java | 4 +-
.../server/orm/entities/ArtifactEntity.java | 2 +-
.../server/orm/entities/ArtifactEntityPK.java | 2 +-
.../orm/entities/BlueprintConfigEntity.java | 2 +-
.../orm/entities/BlueprintConfigEntityPK.java | 2 +-
.../server/orm/entities/BlueprintEntity.java | 2 +-
.../orm/entities/BlueprintSettingEntity.java | 2 +-
.../orm/entities/ClusterConfigEntity.java | 2 +-
.../server/orm/entities/ClusterEntity.java | 25 +-
.../orm/entities/ClusterServiceEntity.java | 2 +-
.../orm/entities/ClusterServiceEntityPK.java | 2 +-
.../server/orm/entities/ClusterStateEntity.java | 2 +-
.../orm/entities/ClusterVersionEntity.java | 217 -
.../ConfigGroupConfigMappingEntity.java | 2 +-
.../ConfigGroupConfigMappingEntityPK.java | 2 +-
.../server/orm/entities/ConfigGroupEntity.java | 2 +-
.../entities/ConfigGroupHostMappingEntity.java | 2 +-
.../ConfigGroupHostMappingEntityPK.java | 2 +-
.../server/orm/entities/ExtensionEntity.java | 2 +-
.../orm/entities/ExtensionLinkEntity.java | 2 +-
.../ambari/server/orm/entities/GroupEntity.java | 2 +-
.../HostComponentDesiredStateEntity.java | 23 +-
.../orm/entities/HostComponentStateEntity.java | 24 +-
.../ambari/server/orm/entities/HostEntity.java | 2 +-
.../ambari/server/orm/entities/HostEntity_.java | 4 +-
.../orm/entities/HostGroupComponentEntity.java | 2 +-
.../entities/HostGroupComponentEntityPK.java | 2 +-
.../orm/entities/HostGroupConfigEntity.java | 2 +-
.../orm/entities/HostGroupConfigEntityPK.java | 2 +-
.../server/orm/entities/HostGroupEntity.java | 2 +-
.../server/orm/entities/HostGroupEntityPK.java | 2 +-
.../server/orm/entities/HostStateEntity.java | 2 +-
.../server/orm/entities/HostVersionEntity.java | 73 +-
.../orm/entities/LdapSyncEventEntity.java | 2 +-
.../server/orm/entities/LdapSyncSpecEntity.java | 2 +-
.../server/orm/entities/MemberEntity.java | 2 +-
.../orm/entities/OperatingSystemEntity.java | 2 +-
.../server/orm/entities/PrincipalEntity.java | 2 +-
.../orm/entities/PrincipalTypeEntity.java | 12 +-
.../orm/entities/RemoteAmbariClusterEntity.java | 2 +-
.../RemoteAmbariClusterServiceEntity.java | 2 +-
.../server/orm/entities/RepositoryEntity.java | 2 +-
.../orm/entities/RepositoryVersionEntity.java | 87 +-
.../server/orm/entities/RequestEntity.java | 19 +
.../RequestScheduleBatchRequestEntity.java | 2 +-
.../RequestScheduleBatchRequestEntityPK.java | 2 +-
.../orm/entities/RequestScheduleEntity.java | 2 +-
.../server/orm/entities/ResourceEntity.java | 2 +-
.../server/orm/entities/ResourceTypeEntity.java | 2 +-
.../ServiceComponentDesiredStateEntity.java | 133 +-
.../entities/ServiceComponentHistoryEntity.java | 181 -
.../entities/ServiceComponentVersionEntity.java | 2 +-
.../orm/entities/ServiceConfigEntity.java | 24 +-
.../orm/entities/ServiceDesiredStateEntity.java | 87 +-
.../entities/ServiceDesiredStateEntityPK.java | 2 +-
.../server/orm/entities/SettingEntity.java | 2 +-
.../ambari/server/orm/entities/StageEntity.java | 18 -
.../server/orm/entities/StageEntity_.java | 4 -
.../orm/entities/TopologyHostGroupEntity.java | 2 +-
.../orm/entities/TopologyHostInfoEntity.java | 2 +-
.../orm/entities/TopologyHostRequestEntity.java | 2 +-
.../orm/entities/TopologyHostTaskEntity.java | 2 +-
.../entities/TopologyLogicalRequestEntity.java | 2 +-
.../orm/entities/TopologyLogicalTaskEntity.java | 2 +-
.../orm/entities/TopologyRequestEntity.java | 2 +-
.../server/orm/entities/UpgradeEntity.java | 168 +-
.../server/orm/entities/UpgradeGroupEntity.java | 2 +-
.../orm/entities/UpgradeHistoryEntity.java | 233 +
.../server/orm/entities/UpgradeItemEntity.java | 2 +-
.../ambari/server/orm/entities/UserEntity.java | 2 +-
.../ambari/server/orm/entities/ViewEntity.java | 2 +-
.../server/orm/entities/ViewEntityEntity.java | 2 +-
.../orm/entities/ViewInstanceDataEntity.java | 2 +-
.../orm/entities/ViewInstanceDataEntityPK.java | 2 +-
.../server/orm/entities/ViewInstanceEntity.java | 2 +-
.../entities/ViewInstancePropertyEntity.java | 2 +-
.../entities/ViewInstancePropertyEntityPK.java | 2 +-
.../orm/entities/ViewParameterEntity.java | 2 +-
.../orm/entities/ViewParameterEntityPK.java | 2 +-
.../server/orm/entities/ViewResourceEntity.java | 2 +-
.../orm/entities/ViewResourceEntityPK.java | 2 +-
.../server/orm/entities/ViewURLEntity.java | 2 +-
.../server/orm/entities/WidgetEntity.java | 2 +-
.../server/orm/entities/WidgetLayoutEntity.java | 4 +-
.../entities/WidgetLayoutUserWidgetEntity.java | 4 +-
.../WidgetLayoutUserWidgetEntityPK.java | 4 +-
.../ambari/server/orm/helpers/ScriptRunner.java | 10 +-
.../server/orm/helpers/dbms/DbmsHelper.java | 21 +
.../orm/helpers/dbms/GenericDbmsHelper.java | 8 +
.../server/orm/helpers/dbms/H2Helper.java | 2 +-
.../server/orm/helpers/dbms/MySqlHelper.java | 12 +
.../server/orm/helpers/dbms/OracleHelper.java | 12 +
.../server/orm/helpers/dbms/PostgresHelper.java | 12 +
.../server/orm/models/HostComponentSummary.java | 2 +-
.../ambari/server/proxy/ProxyService.java | 2 +-
.../server/resources/ResourceManager.java | 2 +-
.../server/resources/api/rest/GetResource.java | 2 +-
.../scheduler/AbstractLinearExecutionJob.java | 2 +-
.../ambari/server/scheduler/ExecutionJob.java | 2 +-
.../scheduler/ExecutionScheduleManager.java | 6 +-
.../server/scheduler/ExecutionScheduler.java | 2 +-
.../scheduler/ExecutionSchedulerImpl.java | 4 +-
.../server/security/CertificateManager.java | 2 +-
.../server/security/ClientSecurityType.java | 2 +-
.../security/InternalSSLSocketFactory.java | 112 +
.../InternalSSLSocketFactoryNonTrusting.java | 49 +
.../InternalSSLSocketFactoryTrusting.java | 48 +
.../ambari/server/security/SecurityFilter.java | 2 +-
.../ambari/server/security/SecurityHelper.java | 2 +-
.../server/security/SecurityHelperImpl.java | 2 +-
.../server/security/SignCertResponse.java | 2 +-
.../ambari/server/security/SignMessage.java | 2 +-
.../authorization/AmbariAuthentication.java | 2 +-
.../authorization/AmbariGrantedAuthority.java | 2 +-
.../AmbariLdapAuthoritiesPopulator.java | 2 +-
.../authorization/AmbariLocalUserProvider.java | 2 +-
.../AmbariPamAuthenticationProvider.java | 2 +-
.../authorization/AmbariUserAuthentication.java | 2 +-
.../AmbariUserAuthorizationFilter.java | 2 +-
...ateLdapUserFoundAuthenticationException.java | 2 +-
.../security/authorization/GroupType.java | 2 +-
.../authorization/LdapServerProperties.java | 2 +-
.../PamAuthenticationException.java | 2 +-
.../server/security/authorization/User.java | 12 +
.../authorization/UserIdAuthentication.java | 2 +-
.../server/security/authorization/UserType.java | 2 +-
.../InternalAuthenticationInterceptor.java | 2 +-
.../internal/InternalTokenStorage.java | 2 +-
.../RunWithInternalSecurityContext.java | 2 +-
.../security/encryption/AESEncryptor.java | 26 +-
.../encryption/AbstractCredentialStore.java | 4 +-
.../security/encryption/CredentialProvider.java | 2 +-
.../security/encryption/EncryptionResult.java | 2 +-
.../security/encryption/MasterKeyService.java | 2 +-
.../encryption/MasterKeyServiceImpl.java | 10 +-
.../server/security/ldap/LdapBatchDto.java | 2 +-
.../server/security/ldap/LdapGroupDto.java | 2 +-
.../server/security/ldap/LdapSyncDto.java | 2 +-
.../server/security/ldap/LdapUserDto.java | 2 +-
.../security/ldap/LdapUserGroupMemberDto.java | 2 +-
.../unsecured/rest/CertificateDownload.java | 2 +-
.../unsecured/rest/CertificateSign.java | 2 +-
.../security/unsecured/rest/ConnectionInfo.java | 2 +-
.../server/serveraction/ServerAction.java | 2 +-
.../serveraction/ServerActionExecutor.java | 3 +-
.../kerberos/ADKerberosOperationHandler.java | 39 +-
.../kerberos/IPAKerberosOperationHandler.java | 8 +-
.../KerberosKDCSSLConnectionException.java | 45 +
.../kerberos/KerberosOperationHandler.java | 6 -
.../PrepareDisableKerberosServerAction.java | 4 +-
.../kerberos/TrustingSSLSocketFactory.java | 101 -
.../UpdateKerberosConfigsServerAction.java | 5 +-
.../upgrades/AbstractUpgradeServerAction.java | 51 +-
.../upgrades/AutoSkipFailedSummaryAction.java | 12 +-
.../upgrades/ComponentVersionCheckAction.java | 26 +-
.../serveraction/upgrades/ConfigureAction.java | 34 +-
.../upgrades/FinalizeUpgradeAction.java | 558 +-
.../FixCapacitySchedulerOrderingPolicy.java | 2 +-
.../upgrades/FixYarnWebServiceUrl.java | 2 +-
.../upgrades/HiveZKQuorumConfigAction.java | 2 +-
.../upgrades/KerberosKeytabsAction.java | 2 +-
.../upgrades/ManualStageAction.java | 2 +-
.../upgrades/RangerConfigCalculation.java | 2 +-
.../RangerKerberosConfigCalculation.java | 4 +-
.../upgrades/RangerKmsProxyConfig.java | 2 +-
.../upgrades/RangerWebAlertConfigAction.java | 2 +-
.../upgrades/UpdateDesiredStackAction.java | 179 +-
.../upgrades/ZooKeeperQuorumCalculator.java | 2 +-
.../users/CollectionPersisterService.java | 2 +-
.../CollectionPersisterServiceFactory.java | 2 +-
.../users/CsvFilePersisterService.java | 2 +-
.../users/PostUserCreationHookServerAction.java | 2 +-
.../users/ShellCommandCallableFactory.java | 2 +-
.../users/ShellCommandUtilityCallable.java | 2 +-
.../users/ShellCommandUtilityWrapper.java | 2 +-
.../apache/ambari/server/stack/BaseModule.java | 2 +-
.../server/stack/CommonServiceDirectory.java | 10 +-
.../ambari/server/stack/ComponentModule.java | 2 +-
.../server/stack/ConfigurationDirectory.java | 2 +-
.../ambari/server/stack/ConfigurationInfo.java | 2 +-
.../server/stack/ConfigurationModule.java | 2 +-
.../ambari/server/stack/ExtensionDirectory.java | 2 +-
.../ambari/server/stack/ExtensionHelper.java | 2 +-
.../ambari/server/stack/ExtensionModule.java | 2 +-
.../apache/ambari/server/stack/HostsType.java | 2 +-
.../ambari/server/stack/MasterHostResolver.java | 64 +-
.../server/stack/ModuleFileUnmarshaller.java | 6 +-
.../apache/ambari/server/stack/ModuleState.java | 2 +-
.../server/stack/NoSuchStackException.java | 2 +-
.../stack/QuickLinksConfigurationModule.java | 2 +-
.../apache/ambari/server/stack/RepoUtil.java | 8 +-
.../ambari/server/stack/ServiceDirectory.java | 2 +-
.../ambari/server/stack/ServiceModule.java | 4 +-
.../ambari/server/stack/StackContext.java | 2 +-
.../server/stack/StackDefinitionDirectory.java | 2 +-
.../server/stack/StackDefinitionModule.java | 2 +-
.../ambari/server/stack/StackDirectory.java | 2 +-
.../ambari/server/stack/StackManager.java | 2 +-
.../server/stack/StackManagerFactory.java | 2 +-
.../apache/ambari/server/stack/StackModule.java | 2 +-
.../server/stack/StackServiceDirectory.java | 11 +-
.../apache/ambari/server/stack/ThemeModule.java | 2 +-
.../stack/UpdateActiveRepoVersionOnStartup.java | 51 +-
.../apache/ambari/server/stack/Validable.java | 2 +-
.../ambari/server/stageplanner/RoleGraph.java | 53 +-
.../server/stageplanner/RoleGraphFactory.java | 2 +-
.../server/stageplanner/RoleGraphNode.java | 2 +-
.../ambari/server/state/AgentVersion.java | 2 +-
.../org/apache/ambari/server/state/Alert.java | 2 +-
.../ambari/server/state/AlertFirmness.java | 2 +-
.../apache/ambari/server/state/AlertState.java | 2 +-
.../ambari/server/state/AutoDeployInfo.java | 2 +-
.../server/state/BulkCommandDefinition.java | 2 +-
.../ambari/server/state/ChangedConfigInfo.java | 2 +-
.../apache/ambari/server/state/CheckHelper.java | 37 +-
.../state/ClientConfigFileDefinition.java | 2 +-
.../org/apache/ambari/server/state/Cluster.java | 181 +-
.../server/state/ClusterHealthReport.java | 45 +-
.../apache/ambari/server/state/Clusters.java | 11 +-
.../server/state/CommandScriptDefinition.java | 2 +-
.../org/apache/ambari/server/state/Config.java | 2 +-
.../ambari/server/state/ConfigFactory.java | 15 +-
.../ambari/server/state/ConfigHelper.java | 296 +-
.../apache/ambari/server/state/ConfigImpl.java | 24 +-
.../ambari/server/state/ConfigMergeHelper.java | 2 +-
.../server/state/CredentialStoreInfo.java | 2 +-
.../server/state/CustomCommandDefinition.java | 2 +-
.../server/state/DependencyConditionInfo.java | 2 +-
.../ambari/server/state/DependencyInfo.java | 2 +-
.../apache/ambari/server/state/ExtensionId.java | 2 +-
.../ambari/server/state/ExtensionInfo.java | 2 +-
.../org/apache/ambari/server/state/Host.java | 2 +-
.../server/state/HostComponentAdminState.java | 2 +-
.../apache/ambari/server/state/HostEvent.java | 2 +-
.../ambari/server/state/HostEventType.java | 2 +-
.../ambari/server/state/HostHealthStatus.java | 2 +-
.../apache/ambari/server/state/HostState.java | 2 +-
.../ambari/server/state/LogDefinition.java | 2 +-
.../ambari/server/state/MaintenanceState.java | 2 +-
.../ambari/server/state/NotificationState.java | 2 +-
.../server/state/OperatingSystemInfo.java | 2 +-
.../server/state/PropertyDependencyInfo.java | 2 +-
.../ambari/server/state/PropertyInfo.java | 2 +-
.../state/PropertyStackUpgradeBehavior.java | 2 +-
.../server/state/PropertyUpgradeBehavior.java | 2 +-
.../state/QuickLinksConfigurationInfo.java | 10 +-
.../ambari/server/state/RepositoryInfo.java | 2 +-
.../ambari/server/state/RepositoryType.java | 2 +-
.../server/state/RepositoryVersionState.java | 58 +-
.../org/apache/ambari/server/state/Service.java | 23 +-
.../ambari/server/state/ServiceComponent.java | 14 +-
.../server/state/ServiceComponentFactory.java | 5 +-
.../server/state/ServiceComponentHost.java | 40 +-
.../server/state/ServiceComponentHostEvent.java | 2 +-
.../state/ServiceComponentHostEventType.java | 2 +-
.../state/ServiceComponentHostFactory.java | 2 +-
.../server/state/ServiceComponentImpl.java | 76 +-
.../ambari/server/state/ServiceFactory.java | 27 +-
.../apache/ambari/server/state/ServiceImpl.java | 129 +-
.../apache/ambari/server/state/ServiceInfo.java | 2 +-
.../ambari/server/state/ServiceOsSpecific.java | 2 +-
.../server/state/ServicePropertyInfo.java | 2 +-
.../org/apache/ambari/server/state/StackId.java | 2 +-
.../apache/ambari/server/state/StackInfo.java | 4 +-
.../org/apache/ambari/server/state/State.java | 2 +-
.../apache/ambari/server/state/ThemeInfo.java | 2 +-
.../ambari/server/state/UpgradeContext.java | 1011 +-
.../server/state/UpgradeContextFactory.java | 17 +-
.../ambari/server/state/UpgradeHelper.java | 347 +-
.../ambari/server/state/UpgradeState.java | 2 +-
.../server/state/ValueAttributesInfo.java | 75 +-
.../ambari/server/state/ValueEntryInfo.java | 8 +-
.../ambari/server/state/action/Action.java | 2 +-
.../state/action/ActionCompletedEvent.java | 2 +-
.../ambari/server/state/action/ActionEvent.java | 2 +-
.../server/state/action/ActionEventType.java | 2 +-
.../server/state/action/ActionFailedEvent.java | 2 +-
.../ambari/server/state/action/ActionId.java | 2 +-
.../ambari/server/state/action/ActionImpl.java | 2 +-
.../server/state/action/ActionInitEvent.java | 2 +-
.../state/action/ActionProgressUpdateEvent.java | 2 +-
.../ambari/server/state/action/ActionState.java | 2 +-
.../ambari/server/state/action/ActionType.java | 2 +-
.../state/alert/AggregateDefinitionMapping.java | 2 +-
.../server/state/alert/AggregateSource.java | 2 +-
.../server/state/alert/AlertDefinition.java | 2 +-
.../state/alert/AlertDefinitionFactory.java | 2 +-
.../server/state/alert/AlertDefinitionHash.java | 2 +-
.../ambari/server/state/alert/AlertGroup.java | 2 +-
.../server/state/alert/AlertNotification.java | 2 +-
.../ambari/server/state/alert/AlertTarget.java | 2 +-
.../ambari/server/state/alert/AlertUri.java | 4 +-
.../ambari/server/state/alert/AmsSource.java | 2 +-
.../ambari/server/state/alert/MetricSource.java | 2 +-
.../server/state/alert/ParameterizedSource.java | 2 +-
.../server/state/alert/PercentSource.java | 2 +-
.../ambari/server/state/alert/PortSource.java | 2 +-
.../server/state/alert/RecoverySource.java | 2 +-
.../ambari/server/state/alert/Reporting.java | 2 +-
.../apache/ambari/server/state/alert/Scope.java | 2 +-
.../ambari/server/state/alert/ScriptSource.java | 2 +-
.../ambari/server/state/alert/ServerSource.java | 2 +-
.../ambari/server/state/alert/Source.java | 2 +-
.../ambari/server/state/alert/SourceType.java | 2 +-
.../ambari/server/state/alert/TargetType.java | 2 +-
.../ambari/server/state/alert/WebSource.java | 2 +-
.../server/state/cluster/ClusterFactory.java | 2 +-
.../server/state/cluster/ClusterImpl.java | 984 +-
.../server/state/cluster/ClustersImpl.java | 60 +-
.../server/state/configgroup/ConfigGroup.java | 4 +-
.../state/configgroup/ConfigGroupFactory.java | 7 +-
.../state/configgroup/ConfigGroupImpl.java | 37 +-
.../fsm/InvalidStateTransitionException.java | 2 +-
.../server/state/fsm/MultipleArcTransition.java | 2 +-
.../server/state/fsm/SingleArcTransition.java | 2 +-
.../ambari/server/state/fsm/StateMachine.java | 2 +-
.../server/state/fsm/StateMachineFactory.java | 2 +-
.../server/state/fsm/event/AbstractEvent.java | 2 +-
.../ambari/server/state/fsm/event/Event.java | 2 +-
.../server/state/fsm/event/EventHandler.java | 2 +-
.../ambari/server/state/host/HostFactory.java | 2 +-
.../state/host/HostHealthyHeartbeatEvent.java | 2 +-
.../state/host/HostHeartbeatLostEvent.java | 2 +-
.../ambari/server/state/host/HostImpl.java | 7 +-
.../host/HostRegistrationRequestEvent.java | 2 +-
.../host/HostStatusUpdatesReceivedEvent.java | 2 +-
.../state/host/HostUnhealthyHeartbeatEvent.java | 2 +-
.../kerberos/AbstractKerberosDescriptor.java | 2 +-
.../kerberos/KerberosComponentDescriptor.java | 2 +-
.../state/kerberos/KerberosDescriptor.java | 51 +
.../kerberos/KerberosIdentityDescriptor.java | 2 +-
.../kerberos/KerberosPrincipalDescriptor.java | 2 +-
.../kerberos/KerberosServiceDescriptor.java | 2 +-
.../kerberos/VariableReplacementHelper.java | 23 +-
.../server/state/quicklinksprofile/Filter.java | 4 +-
.../state/repository/AvailableService.java | 2 +-
.../repository/AvailableServiceReference.java | 2 +-
.../state/repository/AvailableVersion.java | 2 +-
.../state/repository/ManifestService.java | 2 +-
.../state/repository/ManifestServiceInfo.java | 2 +-
.../ambari/server/state/repository/Release.java | 2 +-
.../state/repository/VersionDefinitionXml.java | 2 +-
.../server/state/repository/package-info.java | 2 +-
.../ambari/server/state/scheduler/Batch.java | 2 +-
.../server/state/scheduler/BatchRequest.java | 2 +-
.../server/state/scheduler/BatchRequestJob.java | 2 +-
.../state/scheduler/BatchRequestResponse.java | 2 +-
.../server/state/scheduler/BatchSettings.java | 2 +-
.../state/scheduler/RequestExecution.java | 2 +-
.../scheduler/RequestExecutionFactory.java | 2 +-
.../state/scheduler/RequestExecutionImpl.java | 2 +-
.../ambari/server/state/scheduler/Schedule.java | 2 +-
.../services/AlertNoticeDispatchService.java | 2 +-
.../services/AmbariServerAlertService.java | 2 +-
.../state/services/CachedAlertFlushService.java | 4 +-
.../state/services/MetricsRetrievalService.java | 2 +-
.../services/RetryUpgradeActionService.java | 24 +-
.../server/state/stack/ConfigUpgradePack.java | 2 +-
.../server/state/stack/ConfigurationXml.java | 2 +-
.../state/stack/ExtensionMetainfoXml.java | 2 +-
.../server/state/stack/JsonOsFamilyEntry.java | 2 +-
.../server/state/stack/JsonOsFamilyRoot.java | 2 +-
.../server/state/stack/LatestRepoCallable.java | 2 +-
.../ambari/server/state/stack/Metric.java | 4 +-
.../server/state/stack/MetricDefinition.java | 2 +-
.../ambari/server/state/stack/OsFamily.java | 16 +-
.../server/state/stack/RepositoryXml.java | 2 +-
.../server/state/stack/ServiceMetainfoXml.java | 2 +-
.../server/state/stack/StackMetainfoXml.java | 2 +-
.../state/stack/StackRoleCommandOrder.java | 2 +-
.../server/state/stack/TrimmingAdapter.java | 4 +-
.../ambari/server/state/stack/UpgradePack.java | 2 +-
.../ambari/server/state/stack/WidgetLayout.java | 2 +-
.../server/state/stack/WidgetLayoutInfo.java | 2 +-
.../ambari/server/state/stack/package-info.java | 4 +-
.../server/state/stack/upgrade/Batch.java | 2 +-
.../state/stack/upgrade/ClusterGrouping.java | 9 +-
.../state/stack/upgrade/ColocatedGrouping.java | 2 +-
.../server/state/stack/upgrade/Condition.java | 2 +-
.../upgrade/ConfigUpgradeChangeDefinition.java | 4 +-
.../stack/upgrade/ConfigurationCondition.java | 2 +-
.../state/stack/upgrade/ConfigureFunction.java | 2 +-
.../state/stack/upgrade/ConfigureTask.java | 4 +-
.../server/state/stack/upgrade/Direction.java | 11 +-
.../state/stack/upgrade/ExecuteHostType.java | 2 +-
.../server/state/stack/upgrade/ExecuteTask.java | 4 +-
.../server/state/stack/upgrade/Grouping.java | 2 +-
.../state/stack/upgrade/HostOrderGrouping.java | 17 +-
.../state/stack/upgrade/HostOrderItem.java | 4 +-
.../server/state/stack/upgrade/ManualTask.java | 2 +-
.../state/stack/upgrade/ParallelScheduler.java | 2 +-
.../state/stack/upgrade/PropertyKeyState.java | 2 +-
.../stack/upgrade/RepositoryVersionHelper.java | 130 +-
.../state/stack/upgrade/RestartGrouping.java | 2 +-
.../server/state/stack/upgrade/RestartTask.java | 4 +-
.../state/stack/upgrade/SecurityCondition.java | 2 +-
.../state/stack/upgrade/ServerActionTask.java | 2 +-
.../stack/upgrade/ServerSideActionTask.java | 2 +-
.../stack/upgrade/ServiceCheckGrouping.java | 5 +-
.../state/stack/upgrade/ServiceCheckTask.java | 4 +-
.../state/stack/upgrade/StageWrapper.java | 2 +-
.../stack/upgrade/StageWrapperBuilder.java | 2 +-
.../state/stack/upgrade/StartGrouping.java | 2 +-
.../server/state/stack/upgrade/StartTask.java | 4 +-
.../state/stack/upgrade/StopGrouping.java | 2 +-
.../server/state/stack/upgrade/StopTask.java | 4 +-
.../ambari/server/state/stack/upgrade/Task.java | 2 +-
.../server/state/stack/upgrade/TaskWrapper.java | 2 +-
.../state/stack/upgrade/TaskWrapperBuilder.java | 2 +-
.../stack/upgrade/TransferCoercionType.java | 2 +-
.../state/stack/upgrade/TransferOperation.java | 2 +-
.../stack/upgrade/UpdateStackGrouping.java | 2 +-
.../state/stack/upgrade/UpgradeFunction.java | 2 +-
.../state/stack/upgrade/UpgradeScope.java | 11 +-
.../server/state/stack/upgrade/UpgradeType.java | 2 +-
.../svccomphost/ServiceComponentHostImpl.java | 205 +-
.../ServiceComponentHostInstallEvent.java | 2 +-
.../ServiceComponentHostOpFailedEvent.java | 2 +-
.../ServiceComponentHostOpInProgressEvent.java | 2 +-
.../ServiceComponentHostOpRestartedEvent.java | 2 +-
.../ServiceComponentHostOpSucceededEvent.java | 2 +-
.../ServiceComponentHostStartEvent.java | 2 +-
.../ServiceComponentHostStartedEvent.java | 2 +-
.../ServiceComponentHostStopEvent.java | 2 +-
.../ServiceComponentHostStoppedEvent.java | 2 +-
.../ServiceComponentHostSummary.java | 106 +-
.../ServiceComponentHostUninstallEvent.java | 2 +-
.../ServiceComponentHostUpgradeEvent.java | 2 +-
.../ServiceComponentHostWipeoutEvent.java | 2 +-
.../server/state/theme/ConfigCondition.java | 15 +-
.../server/state/theme/ConfigPlacement.java | 25 +-
.../ambari/server/state/theme/Layout.java | 5 +
.../ambari/server/state/theme/Section.java | 22 +-
.../ambari/server/state/theme/Subsection.java | 13 +-
.../apache/ambari/server/state/theme/Tab.java | 12 +-
.../ambari/server/state/theme/TabLayout.java | 8 +-
.../apache/ambari/server/state/theme/Theme.java | 9 +-
.../server/state/theme/ThemeConfiguration.java | 10 +-
.../apache/ambari/server/state/theme/Unit.java | 7 +-
.../ambari/server/state/theme/Widget.java | 12 +-
.../ambari/server/state/theme/WidgetEntry.java | 9 +-
.../ambari/server/topology/AmbariContext.java | 15 +-
.../ambari/server/topology/Blueprint.java | 5 +-
.../server/topology/BlueprintFactory.java | 2 +-
.../ambari/server/topology/BlueprintImpl.java | 39 +-
.../server/topology/BlueprintValidator.java | 2 +-
.../server/topology/BlueprintValidatorImpl.java | 2 +-
.../ambari/server/topology/Cardinality.java | 2 +-
.../topology/ClusterConfigurationRequest.java | 6 +-
.../ambari/server/topology/ClusterTopology.java | 2 +-
.../server/topology/ClusterTopologyImpl.java | 2 +-
.../ambari/server/topology/Component.java | 2 +-
.../ambari/server/topology/Configuration.java | 2 +-
.../server/topology/ConfigurationFactory.java | 2 +-
.../ambari/server/topology/Credential.java | 2 +-
.../ambari/server/topology/HostGroup.java | 2 +-
.../ambari/server/topology/HostGroupImpl.java | 2 +-
.../ambari/server/topology/HostGroupInfo.java | 2 +-
.../ambari/server/topology/HostRequest.java | 2 +-
.../topology/InvalidTopologyException.java | 2 +-
.../InvalidTopologyTemplateException.java | 2 +-
.../topology/KerberosDescriptorFactory.java | 5 +-
.../server/topology/LogicalRequestFactory.java | 2 +-
.../topology/NoSuchBlueprintException.java | 2 +-
.../topology/NoSuchHostGroupException.java | 2 +-
.../ambari/server/topology/PersistedState.java | 2 +-
.../server/topology/PersistedStateImpl.java | 2 +-
.../topology/PersistedTopologyRequest.java | 2 +-
.../server/topology/RepositorySetting.java | 116 +
.../server/topology/SecurityConfiguration.java | 2 +-
.../topology/SecurityConfigurationFactory.java | 2 +-
.../apache/ambari/server/topology/Setting.java | 4 +-
.../ambari/server/topology/SettingFactory.java | 2 +-
.../ambari/server/topology/TopologyManager.java | 54 +-
.../ambari/server/topology/TopologyRequest.java | 2 +-
.../server/topology/TopologyRequestFactory.java | 2 +-
.../topology/TopologyRequestFactoryImpl.java | 2 +-
.../server/topology/TopologyValidator.java | 2 +-
.../tasks/ConfigureClusterTaskFactory.java | 2 +-
.../server/topology/tasks/TopologyTask.java | 2 +-
.../RequiredConfigPropertiesValidator.java | 13 +-
.../server/upgrade/AbstractUpgradeCatalog.java | 30 +-
.../server/upgrade/FinalUpgradeCatalog.java | 30 +-
.../server/upgrade/StackUpgradeHelper.java | 171 -
.../ambari/server/upgrade/StackUpgradeUtil.java | 198 -
.../server/upgrade/UpgradeCatalog200.java | 14 +-
.../server/upgrade/UpgradeCatalog210.java | 24 +-
.../server/upgrade/UpgradeCatalog212.java | 10 +-
.../server/upgrade/UpgradeCatalog2121.java | 64 +-
.../server/upgrade/UpgradeCatalog220.java | 177 +-
.../server/upgrade/UpgradeCatalog221.java | 11 +-
.../server/upgrade/UpgradeCatalog222.java | 146 +-
.../server/upgrade/UpgradeCatalog240.java | 47 +-
.../server/upgrade/UpgradeCatalog250.java | 29 +-
.../server/upgrade/UpgradeCatalog251.java | 118 +
.../server/upgrade/UpgradeCatalog252.java | 2 +-
.../server/upgrade/UpgradeCatalog300.java | 19 +
.../apache/ambari/server/utils/DateUtils.java | 2 +-
.../server/utils/EventBusSynchronizer.java | 2 +-
.../apache/ambari/server/utils/HTTPUtils.java | 5 +-
.../apache/ambari/server/utils/HostAndPort.java | 4 +-
.../ambari/server/utils/JaxbMapKeyList.java | 2 +-
.../server/utils/JaxbMapKeyListAdapter.java | 2 +-
.../ambari/server/utils/JaxbMapKeyMap.java | 2 +-
.../server/utils/JaxbMapKeyMapAdapter.java | 2 +-
.../ambari/server/utils/JaxbMapKeyVal.java | 2 +-
.../server/utils/JaxbMapKeyValAdapter.java | 2 +-
.../apache/ambari/server/utils/LoopBody.java | 4 +-
.../apache/ambari/server/utils/Parallel.java | 2 +-
.../ambari/server/utils/ParallelLoopResult.java | 2 +-
.../ambari/server/utils/RequestUtils.java | 2 +-
.../ambari/server/utils/SecretReference.java | 2 +-
.../apache/ambari/server/utils/SetUtils.java | 2 +-
.../ambari/server/utils/ShellCommandUtil.java | 25 +-
.../apache/ambari/server/utils/StageUtils.java | 10 +-
.../ambari/server/utils/VersionUtils.java | 2 +-
.../apache/ambari/server/view/ClusterImpl.java | 2 +-
.../ambari/server/view/DefaultMasker.java | 2 +-
.../ambari/server/view/DirectoryWatcher.java | 2 +-
.../server/view/HttpImpersonatorImpl.java | 2 +-
.../server/view/IllegalClusterException.java | 2 +-
.../server/view/ImpersonatorSettingImpl.java | 2 +-
.../ambari/server/view/RemoteAmbariCluster.java | 2 +-
.../view/RemoteAmbariClusterRegistry.java | 2 +-
.../RemoteAmbariConfigurationReadException.java | 2 +-
.../server/view/RemoteAmbariStreamProvider.java | 2 +-
.../server/view/ViewAmbariStreamProvider.java | 2 +-
.../ambari/server/view/ViewArchiveUtility.java | 2 +-
.../ambari/server/view/ViewClassLoader.java | 2 +-
.../ambari/server/view/ViewContextImpl.java | 2 +-
.../view/ViewDataMigrationContextImpl.java | 2 +-
.../server/view/ViewDataMigrationUtility.java | 2 +-
.../server/view/ViewDirectoryWatcher.java | 2 +-
.../view/ViewExternalSubResourceProvider.java | 2 +-
.../ambari/server/view/ViewExtractor.java | 2 +-
.../server/view/ViewInstanceHandlerList.java | 2 +-
.../ambari/server/view/ViewProviderModule.java | 2 +-
.../apache/ambari/server/view/ViewRegistry.java | 31 +-
.../server/view/ViewSubResourceDefinition.java | 2 +-
.../server/view/ViewSubResourceProvider.java | 2 +-
.../ambari/server/view/ViewThrottleFilter.java | 2 +-
.../server/view/ViewURLStreamProvider.java | 2 +-
.../server/view/configuration/EntityConfig.java | 2 +-
.../view/configuration/InstanceConfig.java | 2 +-
.../view/configuration/ParameterConfig.java | 2 +-
.../view/configuration/PermissionConfig.java | 2 +-
.../view/configuration/PersistenceConfig.java | 2 +-
.../view/configuration/PropertyConfig.java | 2 +-
.../view/configuration/ResourceConfig.java | 2 +-
.../server/view/configuration/ViewConfig.java | 2 +-
.../ambari/server/view/events/EventImpl.java | 2 +-
.../server/view/persistence/DataStoreImpl.java | 2 +-
.../view/persistence/DataStoreModule.java | 4 +-
.../view/persistence/SchemaManagerFactory.java | 2 +-
.../InstanceValidationResultImpl.java | 2 +-
.../view/validation/ValidationException.java | 2 +-
.../view/validation/ValidationResultImpl.java | 2 +-
ambari-server/src/main/python/ambari-server.py | 8 +-
.../ambari_server/dbConfiguration_linux.py | 27 +-
.../main/python/ambari_server/serverUpgrade.py | 140 -
.../main/python/ambari_server/setupActions.py | 1 -
.../src/main/python/ambari_server_main.py | 2 +-
.../main/resources/Ambari-DDL-Derby-CREATE.sql | 57 +-
.../main/resources/Ambari-DDL-MySQL-CREATE.sql | 54 +-
.../main/resources/Ambari-DDL-Oracle-CREATE.sql | 60 +-
.../resources/Ambari-DDL-Postgres-CREATE.sql | 58 +-
.../resources/Ambari-DDL-SQLAnywhere-CREATE.sql | 61 +-
.../resources/Ambari-DDL-SQLServer-CREATE.sql | 57 +-
.../src/main/resources/META-INF/persistence.xml | 4 +-
.../hadoop-metrics2-accumulo.properties.j2 | 2 -
.../hadoop-metrics2-hbase.properties.j2 | 2 -
.../configuration/application-properties.xml | 10 +-
.../DRUID/0.9.2/configuration/druid-env.xml | 2 +-
.../DRUID/0.9.2/package/scripts/druid.py | 7 +
.../DRUID/0.9.2/package/scripts/params.py | 1 +
.../templates/flume-metrics2.properties.j2 | 3 -
...-metrics2-hbase.properties-GANGLIA-MASTER.j2 | 2 -
...doop-metrics2-hbase.properties-GANGLIA-RS.j2 | 2 -
.../hadoop-metrics2.properties.xml | 2 -
.../HDFS/3.0.0.3.0/package/scripts/utils.py | 2 +-
.../HIVE/0.12.0.2.0/configuration/hive-site.xml | 2 +-
.../0.12.0.2.0/package/scripts/params_linux.py | 2 +-
.../hadoop-metrics2-hivemetastore.properties.j2 | 2 -
.../hadoop-metrics2-hiveserver2.properties.j2 | 2 -
.../templates/hadoop-metrics2-llapdaemon.j2 | 2 -
.../hadoop-metrics2-llaptaskscheduler.j2 | 2 -
.../2.1.0.3.0/package/scripts/params_linux.py | 2 +-
.../hadoop-metrics2-hivemetastore.properties.j2 | 2 -
.../hadoop-metrics2-hiveserver2.properties.j2 | 2 -
.../templates/hadoop-metrics2-llapdaemon.j2 | 2 -
.../hadoop-metrics2-llaptaskscheduler.j2 | 2 -
.../0.10.0.3.0/configuration/kafka-broker.xml | 10 -
.../KAFKA/0.8.1/configuration/kafka-broker.xml | 10 -
.../package/templates/krb5JAASLogin.conf.j2 | 9 +-
.../package/templates/krb5JAASLogin.conf.j2 | 9 +-
.../package/templates/global.config.json.j2 | 3 +-
.../0.5.0/properties/logfeeder-log4j.xml.j2 | 2 +-
.../0.5.0/properties/logsearch-log4j.xml.j2 | 2 +-
.../OOZIE/4.0.0.2.0/package/scripts/oozie.py | 9 +-
.../common-services/OOZIE/4.2.0.3.0/alerts.json | 45 +
.../OOZIE/4.2.0.3.0/configuration/oozie-env.xml | 255 +
.../4.2.0.3.0/configuration/oozie-log4j.xml | 149 +
.../4.2.0.3.0/configuration/oozie-site.xml | 254 +
.../OOZIE/4.2.0.3.0/kerberos.json | 70 +
.../OOZIE/4.2.0.3.0/metainfo.xml | 203 +
.../package/alerts/alert_check_oozie_server.py | 244 +
.../4.2.0.3.0/package/files/oozieSmoke2.sh | 84 +
.../files/prepareOozieHdfsDirectories.sh | 42 +
.../4.2.0.3.0/package/files/wrap_ooziedb.sh | 31 +
.../scripts/check_oozie_server_status.py | 38 +
.../OOZIE/4.2.0.3.0/package/scripts/oozie.py | 511 +
.../4.2.0.3.0/package/scripts/oozie_client.py | 78 +
.../4.2.0.3.0/package/scripts/oozie_server.py | 163 +
.../package/scripts/oozie_server_upgrade.py | 237 +
.../4.2.0.3.0/package/scripts/oozie_service.py | 188 +
.../OOZIE/4.2.0.3.0/package/scripts/params.py | 39 +
.../4.2.0.3.0/package/scripts/params_linux.py | 374 +
.../4.2.0.3.0/package/scripts/params_windows.py | 34 +
.../4.2.0.3.0/package/scripts/service_check.py | 140 +
.../4.2.0.3.0/package/scripts/status_params.py | 65 +
.../package/templates/adminusers.txt.j2 | 28 +
.../templates/input.config-oozie.json.j2 | 48 +
.../package/templates/oozie-log4j.properties.j2 | 93 +
.../4.2.0.3.0/package/templates/oozie.conf.j2 | 35 +
.../package/templates/zkmigrator_jaas.conf.j2 | 26 +
.../OOZIE/4.2.0.3.0/quicklinks/quicklinks.json | 45 +
.../OOZIE/4.2.0.3.0/role_command_order.json | 9 +
.../OOZIE/4.2.0.3.0/service_advisor.py | 314 +
.../OOZIE/4.2.0.3.0/themes/theme.json | 116 +
.../scripts/alerts/alert_spark_thrift_port.py | 5 +-
.../scripts/alerts/alert_spark2_thrift_port.py | 5 +-
.../STORM/0.9.1/configuration/storm-env.xml | 11 +
.../0.9.1/package/templates/config.yaml.j2 | 3 -
.../templates/storm-metrics2.properties.j2 | 2 -
.../common-services/STORM/1.0.1.3.0/alerts.json | 145 +
.../configuration/ranger-storm-audit.xml | 133 +
.../ranger-storm-plugin-properties.xml | 121 +
.../ranger-storm-policymgr-ssl.xml | 70 +
.../configuration/ranger-storm-security.xml | 67 +
.../storm-atlas-application.properties.xml | 31 +
.../configuration/storm-cluster-log4j.xml | 133 +
.../STORM/1.0.1.3.0/configuration/storm-env.xml | 165 +
.../1.0.1.3.0/configuration/storm-site.xml | 1002 +
.../configuration/storm-worker-log4j.xml | 189 +
.../STORM/1.0.1.3.0/kerberos.json | 134 +
.../STORM/1.0.1.3.0/metainfo.xml | 179 +
.../STORM/1.0.1.3.0/metrics.json | 1202 +
.../alerts/check_supervisor_process_win.py | 50 +
.../STORM/1.0.1.3.0/package/files/wordCount.jar | Bin 0 -> 690588 bytes
.../1.0.1.3.0/package/scripts/drpc_server.py | 91 +
.../STORM/1.0.1.3.0/package/scripts/nimbus.py | 116 +
.../1.0.1.3.0/package/scripts/nimbus_prod.py | 81 +
.../1.0.1.3.0/package/scripts/pacemaker.py | 90 +
.../STORM/1.0.1.3.0/package/scripts/params.py | 28 +
.../1.0.1.3.0/package/scripts/params_linux.py | 424 +
.../1.0.1.3.0/package/scripts/params_windows.py | 60 +
.../STORM/1.0.1.3.0/package/scripts/rest_api.py | 85 +
.../STORM/1.0.1.3.0/package/scripts/service.py | 95 +
.../1.0.1.3.0/package/scripts/service_check.py | 79 +
.../package/scripts/setup_ranger_storm.py | 133 +
.../1.0.1.3.0/package/scripts/status_params.py | 83 +
.../STORM/1.0.1.3.0/package/scripts/storm.py | 182 +
.../1.0.1.3.0/package/scripts/storm_upgrade.py | 177 +
.../package/scripts/storm_yaml_utils.py | 53 +
.../1.0.1.3.0/package/scripts/supervisor.py | 117 +
.../package/scripts/supervisor_prod.py | 84 +
.../package/scripts/supervisord_service.py | 33 +
.../1.0.1.3.0/package/scripts/ui_server.py | 137 +
.../package/templates/client_jaas.conf.j2 | 33 +
.../1.0.1.3.0/package/templates/config.yaml.j2 | 72 +
.../templates/input.config-storm.json.j2 | 78 +
.../templates/storm-metrics2.properties.j2 | 32 +
.../1.0.1.3.0/package/templates/storm.conf.j2 | 35 +
.../package/templates/storm_jaas.conf.j2 | 65 +
.../package/templates/worker-launcher.cfg.j2 | 19 +
.../STORM/1.0.1.3.0/quicklinks/quicklinks.json | 45 +
.../STORM/1.0.1.3.0/role_command_order.json | 13 +
.../STORM/1.0.1.3.0/service_advisor.py | 387 +
.../STORM/1.0.1.3.0/widgets.json | 127 +
.../STORM/1.1.0/configuration/storm-site.xml | 48 +
.../common-services/STORM/1.1.0/kerberos.json | 134 +
.../common-services/STORM/1.1.0/metainfo.xml | 44 +
.../YARN/2.1.0.2.0/package/scripts/yarn.py | 1 -
.../YARN/3.0.0.3.0/kerberos.json | 4 +-
.../YARN/3.0.0.3.0/package/scripts/yarn.py | 1 -
.../YARN/3.0.0.3.0/service_advisor.py | 4 +-
.../ZEPPELIN/0.6.0.3.0/alerts.json | 18 +
.../0.6.0.3.0/configuration/zeppelin-config.xml | 189 +
.../0.6.0.3.0/configuration/zeppelin-env.xml | 185 +
.../configuration/zeppelin-log4j-properties.xml | 37 +
.../configuration/zeppelin-shiro-ini.xml | 90 +
.../ZEPPELIN/0.6.0.3.0/kerberos.json | 53 +
.../ZEPPELIN/0.6.0.3.0/metainfo.xml | 111 +
.../package/scripts/alert_check_zeppelin.py | 47 +
.../package/scripts/livy2_config_template.py | 107 +
.../0.6.0.3.0/package/scripts/master.py | 448 +
.../0.6.0.3.0/package/scripts/params.py | 228 +
.../0.6.0.3.0/package/scripts/service_check.py | 39 +
.../package/scripts/spark2_config_template.py | 84 +
.../0.6.0.3.0/package/scripts/status_params.py | 29 +
.../templates/input.config-zeppelin.json.j2 | 48 +
.../0.6.0.3.0/quicklinks/quicklinks.json | 35 +
.../ZEPPELIN/0.6.0.3.0/role_command_order.json | 7 +
.../ZEPPELIN/0.6.0.3.0/service_advisor.py | 167 +
.../custom_actions/scripts/install_packages.py | 63 +-
.../custom_actions/scripts/ru_set_all.py | 49 +-
.../resources/host_scripts/alert_disk_space.py | 22 +-
.../src/main/resources/key_properties.json | 10 -
.../src/main/resources/properties.json | 41 +-
.../hooks/before-INSTALL/scripts/params.py | 2 +
.../scripts/repo_initialization.py | 22 +-
.../templates/hadoop-metrics2.properties.j2 | 2 -
.../HDP/2.0.6/properties/stack_features.json | 6 +-
.../services/HIVE/configuration/hive-site.xml | 2 +-
.../services/YARN/configuration/yarn-site.xml | 8 +-
.../stacks/HDP/2.3/services/stack_advisor.py | 2 +-
.../stacks/HDP/2.3/upgrades/config-upgrade.xml | 8 -
.../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml | 6 -
.../stacks/HDP/2.3/upgrades/upgrade-2.6.xml | 1 -
.../stacks/HDP/2.4/upgrades/config-upgrade.xml | 6 +-
.../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml | 6 -
.../stacks/HDP/2.4/upgrades/upgrade-2.6.xml | 1 -
.../stacks/HDP/2.5/upgrades/config-upgrade.xml | 10 +-
.../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml | 6 -
.../stacks/HDP/2.5/upgrades/upgrade-2.6.xml | 4 -
.../resources/stacks/HDP/2.6/repos/repoinfo.xml | 14 +
.../hadoop-metrics2.properties.xml | 2 -
.../HIVE/configuration/tez-interactive-site.xml | 12 +
.../services/SPARK2/configuration/livy2-env.xml | 4 +-
.../services/STORM/configuration/storm-site.xml | 61 +
.../stacks/HDP/2.6/services/STORM/metainfo.xml | 8 +
.../services/YARN/configuration/yarn-site.xml | 13 +-
.../stacks/HDP/2.6/services/YARN/kerberos.json | 4 +-
.../stacks/HDP/2.6/upgrades/config-upgrade.xml | 5 +-
.../HDP/2.6/upgrades/nonrolling-upgrade-2.6.xml | 6 +-
.../stacks/HDP/2.6/upgrades/upgrade-2.6.xml | 2 +-
.../3.0/hooks/after-INSTALL/scripts/params.py | 14 +
.../scripts/shared_initialization.py | 17 +
.../templates/hadoop-metrics2.properties.j2 | 2 -
.../stacks/HDP/3.0/services/OOZIE/metainfo.xml | 27 +
.../stacks/HDP/3.0/services/STORM/metainfo.xml | 27 +
.../HDP/3.0/services/ZEPPELIN/metainfo.xml | 27 +
.../src/main/resources/stacks/stack_advisor.py | 115 +-
.../apache/ambari/server/H2DatabaseCleaner.java | 2 +-
.../ambari/server/RandomPortJerseyTest.java | 2 +-
.../ambari/server/StateRecoveryManagerTest.java | 68 +-
.../actionmanager/ActionManagerTestHelper.java | 2 +-
.../ExecutionCommandWrapperTest.java | 15 +-
.../actionmanager/HostRoleStatusTest.java | 2 +-
.../ambari/server/actionmanager/StageTest.java | 4 +-
.../actionmanager/TestActionDBAccessorImpl.java | 36 +-
.../server/actionmanager/TestActionManager.java | 10 +-
.../actionmanager/TestActionScheduler.java | 45 +-
.../TestActionSchedulerThreading.java | 37 +-
.../ambari/server/actionmanager/TestStage.java | 7 +-
.../ambari/server/agent/AgentHostInfoTest.java | 2 +-
.../ambari/server/agent/AgentResourceTest.java | 4 +-
.../server/agent/DummyHeartbeatConstants.java | 1 +
.../server/agent/HeartbeatProcessorTest.java | 178 +-
.../server/agent/HeartbeatTestHelper.java | 22 +-
.../server/agent/LocalAgentSimulator.java | 7 +-
.../ambari/server/agent/TestActionQueue.java | 2 +-
.../server/agent/TestHeartbeatHandler.java | 122 +-
.../server/agent/TestHeartbeatMonitor.java | 45 +-
.../alerts/AgentHeartbeatAlertRunnableTest.java | 2 +-
.../alerts/AmbariPerformanceRunnableTest.java | 2 +-
.../ComponentVersionAlertRunnableTest.java | 33 +-
.../server/alerts/StaleAlertRunnableTest.java | 2 +-
.../org/apache/ambari/server/api/TestSuite.java | 12 +-
.../server/api/UserNameOverrideFilterTest.java | 2 +-
.../server/api/handlers/CreateHandlerTest.java | 2 +-
.../server/api/handlers/DeleteHandlerTest.java | 5 +-
.../api/handlers/QueryCreateHandlerTest.java | 2 +-
.../server/api/handlers/ReadHandlerTest.java | 2 +-
.../server/api/handlers/UpdateHandlerTest.java | 4 +-
.../server/api/predicate/QueryLexerTest.java | 2 +-
.../server/api/predicate/QueryParserTest.java | 2 +-
.../predicate/operators/AndOperatorTest.java | 4 +-
.../predicate/operators/EqualsOperatorTest.java | 4 +-
.../predicate/operators/FilterOperatorTest.java | 2 +-
.../operators/GreaterEqualsOperatorTest.java | 4 +-
.../operators/GreaterOperatorTest.java | 4 +-
.../api/predicate/operators/InOperatorTest.java | 2 +-
.../operators/IsEmptyOperatorTest.java | 2 +-
.../operators/LessEqualsOperatorTest.java | 4 +-
.../predicate/operators/LessOperatorTest.java | 4 +-
.../operators/NotEqualsOperatorTest.java | 4 +-
.../predicate/operators/NotOperatorTest.java | 4 +-
.../api/predicate/operators/OrOperatorTest.java | 4 +-
.../ExtendedResourcePredicateVisitorTest.java | 2 +-
.../server/api/query/JpaSortBuilderTest.java | 2 +-
.../query/ProcessingPredicateVisitorTest.java | 2 +-
.../ambari/server/api/query/QueryImplTest.java | 2 +-
.../ambari/server/api/query/QueryInfoTest.java | 2 +-
.../query/SubResourcePredicateVisitorTest.java | 2 +-
.../render/ClusterBlueprintRendererTest.java | 2 +-
.../api/query/render/DefaultRendererTest.java | 2 +-
.../render/MetricsPaddingRendererTest.java | 2 +-
.../api/query/render/MinimalRendererTest.java | 2 +-
.../resources/BaseResourceDefinitionTest.java | 29 +-
.../BlueprintResourceDefinitionTest.java | 2 +-
.../ClusterResourceDefinitionTest.java | 2 +-
...onentStackVersionResourceDefinitionTest.java | 2 +-
.../resources/FeedResourceDefinitionTest.java | 2 +-
.../resources/HostResourceDefinitionTest.java | 2 +-
.../InstanceResourceDefinitionTest.java | 2 +-
.../LdapSyncEventResourceDefinitionTest.java | 2 +-
.../PermissionResourceDefinitionTest.java | 2 +-
.../PrivilegeResourceDefinitionTest.java | 2 +-
.../RepositoryResourceDefinitionTest.java | 2 +-
...RepositoryVersionResourceDefinitionTest.java | 2 +-
.../ResourceInstanceFactoryImplTest.java | 2 +-
.../ServiceResourceDefinitionTest.java | 2 +-
.../resources/SimpleResourceDefinitionTest.java | 4 +-
.../StackConfigurationDefinitionTest.java | 2 +-
...ckConfigurationDependencyDefinitionTest.java | 2 +-
.../StackServiceResourceDefinitionTest.java | 2 +-
.../StackVersionResourceDefinitionTest.java | 2 +-
.../TargetClusterResourceDefinitionTest.java | 2 +-
.../UpgradeResourceDefinitionTest.java | 4 +-
.../resources/UserResourceDefinitionTest.java | 2 +-
.../ViewExternalSubResourceDefinitionTest.java | 2 +-
.../ViewInstanceResourceDefinitionTest.java | 2 +-
.../ViewPermissionResourceDefinitionTest.java | 2 +-
.../resources/ViewResourceDefinitionTest.java | 2 +-
.../ViewVersionResourceDefinitionTest.java | 2 +-
.../server/api/services/ActionServiceTest.java | 2 +-
.../services/ActiveWidgetLayoutServiceTest.java | 75 -
.../server/api/services/AmbariMetaInfoTest.java | 23 +-
.../server/api/services/BaseRequestTest.java | 2 +-
.../server/api/services/BaseServiceTest.java | 2 +-
.../api/services/BlueprintServiceTest.java | 4 +-
.../services/ClusterPrivilegeServiceTest.java | 4 +-
.../server/api/services/ClusterServiceTest.java | 30 +-
.../ClusterStackVersionServiceTest.java | 4 +-
.../api/services/ComponentServiceTest.java | 2 +-
.../api/services/ConfigGroupServiceTest.java | 2 +-
.../api/services/ConfigurationServiceTest.java | 2 +-
.../server/api/services/DeleteRequestTest.java | 2 +-
.../api/services/DeleteResultMetaDataTest.java | 2 +-
.../api/services/ExtensionsServiceTest.java | 2 +-
.../server/api/services/FeedServiceTest.java | 2 +-
.../server/api/services/GetRequestTest.java | 2 +-
.../api/services/GroupPrivilegeServiceTest.java | 111 -
.../server/api/services/GroupServiceTest.java | 5 +-
.../api/services/HostComponentServiceTest.java | 2 +-
.../server/api/services/HostServiceTest.java | 4 +-
.../services/HostStackVersionServiceTest.java | 4 +-
.../api/services/InstanceServiceTest.java | 2 +-
.../api/services/LdapSyncEventServiceTest.java | 2 +-
.../server/api/services/LoggingServiceTest.java | 2 +-
.../server/api/services/MemberServiceTest.java | 110 -
.../api/services/NamedPropertySetTest.java | 2 +-
.../api/services/PermissionServiceTest.java | 2 +-
.../server/api/services/PersistServiceTest.java | 2 +-
.../services/PersistenceManagerImplTest.java | 4 +-
.../server/api/services/PostRequestTest.java | 2 +-
.../services/PreUpgradeCheckServiceTest.java | 4 +-
.../api/services/PrivilegeServiceTest.java | 2 +-
.../server/api/services/PutRequestTest.java | 2 +-
.../api/services/QueryPostRequestTest.java | 2 +-
.../api/services/RecommendationServiceTest.java | 2 +-
.../api/services/RepositoryServiceTest.java | 4 +-
.../server/api/services/RequestBodyTest.java | 2 +-
.../server/api/services/RequestFactoryTest.java | 2 +-
.../api/services/RootServiceServiceTest.java | 13 +-
.../server/api/services/ServiceServiceTest.java | 2 +-
.../server/api/services/SettingServiceTest.java | 4 +-
.../server/api/services/StacksServiceTest.java | 2 +-
.../api/services/TargetClusterServiceTest.java | 2 +-
.../services/UpdatePersistenceManagerTest.java | 2 +-
.../api/services/UpgradeItemServiceTest.java | 4 +-
.../services/UserAuthorizationServiceTest.java | 100 -
.../api/services/UserPrivilegeServiceTest.java | 124 -
.../api/services/ValidationServiceTest.java | 2 +-
.../services/ViewDataMigrationServiceTest.java | 81 -
.../ViewExternalSubResourceServiceTest.java | 50 -
.../api/services/ViewPermissionServiceTest.java | 101 -
.../services/ViewSubResourceServiceTest.java | 3 +-
.../parsers/BodyParseExceptionTest.java | 2 +-
.../parsers/JsonRequestBodyParserTest.java | 2 +-
.../serializers/JsonSerializerTest.java | 2 +-
.../stackadvisor/StackAdvisorExceptionTest.java | 2 +-
.../stackadvisor/StackAdvisorHelperTest.java | 2 +-
.../StackAdvisorRequestTypeTest.java | 2 +-
.../stackadvisor/StackAdvisorRunnerTest.java | 2 +-
.../ConfigurationRecommendationCommandTest.java | 4 +-
.../commands/StackAdvisorCommandTest.java | 2 +-
.../views/ViewDataMigrationServiceTest.java | 81 +
.../ViewExternalSubResourceServiceTest.java | 50 +
.../audit/AccessUnauthorizedAuditEventTest.java | 2 +-
.../server/audit/LoginAuditEventTest.java | 2 +-
.../server/audit/LogoutAuditEventTest.java | 2 +-
.../audit/OperationStatusAuditEventTest.java | 2 +-
.../StartOperationRequestAuditEventTest.java | 2 +-
.../audit/request/AbstractBaseCreator.java | 2 +-
.../server/audit/request/AllGetCreator.java | 2 +-
.../audit/request/AllPostAndPutCreator.java | 2 +-
.../audit/request/DefaultEventCreatorTest.java | 2 +-
.../audit/request/PutHostComponentCreator.java | 2 +-
.../audit/request/RequestAuditLogModule.java | 2 +-
.../audit/request/RequestAuditLoggerTest.java | 2 +-
.../request/creator/HostEventCreatorTest.java | 4 +-
.../creator/UpgradeEventCreatorTest.java | 4 +-
.../server/bootstrap/BootStrapResourceTest.java | 2 +-
.../ambari/server/bootstrap/BootStrapTest.java | 2 +-
.../checks/AutoStartDisabledCheckTest.java | 2 +-
...ardcodedStackVersionPropertiesCheckTest.java | 4 +-
.../checks/HiveMultipleMetastoreCheckTest.java | 2 +-
.../checks/HostsMasterMaintenanceCheckTest.java | 8 +-
.../server/checks/InstallPackagesCheckTest.java | 26 +-
...duce2JobHistoryStatePreservingCheckTest.java | 7 -
.../checks/PreviousUpgradeCompletedTest.java | 8 +-
.../server/checks/RangerPasswordCheckTest.java | 15 +-
.../checks/ServiceCheckValidityCheckTest.java | 45 +-
.../server/checks/ServicesUpCheckTest.java | 5 +
.../server/checks/UpgradeCheckOrderTest.java | 2 +-
.../server/checks/VersionMismatchCheckTest.java | 4 +-
...nTimelineServerStatePreservingCheckTest.java | 11 -
.../server/cleanup/CleanupServiceImplTest.java | 4 +-
.../ComponentSSLConfigurationTest.java | 2 +-
.../configuration/RecoveryConfigHelperTest.java | 53 +-
.../server/controller/ActionRequestTest.java | 2 +-
.../server/controller/ActionResponseTest.java | 5 +-
.../AmbariCustomCommandExecutionHelperTest.java | 125 +-
.../controller/AmbariHandlerListTest.java | 2 +-
.../AmbariManagementControllerImplTest.java | 215 +-
.../AmbariManagementControllerTest.java | 1586 +-
.../server/controller/AmbariServerTest.java | 2 +-
.../controller/AmbariSessionManagerTest.java | 4 +-
.../BackgroundCustomCommandExecutionTest.java | 26 +-
.../server/controller/ClusterRequestTest.java | 18 +-
.../server/controller/ClusterResponseTest.java | 16 +-
.../server/controller/KerberosHelperTest.java | 433 +-
.../server/controller/LdapSyncRequestTest.java | 2 +-
.../controller/MaintenanceStateHelperTest.java | 2 +-
...hYarnCapacitySchedulerReleaseConfigTest.java | 76 +-
.../RootServiceResponseFactoryTest.java | 11 +-
.../ServiceConfigVersionResponseTest.java | 2 +-
.../controller/StackServiceResponseTest.java | 2 +-
.../AbstractControllerResourceProviderTest.java | 34 +-
.../AbstractDRResourceProviderTest.java | 2 +-
.../internal/AbstractPropertyProviderTest.java | 2 +-
.../internal/AbstractResourceProviderTest.java | 41 +-
.../internal/ActionResourceProviderTest.java | 2 +-
.../AlertDefinitionResourceProviderTest.java | 2 +-
.../AlertGroupResourceProviderTest.java | 2 +-
.../AlertHistoryResourceProviderTest.java | 2 +-
.../AlertNoticeResourceProviderTest.java | 2 +-
.../internal/AlertResourceProviderTest.java | 2 +-
.../AlertTargetResourceProviderTest.java | 2 +-
.../internal/AppCookieManagerTest.java | 2 +-
.../internal/ArtifactResourceProviderTest.java | 2 +-
.../AtlasServerHttpPropertyRequestTest.java | 4 +-
.../controller/internal/BaseProviderTest.java | 2 +-
.../BlueprintConfigurationProcessorTest.java | 3 +
.../internal/BlueprintResourceProviderTest.java | 2 +-
.../internal/CalculatedStatusTest.java | 4 +-
.../ClientConfigResourceProviderTest.java | 20 +-
.../internal/ClusterControllerImplTest.java | 2 +-
.../internal/ClusterResourceProviderTest.java | 22 +-
...ClusterStackVersionResourceProviderTest.java | 486 +-
...leRepositoryVersionResourceProviderTest.java | 5 +-
.../internal/ComponentResourceProviderTest.java | 110 +-
.../ConfigGroupResourceProviderTest.java | 5 +-
.../ConfigurationResourceProviderTest.java | 2 +-
.../internal/DeleteStatusMetaDataTest.java | 4 +-
.../internal/ExportBlueprintRequestTest.java | 2 +-
.../internal/ExtensionResourceProviderTest.java | 2 +-
.../internal/FeedResourceProviderTest.java | 2 +-
.../GroupPrivilegeResourceProviderTest.java | 13 +-
...ostComponentProcessResourceProviderTest.java | 2 +-
.../HostComponentResourceProviderTest.java | 47 +-
.../internal/HostResourceProviderTest.java | 112 +-
.../HostStackVersionResourceProviderTest.java | 5 +-
.../internal/HttpPropertyProviderTest.java | 2 +-
.../internal/InstanceResourceProviderTest.java | 2 +-
.../internal/JMXHostProviderTest.java | 34 +-
.../LdapSyncEventResourceProviderTest.java | 2 +-
.../internal/MetricsServiceProviderTest.java | 2 +-
.../internal/PageRequestImplTest.java | 2 +-
.../internal/PageResponseImplTest.java | 2 +-
.../PermissionResourceProviderTest.java | 2 +-
.../PreUpgradeCheckResourceProviderTest.java | 17 +-
.../internal/PropertyPredicateVisitorTest.java | 2 +-
.../internal/ProvisionClusterRequestTest.java | 8 +-
.../QuickLinkArtifactResourceProviderTest.java | 2 +-
.../RecommendationResourceProviderTest.java | 4 +-
.../RemoteClusterResourceProviderTest.java | 2 +-
.../RepositoryResourceProviderTest.java | 2 +-
.../RepositoryVersionResourceProviderTest.java | 76 +-
.../controller/internal/RequestImplTest.java | 33 +-
.../internal/RequestOperationLevelTest.java | 2 +-
.../RequestScheduleResourceProviderTest.java | 2 +-
.../internal/RequestStageContainerTest.java | 4 +-
.../internal/RequestStatusImplTest.java | 2 +-
.../controller/internal/ResourceImplTest.java | 2 +-
...ootServiceComponentResourceProviderTest.java | 21 +-
...erviceHostComponentResourceProviderTest.java | 13 +-
.../RootServiceResourceProviderTest.java | 2 +-
.../internal/ScaleClusterRequestTest.java | 16 +-
.../controller/internal/SchemaImplTest.java | 2 +-
.../internal/ServiceResourceProviderTest.java | 121 +-
.../internal/SettingResourceProviderTest.java | 2 +-
.../SimplifyingPredicateVisitorTest.java | 2 +-
.../StackAdvisorResourceProviderTest.java | 2 +-
.../StackArtifactResourceProviderTest.java | 2 +-
...igurationDependencyResourceProviderTest.java | 2 +-
.../StackConfigurationResourceProviderTest.java | 2 +-
.../StackDefinedPropertyProviderTest.java | 26 +-
.../StackDependencyResourceProviderTest.java | 2 +-
...kLevelConfigurationResourceProviderTest.java | 2 +-
.../internal/StackResourceProviderTest.java | 2 +-
.../StackServiceResourceProviderTest.java | 2 +-
.../server/controller/internal/StackTest.java | 2 +-
.../StackUpgradeConfigurationMergeTest.java | 256 +-
.../internal/StageResourceProviderTest.java | 4 +-
.../TargetClusterResourceProviderTest.java | 2 +-
.../internal/TaskResourceProviderTest.java | 2 +-
.../internal/TestIvoryProviderModule.java | 2 +-
.../controller/internal/TestIvoryService.java | 2 +-
.../internal/URLStreamProviderTest.java | 4 +-
.../UpgradeResourceProviderHDP22Test.java | 321 -
.../internal/UpgradeResourceProviderTest.java | 460 +-
.../UpgradeSummaryResourceProviderTest.java | 21 +-
.../UserPrivilegeResourceProviderTest.java | 13 +-
.../internal/UserResourceProviderDBTest.java | 2 +-
.../ValidationResourceProviderTest.java | 4 +-
.../VersionDefinitionResourceProviderTest.java | 2 +-
.../ViewInstanceResourceProviderTest.java | 2 +-
.../ViewPermissionResourceProviderTest.java | 2 +-
.../internal/ViewURLResourceProviderTest.java | 4 +-
.../WidgetLayoutResourceProviderTest.java | 2 +-
.../internal/WidgetResourceProviderTest.java | 2 +-
.../server/controller/ivory/ClusterTest.java | 2 +-
.../server/controller/ivory/FeedTest.java | 2 +-
.../server/controller/ivory/InstanceTest.java | 2 +-
.../jdbc/TestJDBCResourceProvider.java | 2 +-
.../controller/jmx/TestStreamProvider.java | 2 +-
.../logging/LogLevelQueryResponseTest.java | 2 +-
.../controller/logging/LogLineResultTest.java | 2 +-
.../logging/LogQueryResponseTest.java | 2 +-
.../LogSearchDataRetrievalServiceTest.java | 3 +-
.../LoggingRequestHelperFactoryImplTest.java | 2 +-
.../logging/LoggingRequestHelperImplTest.java | 2 +-
.../LoggingSearchPropertyProviderTest.java | 27 +-
.../server/controller/logging/UtilsTest.java | 2 +-
.../metrics/JMXPropertyProviderTest.java | 2 +-
.../RestMetricsPropertyProviderTest.java | 16 +-
.../ThreadPoolEnabledPropertyProviderTest.java | 2 +-
.../metrics/ganglia/GangliaMetricTest.java | 4 +-
.../ganglia/GangliaPropertyProviderTest.java | 2 +-
.../GangliaReportPropertyProviderTest.java | 2 +-
.../metrics/ganglia/TestHttpUrlConnection.java | 5 +-
.../metrics/ganglia/TestStreamProvider.java | 5 +-
.../timeline/AMSPropertyProviderTest.java | 38 +-
.../timeline/AMSReportPropertyProviderTest.java | 2 +-
.../timeline/MetricsPaddingMethodTest.java | 2 +-
.../timeline/MetricsRequestHelperTest.java | 2 +-
.../cache/TimelineMetricCacheSizingTest.java | 2 +-
.../timeline/cache/TimelineMetricCacheTest.java | 2 +-
.../controller/predicate/AndPredicateTest.java | 2 +-
.../predicate/CategoryIsEmptyPredicateTest.java | 2 +-
.../predicate/CategoryPredicateTest.java | 2 +-
.../predicate/EqualsPredicateTest.java | 2 +-
.../predicate/FilterPredicateTest.java | 2 +-
.../predicate/GreaterEqualsPredicateTest.java | 2 +-
.../predicate/GreaterPredicateTest.java | 2 +-
.../predicate/LessEqualsPredicateTest.java | 2 +-
.../controller/predicate/LessPredicateTest.java | 2 +-
.../controller/predicate/NotPredicateTest.java | 2 +-
.../controller/predicate/OrPredicateTest.java | 2 +-
.../predicate/PredicateVisitorTest.java | 2 +-
.../server/controller/spi/ResourceTest.java | 2 +-
...ThreadPoolExecutorCompletionServiceTest.java | 2 +-
.../utilities/DatabaseCheckerTest.java | 2 +-
.../utilities/PredicateBuilderTest.java | 2 +-
.../utilities/PropertyHelperTest.java | 8 +-
.../DefaultServiceCalculatedStateTest.java | 2 +-
.../state/FlumeServiceCalculatedStateTest.java | 2 +-
.../GeneralServiceCalculatedStateTest.java | 13 +-
.../state/HBaseServiceCalculatedStateTest.java | 2 +-
.../state/HDFSServiceCalculatedStateTest.java | 2 +-
.../state/HiveServiceCalculatedStateTest.java | 2 +-
.../state/OozieServiceCalculatedStateTest.java | 2 +-
.../state/YarnServiceCalculatedStateTest.java | 2 +-
.../utilities/webserver/StartServer.java | 2 +-
.../credentialapi/CredentialUtilTest.java | 5 +-
.../ActionDefinitionManagerTest.java | 2 +-
.../apache/ambari/server/events/EventsTest.java | 21 +-
.../ambari/server/events/MockEventListener.java | 2 +-
.../listeners/tasks/TaskStatusListenerTest.java | 2 +-
.../AlertMaintenanceModeListenerTest.java | 6 +-
.../HostVersionOutOfSyncListenerTest.java | 134 +-
.../upgrade/StackUpgradeFinishListenerTest.java | 4 +-
.../upgrade/StackVersionListenerTest.java | 51 +-
.../publishers/VersionEventPublisherTest.java | 4 +-
.../server/hooks/users/UserHookServiceTest.java | 8 +-
.../metadata/AgentAlertDefinitionsTest.java | 2 +-
.../server/metadata/RoleCommandOrderTest.java | 66 +-
.../ambari/server/metadata/RoleGraphTest.java | 25 +-
.../metric/system/impl/MetricsServiceTest.java | 4 +-
.../metric/system/impl/MetricsSourceTest.java | 4 +-
.../system/impl/TestAmbariMetricsSinkImpl.java | 2 +-
.../metric/system/impl/TestMetricsSource.java | 4 +-
.../notifications/DispatchFactoryTest.java | 2 +-
.../server/notifications/MockDispatcher.java | 2 +-
.../dispatchers/AlertScriptDispatcherTest.java | 69 +-
.../dispatchers/AmbariSNMPDispatcherTest.java | 2 +-
.../dispatchers/EmailDispatcherTest.java | 2 +-
.../dispatchers/SNMPDispatcherTest.java | 2 +-
.../ambari/server/orm/AlertDaoHelper.java | 2 +-
.../server/orm/InMemoryDefaultTestModule.java | 5 +-
.../ambari/server/orm/JdbcPropertyTest.java | 2 +-
.../apache/ambari/server/orm/OrmTestHelper.java | 84 +-
.../apache/ambari/server/orm/TestOrmImpl.java | 2 +-
.../server/orm/dao/AlertDefinitionDAOTest.java | 2 +-
.../server/orm/dao/AlertDispatchDAOTest.java | 2 +-
.../server/orm/dao/AlertsDAOCachedTest.java | 2 +-
.../ambari/server/orm/dao/AlertsDAOTest.java | 2 +-
.../ambari/server/orm/dao/BlueprintDAOTest.java | 2 +-
.../server/orm/dao/ClusterVersionDAOTest.java | 264 -
.../server/orm/dao/ConfigGroupDAOTest.java | 2 +-
.../ambari/server/orm/dao/CrudDAOTest.java | 2 +-
.../ambari/server/orm/dao/GroupDAOTest.java | 2 +-
.../dao/HostComponentDesiredStateDAOTest.java | 4 +-
.../orm/dao/HostComponentStateDAOTest.java | 4 +-
.../orm/dao/HostConfigMappingDAOTest.java | 2 +-
.../server/orm/dao/HostRoleCommandDAOTest.java | 2 +-
.../server/orm/dao/HostVersionDAOTest.java | 36 +-
.../ambari/server/orm/dao/PrincipalDAOTest.java | 2 +-
.../server/orm/dao/PrincipalTypeDAOTest.java | 2 +-
.../orm/dao/RepositoryVersionDAOTest.java | 37 +-
.../ambari/server/orm/dao/RequestDAOTest.java | 2 +-
.../server/orm/dao/RequestScheduleDAOTest.java | 2 +-
.../ambari/server/orm/dao/ResourceDAOTest.java | 2 +-
.../server/orm/dao/ResourceTypeDAOTest.java | 2 +-
.../server/orm/dao/ServiceConfigDAOTest.java | 13 +-
.../ambari/server/orm/dao/SettingDAOTest.java | 2 +-
.../ambari/server/orm/dao/StageDAOTest.java | 2 +-
.../orm/dao/TopologyLogicalRequestDAOTest.java | 2 +-
.../server/orm/dao/TopologyRequestDAOTest.java | 2 +-
.../ambari/server/orm/dao/UpgradeDAOTest.java | 28 +-
.../ambari/server/orm/dao/UserDAOTest.java | 2 +-
.../server/orm/dao/ViewInstanceDAOTest.java | 2 +-
.../ambari/server/orm/dao/WidgetDAOTest.java | 2 +-
.../server/orm/dao/WidgetLayoutDAOTest.java | 2 +-
.../apache/ambari/server/orm/db/DDLTests.java | 2 +-
.../orm/entities/AlertCurrentEntityTest.java | 2 +-
.../orm/entities/AlertDefinitionEntityTest.java | 2 +-
.../orm/entities/AlertHistoryEntityTest.java | 2 +-
.../entities/BlueprintConfigEntityPKTest.java | 2 +-
.../orm/entities/BlueprintConfigEntityTest.java | 2 +-
.../orm/entities/BlueprintEntityTest.java | 2 +-
.../entities/BlueprintSettingEntityTest.java | 2 +-
.../server/orm/entities/HostEntityTest.java | 4 +-
.../entities/HostGroupComponentEntityTest.java | 2 +-
.../entities/HostGroupConfigEntityPKTest.java | 2 +-
.../orm/entities/HostGroupConfigEntityTest.java | 2 +-
.../orm/entities/HostGroupEntityTest.java | 2 +-
.../orm/entities/HostRoleCommandEntityTest.java | 2 +-
.../orm/entities/LdapSyncEventEntityTest.java | 2 +-
.../orm/entities/LdapSyncSpecEntityTest.java | 2 +-
.../orm/entities/PrincipalEntityTest.java | 2 +-
.../orm/entities/PrincipalTypeEntityTest.java | 2 +-
.../server/orm/entities/ResourceEntityTest.java | 2 +-
.../orm/entities/ResourceTypeEntityTest.java | 2 +-
.../orm/entities/ServiceConfigEntityTest.java | 2 +-
.../server/orm/entities/SettingEntityTest.java | 2 +-
.../server/orm/entities/StageEntityTest.java | 2 +-
.../orm/entities/ViewEntityEntityTest.java | 2 +-
.../server/orm/entities/ViewEntityTest.java | 2 +-
.../orm/entities/ViewInstanceEntityTest.java | 2 +-
.../ambari/server/proxy/ProxyServiceTest.java | 2 +-
.../ambari/server/resources/TestResources.java | 2 +-
.../sample/checks/SampleServiceCheck.java | 4 -
.../scheduler/ExecutionScheduleManagerTest.java | 2 +-
.../scheduler/ExecutionSchedulerTest.java | 2 +-
.../server/security/CertGenerationTest.java | 2 +-
.../server/security/SecurityFilterTest.java | 2 +-
.../server/security/SecurityHelperImplTest.java | 2 +-
.../server/security/SslExecutionTest.java | 2 +-
.../authorization/AmbariAuthenticationTest.java | 2 +-
...mbariLdapAuthenticationProviderBaseTest.java | 2 +-
...uthenticationProviderForDNWithSpaceTest.java | 2 +-
...henticationProviderForDuplicateUserTest.java | 2 +-
.../AmbariLdapAuthenticationProviderTest.java | 2 +-
.../AmbariLocalUserProviderTest.java | 2 +-
.../AmbariPamAuthenticationProviderTest.java | 3 +-
.../AmbariUserAuthenticationFilterTest.java | 4 +-
.../AuthorizationHelperInitializer.java | 2 +-
.../authorization/AuthorizationHelperTest.java | 2 +-
.../authorization/AuthorizationTestModule.java | 2 +-
...thorizationTestModuleForLdapDNWithSpace.java | 2 +-
.../authorization/LdapServerPropertiesTest.java | 2 +-
.../TestAmbariLdapAuthoritiesPopulator.java | 2 +-
.../security/encryption/AESEncryptorTest.java | 2 +-
.../encryption/CredentialProviderTest.java | 2 +-
.../encryption/CredentialStoreTest.java | 2 +-
.../encryption/MasterKeyServiceTest.java | 2 +-
.../ldap/AmbariLdapDataPopulatorTest.java | 2 +-
.../serveraction/ServerActionExecutorTest.java | 9 +-
.../ADKerberosOperationHandlerTest.java | 96 +-
.../serveraction/kerberos/KDCTypeTest.java | 4 +-
.../UpdateKerberosConfigsServerActionTest.java | 5 +-
.../AutoSkipFailedSummaryActionTest.java | 26 +-
.../ComponentVersionCheckActionTest.java | 254 +-
.../upgrades/ConfigureActionTest.java | 701 +-
.../FixCapacitySchedulerOrderingPolicyTest.java | 2 +-
.../upgrades/FixLzoCodecPathTest.java | 2 +-
.../upgrades/FixOozieAdminUsersTest.java | 2 +-
.../upgrades/FixYarnWebServiceUrlTest.java | 2 +-
.../HBaseEnvMaxDirectMemorySizeActionTest.java | 2 +-
.../upgrades/HiveEnvClasspathActionTest.java | 2 +-
.../upgrades/HiveZKQuorumConfigActionTest.java | 2 +-
.../upgrades/KerberosKeytabsActionTest.java | 2 +-
.../upgrades/OozieConfigCalculationTest.java | 2 +-
.../upgrades/RangerConfigCalculationTest.java | 2 +-
.../RangerKerberosConfigCalculationTest.java | 2 +-
.../upgrades/RangerKmsProxyConfigTest.java | 4 +-
.../RangerWebAlertConfigActionTest.java | 4 +-
.../upgrades/UpgradeActionTest.java | 724 +-
.../UpgradeUserKerberosDescriptorTest.java | 2 +-
.../CsvFilePersisterServiceFunctionalTest.java | 4 +-
.../PostUserCreationHookServerActionTest.java | 4 +-
.../server/stack/ComponentModuleTest.java | 2 +-
.../QuickLinksConfigurationModuleTest.java | 2 +-
.../ambari/server/stack/RepoUtilTest.java | 2 +-
.../ambari/server/stack/ServiceModuleTest.java | 2 +-
.../stack/StackManagerCommonServicesTest.java | 2 +-
.../server/stack/StackManagerExtensionTest.java | 2 +-
.../server/stack/StackManagerMiscTest.java | 2 +-
.../ambari/server/stack/StackManagerMock.java | 2 +-
.../ambari/server/stack/StackManagerTest.java | 2 +-
.../ambari/server/stack/StackModuleTest.java | 2 +-
.../ambari/server/stack/ThemeModuleTest.java | 4 +-
.../UpdateActiveRepoVersionOnStartupTest.java | 83 +-
.../server/stageplanner/TestStagePlanner.java | 259 +-
.../apache/ambari/server/state/AlertTest.java | 2 +-
.../ambari/server/state/CheckHelperTest.java | 43 +-
.../ambari/server/state/ConfigGroupTest.java | 11 +-
.../ambari/server/state/ConfigHelperTest.java | 41 +-
.../server/state/ConfigMergeHelperTest.java | 2 +-
.../ambari/server/state/DesiredConfigTest.java | 2 +-
.../ambari/server/state/PropertyInfoTest.java | 4 +-
.../server/state/RequestExecutionTest.java | 2 +-
.../server/state/ServiceComponentTest.java | 286 +-
.../ambari/server/state/ServiceInfoTest.java | 2 +-
.../server/state/ServicePropertiesTest.java | 4 +-
.../server/state/ServicePropertyInfoTest.java | 2 +-
.../apache/ambari/server/state/ServiceTest.java | 78 +-
.../ambari/server/state/UpgradeHelperTest.java | 727 +-
.../ambari/server/state/action/JobTest.java | 2 +-
.../alerts/AggregateAlertListenerTest.java | 2 +-
.../alerts/AlertDefinitionEqualityTest.java | 2 +-
.../state/alerts/AlertDefinitionHashTest.java | 2 +-
.../state/alerts/AlertEventPublisherTest.java | 16 +-
.../state/alerts/AlertReceivedListenerTest.java | 2 +-
.../alerts/AlertStateChangedEventTest.java | 2 +-
.../state/alerts/InitialAlertEventTest.java | 18 +-
.../state/cluster/AlertDataManagerTest.java | 2 +-
.../state/cluster/ClusterDeadlockTest.java | 17 +-
.../cluster/ClusterEffectiveVersionTest.java | 305 -
.../server/state/cluster/ClusterImplTest.java | 31 +-
.../server/state/cluster/ClusterTest.java | 855 +-
.../state/cluster/ClustersDeadlockTest.java | 18 +-
.../server/state/cluster/ClustersImplTest.java | 4 +-
.../server/state/cluster/ClustersTest.java | 104 +-
.../ConcurrentServiceConfigVersionTest.java | 17 +-
...omponentHostConcurrentWriteDeadlockTest.java | 22 +-
.../ambari/server/state/host/HostImplTest.java | 4 +-
.../ambari/server/state/host/HostTest.java | 8 +-
.../state/kerberos/KerberosDescriptorTest.java | 9 +
.../kerberos/VariableReplacementHelperTest.java | 130 +-
.../state/repository/VersionDefinitionTest.java | 2 +-
.../AlertNoticeDispatchServiceTest.java | 2 +-
.../services/CachedAlertFlushServiceTest.java | 2 +-
.../services/MetricsRetrievalServiceTest.java | 2 +-
.../services/RetryUpgradeActionServiceTest.java | 19 +-
.../state/stack/ConfigUpgradePackTest.java | 2 +-
.../state/stack/ConfigUpgradeValidityTest.java | 2 +-
.../ambari/server/state/stack/OSFamilyTest.java | 2 +-
.../state/stack/UpgradePackParsingTest.java | 2 +-
.../server/state/stack/UpgradePackTest.java | 2 +-
.../upgrade/RepositoryVersionHelperTest.java | 29 +-
.../stack/upgrade/StageWrapperBuilderTest.java | 32 +-
.../svccomphost/ServiceComponentHostTest.java | 66 +-
.../server/testing/DBInconsistencyTests.java | 2 +-
.../server/testing/DeadlockWarningThread.java | 2 +-
.../server/testing/DeadlockedThreadsTest.java | 4 +-
.../server/topology/AmbariContextTest.java | 2 +-
.../server/topology/BlueprintFactoryTest.java | 2 +-
.../server/topology/BlueprintImplTest.java | 2 +-
.../topology/BlueprintValidatorImplTest.java | 2 +-
.../ClusterConfigurationRequestTest.java | 2 +-
.../ClusterDeployWithStartOnlyTest.java | 7 +-
...InstallWithoutStartOnComponentLevelTest.java | 7 +-
.../ClusterInstallWithoutStartTest.java | 9 +-
.../topology/ClusterTopologyImplTest.java | 4 +-
.../topology/ConfigurationFactoryTest.java | 2 +-
.../server/topology/ConfigurationTest.java | 2 +-
.../topology/ConfigureClusterTaskTest.java | 4 +-
.../server/topology/HostGroupInfoTest.java | 2 +-
.../server/topology/LogicalRequestTest.java | 2 +-
.../topology/RequiredPasswordValidatorTest.java | 2 +-
.../SecurityConfigurationFactoryTest.java | 2 +-
.../server/topology/SettingFactoryTest.java | 2 +-
.../ambari/server/topology/SettingTest.java | 20 +-
.../server/topology/TopologyManagerTest.java | 11 +-
.../RequiredConfigPropertiesValidatorTest.java | 35 +-
.../upgrade/AbstractUpgradeCatalogTest.java | 8 +-
.../server/upgrade/StackUpgradeUtilTest.java | 145 -
.../server/upgrade/UpgradeCatalog200Test.java | 38 +-
.../server/upgrade/UpgradeCatalog210Test.java | 21 +-
.../server/upgrade/UpgradeCatalog211Test.java | 5 +-
.../server/upgrade/UpgradeCatalog212Test.java | 13 +-
.../server/upgrade/UpgradeCatalog220Test.java | 124 +-
.../server/upgrade/UpgradeCatalog221Test.java | 4 +-
.../server/upgrade/UpgradeCatalog222Test.java | 84 +-
.../server/upgrade/UpgradeCatalog240Test.java | 122 +-
.../server/upgrade/UpgradeCatalog242Test.java | 22 +-
.../server/upgrade/UpgradeCatalog250Test.java | 36 +-
.../server/upgrade/UpgradeCatalog251Test.java | 102 +
.../server/upgrade/UpgradeCatalog300Test.java | 50 +-
.../server/upgrade/UpgradeCatalogHelper.java | 37 +-
.../utils/CollectionPresentationUtils.java | 2 +-
.../ambari/server/utils/RequestUtilsTest.java | 2 +-
.../ambari/server/utils/SetUtilsTest.java | 2 +-
.../ambari/server/utils/StageUtilsTest.java | 29 +-
.../utils/SynchronousThreadPoolExecutor.java | 2 +-
.../ambari/server/utils/TestDateUtils.java | 2 +-
.../ambari/server/utils/TestHTTPUtils.java | 2 +-
.../ambari/server/utils/TestJsonUtils.java | 2 +-
.../ambari/server/utils/TestParallel.java | 2 +-
.../server/utils/TestShellCommandUtil.java | 2 +-
.../ambari/server/utils/TestVersionUtils.java | 2 +-
.../ambari/server/view/ClusterImplTest.java | 4 +-
.../ambari/server/view/DefaultMaskerTest.java | 2 +-
.../server/view/HttpImpersonatorImplTest.java | 2 +-
.../server/view/RemoteAmbariClusterTest.java | 2 +-
.../view/ViewAmbariStreamProviderTest.java | 4 +-
.../server/view/ViewArchiveUtilityTest.java | 4 +-
.../ambari/server/view/ViewClassLoaderTest.java | 2 +-
.../ambari/server/view/ViewContextImplTest.java | 2 +-
.../view/ViewDataMigrationContextImplTest.java | 2 +-
.../view/ViewDataMigrationUtilityTest.java | 2 +-
.../server/view/ViewDirectoryWatcherTest.java | 2 +-
.../ambari/server/view/ViewExtractorTest.java | 2 +-
.../ambari/server/view/ViewRegistryTest.java | 13 +-
.../view/ViewSubResourceDefinitionTest.java | 2 +-
.../view/ViewSubResourceProviderTest.java | 2 +-
.../server/view/ViewThrottleFilterTest.java | 2 +-
.../server/view/ViewURLStreamProviderTest.java | 2 +-
.../view/configuration/EntityConfigTest.java | 2 +-
.../view/configuration/InstanceConfigTest.java | 2 +-
.../view/configuration/ParameterConfigTest.java | 2 +-
.../configuration/PermissionConfigTest.java | 2 +-
.../configuration/PersistenceConfigTest.java | 2 +-
.../view/configuration/PropertyConfigTest.java | 2 +-
.../view/configuration/ResourceConfigTest.java | 2 +-
.../view/configuration/ViewConfigTest.java | 2 +-
.../server/view/events/EventImplTest.java | 2 +-
.../InstanceValidationResultImplTest.java | 4 +-
.../validation/ValidationResultImplTest.java | 4 +-
.../src/test/python/TestAmbariServer.py | 166 +-
.../src/test/python/TestServerUpgrade.py | 35 +-
ambari-server/src/test/python/TestVersion.py | 12 +
.../custom_actions/TestInstallPackages.py | 188 +-
.../install_packages_repository_file.json | 112 +
.../python/custom_actions/test_ru_set_all.py | 124 +-
.../python/host_scripts/TestAlertDiskSpace.py | 12 +-
.../stacks/2.0.6/YARN/test_historyserver.py | 2 -
.../stacks/2.0.6/common/test_stack_advisor.py | 153 +
.../stacks/2.0.6/configs/repository_file.json | 1275 +
.../hooks/before-INSTALL/test_before_install.py | 30 +
.../test/python/stacks/2.6/DRUID/test_druid.py | 23 +-
.../test/python/stacks/2.6/configs/default.json | 3 +-
.../src/test/python/stacks/utils/RMFTestCase.py | 12 +-
.../stacks/HDP/2.0.6.1/role_command_order.json | 101 +-
.../upgrades/upgrade_execute_task_test.xml | 42 +
.../upgrades/upgrade_nonrolling_new_stack.xml | 2 +-
ambari-web/api-docs/css/api-explorer.css | 2423 +
ambari-web/api-docs/css/index.css | 17430 +++++
ambari-web/api-docs/css/print.css | 1167 +
ambari-web/api-docs/css/reset.css | 125 +
ambari-web/api-docs/css/screen.css | 9 +
ambari-web/api-docs/css/standalone.css | 293 +
ambari-web/api-docs/css/typography.css | 26 +
.../api-docs/fonts/droid-sans-v6-latin-700.eot | Bin 0 -> 22922 bytes
.../api-docs/fonts/droid-sans-v6-latin-700.svg | 411 +
.../api-docs/fonts/droid-sans-v6-latin-700.ttf | Bin 0 -> 40513 bytes
.../api-docs/fonts/droid-sans-v6-latin-700.woff | Bin 0 -> 25992 bytes
.../fonts/droid-sans-v6-latin-700.woff2 | Bin 0 -> 11480 bytes
.../fonts/droid-sans-v6-latin-regular.eot | Bin 0 -> 22008 bytes
.../fonts/droid-sans-v6-latin-regular.svg | 403 +
.../fonts/droid-sans-v6-latin-regular.ttf | Bin 0 -> 39069 bytes
.../fonts/droid-sans-v6-latin-regular.woff | Bin 0 -> 24868 bytes
.../fonts/droid-sans-v6-latin-regular.woff2 | Bin 0 -> 11304 bytes
ambari-web/api-docs/images/Swagger_explorer.png | Bin 0 -> 108087 bytes
.../api-docs/images/Swagger_explorer_min.png | Bin 0 -> 46646 bytes
ambari-web/api-docs/images/explorer_icons.png | Bin 0 -> 5763 bytes
ambari-web/api-docs/images/favicon-16x16.png | Bin 0 -> 645 bytes
ambari-web/api-docs/images/favicon-32x32.png | Bin 0 -> 1654 bytes
ambari-web/api-docs/images/favicon.ico | Bin 0 -> 5430 bytes
.../api-docs/images/json_editor_integration.png | Bin 0 -> 63019 bytes
ambari-web/api-docs/images/logo_small.png | Bin 0 -> 770 bytes
ambari-web/api-docs/images/pet_store_api.png | Bin 0 -> 824 bytes
ambari-web/api-docs/images/senodio.png | Bin 0 -> 22838 bytes
ambari-web/api-docs/images/throbber.gif | Bin 0 -> 9257 bytes
ambari-web/api-docs/images/wordnik_api.png | Bin 0 -> 980 bytes
ambari-web/api-docs/index.html | 241 +
ambari-web/api-docs/lib/backbone-min.js | 15 +
ambari-web/api-docs/lib/bootstrap.min.js | 6 +
ambari-web/api-docs/lib/handlebars-2.0.0.js | 28 +
ambari-web/api-docs/lib/highlight.7.3.pack.js | 1 +
ambari-web/api-docs/lib/jquery-1.8.0.min.js | 2 +
ambari-web/api-docs/lib/jquery.ba-bbq.min.js | 18 +
ambari-web/api-docs/lib/jquery.slideto.min.js | 1 +
ambari-web/api-docs/lib/jquery.wiggle.min.js | 8 +
ambari-web/api-docs/lib/jsoneditor.js | 7287 +++
ambari-web/api-docs/lib/marked.js | 1272 +
ambari-web/api-docs/lib/swagger-oauth.js | 286 +
ambari-web/api-docs/lib/underscore-min.js | 6 +
ambari-web/api-docs/lib/underscore-min.map | 1 +
ambari-web/api-docs/o2c.html | 20 +
ambari-web/api-docs/swagger-ui.js | 22644 +++++++
ambari-web/api-docs/swagger-ui.min.js | 12 +
.../assets/data/stack_versions/upgrades.json | 17 +-
ambari-web/app/config.js | 3 +-
ambari-web/app/controllers/installer.js | 15 -
.../journalNode/step1_controller.js | 2 +-
.../main/admin/stack_and_upgrade_controller.js | 27 +-
.../app/controllers/main/host/add_controller.js | 3 -
.../service/manage_config_groups_controller.js | 89 +-
.../main/service/reassign/step3_controller.js | 1 +
.../app/controllers/main/views_controller.js | 4 +-
ambari-web/app/controllers/wizard.js | 47 +-
.../wizard/step7/assign_master_controller.js | 16 +-
.../app/controllers/wizard/step7_controller.js | 3 +
.../app/controllers/wizard/step8_controller.js | 183 +-
.../app/mappers/stack_upgrade_history_mapper.js | 10 +-
ambari-web/app/messages.js | 22 +-
.../mixins/wizard/assign_master_components.js | 77 +-
.../app/mixins/wizard/wizardHostsLoading.js | 6 +-
.../stack_version/stack_upgrade_history.js | 4 +-
ambari-web/app/models/view_instance.js | 6 +-
ambari-web/app/routes/add_host_routes.js | 38 +-
ambari-web/app/routes/add_service_routes.js | 1 +
ambari-web/app/routes/installer.js | 1 +
ambari-web/app/styles/alerts.less | 14 +
ambari-web/app/styles/application.less | 34 +-
ambari-web/app/styles/bootstrap_overrides.less | 49 +
ambari-web/app/styles/common.less | 1 +
ambari-web/app/styles/config_history_flow.less | 7 +-
ambari-web/app/styles/dashboard.less | 115 +-
.../app/styles/theme/bootstrap-ambari.css | 34 +-
.../templates/common/export_metrics_menu.hbs | 16 +-
ambari-web/app/templates/common/progress.hbs | 4 +
.../admin/stack_upgrade/upgrade_history.hbs | 14 +-
ambari-web/app/templates/main/dashboard.hbs | 2 +-
.../main/dashboard/widgets/cluster_metrics.hbs | 12 +-
.../main/dashboard/widgets/hbase_links.hbs | 15 +-
.../main/dashboard/widgets/hdfs_links.hbs | 17 +-
.../main/dashboard/widgets/pie_chart.hbs | 21 +-
.../main/dashboard/widgets/simple_text.hbs | 21 +-
.../templates/main/dashboard/widgets/uptime.hbs | 16 +-
.../main/dashboard/widgets/yarn_links.hbs | 18 +-
.../app/templates/main/service/menu_item.hbs | 11 +-
.../app/templates/main/side-menu-item.hbs | 6 +-
.../wizard/step3/step3_host_warnings_popup.hbs | 4 +-
ambari-web/app/templates/wizard/step4.hbs | 16 +-
ambari-web/app/templates/wizard/step6.hbs | 2 +-
ambari-web/app/templates/wizard/step8.hbs | 2 +-
ambari-web/app/utils/ajax/ajax.js | 12 +-
ambari-web/app/utils/array_utils.js | 6 +-
ambari-web/app/utils/config.js | 2 +-
.../common/assign_master_components_view.js | 4 +
ambari-web/app/views/common/chart/pie.js | 10 +-
.../views/main/admin/kerberos/disable_view.js | 3 +-
.../admin/stack_upgrade/upgrade_history_view.js | 42 +-
.../stack_upgrade/upgrade_version_box_view.js | 4 +-
.../dashboard/widgets/cluster_metrics_widget.js | 3 -
.../main/dashboard/widgets/pie_chart_widget.js | 23 +-
ambari-web/app/views/main/menu.js | 12 +
ambari-web/app/views/main/service/menu.js | 4 -
.../app/views/main/service/reassign_view.js | 4 -
ambari-web/app/views/wizard/step4_view.js | 7 +-
ambari-web/brunch-config.js | 3 +-
ambari-web/pom.xml | 1 +
ambari-web/test/controllers/installer_test.js | 12 -
.../journalNode/step1_controller_test.js | 4 +-
.../admin/stack_and_upgrade_controller_test.js | 14 +-
.../main/host/add_controller_test.js | 19 -
.../main/service/add_controller_test.js | 54 +-
.../controllers/main/views_controller_test.js | 14 +-
.../test/controllers/wizard/step5_test.js | 86 +-
.../test/controllers/wizard/step8_test.js | 82 +-
ambari-web/test/controllers/wizard_test.js | 34 +-
.../stack_upgrade_history_mapper_test.js | 32 +-
ambari-web/test/models/view_instance_test.js | 6 +-
ambari-web/test/utils/config_test.js | 2 +-
.../resourceManager/wizard_view_test.js | 18 +-
.../stack_upgrade/upgrade_history_view_test.js | 83 +-
.../upgrade_version_box_view_test.js | 4 +-
ambari-web/test/views/main/service/menu_test.js | 12 -
.../views/main/service/reassign_view_test.js | 12 -
.../vendor/scripts/theme/bootstrap-ambari.js | 20 +-
.../view/filebrowser/DownloadService.java | 13 +-
.../ambari/view/hive2/actor/DeathWatch.java | 5 +-
.../view/hive2/client/NonPersistentCursor.java | 4 +-
.../src/main/resources/ui/hive-web/Brocfile.js | 1 +
.../resources/ui/hive-web/app/routes/splash.js | 2 +-
.../ui/hive-web/vendor/browser-pollyfills.js | 213 +
.../ambari/view/hive20/actor/DeathWatch.java | 7 +-
.../view/hive20/client/NonPersistentCursor.java | 4 +-
.../src/main/resources/ui/ember-cli-build.js | 1 +
.../resources/ui/vendor/browser-pollyfills.js | 213 +
.../ambari/storm/StormDetailsServlet.java | 81 +
.../storm/src/main/resources/WEB-INF/web.xml | 8 +
.../resources/scripts/components/SearchLogs.jsx | 38 +-
.../ui/app/components/search-create-new-bar.js | 12 +-
.../components/search-create-new-bar.hbs | 4 +
.../config-utils/diff_stack_properties.py | 154 +
docs/pom.xml | 2 +-
docs/src/site/apt/index.apt | 2 +-
docs/src/site/apt/whats-new.apt | 4 +-
docs/src/site/site.xml | 4 +
pom.xml | 1 +
utility/checkstyle.xml | 38 +
utility/pom.xml | 5 +-
.../apache/ambari/annotations/ApiIgnore.java | 29 +
.../UndocumentedRestApiOperationCheck.java | 76 +
...dTransactionalOnPrivateMethodsCheckTest.java | 4 +-
.../UndocumentedRestApiOperationCheckTest.java | 53 +
.../checkstyle/InputRestApiOperation.java | 138 +
2661 files changed, 168400 insertions(+), 24457 deletions(-)
----------------------------------------------------------------------
[03/50] [abbrv] ambari git commit: Merge branch
'branch-feature-AMBARI-12556' into trunk
Posted by rl...@apache.org.
Merge branch 'branch-feature-AMBARI-12556' into trunk
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/851c8571
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/851c8571
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/851c8571
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 851c85718b8a239392d51c937f51b3c070b27356
Parents: 81f64bf 9a42d40
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Thu Jun 1 09:31:13 2017 -0400
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Jun 1 09:31:13 2017 -0400
----------------------------------------------------------------------
.../AmbariCustomCommandExecutionHelper.java | 10 ++--
.../server/controller/KerberosHelperImpl.java | 10 +++-
.../internal/UpgradeResourceProvider.java | 26 +++++++---
.../0.12.0.2.0/package/scripts/params_linux.py | 2 +-
.../2.1.0.3.0/package/scripts/params_linux.py | 2 +-
.../AmbariManagementControllerTest.java | 6 +--
.../server/controller/KerberosHelperTest.java | 7 +++
.../internal/UpgradeResourceProviderTest.java | 54 ++++++++++++++++++++
.../upgrades/upgrade_execute_task_test.xml | 42 +++++++++++++++
9 files changed, 139 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
[39/50] [abbrv] ambari git commit: AMBARI-21196. Fix
ambari-solr-plugin folder structure (oleewere)
Posted by rl...@apache.org.
AMBARI-21196. Fix ambari-solr-plugin folder structure (oleewere)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3146a197
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3146a197
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3146a197
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 3146a1970f356427010a2275462a6ad93c9ce126
Parents: 2ff48a0
Author: oleewere <ol...@gmail.com>
Authored: Wed Jun 7 19:54:17 2017 +0200
Committer: oleewere <ol...@gmail.com>
Committed: Thu Jun 8 13:29:46 2017 +0200
----------------------------------------------------------------------
.../InfraKerberosHostValidator.java | 54 --
.../InfraRuleBasedAuthorizationPlugin.java | 542 -------------------
.../InfraUserRolesLookupStrategy.java | 49 --
.../security/InfraKerberosHostValidator.java | 54 ++
.../InfraRuleBasedAuthorizationPlugin.java | 542 +++++++++++++++++++
.../security/InfraUserRolesLookupStrategy.java | 49 ++
6 files changed, 645 insertions(+), 645 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/3146a197/ambari-infra/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraKerberosHostValidator.java
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraKerberosHostValidator.java b/ambari-infra/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraKerberosHostValidator.java
deleted file mode 100644
index 4a47a89..0000000
--- a/ambari-infra/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraKerberosHostValidator.java
+++ /dev/null
@@ -1,54 +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.
- */
-package org.apache.ambari.infra.security;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.collections.MapUtils;
-import org.apache.hadoop.security.authentication.server.AuthenticationToken;
-import org.apache.hadoop.security.authentication.util.KerberosName;
-
-import java.security.Principal;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Validate that the user has the right access based on the hostname in the kerberos principal
- */
-public class InfraKerberosHostValidator {
-
- public boolean validate(Principal principal, Map<String, Set<String>> userVsHosts, Map<String, String> userVsHostRegex) {
- if (principal instanceof AuthenticationToken) {
- AuthenticationToken authenticationToken = (AuthenticationToken) principal;
- KerberosName kerberosName = new KerberosName(authenticationToken.getName());
- String hostname = kerberosName.getHostName();
- String serviceUserName = kerberosName.getServiceName();
- if (MapUtils.isNotEmpty(userVsHostRegex)) {
- String regex = userVsHostRegex.get(serviceUserName);
- return hostname.matches(regex);
- }
- if (MapUtils.isNotEmpty(userVsHosts)) {
- Set<String> hosts = userVsHosts.get(serviceUserName);
- if (CollectionUtils.isNotEmpty(hosts)) {
- return hosts.contains(hostname);
- }
- }
- }
- return true;
- }
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3146a197/ambari-infra/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraRuleBasedAuthorizationPlugin.java
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraRuleBasedAuthorizationPlugin.java b/ambari-infra/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraRuleBasedAuthorizationPlugin.java
deleted file mode 100644
index 2f1a558..0000000
--- a/ambari-infra/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraRuleBasedAuthorizationPlugin.java
+++ /dev/null
@@ -1,542 +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.
- */
-package org.apache.ambari.infra.security;
-
-import com.google.common.collect.ImmutableSet;
-import java.io.IOException;
-import java.lang.invoke.MethodHandles;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.params.CollectionParams;
-import org.apache.solr.common.util.Utils;
-import org.apache.solr.security.AuthorizationContext;
-import org.apache.solr.security.AuthorizationPlugin;
-import org.apache.solr.security.AuthorizationResponse;
-import org.apache.solr.security.ConfigEditablePlugin;
-import org.apache.solr.util.CommandOperation;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static java.util.Collections.singleton;
-import static org.apache.solr.common.params.CommonParams.NAME;
-import static org.apache.solr.common.util.Utils.getDeepCopy;
-import static org.apache.solr.handler.admin.SecurityConfHandler.getListValue;
-import static org.apache.solr.handler.admin.SecurityConfHandler.getMapValue;
-
-/**
- * Modified copy of solr.RuleBasedAuthorizationPlugin to handle role - permission mappings with KereberosPlugin
- * Added 2 new JSON map: (precedence: user-host-regex > user-host)
- * 1. "user-host": user host mappings (array) for hostname validation
- * 2. "user-host-regex": user host regex mapping (string) for hostname validation
- */
-public class InfraRuleBasedAuthorizationPlugin implements AuthorizationPlugin, ConfigEditablePlugin {
-
- private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
- private final Map<String, Set<String>> usersVsRoles = new HashMap<>();
- private final Map<String, WildCardSupportMap> mapping = new HashMap<>();
- private final List<Permission> permissions = new ArrayList<>();
- private final Map<String, Set<String>> userVsHosts = new HashMap<>();
- private final Map<String, String> userVsHostRegex = new HashMap<>();
-
- private final InfraUserRolesLookupStrategy infraUserRolesLookupStrategy = new InfraUserRolesLookupStrategy();
- private final InfraKerberosHostValidator infraKerberosDomainValidator = new InfraKerberosHostValidator();
-
- private static class WildCardSupportMap extends HashMap<String, List<Permission>> {
- final Set<String> wildcardPrefixes = new HashSet<>();
-
- @Override
- public List<Permission> put(String key, List<Permission> value) {
- if (key != null && key.endsWith("/*")) {
- key = key.substring(0, key.length() - 2);
- wildcardPrefixes.add(key);
- }
- return super.put(key, value);
- }
-
- @Override
- public List<Permission> get(Object key) {
- List<Permission> result = super.get(key);
- if (key == null || result != null) return result;
- if (!wildcardPrefixes.isEmpty()) {
- for (String s : wildcardPrefixes) {
- if (key.toString().startsWith(s)) {
- List<Permission> l = super.get(s);
- if (l != null) {
- result = result == null ? new ArrayList<Permission>() : new ArrayList<Permission>(result);
- result.addAll(l);
- }
- }
- }
- }
- return result;
- }
- }
-
- @Override
- public AuthorizationResponse authorize(AuthorizationContext context) {
- List<AuthorizationContext.CollectionRequest> collectionRequests = context.getCollectionRequests();
- if (context.getRequestType() == AuthorizationContext.RequestType.ADMIN) {
- MatchStatus flag = checkCollPerm(mapping.get(null), context);
- return flag.rsp;
- }
-
- for (AuthorizationContext.CollectionRequest collreq : collectionRequests) {
- //check permissions for each collection
- MatchStatus flag = checkCollPerm(mapping.get(collreq.collectionName), context);
- if (flag != MatchStatus.NO_PERMISSIONS_FOUND) return flag.rsp;
- }
- //check wildcard (all=*) permissions.
- MatchStatus flag = checkCollPerm(mapping.get("*"), context);
- return flag.rsp;
- }
-
- private MatchStatus checkCollPerm(Map<String, List<Permission>> pathVsPerms,
- AuthorizationContext context) {
- if (pathVsPerms == null) return MatchStatus.NO_PERMISSIONS_FOUND;
-
- String path = context.getResource();
- MatchStatus flag = checkPathPerm(pathVsPerms.get(path), context);
- if (flag != MatchStatus.NO_PERMISSIONS_FOUND) return flag;
- return checkPathPerm(pathVsPerms.get(null), context);
- }
-
- private MatchStatus checkPathPerm(List<Permission> permissions, AuthorizationContext context) {
- if (permissions == null || permissions.isEmpty()) return MatchStatus.NO_PERMISSIONS_FOUND;
- Principal principal = context.getUserPrincipal();
- loopPermissions:
- for (int i = 0; i < permissions.size(); i++) {
- Permission permission = permissions.get(i);
- if (permission.method != null && !permission.method.contains(context.getHttpMethod())) {
- //this permissions HTTP method does not match this rule. try other rules
- continue;
- }
- if(permission.predicate != null){
- if(!permission.predicate.test(context)) continue ;
- }
-
- if (permission.params != null) {
- for (Map.Entry<String, Object> e : permission.params.entrySet()) {
- String paramVal = context.getParams().get(e.getKey());
- Object val = e.getValue();
- if (val instanceof List) {
- if (!((List) val).contains(paramVal)) continue loopPermissions;
- } else if (!Objects.equals(val, paramVal)) continue loopPermissions;
- }
- }
-
- if (permission.role == null) {
- //no role is assigned permission.That means everybody is allowed to access
- return MatchStatus.PERMITTED;
- }
- if (principal == null) {
- log.info("request has come without principal. failed permission {} ",permission);
- //this resource needs a principal but the request has come without
- //any credential.
- return MatchStatus.USER_REQUIRED;
- } else if (permission.role.contains("*")) {
- return MatchStatus.PERMITTED;
- }
-
- for (String role : permission.role) {
- Set<String> userRoles = infraUserRolesLookupStrategy.getUserRolesFromPrincipal(usersVsRoles, principal);
- boolean validHostname = infraKerberosDomainValidator.validate(principal, userVsHosts, userVsHostRegex);
- if (!validHostname) {
- log.warn("Hostname is not valid for principal {}", principal);
- return MatchStatus.FORBIDDEN;
- }
- if (userRoles != null && userRoles.contains(role)) return MatchStatus.PERMITTED;
- }
- log.info("This resource is configured to have a permission {}, The principal {} does not have the right role ", permission, principal);
- return MatchStatus.FORBIDDEN;
- }
- log.debug("No permissions configured for the resource {} . So allowed to access", context.getResource());
- return MatchStatus.NO_PERMISSIONS_FOUND;
- }
-
- @Override
- public void init(Map<String, Object> initInfo) {
- mapping.put(null, new WildCardSupportMap());
- Map<String, Object> map = getMapValue(initInfo, "user-role");
- for (Object o : map.entrySet()) {
- Map.Entry e = (Map.Entry) o;
- String roleName = (String) e.getKey();
- usersVsRoles.put(roleName, readValueAsSet(map, roleName));
- }
- List<Map> perms = getListValue(initInfo, "permissions");
- for (Map o : perms) {
- Permission p;
- try {
- p = Permission.load(o);
- } catch (Exception exp) {
- log.error("Invalid permission ", exp);
- continue;
- }
- permissions.add(p);
- add2Mapping(p);
- }
- // adding user-host
- Map<String, Object> userHostsMap = getMapValue(initInfo, "user-host");
- for (Object userHost : userHostsMap.entrySet()) {
- Map.Entry e = (Map.Entry) userHost;
- String roleName = (String) e.getKey();
- userVsHosts.put(roleName, readValueAsSet(userHostsMap, roleName));
- }
- // adding user-host-regex
- Map<String, Object> userHostRegexMap = getMapValue(initInfo, "user-host-regex");
- for (Map.Entry<String, Object> entry : userHostRegexMap.entrySet()) {
- userVsHostRegex.put(entry.getKey(), entry.getValue().toString());
- }
-
- }
-
- //this is to do optimized lookup of permissions for a given collection/path
- private void add2Mapping(Permission permission) {
- for (String c : permission.collections) {
- WildCardSupportMap m = mapping.get(c);
- if (m == null) mapping.put(c, m = new WildCardSupportMap());
- for (String path : permission.path) {
- List<Permission> perms = m.get(path);
- if (perms == null) m.put(path, perms = new ArrayList<>());
- perms.add(permission);
- }
- }
- }
-
- /**
- * read a key value as a set. if the value is a single string ,
- * return a singleton set
- *
- * @param m the map from which to lookup
- * @param key the key with which to do lookup
- */
- static Set<String> readValueAsSet(Map m, String key) {
- Set<String> result = new HashSet<>();
- Object val = m.get(key);
- if (val == null) {
- if("collection".equals(key)){
- //for collection collection: null means a core admin/ collection admin request
- // otherwise it means a request where collection name is ignored
- return m.containsKey(key) ? singleton((String) null) : singleton("*");
- }
- return null;
- }
- if (val instanceof Collection) {
- Collection list = (Collection) val;
- for (Object o : list) result.add(String.valueOf(o));
- } else if (val instanceof String) {
- result.add((String) val);
- } else {
- throw new RuntimeException("Bad value for : " + key);
- }
- return result.isEmpty() ? null : Collections.unmodifiableSet(result);
- }
-
- @Override
- public void close() throws IOException { }
-
- static class Permission {
- String name;
- Set<String> path, role, collections, method;
- Map<String, Object> params;
- Predicate<AuthorizationContext> predicate;
- Map originalConfig;
-
- private Permission() {
- }
-
- static Permission load(Map m) {
- Permission p = new Permission();
- p.originalConfig = new LinkedHashMap<>(m);
- String name = (String) m.get(NAME);
- if (!m.containsKey("role")) throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "role not specified");
- p.role = readValueAsSet(m, "role");
- if (well_known_permissions.containsKey(name)) {
- HashSet<String> disAllowed = new HashSet<>(knownKeys);
- disAllowed.remove("role");//these are the only
- disAllowed.remove(NAME);//allowed keys for well-known permissions
- for (String s : disAllowed) {
- if (m.containsKey(s))
- throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, s + " is not a valid key for the permission : " + name);
- }
- p.predicate = (Predicate<AuthorizationContext>) ((Map) well_known_permissions.get(name)).get(Predicate.class.getName());
- m = well_known_permissions.get(name);
- }
- p.name = name;
- p.path = readSetSmart(name, m, "path");
- p.collections = readSetSmart(name, m, "collection");
- p.method = readSetSmart(name, m, "method");
- p.params = (Map<String, Object>) m.get("params");
- return p;
- }
-
- @Override
- public String toString() {
- return Utils.toJSONString(originalConfig);
- }
-
- static final Set<String> knownKeys = ImmutableSet.of("collection", "role", "params", "path", "method", NAME);
- }
-
- enum MatchStatus {
- USER_REQUIRED(AuthorizationResponse.PROMPT),
- NO_PERMISSIONS_FOUND(AuthorizationResponse.OK),
- PERMITTED(AuthorizationResponse.OK),
- FORBIDDEN(AuthorizationResponse.FORBIDDEN);
-
- final AuthorizationResponse rsp;
-
- MatchStatus(AuthorizationResponse rsp) {
- this.rsp = rsp;
- }
- }
-
- /**
- * This checks for the defaults available other rules for the keys
- */
- private static Set<String> readSetSmart(String permissionName, Map m, String key) {
- Set<String> set = readValueAsSet(m, key);
- if (set == null && well_known_permissions.containsKey(permissionName)) {
- set = readValueAsSet((Map) well_known_permissions.get(permissionName), key);
- }
- if ("method".equals(key)) {
- if (set != null) {
- for (String s : set) if (!HTTP_METHODS.contains(s)) return null;
- }
- return set;
- }
- return set == null ? singleton((String)null) : set;
- }
-
- @Override
- public Map<String, Object> edit(Map<String, Object> latestConf, List<CommandOperation> commands) {
- for (CommandOperation op : commands) {
- OPERATION operation = null;
- for (OPERATION o : OPERATION.values()) {
- if (o.name.equals(op.name)) {
- operation = o;
- break;
- }
- }
- if (operation == null) {
- op.unknownOperation();
- return null;
- }
- latestConf = operation.edit(latestConf, op);
- if (latestConf == null) return null;
-
- }
- return latestConf;
- }
-
- enum OPERATION {
- SET_USER_ROLE("set-user-role") {
- @Override
- public Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op) {
- Map<String, Object> roleMap = getMapValue(latestConf, "user-role");
- Map<String, Object> map = op.getDataMap();
- if (op.hasError()) return null;
- for (Map.Entry<String, Object> e : map.entrySet()) {
- if (e.getValue() == null) {
- roleMap.remove(e.getKey());
- continue;
- }
- if (e.getValue() instanceof String || e.getValue() instanceof List) {
- roleMap.put(e.getKey(), e.getValue());
- } else {
- op.addError("Unexpected value ");
- return null;
- }
- }
- return latestConf;
- }
- },
- SET_PERMISSION("set-permission") {
- @Override
- public Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op) {
- String name = op.getStr(NAME);
- Map<String, Object> dataMap = op.getDataMap();
- if (op.hasError()) return null;
- dataMap = getDeepCopy(dataMap, 3);
- String before = (String) dataMap.remove("before");
- for (String key : dataMap.keySet()) {
- if (!Permission.knownKeys.contains(key)) op.addError("Unknown key, " + key);
- }
- try {
- Permission.load(dataMap);
- } catch (Exception e) {
- op.addError(e.getMessage());
- return null;
- }
- List<Map> permissions = getListValue(latestConf, "permissions");
- List<Map> permissionsCopy = new ArrayList<>();
- boolean added = false;
- for (Map e : permissions) {
- Object n = e.get(NAME);
- if (n.equals(before) || n.equals(name)) {
- added = true;
- permissionsCopy.add(dataMap);
- }
- if (!n.equals(name)) permissionsCopy.add(e);
- }
- if (!added && before != null) {
- op.addError("Invalid 'before' :" + before);
- return null;
- }
- if (!added) permissionsCopy.add(dataMap);
- latestConf.put("permissions", permissionsCopy);
- return latestConf;
- }
- },
- UPDATE_PERMISSION("update-permission") {
- @Override
- public Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op) {
- String name = op.getStr(NAME);
- if (op.hasError()) return null;
- for (Map permission : (List<Map>) getListValue(latestConf, "permissions")) {
- if (name.equals(permission.get(NAME))) {
- LinkedHashMap copy = new LinkedHashMap<>(permission);
- copy.putAll(op.getDataMap());
- op.setCommandData(copy);
- return SET_PERMISSION.edit(latestConf, op);
- }
- }
- op.addError("No such permission " + name);
- return null;
- }
- },
- DELETE_PERMISSION("delete-permission") {
- @Override
- public Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op) {
- List<String> names = op.getStrs("");
- if (names == null || names.isEmpty()) {
- op.addError("Invalid command");
- return null;
- }
- names = new ArrayList<>(names);
- List<Map> copy = new ArrayList<>();
- List<Map> p = getListValue(latestConf, "permissions");
- for (Map map : p) {
- Object n = map.get(NAME);
- if (names.contains(n)) {
- names.remove(n);
- continue;
- } else {
- copy.add(map);
- }
- }
- if (!names.isEmpty()) {
- op.addError("Unknown permission name(s) " + names);
- return null;
- }
- latestConf.put("permissions", copy);
- return latestConf;
- }
- };
-
- public abstract Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op);
-
- public final String name;
-
- OPERATION(String s) {
- this.name = s;
- }
-
- public static OPERATION get(String name) {
- for (OPERATION o : values()) if (o.name.equals(name)) return o;
- return null;
- }
- }
-
- public static final Set<String> HTTP_METHODS = ImmutableSet.of("GET", "POST", "DELETE", "PUT", "HEAD");
-
- private static final Map<String, Map<String,Object>> well_known_permissions = (Map) Utils.fromJSONString(
- " { " +
- " security-edit :{" +
- " path:['/admin/authentication','/admin/authorization']," +
- " collection:null," +
- " method:POST }," +
- " security-read :{" +
- " path:['/admin/authentication','/admin/authorization']," +
- " collection:null," +
- " method:GET}," +
- " schema-edit :{" +
- " method:POST," +
- " path:'/schema/*'}," +
- " collection-admin-edit :{" +
- " collection:null," +
- " path:'/admin/collections'}," +
- " collection-admin-read :{" +
- " collection:null," +
- " path:'/admin/collections'}," +
- " schema-read :{" +
- " method:GET," +
- " path:'/schema/*'}," +
- " config-read :{" +
- " method:GET," +
- " path:'/config/*'}," +
- " update :{" +
- " path:'/update/*'}," +
- " read :{" +
- " path:['/select', '/get','/browse','/tvrh','/terms','/clustering','/elevate', '/export','/spell','/clustering']}," +
- " config-edit:{" +
- " method:POST," +
- " path:'/config/*'}," +
- " all:{collection:['*', null]}" +
- "}");
-
- static {
- ((Map) well_known_permissions.get("collection-admin-edit")).put(Predicate.class.getName(), getCollectionActionPredicate(true));
- ((Map) well_known_permissions.get("collection-admin-read")).put(Predicate.class.getName(), getCollectionActionPredicate(false));
- }
-
- private static Predicate<AuthorizationContext> getCollectionActionPredicate(final boolean isEdit) {
- return new Predicate<AuthorizationContext>() {
- @Override
- public boolean test(AuthorizationContext context) {
- String action = context.getParams().get("action");
- if (action == null) return false;
- CollectionParams.CollectionAction collectionAction = CollectionParams.CollectionAction.get(action);
- if (collectionAction == null) return false;
- return isEdit ? collectionAction.isWrite : !collectionAction.isWrite;
- }
- };
- }
-
-
- public static void main(String[] args) {
- System.out.println(Utils.toJSONString(well_known_permissions));
-
- }
-
- public interface Predicate<T> {
-
- boolean test(T t);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/3146a197/ambari-infra/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraUserRolesLookupStrategy.java
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraUserRolesLookupStrategy.java b/ambari-infra/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraUserRolesLookupStrategy.java
deleted file mode 100644
index a54e4ad..0000000
--- a/ambari-infra/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraUserRolesLookupStrategy.java
+++ /dev/null
@@ -1,49 +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.
- */
-package org.apache.ambari.infra.security;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.hadoop.security.authentication.server.AuthenticationToken;
-import org.apache.hadoop.security.authentication.util.KerberosName;
-
-import java.security.Principal;
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * Strategy class to get roles with the principal name (in a specific format e.g.: 'name@DOMAIN')
- * in case of KerberosPlugin is used for authentication
- */
-public class InfraUserRolesLookupStrategy {
-
- public Set<String> getUserRolesFromPrincipal(Map<String, Set<String>> usersVsRoles, Principal principal) {
- if (principal instanceof AuthenticationToken) {
- AuthenticationToken authenticationToken = (AuthenticationToken) principal;
- KerberosName kerberosName = new KerberosName(authenticationToken.getName());
- Set<String> rolesResult = usersVsRoles.get(String.format("%s@%s", kerberosName.getServiceName(), kerberosName.getRealm()));
- if (CollectionUtils.isEmpty(rolesResult)) {
- rolesResult = usersVsRoles.get(principal.getName());
- }
- return rolesResult;
- } else {
- return usersVsRoles.get(principal.getName());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3146a197/ambari-infra/ambari-infra-solr-plugin/src/main/java/org/apache/ambari/infra/security/InfraKerberosHostValidator.java
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-plugin/src/main/java/org/apache/ambari/infra/security/InfraKerberosHostValidator.java b/ambari-infra/ambari-infra-solr-plugin/src/main/java/org/apache/ambari/infra/security/InfraKerberosHostValidator.java
new file mode 100644
index 0000000..4a47a89
--- /dev/null
+++ b/ambari-infra/ambari-infra-solr-plugin/src/main/java/org/apache/ambari/infra/security/InfraKerberosHostValidator.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ambari.infra.security;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.MapUtils;
+import org.apache.hadoop.security.authentication.server.AuthenticationToken;
+import org.apache.hadoop.security.authentication.util.KerberosName;
+
+import java.security.Principal;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Validate that the user has the right access based on the hostname in the kerberos principal
+ */
+public class InfraKerberosHostValidator {
+
+ public boolean validate(Principal principal, Map<String, Set<String>> userVsHosts, Map<String, String> userVsHostRegex) {
+ if (principal instanceof AuthenticationToken) {
+ AuthenticationToken authenticationToken = (AuthenticationToken) principal;
+ KerberosName kerberosName = new KerberosName(authenticationToken.getName());
+ String hostname = kerberosName.getHostName();
+ String serviceUserName = kerberosName.getServiceName();
+ if (MapUtils.isNotEmpty(userVsHostRegex)) {
+ String regex = userVsHostRegex.get(serviceUserName);
+ return hostname.matches(regex);
+ }
+ if (MapUtils.isNotEmpty(userVsHosts)) {
+ Set<String> hosts = userVsHosts.get(serviceUserName);
+ if (CollectionUtils.isNotEmpty(hosts)) {
+ return hosts.contains(hostname);
+ }
+ }
+ }
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/3146a197/ambari-infra/ambari-infra-solr-plugin/src/main/java/org/apache/ambari/infra/security/InfraRuleBasedAuthorizationPlugin.java
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-plugin/src/main/java/org/apache/ambari/infra/security/InfraRuleBasedAuthorizationPlugin.java b/ambari-infra/ambari-infra-solr-plugin/src/main/java/org/apache/ambari/infra/security/InfraRuleBasedAuthorizationPlugin.java
new file mode 100644
index 0000000..2f1a558
--- /dev/null
+++ b/ambari-infra/ambari-infra-solr-plugin/src/main/java/org/apache/ambari/infra/security/InfraRuleBasedAuthorizationPlugin.java
@@ -0,0 +1,542 @@
+/*
+ * 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.infra.security;
+
+import com.google.common.collect.ImmutableSet;
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.params.CollectionParams;
+import org.apache.solr.common.util.Utils;
+import org.apache.solr.security.AuthorizationContext;
+import org.apache.solr.security.AuthorizationPlugin;
+import org.apache.solr.security.AuthorizationResponse;
+import org.apache.solr.security.ConfigEditablePlugin;
+import org.apache.solr.util.CommandOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static java.util.Collections.singleton;
+import static org.apache.solr.common.params.CommonParams.NAME;
+import static org.apache.solr.common.util.Utils.getDeepCopy;
+import static org.apache.solr.handler.admin.SecurityConfHandler.getListValue;
+import static org.apache.solr.handler.admin.SecurityConfHandler.getMapValue;
+
+/**
+ * Modified copy of solr.RuleBasedAuthorizationPlugin to handle role - permission mappings with KereberosPlugin
+ * Added 2 new JSON map: (precedence: user-host-regex > user-host)
+ * 1. "user-host": user host mappings (array) for hostname validation
+ * 2. "user-host-regex": user host regex mapping (string) for hostname validation
+ */
+public class InfraRuleBasedAuthorizationPlugin implements AuthorizationPlugin, ConfigEditablePlugin {
+
+ private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+ private final Map<String, Set<String>> usersVsRoles = new HashMap<>();
+ private final Map<String, WildCardSupportMap> mapping = new HashMap<>();
+ private final List<Permission> permissions = new ArrayList<>();
+ private final Map<String, Set<String>> userVsHosts = new HashMap<>();
+ private final Map<String, String> userVsHostRegex = new HashMap<>();
+
+ private final InfraUserRolesLookupStrategy infraUserRolesLookupStrategy = new InfraUserRolesLookupStrategy();
+ private final InfraKerberosHostValidator infraKerberosDomainValidator = new InfraKerberosHostValidator();
+
+ private static class WildCardSupportMap extends HashMap<String, List<Permission>> {
+ final Set<String> wildcardPrefixes = new HashSet<>();
+
+ @Override
+ public List<Permission> put(String key, List<Permission> value) {
+ if (key != null && key.endsWith("/*")) {
+ key = key.substring(0, key.length() - 2);
+ wildcardPrefixes.add(key);
+ }
+ return super.put(key, value);
+ }
+
+ @Override
+ public List<Permission> get(Object key) {
+ List<Permission> result = super.get(key);
+ if (key == null || result != null) return result;
+ if (!wildcardPrefixes.isEmpty()) {
+ for (String s : wildcardPrefixes) {
+ if (key.toString().startsWith(s)) {
+ List<Permission> l = super.get(s);
+ if (l != null) {
+ result = result == null ? new ArrayList<Permission>() : new ArrayList<Permission>(result);
+ result.addAll(l);
+ }
+ }
+ }
+ }
+ return result;
+ }
+ }
+
+ @Override
+ public AuthorizationResponse authorize(AuthorizationContext context) {
+ List<AuthorizationContext.CollectionRequest> collectionRequests = context.getCollectionRequests();
+ if (context.getRequestType() == AuthorizationContext.RequestType.ADMIN) {
+ MatchStatus flag = checkCollPerm(mapping.get(null), context);
+ return flag.rsp;
+ }
+
+ for (AuthorizationContext.CollectionRequest collreq : collectionRequests) {
+ //check permissions for each collection
+ MatchStatus flag = checkCollPerm(mapping.get(collreq.collectionName), context);
+ if (flag != MatchStatus.NO_PERMISSIONS_FOUND) return flag.rsp;
+ }
+ //check wildcard (all=*) permissions.
+ MatchStatus flag = checkCollPerm(mapping.get("*"), context);
+ return flag.rsp;
+ }
+
+ private MatchStatus checkCollPerm(Map<String, List<Permission>> pathVsPerms,
+ AuthorizationContext context) {
+ if (pathVsPerms == null) return MatchStatus.NO_PERMISSIONS_FOUND;
+
+ String path = context.getResource();
+ MatchStatus flag = checkPathPerm(pathVsPerms.get(path), context);
+ if (flag != MatchStatus.NO_PERMISSIONS_FOUND) return flag;
+ return checkPathPerm(pathVsPerms.get(null), context);
+ }
+
+ private MatchStatus checkPathPerm(List<Permission> permissions, AuthorizationContext context) {
+ if (permissions == null || permissions.isEmpty()) return MatchStatus.NO_PERMISSIONS_FOUND;
+ Principal principal = context.getUserPrincipal();
+ loopPermissions:
+ for (int i = 0; i < permissions.size(); i++) {
+ Permission permission = permissions.get(i);
+ if (permission.method != null && !permission.method.contains(context.getHttpMethod())) {
+ //this permissions HTTP method does not match this rule. try other rules
+ continue;
+ }
+ if(permission.predicate != null){
+ if(!permission.predicate.test(context)) continue ;
+ }
+
+ if (permission.params != null) {
+ for (Map.Entry<String, Object> e : permission.params.entrySet()) {
+ String paramVal = context.getParams().get(e.getKey());
+ Object val = e.getValue();
+ if (val instanceof List) {
+ if (!((List) val).contains(paramVal)) continue loopPermissions;
+ } else if (!Objects.equals(val, paramVal)) continue loopPermissions;
+ }
+ }
+
+ if (permission.role == null) {
+ //no role is assigned permission.That means everybody is allowed to access
+ return MatchStatus.PERMITTED;
+ }
+ if (principal == null) {
+ log.info("request has come without principal. failed permission {} ",permission);
+ //this resource needs a principal but the request has come without
+ //any credential.
+ return MatchStatus.USER_REQUIRED;
+ } else if (permission.role.contains("*")) {
+ return MatchStatus.PERMITTED;
+ }
+
+ for (String role : permission.role) {
+ Set<String> userRoles = infraUserRolesLookupStrategy.getUserRolesFromPrincipal(usersVsRoles, principal);
+ boolean validHostname = infraKerberosDomainValidator.validate(principal, userVsHosts, userVsHostRegex);
+ if (!validHostname) {
+ log.warn("Hostname is not valid for principal {}", principal);
+ return MatchStatus.FORBIDDEN;
+ }
+ if (userRoles != null && userRoles.contains(role)) return MatchStatus.PERMITTED;
+ }
+ log.info("This resource is configured to have a permission {}, The principal {} does not have the right role ", permission, principal);
+ return MatchStatus.FORBIDDEN;
+ }
+ log.debug("No permissions configured for the resource {} . So allowed to access", context.getResource());
+ return MatchStatus.NO_PERMISSIONS_FOUND;
+ }
+
+ @Override
+ public void init(Map<String, Object> initInfo) {
+ mapping.put(null, new WildCardSupportMap());
+ Map<String, Object> map = getMapValue(initInfo, "user-role");
+ for (Object o : map.entrySet()) {
+ Map.Entry e = (Map.Entry) o;
+ String roleName = (String) e.getKey();
+ usersVsRoles.put(roleName, readValueAsSet(map, roleName));
+ }
+ List<Map> perms = getListValue(initInfo, "permissions");
+ for (Map o : perms) {
+ Permission p;
+ try {
+ p = Permission.load(o);
+ } catch (Exception exp) {
+ log.error("Invalid permission ", exp);
+ continue;
+ }
+ permissions.add(p);
+ add2Mapping(p);
+ }
+ // adding user-host
+ Map<String, Object> userHostsMap = getMapValue(initInfo, "user-host");
+ for (Object userHost : userHostsMap.entrySet()) {
+ Map.Entry e = (Map.Entry) userHost;
+ String roleName = (String) e.getKey();
+ userVsHosts.put(roleName, readValueAsSet(userHostsMap, roleName));
+ }
+ // adding user-host-regex
+ Map<String, Object> userHostRegexMap = getMapValue(initInfo, "user-host-regex");
+ for (Map.Entry<String, Object> entry : userHostRegexMap.entrySet()) {
+ userVsHostRegex.put(entry.getKey(), entry.getValue().toString());
+ }
+
+ }
+
+ //this is to do optimized lookup of permissions for a given collection/path
+ private void add2Mapping(Permission permission) {
+ for (String c : permission.collections) {
+ WildCardSupportMap m = mapping.get(c);
+ if (m == null) mapping.put(c, m = new WildCardSupportMap());
+ for (String path : permission.path) {
+ List<Permission> perms = m.get(path);
+ if (perms == null) m.put(path, perms = new ArrayList<>());
+ perms.add(permission);
+ }
+ }
+ }
+
+ /**
+ * read a key value as a set. if the value is a single string ,
+ * return a singleton set
+ *
+ * @param m the map from which to lookup
+ * @param key the key with which to do lookup
+ */
+ static Set<String> readValueAsSet(Map m, String key) {
+ Set<String> result = new HashSet<>();
+ Object val = m.get(key);
+ if (val == null) {
+ if("collection".equals(key)){
+ //for collection collection: null means a core admin/ collection admin request
+ // otherwise it means a request where collection name is ignored
+ return m.containsKey(key) ? singleton((String) null) : singleton("*");
+ }
+ return null;
+ }
+ if (val instanceof Collection) {
+ Collection list = (Collection) val;
+ for (Object o : list) result.add(String.valueOf(o));
+ } else if (val instanceof String) {
+ result.add((String) val);
+ } else {
+ throw new RuntimeException("Bad value for : " + key);
+ }
+ return result.isEmpty() ? null : Collections.unmodifiableSet(result);
+ }
+
+ @Override
+ public void close() throws IOException { }
+
+ static class Permission {
+ String name;
+ Set<String> path, role, collections, method;
+ Map<String, Object> params;
+ Predicate<AuthorizationContext> predicate;
+ Map originalConfig;
+
+ private Permission() {
+ }
+
+ static Permission load(Map m) {
+ Permission p = new Permission();
+ p.originalConfig = new LinkedHashMap<>(m);
+ String name = (String) m.get(NAME);
+ if (!m.containsKey("role")) throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "role not specified");
+ p.role = readValueAsSet(m, "role");
+ if (well_known_permissions.containsKey(name)) {
+ HashSet<String> disAllowed = new HashSet<>(knownKeys);
+ disAllowed.remove("role");//these are the only
+ disAllowed.remove(NAME);//allowed keys for well-known permissions
+ for (String s : disAllowed) {
+ if (m.containsKey(s))
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, s + " is not a valid key for the permission : " + name);
+ }
+ p.predicate = (Predicate<AuthorizationContext>) ((Map) well_known_permissions.get(name)).get(Predicate.class.getName());
+ m = well_known_permissions.get(name);
+ }
+ p.name = name;
+ p.path = readSetSmart(name, m, "path");
+ p.collections = readSetSmart(name, m, "collection");
+ p.method = readSetSmart(name, m, "method");
+ p.params = (Map<String, Object>) m.get("params");
+ return p;
+ }
+
+ @Override
+ public String toString() {
+ return Utils.toJSONString(originalConfig);
+ }
+
+ static final Set<String> knownKeys = ImmutableSet.of("collection", "role", "params", "path", "method", NAME);
+ }
+
+ enum MatchStatus {
+ USER_REQUIRED(AuthorizationResponse.PROMPT),
+ NO_PERMISSIONS_FOUND(AuthorizationResponse.OK),
+ PERMITTED(AuthorizationResponse.OK),
+ FORBIDDEN(AuthorizationResponse.FORBIDDEN);
+
+ final AuthorizationResponse rsp;
+
+ MatchStatus(AuthorizationResponse rsp) {
+ this.rsp = rsp;
+ }
+ }
+
+ /**
+ * This checks for the defaults available other rules for the keys
+ */
+ private static Set<String> readSetSmart(String permissionName, Map m, String key) {
+ Set<String> set = readValueAsSet(m, key);
+ if (set == null && well_known_permissions.containsKey(permissionName)) {
+ set = readValueAsSet((Map) well_known_permissions.get(permissionName), key);
+ }
+ if ("method".equals(key)) {
+ if (set != null) {
+ for (String s : set) if (!HTTP_METHODS.contains(s)) return null;
+ }
+ return set;
+ }
+ return set == null ? singleton((String)null) : set;
+ }
+
+ @Override
+ public Map<String, Object> edit(Map<String, Object> latestConf, List<CommandOperation> commands) {
+ for (CommandOperation op : commands) {
+ OPERATION operation = null;
+ for (OPERATION o : OPERATION.values()) {
+ if (o.name.equals(op.name)) {
+ operation = o;
+ break;
+ }
+ }
+ if (operation == null) {
+ op.unknownOperation();
+ return null;
+ }
+ latestConf = operation.edit(latestConf, op);
+ if (latestConf == null) return null;
+
+ }
+ return latestConf;
+ }
+
+ enum OPERATION {
+ SET_USER_ROLE("set-user-role") {
+ @Override
+ public Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op) {
+ Map<String, Object> roleMap = getMapValue(latestConf, "user-role");
+ Map<String, Object> map = op.getDataMap();
+ if (op.hasError()) return null;
+ for (Map.Entry<String, Object> e : map.entrySet()) {
+ if (e.getValue() == null) {
+ roleMap.remove(e.getKey());
+ continue;
+ }
+ if (e.getValue() instanceof String || e.getValue() instanceof List) {
+ roleMap.put(e.getKey(), e.getValue());
+ } else {
+ op.addError("Unexpected value ");
+ return null;
+ }
+ }
+ return latestConf;
+ }
+ },
+ SET_PERMISSION("set-permission") {
+ @Override
+ public Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op) {
+ String name = op.getStr(NAME);
+ Map<String, Object> dataMap = op.getDataMap();
+ if (op.hasError()) return null;
+ dataMap = getDeepCopy(dataMap, 3);
+ String before = (String) dataMap.remove("before");
+ for (String key : dataMap.keySet()) {
+ if (!Permission.knownKeys.contains(key)) op.addError("Unknown key, " + key);
+ }
+ try {
+ Permission.load(dataMap);
+ } catch (Exception e) {
+ op.addError(e.getMessage());
+ return null;
+ }
+ List<Map> permissions = getListValue(latestConf, "permissions");
+ List<Map> permissionsCopy = new ArrayList<>();
+ boolean added = false;
+ for (Map e : permissions) {
+ Object n = e.get(NAME);
+ if (n.equals(before) || n.equals(name)) {
+ added = true;
+ permissionsCopy.add(dataMap);
+ }
+ if (!n.equals(name)) permissionsCopy.add(e);
+ }
+ if (!added && before != null) {
+ op.addError("Invalid 'before' :" + before);
+ return null;
+ }
+ if (!added) permissionsCopy.add(dataMap);
+ latestConf.put("permissions", permissionsCopy);
+ return latestConf;
+ }
+ },
+ UPDATE_PERMISSION("update-permission") {
+ @Override
+ public Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op) {
+ String name = op.getStr(NAME);
+ if (op.hasError()) return null;
+ for (Map permission : (List<Map>) getListValue(latestConf, "permissions")) {
+ if (name.equals(permission.get(NAME))) {
+ LinkedHashMap copy = new LinkedHashMap<>(permission);
+ copy.putAll(op.getDataMap());
+ op.setCommandData(copy);
+ return SET_PERMISSION.edit(latestConf, op);
+ }
+ }
+ op.addError("No such permission " + name);
+ return null;
+ }
+ },
+ DELETE_PERMISSION("delete-permission") {
+ @Override
+ public Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op) {
+ List<String> names = op.getStrs("");
+ if (names == null || names.isEmpty()) {
+ op.addError("Invalid command");
+ return null;
+ }
+ names = new ArrayList<>(names);
+ List<Map> copy = new ArrayList<>();
+ List<Map> p = getListValue(latestConf, "permissions");
+ for (Map map : p) {
+ Object n = map.get(NAME);
+ if (names.contains(n)) {
+ names.remove(n);
+ continue;
+ } else {
+ copy.add(map);
+ }
+ }
+ if (!names.isEmpty()) {
+ op.addError("Unknown permission name(s) " + names);
+ return null;
+ }
+ latestConf.put("permissions", copy);
+ return latestConf;
+ }
+ };
+
+ public abstract Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op);
+
+ public final String name;
+
+ OPERATION(String s) {
+ this.name = s;
+ }
+
+ public static OPERATION get(String name) {
+ for (OPERATION o : values()) if (o.name.equals(name)) return o;
+ return null;
+ }
+ }
+
+ public static final Set<String> HTTP_METHODS = ImmutableSet.of("GET", "POST", "DELETE", "PUT", "HEAD");
+
+ private static final Map<String, Map<String,Object>> well_known_permissions = (Map) Utils.fromJSONString(
+ " { " +
+ " security-edit :{" +
+ " path:['/admin/authentication','/admin/authorization']," +
+ " collection:null," +
+ " method:POST }," +
+ " security-read :{" +
+ " path:['/admin/authentication','/admin/authorization']," +
+ " collection:null," +
+ " method:GET}," +
+ " schema-edit :{" +
+ " method:POST," +
+ " path:'/schema/*'}," +
+ " collection-admin-edit :{" +
+ " collection:null," +
+ " path:'/admin/collections'}," +
+ " collection-admin-read :{" +
+ " collection:null," +
+ " path:'/admin/collections'}," +
+ " schema-read :{" +
+ " method:GET," +
+ " path:'/schema/*'}," +
+ " config-read :{" +
+ " method:GET," +
+ " path:'/config/*'}," +
+ " update :{" +
+ " path:'/update/*'}," +
+ " read :{" +
+ " path:['/select', '/get','/browse','/tvrh','/terms','/clustering','/elevate', '/export','/spell','/clustering']}," +
+ " config-edit:{" +
+ " method:POST," +
+ " path:'/config/*'}," +
+ " all:{collection:['*', null]}" +
+ "}");
+
+ static {
+ ((Map) well_known_permissions.get("collection-admin-edit")).put(Predicate.class.getName(), getCollectionActionPredicate(true));
+ ((Map) well_known_permissions.get("collection-admin-read")).put(Predicate.class.getName(), getCollectionActionPredicate(false));
+ }
+
+ private static Predicate<AuthorizationContext> getCollectionActionPredicate(final boolean isEdit) {
+ return new Predicate<AuthorizationContext>() {
+ @Override
+ public boolean test(AuthorizationContext context) {
+ String action = context.getParams().get("action");
+ if (action == null) return false;
+ CollectionParams.CollectionAction collectionAction = CollectionParams.CollectionAction.get(action);
+ if (collectionAction == null) return false;
+ return isEdit ? collectionAction.isWrite : !collectionAction.isWrite;
+ }
+ };
+ }
+
+
+ public static void main(String[] args) {
+ System.out.println(Utils.toJSONString(well_known_permissions));
+
+ }
+
+ public interface Predicate<T> {
+
+ boolean test(T t);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/3146a197/ambari-infra/ambari-infra-solr-plugin/src/main/java/org/apache/ambari/infra/security/InfraUserRolesLookupStrategy.java
----------------------------------------------------------------------
diff --git a/ambari-infra/ambari-infra-solr-plugin/src/main/java/org/apache/ambari/infra/security/InfraUserRolesLookupStrategy.java b/ambari-infra/ambari-infra-solr-plugin/src/main/java/org/apache/ambari/infra/security/InfraUserRolesLookupStrategy.java
new file mode 100644
index 0000000..a54e4ad
--- /dev/null
+++ b/ambari-infra/ambari-infra-solr-plugin/src/main/java/org/apache/ambari/infra/security/InfraUserRolesLookupStrategy.java
@@ -0,0 +1,49 @@
+/*
+ * 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.infra.security;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.hadoop.security.authentication.server.AuthenticationToken;
+import org.apache.hadoop.security.authentication.util.KerberosName;
+
+import java.security.Principal;
+import java.util.Map;
+import java.util.Set;
+
+
+/**
+ * Strategy class to get roles with the principal name (in a specific format e.g.: 'name@DOMAIN')
+ * in case of KerberosPlugin is used for authentication
+ */
+public class InfraUserRolesLookupStrategy {
+
+ public Set<String> getUserRolesFromPrincipal(Map<String, Set<String>> usersVsRoles, Principal principal) {
+ if (principal instanceof AuthenticationToken) {
+ AuthenticationToken authenticationToken = (AuthenticationToken) principal;
+ KerberosName kerberosName = new KerberosName(authenticationToken.getName());
+ Set<String> rolesResult = usersVsRoles.get(String.format("%s@%s", kerberosName.getServiceName(), kerberosName.getRealm()));
+ if (CollectionUtils.isEmpty(rolesResult)) {
+ rolesResult = usersVsRoles.get(principal.getName());
+ }
+ return rolesResult;
+ } else {
+ return usersVsRoles.get(principal.getName());
+ }
+ }
+}
[26/50] [abbrv] ambari git commit: AMBARI-21168. Deleting host from
cluster leaves Ambari in inconsistent state (intermittently) (magyari_sandor)
Posted by rl...@apache.org.
AMBARI-21168. Deleting host from cluster leaves Ambari in inconsistent state (intermittently) (magyari_sandor)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d8d58688
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d8d58688
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d8d58688
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: d8d586888d415d1c429ff6514e5b8435f6cb7e47
Parents: 0dd9fbf
Author: Sandor Magyari <sm...@hortonworks.com>
Authored: Fri Jun 2 15:38:06 2017 +0200
Committer: Sandor Magyari <sm...@hortonworks.com>
Committed: Tue Jun 6 13:08:33 2017 +0200
----------------------------------------------------------------------
.../server/state/svccomphost/ServiceComponentHostImpl.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/d8d58688/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
index bb51733..9704dc5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java
@@ -871,6 +871,7 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
}
@Override
+ @Transactional
public void setState(State state) {
stateMachine.setCurrentState(state);
HostComponentStateEntity stateEntity = getStateEntity();
@@ -899,6 +900,7 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
}
@Override
+ @Transactional
public void setVersion(String version) {
HostComponentStateEntity stateEntity = getStateEntity();
if (stateEntity != null) {
@@ -926,6 +928,7 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
}
@Override
+ @Transactional
public void setSecurityState(SecurityState securityState) {
HostComponentStateEntity stateEntity = getStateEntity();
if (stateEntity != null) {
@@ -975,6 +978,7 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
* @param upgradeState the upgrade state
*/
@Override
+ @Transactional
public void setUpgradeState(UpgradeState upgradeState) {
HostComponentStateEntity stateEntity = getStateEntity();
if (stateEntity != null) {
@@ -1003,6 +1007,7 @@ public class ServiceComponentHostImpl implements ServiceComponentHost {
@Override
+ @Transactional
public void handleEvent(ServiceComponentHostEvent event)
throws InvalidStateTransitionException {
if (LOG.isDebugEnabled()) {
[06/50] [abbrv] ambari git commit: AMBARI-21130 Delete view
privileges from the Users page (Anita Jebaraj via dili)
Posted by rl...@apache.org.
AMBARI-21130 Delete view privileges from the Users page (Anita Jebaraj via dili)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/49605dae
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/49605dae
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/49605dae
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 49605daef3f5404b6be59a051c268b56cb81b291
Parents: dfb5d39
Author: Di Li <di...@apache.org>
Authored: Thu Jun 1 16:14:27 2017 -0400
Committer: Di Li <di...@apache.org>
Committed: Thu Jun 1 16:14:27 2017 -0400
----------------------------------------------------------------------
.../app/scripts/controllers/users/UsersShowCtrl.js | 13 +++++++++++++
.../resources/ui/admin-web/app/views/users/show.html | 5 ++++-
2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/49605dae/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
index 0706620..200872e 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
@@ -184,6 +184,18 @@ angular.module('ambariAdminConsole')
}
};
+ $scope.removePrivilege = function(name, privilege) {
+ var privilegeObject = {
+ id: privilege.privilege_id,
+ view_name: privilege.view_name,
+ version: privilege.version,
+ instance_name: name
+ };
+ View.deletePrivilege(privilegeObject).then(function() {
+ loadPrivileges();
+ });
+ };
+
$scope.deleteUser = function() {
ConfirmationModal.show(
$t('common.delete', {
@@ -257,6 +269,7 @@ angular.module('ambariAdminConsole')
privileges.views[privilege.instance_name] = privileges.views[privilege.instance_name] || { privileges:[]};
privileges.views[privilege.instance_name].version = privilege.version;
privileges.views[privilege.instance_name].view_name = privilege.view_name;
+ privileges.views[privilege.instance_name].privilege_id = privilege.privilege_id;
if (privileges.views[privilege.instance_name].privileges.indexOf(privilege.permission_label) == -1) {
privileges.views[privilege.instance_name].privileges.push(privilege.permission_label);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/49605dae/ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html
index 7abdf05..f965c5d 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html
@@ -105,6 +105,9 @@
<td>
<span tooltip="{{item}}" ng-repeat="item in privilege.privileges track by $index">{{item | translate}}{{$last ? '' : ', '}}</span>
</td>
+ <td>
+ <i class="fa fa-trash-o" aria-hidden="true" ng-click="removePrivilege(name, privilege);"></i>
+ </td>
</tr>
<tr>
<td ng-show="noViewPriv">{{'common.alerts.noPrivileges' | translate: '{term: constants.view}'}}</td>
@@ -116,4 +119,4 @@
</div>
</div>
</form>
-</div>
\ No newline at end of file
+</div>
[47/50] [abbrv] ambari git commit: AMBARI-21197 Disable Kerberos UI
step by step panel misalign with the Complete button at the bottom of the
page (dili)
Posted by rl...@apache.org.
AMBARI-21197 Disable Kerberos UI step by step panel misalign with the Complete button at the bottom of the page (dili)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9c302dcd
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9c302dcd
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9c302dcd
Branch: refs/heads/branch-feature-AMBARI-20859
Commit: 9c302dcd237af0ba9b5099ddc3bf7b94e29496cd
Parents: 7e3641e
Author: Di Li <di...@apache.org>
Authored: Thu Jun 8 13:21:06 2017 -0400
Committer: Di Li <di...@apache.org>
Committed: Thu Jun 8 13:21:06 2017 -0400
----------------------------------------------------------------------
ambari-web/app/templates/common/progress.hbs | 4 ++++
ambari-web/app/views/main/admin/kerberos/disable_view.js | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9c302dcd/ambari-web/app/templates/common/progress.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/progress.hbs b/ambari-web/app/templates/common/progress.hbs
index ab59328..417498a 100644
--- a/ambari-web/app/templates/common/progress.hbs
+++ b/ambari-web/app/templates/common/progress.hbs
@@ -15,7 +15,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
}}
+{{#if view.disableKerberos}}
+<div id="common-progress-page" class="wizard-content col-md-12">
+{{else}}
<div id="common-progress-page" class="wizard-content col-md-9">
+{{/if}}
<h4 class="step-title">{{view.headerTitle}}</h4>
<div {{bindAttr class="view.noticeClass"}}>{{{view.notice}}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/9c302dcd/ambari-web/app/views/main/admin/kerberos/disable_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/kerberos/disable_view.js b/ambari-web/app/views/main/admin/kerberos/disable_view.js
index f7b3527..c3f8902 100644
--- a/ambari-web/app/views/main/admin/kerberos/disable_view.js
+++ b/ambari-web/app/views/main/admin/kerberos/disable_view.js
@@ -37,6 +37,7 @@ App.KerberosDisableView = App.KerberosProgressPageView.extend({
msgColor: 'alert-info',
- isSimpleModal: true
+ isSimpleModal: true,
+ disableKerberos: true
});