ambari git commit: AMBARI-14025. Deleting host from cluster does not work on blueprint deployed cluster. (swagle)
Repository: ambari Updated Branches: refs/heads/trunk bf82dfe69 -> bbf95144c AMBARI-14025. Deleting host from cluster does not work on blueprint deployed cluster. (swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bbf95144 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bbf95144 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bbf95144 Branch: refs/heads/trunk Commit: bbf95144cd5bef938413dd87f8dcf970e79429ec Parents: bf82dfe Author: Siddharth Wagle Authored: Mon Nov 23 22:06:43 2015 -0800 Committer: Siddharth Wagle Committed: Mon Nov 23 22:06:43 2015 -0800 -- .../server/state/cluster/ClustersImpl.java | 28 1 file changed, 23 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/bbf95144/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java index 15730f4..b89a8c4 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java @@ -44,9 +44,11 @@ import org.apache.ambari.server.orm.dao.RequestOperationLevelDAO; import org.apache.ambari.server.orm.dao.ResourceTypeDAO; import org.apache.ambari.server.orm.dao.ServiceConfigDAO; import org.apache.ambari.server.orm.dao.StackDAO; +import org.apache.ambari.server.orm.dao.TopologyLogicalTaskDAO; import org.apache.ambari.server.orm.entities.ClusterEntity; import org.apache.ambari.server.orm.entities.ClusterVersionEntity; import org.apache.ambari.server.orm.entities.HostEntity; +import org.apache.ambari.server.orm.entities.HostRoleCommandEntity; import org.apache.ambari.server.orm.entities.PermissionEntity; import org.apache.ambari.server.orm.entities.PrivilegeEntity; import org.apache.ambari.server.orm.entities.ResourceEntity; @@ -136,6 +138,8 @@ public class ClustersImpl implements Clusters { private AmbariMetaInfo ambariMetaInfo; @Inject private SecurityHelper securityHelper; + @Inject + private TopologyLogicalTaskDAO topologyLogicalTaskDAO; /** * Data access object for stacks. @@ -718,10 +722,13 @@ public class ClustersImpl implements Clusters { @Override public void unmapHostFromCluster(String hostname, String clusterName) throws AmbariException { final Cluster cluster = getCluster(clusterName); -unmapHostFromClusters(hostname, new HashSet() {{ add(cluster); }}); +unmapHostFromClusters(hostname, new HashSet() {{ + add(cluster); +}}); } - public void unmapHostFromClusters(String hostname, Set clusters) throws AmbariException { + @Transactional + void unmapHostFromClusters(String hostname, Set clusters) throws AmbariException { Host host = null; HostEntity hostEntity = null; @@ -766,7 +773,7 @@ public class ClustersImpl implements Clusters { } @Transactional - private void unmapHostClusterEntities(String hostName, long clusterId) { + void unmapHostClusterEntities(String hostName, long clusterId) { HostEntity hostEntity = hostDAO.findByName(hostName); ClusterEntity clusterEntity = clusterDAO.findById(clusterId); @@ -778,7 +785,7 @@ public class ClustersImpl implements Clusters { } @Transactional - private void deleteConfigGroupHostMapping(Long hostId) throws AmbariException { + void deleteConfigGroupHostMapping(Long hostId) throws AmbariException { // Remove Config group mapping for (Cluster cluster : clusters.values()) { for (ConfigGroup configGroup : cluster.getConfigGroups().values()) { @@ -823,7 +830,7 @@ public class ClustersImpl implements Clusters { * @throws AmbariException */ @Transactional - private void deleteHostEntityRelationships(String hostname) throws AmbariException { + void deleteHostEntityRelationships(String hostname) throws AmbariException { checkLoaded(); if (!hosts.containsKey(hostname)) { @@ -846,6 +853,17 @@ public class ClustersImpl implements Clusters { hostDAO.refresh(entity); hostVersionDAO.removeByHostName(hostname); + + // Remove blueprint tasks before hostRoleCommands + // TopologyLogicalTask owns the OneToOne relationship but Cascade is on HostRoleCommandEntity + if (entity.getHostRoleCommandEntities() != null) { +for (HostRoleCommandEntity hrcEntity : entity.getHostRoleCommandEntities()) { + if (hrcEntity.getTopologyLogicalTaskEntity() != null) { + topologyLogicalTaskDAO.remove(hrcEntity.getTopologyLogicalTaskEnt
ambari git commit: AMBARI-14025. Deleting host from cluster does not work on blueprint deployed cluster. (swagle)
Repository: ambari Updated Branches: refs/heads/branch-2.1 f548ce08d -> 21333ef0f AMBARI-14025. Deleting host from cluster does not work on blueprint deployed cluster. (swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/21333ef0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/21333ef0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/21333ef0 Branch: refs/heads/branch-2.1 Commit: 21333ef0f57417d0ca1b8dc0a0c66f873ba47bd9 Parents: f548ce0 Author: Siddharth Wagle Authored: Mon Nov 23 22:05:19 2015 -0800 Committer: Siddharth Wagle Committed: Mon Nov 23 22:05:19 2015 -0800 -- .../server/state/cluster/ClustersImpl.java | 28 1 file changed, 23 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/21333ef0/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java index 9ea9581..a0497eb 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java @@ -44,9 +44,11 @@ import org.apache.ambari.server.orm.dao.RequestOperationLevelDAO; import org.apache.ambari.server.orm.dao.ResourceTypeDAO; import org.apache.ambari.server.orm.dao.ServiceConfigDAO; import org.apache.ambari.server.orm.dao.StackDAO; +import org.apache.ambari.server.orm.dao.TopologyLogicalTaskDAO; import org.apache.ambari.server.orm.entities.ClusterEntity; import org.apache.ambari.server.orm.entities.ClusterVersionEntity; import org.apache.ambari.server.orm.entities.HostEntity; +import org.apache.ambari.server.orm.entities.HostRoleCommandEntity; import org.apache.ambari.server.orm.entities.PermissionEntity; import org.apache.ambari.server.orm.entities.PrivilegeEntity; import org.apache.ambari.server.orm.entities.ResourceEntity; @@ -135,6 +137,8 @@ public class ClustersImpl implements Clusters { private AmbariMetaInfo ambariMetaInfo; @Inject private SecurityHelper securityHelper; + @Inject + private TopologyLogicalTaskDAO topologyLogicalTaskDAO; /** * Data access object for stacks. @@ -717,10 +721,13 @@ public class ClustersImpl implements Clusters { @Override public void unmapHostFromCluster(String hostname, String clusterName) throws AmbariException { final Cluster cluster = getCluster(clusterName); -unmapHostFromClusters(hostname, new HashSet() {{ add(cluster); }}); +unmapHostFromClusters(hostname, new HashSet() {{ + add(cluster); +}}); } - public void unmapHostFromClusters(String hostname, Set clusters) throws AmbariException { + @Transactional + void unmapHostFromClusters(String hostname, Set clusters) throws AmbariException { Host host = null; HostEntity hostEntity = null; @@ -765,7 +772,7 @@ public class ClustersImpl implements Clusters { } @Transactional - private void unmapHostClusterEntities(String hostName, long clusterId) { + void unmapHostClusterEntities(String hostName, long clusterId) { HostEntity hostEntity = hostDAO.findByName(hostName); ClusterEntity clusterEntity = clusterDAO.findById(clusterId); @@ -777,7 +784,7 @@ public class ClustersImpl implements Clusters { } @Transactional - private void deleteConfigGroupHostMapping(Long hostId) throws AmbariException { + void deleteConfigGroupHostMapping(Long hostId) throws AmbariException { // Remove Config group mapping for (Cluster cluster : clusters.values()) { for (ConfigGroup configGroup : cluster.getConfigGroups().values()) { @@ -822,7 +829,7 @@ public class ClustersImpl implements Clusters { * @throws AmbariException */ @Transactional - private void deleteHostEntityRelationships(String hostname) throws AmbariException { + void deleteHostEntityRelationships(String hostname) throws AmbariException { checkLoaded(); if (!hosts.containsKey(hostname)) { @@ -845,6 +852,17 @@ public class ClustersImpl implements Clusters { hostDAO.refresh(entity); hostVersionDAO.removeByHostName(hostname); + + // Remove blueprint tasks before hostRoleCommands + // TopologyLogicalTask owns the OneToOne relationship but Cascade is on HostRoleCommandEntity + if (entity.getHostRoleCommandEntities() != null) { +for (HostRoleCommandEntity hrcEntity : entity.getHostRoleCommandEntities()) { + if (hrcEntity.getTopologyLogicalTaskEntity() != null) { + topologyLogicalTaskDAO.remove(hrcEntity.getTopologyLogi
ambari git commit: AMBARI-14025. Deleting host from cluster does not work on blueprint deployed cluster. (swagle)
Repository: ambari Updated Branches: refs/heads/branch-2.1.2 7b1ac0f0a -> 805f530b1 AMBARI-14025. Deleting host from cluster does not work on blueprint deployed cluster. (swagle) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/805f530b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/805f530b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/805f530b Branch: refs/heads/branch-2.1.2 Commit: 805f530b16ee33a62d874836aa0c50dccc44815e Parents: 7b1ac0f Author: Siddharth Wagle Authored: Mon Nov 23 20:32:27 2015 -0800 Committer: Siddharth Wagle Committed: Mon Nov 23 20:33:10 2015 -0800 -- .../actionmanager/ActionDBAccessorImpl.java | 54 +- .../server/actionmanager/ActionManager.java | 3 +- .../ambari/server/agent/HeartBeatHandler.java | 15 +++- .../controller/internal/CalculatedStatus.java | 6 ++ .../internal/HostResourceProvider.java | 3 +- .../internal/RequestResourceProvider.java | 8 +- .../internal/StageResourceProvider.java | 8 +- .../server/orm/dao/HostRoleCommandDAO.java | 3 +- .../server/state/cluster/ClustersImpl.java | 28 +-- .../internal/RequestResourceProviderTest.java | 78 +--- 10 files changed, 159 insertions(+), 47 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/805f530b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java index 30da833..093976a 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java @@ -17,21 +17,20 @@ */ package org.apache.ambari.server.actionmanager; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; - +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.eventbus.Subscribe; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import com.google.inject.name.Named; +import com.google.inject.persist.Transactional; import org.apache.ambari.annotations.Experimental; import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.agent.CommandReport; import org.apache.ambari.server.agent.ExecutionCommand; import org.apache.ambari.server.configuration.Configuration; +import org.apache.ambari.server.events.HostRemovedEvent; +import org.apache.ambari.server.events.publishers.AmbariEventPublisher; import org.apache.ambari.server.orm.dao.ClusterDAO; import org.apache.ambari.server.orm.dao.ExecutionCommandDAO; import org.apache.ambari.server.orm.dao.HostDAO; @@ -56,13 +55,15 @@ import org.apache.ambari.server.utils.ParallelLoopResult; import org.apache.ambari.server.utils.StageUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import com.google.inject.Inject; -import com.google.inject.Singleton; -import com.google.inject.name.Named; -import com.google.inject.persist.Transactional; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; @Singleton public class ActionDBAccessorImpl implements ActionDBAccessor { @@ -113,13 +114,15 @@ public class ActionDBAccessorImpl implements ActionDBAccessor { private long cacheLimit; //may be exceeded to store tasks from one request @Inject - public ActionDBAccessorImpl(@Named("executionCommandCacheSize") long cacheLimit) { + public ActionDBAccessorImpl(@Named("executionCommandCacheSize") long cacheLimit, + AmbariEventPublisher eventPublisher) { this.cacheLimit = cacheLimit; hostRoleCommandCache = CacheBuilder.newBuilder(). expireAfterAccess(5, TimeUnit.MINUTES). build(); +eventPublisher.register(this); } @Inject @@ -218,7 +221,7 @@ public class ActionDBAccessorImpl implements ActionDBAccessor { @Experimental public List getStagesInProgress() { List stageEntities = stageDAO.findByCommandStatuses( -HostRoleStatus.IN_PROGRESS_STATUSES); +
ambari git commit: AMBARI-13929. Move displayType element for HAWQ/PXF from site_properties.json to stack definition (Bhuvnesh Chaudhary via odiachenko).
Repository: ambari Updated Branches: refs/heads/branch-2.1 3650059aa -> f548ce08d AMBARI-13929. Move displayType element for HAWQ/PXF from site_properties.json to stack definition (Bhuvnesh Chaudhary via odiachenko). Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f548ce08 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f548ce08 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f548ce08 Branch: refs/heads/branch-2.1 Commit: f548ce08d99ea0009e16f23a8a0e7dcc6171d748 Parents: 3650059 Author: Oleksandr Diachenko Authored: Mon Nov 23 17:32:49 2015 -0800 Committer: Oleksandr Diachenko Committed: Mon Nov 23 17:32:53 2015 -0800 -- .../HAWQ/2.0.0/configuration/hawq-site.xml | 24 ambari-web/app/data/HDP2.3/site_properties.js | 8 --- .../test/data/HDP2.3/site_properties_test.js| 2 +- 3 files changed, 25 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/f548ce08/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml -- diff --git a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml index 41b10dc..862b2ee 100644 --- a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml +++ b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml @@ -21,6 +21,9 @@ HAWQ Master localhost The host name of HAWQ master. + + componentHost + @@ -28,6 +31,9 @@ HAWQ Standby Master localhost The host name of HAWQ standby. + + componentHost + @@ -35,6 +41,9 @@ HAWQ Master Port 5432 The port of HAWQ master. + + int + @@ -42,6 +51,9 @@ HAWQ Segment Port 4 The port of HAWQ segment. + + int + @@ -56,6 +68,9 @@ HAWQ Master Directory /data/hawq/master The directory of HAWQ master. + + directory + @@ -63,6 +78,9 @@ HAWQ Segment Directory /data/hawq/segment The directory of HAWQ segment. + + directory + @@ -70,6 +88,9 @@ HAWQ Master Temp Directory /tmp The temporary directory reserved for HAWQ master. + + directory + @@ -77,6 +98,9 @@ HAWQ Segment Temp Directory /tmp The temporary directory reserved for HAWQ segment. + + directory + http://git-wip-us.apache.org/repos/asf/ambari/blob/f548ce08/ambari-web/app/data/HDP2.3/site_properties.js -- diff --git a/ambari-web/app/data/HDP2.3/site_properties.js b/ambari-web/app/data/HDP2.3/site_properties.js index 5150ff2..fb79cd3 100644 --- a/ambari-web/app/data/HDP2.3/site_properties.js +++ b/ambari-web/app/data/HDP2.3/site_properties.js @@ -271,7 +271,6 @@ hdp23properties.push({ /*** HAWQ **/ { "name": "hawq_master_address_host", -"displayType": "masterHost", "filename": "hawq-site.xml", "category": "General", "serviceName": "HAWQ", @@ -279,7 +278,6 @@ hdp23properties.push({ }, { "name": "hawq_standby_address_host", -"displayType": "masterHost", "filename": "hawq-site.xml", "category": "General", "serviceName": "HAWQ", @@ -287,7 +285,6 @@ hdp23properties.push({ }, { "name": "hawq_master_address_port", -"displayType": "int", "filename": "hawq-site.xml", "category": "General", "serviceName": "HAWQ", @@ -295,7 +292,6 @@ hdp23properties.push({ }, { "name": "hawq_segment_address_port", -"displayType": "int", "filename": "hawq-site.xml", "category": "General", "serviceName": "HAWQ", @@ -310,7 +306,6 @@ hdp23properties.push({ }, { "name": "hawq_master_directory", -"displayType": "directory", "filename": "hawq-site.xml", "category": "General", "serviceName": "HAWQ", @@ -318,7 +313,6 @@ hdp23properties.push({ }, { "name": "hawq_master_temp_directory", -"displayType": "directory", "filename": "hawq-site.xml", "category": "General", "serviceName": "HAWQ", @@ -326,7 +320,6 @@ hdp23properties.push({ }, { "name": "hawq_segment_directory", -"displayType": "directory", "filename": "hawq-site.xml", "category": "General", "serviceName": "HAWQ", @@ -334,7 +327,6 @@ hdp23properties.push({ }, { "name": "hawq_segment_temp_directory", -"displayType": "d
ambari git commit: AMBARI-14028. Adding Ranger via Add Service wizard fails with NPE in ambari-server. (Jaimin)
Repository: ambari Updated Branches: refs/heads/trunk 7d45f1f71 -> bf82dfe69 AMBARI-14028. Adding Ranger via Add Service wizard fails with NPE in ambari-server. (Jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bf82dfe6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bf82dfe6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bf82dfe6 Branch: refs/heads/trunk Commit: bf82dfe69e44ed0b87105a99dfef7ac533c9e6b4 Parents: 7d45f1f Author: Jaimin Jetly Authored: Mon Nov 23 16:13:58 2015 -0800 Committer: Jaimin Jetly Committed: Mon Nov 23 16:14:07 2015 -0800 -- ambari-web/app/controllers/wizard/step8_controller.js | 11 ++- ambari-web/test/controllers/wizard/step8_test.js | 7 +++ 2 files changed, 13 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/bf82dfe6/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 5c4baa3..e57f856 100644 --- a/ambari-web/app/controllers/wizard/step8_controller.js +++ b/ambari-web/app/controllers/wizard/step8_controller.js @@ -1378,7 +1378,16 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz if (serviceConfigData.length) { allConfigData.pushObject(JSON.stringify({ Clusters: { -desired_config: serviceConfigData +desired_config: serviceConfigData.map(function(item) { + var props = {}; + Em.keys(item.properties).forEach(function(propName) { +if (item.properties[propName] !== null) { + props[propName] = item.properties[propName]; +} + }); + item.properties = props; + return item; +}) } })); } http://git-wip-us.apache.org/repos/asf/ambari/blob/bf82dfe6/ambari-web/test/controllers/wizard/step8_test.js -- diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js index 9331db5..100f781 100644 --- a/ambari-web/test/controllers/wizard/step8_test.js +++ b/ambari-web/test/controllers/wizard/step8_test.js @@ -1483,10 +1483,9 @@ describe('App.WizardStep8Controller', function () { { type: 'hdfs', tag: 'tag1', - properties: [ -{}, -{} - ] + properties: { +'prop1': 'value1' + } } ], data = '['+JSON.stringify({
[1/3] ambari git commit: AMBARI-13977. Enforce granular role-based access control for user functions (rlevas)
Repository: ambari Updated Branches: refs/heads/trunk e1584720b -> 7d45f1f71 http://git-wip-us.apache.org/repos/asf/ambari/blob/7d45f1f7/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProviderTest.java index e65786b..fdcfbce 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UserPrivilegeResourceProviderTest.java @@ -6,9 +6,9 @@ * 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 - * + * + * 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. @@ -45,9 +45,13 @@ import org.apache.ambari.server.orm.entities.ResourceTypeEntity; import org.apache.ambari.server.orm.entities.UserEntity; import org.apache.ambari.server.orm.entities.ViewEntity; import org.apache.ambari.server.orm.entities.ViewInstanceEntity; +import org.apache.ambari.server.security.authorization.AuthorizationException; import org.apache.ambari.server.security.authorization.ResourceType; +import org.apache.ambari.server.security.TestAuthenticationFactory; import org.easymock.EasyMockSupport; import org.junit.Test; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; import static org.easymock.EasyMock.anyObject; import static org.easymock.EasyMock.expect; @@ -59,74 +63,37 @@ public class UserPrivilegeResourceProviderTest extends EasyMockSupport { @Test(expected = SystemException.class) public void testCreateResources() throws Exception { -final UserPrivilegeResourceProvider resourceProvider = new UserPrivilegeResourceProvider(); + SecurityContextHolder.getContext().setAuthentication(TestAuthenticationFactory.createClusterAdministrator("user1")); +UserPrivilegeResourceProvider resourceProvider = new UserPrivilegeResourceProvider(); resourceProvider.createResources(createNiceMock(Request.class)); } - @SuppressWarnings("serial") @Test - public void testGetResources() throws Exception { -final UserPrivilegeResourceProvider resourceProvider = new UserPrivilegeResourceProvider(); -final UserDAO userDAO = createNiceMock(UserDAO.class); -final GroupDAO groupDAO = createNiceMock(GroupDAO.class); -final ClusterDAO clusterDAO = createNiceMock(ClusterDAO.class); -final ViewInstanceDAO viewInstanceDAO = createNiceMock(ViewInstanceDAO.class); -final UserEntity userEntity = createNiceMock(UserEntity.class); -final PrincipalEntity principalEntity = createNiceMock(PrincipalEntity.class); -final PrivilegeEntity privilegeEntity = createNiceMock(PrivilegeEntity.class); -final PermissionEntity permissionEntity = createNiceMock(PermissionEntity.class); -final PrincipalTypeEntity principalTypeEntity = createNiceMock(PrincipalTypeEntity.class); -final ResourceEntity resourceEntity = createNiceMock(ResourceEntity.class); -final ResourceTypeEntity resourceTypeEntity = createNiceMock(ResourceTypeEntity.class); - - expect(userDAO.findLocalUserByName("user")).andReturn(userEntity).anyTimes(); -expect(userEntity.getPrincipal()).andReturn(principalEntity).anyTimes(); - expect(userEntity.getMemberEntities()).andReturn(Collections. emptySet()).anyTimes(); - expect(privilegeEntity.getPermission()).andReturn(permissionEntity).anyTimes(); - expect(privilegeEntity.getPrincipal()).andReturn(principalEntity).anyTimes(); - expect(principalEntity.getPrincipalType()).andReturn(principalTypeEntity).anyTimes(); - expect(principalTypeEntity.getName()).andReturn(PrincipalTypeEntity.USER_PRINCIPAL_TYPE_NAME).anyTimes(); -expect(principalEntity.getPrivileges()).andReturn(new HashSet() { - { -add(privilegeEntity); - } -}).anyTimes(); - expect(userDAO.findUserByPrincipal(anyObject(PrincipalEntity.class))).andReturn(userEntity).anyTimes(); -expect(userEntity.getUserName()).andReturn("user").anyTimes(); -expect(privilegeEntity.getResource()).andReturn(resourceEntity).anyTimes(); - expect(resourceEntity.getResourceType()).andReturn(resourceTypeEntity).anyTimes(); -expect(resourceTypeEntity.getName()).andReturn(ResourceType.AMBARI.name()); - -
[3/3] ambari git commit: AMBARI-13977. Enforce granular role-based access control for user functions (rlevas)
AMBARI-13977. Enforce granular role-based access control for user functions (rlevas) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7d45f1f7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7d45f1f7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7d45f1f7 Branch: refs/heads/trunk Commit: 7d45f1f71f9b569d3d541ebb7cbd6b79bfd8fdb4 Parents: e158472 Author: Robert Levas Authored: Mon Nov 23 18:57:44 2015 -0500 Committer: Robert Levas Committed: Mon Nov 23 18:57:44 2015 -0500 -- .../controller/AmbariManagementController.java | 5 +- .../AmbariManagementControllerImpl.java | 96 +-- .../internal/AbstractResourceProvider.java | 5 +- .../ActiveWidgetLayoutResourceProvider.java | 43 +- .../AmbariPrivilegeResourceProvider.java| 8 + .../ClusterPrivilegeResourceProvider.java | 29 +- .../internal/PrivilegeResourceProvider.java | 10 +- .../UserAuthorizationResourceProvider.java | 22 +- .../internal/UserPrivilegeResourceProvider.java | 18 + .../internal/UserResourceProvider.java | 14 +- .../AmbariAuthorizationFilter.java | 46 +- .../authorization/AuthorizationHelper.java | 33 +- .../AmbariManagementControllerImplTest.java | 11 + .../AmbariManagementControllerTest.java | 11 + .../ActiveWidgetLayoutResourceProviderTest.java | 458 - .../AmbariPrivilegeResourceProviderTest.java| 626 +- .../ClusterPrivilegeResourceProviderTest.java | 501 +++--- .../UserAuthorizationResourceProviderTest.java | 172 +++-- .../UserPrivilegeResourceProviderTest.java | 140 ++-- .../internal/UserResourceProviderTest.java | 646 +-- .../ViewPrivilegeResourceProviderTest.java | 4 + .../security/TestAuthenticationFactory.java | 164 + .../AmbariAuthorizationFilterTest.java | 77 +-- 23 files changed, 2157 insertions(+), 982 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7d45f1f7/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java index ea7603f..b446121 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementController.java @@ -32,6 +32,7 @@ import org.apache.ambari.server.controller.internal.RequestStageContainer; import org.apache.ambari.server.controller.metrics.timeline.cache.TimelineMetricCacheProvider; import org.apache.ambari.server.metadata.RoleCommandOrder; import org.apache.ambari.server.scheduler.ExecutionScheduleManager; +import org.apache.ambari.server.security.authorization.AuthorizationException; import org.apache.ambari.server.security.ldap.LdapBatchDto; import org.apache.ambari.server.security.ldap.LdapSyncDto; import org.apache.ambari.server.stageplanner.RoleGraphFactory; @@ -182,7 +183,7 @@ public interface AmbariManagementController { * @throws AmbariException if the users could not be read */ public Set getUsers(Set requests) - throws AmbariException; + throws AmbariException, AuthorizationException; /** * Gets the user groups identified by the given request objects. @@ -235,7 +236,7 @@ public interface AmbariManagementController { * * @throws AmbariException if the resources cannot be updated */ - public void updateUsers(Set requests) throws AmbariException; + public void updateUsers(Set requests) throws AmbariException, AuthorizationException; /** * Updates the groups specified. http://git-wip-us.apache.org/repos/asf/ambari/blob/7d45f1f7/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 443c715..7cb7f7d 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 @@ -100,16 +100,15 @@ import org.apache.ambari.server.orm.dao.WidgetLayoutDAO; import org.apache.ambari.server.orm.entities.ClusterEntity; import org.apache.ambari.server.orm.entities.ClusterVersionE
[2/3] ambari git commit: AMBARI-13977. Enforce granular role-based access control for user functions (rlevas)
http://git-wip-us.apache.org/repos/asf/ambari/blob/7d45f1f7/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java index 68f1467..4357a24 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AmbariPrivilegeResourceProviderTest.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 @@ -18,27 +18,27 @@ package org.apache.ambari.server.controller.internal; -import static org.easymock.EasyMock.anyObject; -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.createNiceMock; -import static org.easymock.EasyMock.createStrictMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.reset; -import static org.easymock.EasyMock.verify; - +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; +import com.google.inject.AbstractModule; +import com.google.inject.Guice; +import com.google.inject.Injector; +import org.apache.ambari.server.controller.spi.Predicate; import org.apache.ambari.server.controller.spi.Request; import org.apache.ambari.server.controller.spi.Resource; +import org.apache.ambari.server.controller.spi.ResourceProvider; +import org.apache.ambari.server.controller.utilities.PredicateBuilder; import org.apache.ambari.server.controller.utilities.PropertyHelper; +import org.apache.ambari.server.orm.DBAccessor; import org.apache.ambari.server.orm.dao.ClusterDAO; import org.apache.ambari.server.orm.dao.GroupDAO; import org.apache.ambari.server.orm.dao.MemberDAO; @@ -62,110 +62,112 @@ import org.apache.ambari.server.orm.entities.UserEntity; import org.apache.ambari.server.orm.entities.ViewEntity; import org.apache.ambari.server.orm.entities.ViewInstanceEntity; import org.apache.ambari.server.security.SecurityHelper; +import org.apache.ambari.server.security.TestAuthenticationFactory; +import org.apache.ambari.server.security.authorization.AuthorizationException; import org.apache.ambari.server.security.authorization.ResourceType; import org.apache.ambari.server.view.ViewInstanceHandlerList; import org.apache.ambari.server.view.ViewRegistry; import org.apache.ambari.server.view.ViewRegistryTest; -import org.easymock.EasyMock; +import org.easymock.EasyMockSupport; +import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; + +import javax.persistence.EntityManager; + +import static org.easymock.EasyMock.*; /** * AmbariPrivilegeResourceProvider tests. */ -public class AmbariPrivilegeResourceProviderTest { - private final static PrivilegeDAO privilegeDAO = createStrictMock(PrivilegeDAO.class); - private final static ClusterDAO clusterDAO = createStrictMock(ClusterDAO.class); - private final static UserDAO userDAO = createStrictMock(UserDAO.class); - private final static GroupDAO groupDAO = createStrictMock(GroupDAO.class); - private final static PrincipalDAO principalDAO = createStrictMock(PrincipalDAO.class); - private final static PermissionDAO permissionDAO = createStrictMock(PermissionDAO.class); - private final static ResourceDAO resourceDAO = createStrictMock(ResourceDAO.class); - private static final ViewDAO viewDAO = createMock(ViewDAO.class); - private static final ViewInstanceDAO viewInstanceDAO = createNiceMock(ViewInstanceDAO.class); - private static final MemberDAO memberDAO = createNiceMock(MemberDAO.class); - private static final ResourceTypeDAO resourceTypeDAO = createNiceMock(ResourceTypeDAO.class); - private static final SecurityHelper securityHelper = createNiceMock(SecurityHelper.class); - private static final ViewInstanceHandlerList handlerList = createNiceMock(ViewInstanceHandlerList.class); - - @BeforeClass - public static void initClass() { -PrivilegeResourceProvider.init(privilegeDAO, userDAO, groupDAO, principalDAO, permissionDAO, resourceDAO); -AmbariPrivilegeResourceProvider.init(clusterDAO); - } +public class AmbariPrivilegeResou
ambari git commit: AMBARI-13986. Hive View : Upload Table tab : Distorted alignment of form fields. (Nitiraj Rathore via Jaimin)
Repository: ambari Updated Branches: refs/heads/trunk b26aa4ad2 -> e1584720b AMBARI-13986. Hive View : Upload Table tab : Distorted alignment of form fields. (Nitiraj Rathore via Jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e1584720 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e1584720 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e1584720 Branch: refs/heads/trunk Commit: e1584720b499979a948fc2c4348ca4c4d8c21a97 Parents: b26aa4a Author: Jaimin Jetly Authored: Mon Nov 23 14:12:09 2015 -0800 Committer: Jaimin Jetly Committed: Mon Nov 23 14:16:00 2015 -0800 -- .../hive/src/main/resources/ui/hive-web/app/styles/app.scss | 5 + .../resources/ui/hive-web/app/templates/upload-table.hbs | 8 2 files changed, 9 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/e1584720/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss -- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss index b754700..b29f7a5 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss @@ -580,3 +580,8 @@ tree-view ul li { .mozBoxSizeFix { -moz-box-sizing: border-box; } + +#isFirstRowHeader { + box-shadow: none; + width: inherit; +} http://git-wip-us.apache.org/repos/asf/ambari/blob/e1584720/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/upload-table.hbs -- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/upload-table.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/upload-table.hbs index 0ef4a7d..d811e34 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/upload-table.hbs +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/upload-table.hbs @@ -32,7 +32,7 @@ {{file-upload filesUploaded="filesUploaded"}} - + {{#if rows}} @@ -56,10 +56,10 @@ Table Name : {{input type="text" class="form-control" placeHolder="Table Name" value=tableName }} -Is First Row Header? :{{input type="checkbox" class="form-control" checked=isFirstRowHeader }} +Is First Row Header? :{{input id="isFirstRowHeader" type="checkbox" class="form-control" checked=isFirstRowHeader }} - + @@ -87,6 +87,6 @@ {{/each}} - {{/if}} +{{/if}} {{/unless}} \ No newline at end of file
ambari git commit: AMBARI-13986. Hive View : Upload Table tab : Distorted alignment of form fields. (Nitiraj Rathore via Jaimin)
Repository: ambari Updated Branches: refs/heads/branch-2.1 2799e9aab -> 3650059aa AMBARI-13986. Hive View : Upload Table tab : Distorted alignment of form fields. (Nitiraj Rathore via Jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3650059a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3650059a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3650059a Branch: refs/heads/branch-2.1 Commit: 3650059aa444e4a15fd3f9b7a4e38cd7070dfec7 Parents: 2799e9a Author: Jaimin Jetly Authored: Mon Nov 23 14:12:09 2015 -0800 Committer: Jaimin Jetly Committed: Mon Nov 23 14:12:09 2015 -0800 -- .../hive/src/main/resources/ui/hive-web/app/styles/app.scss | 5 + .../resources/ui/hive-web/app/templates/upload-table.hbs | 8 2 files changed, 9 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/3650059a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss -- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss index b754700..b29f7a5 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/app.scss @@ -580,3 +580,8 @@ tree-view ul li { .mozBoxSizeFix { -moz-box-sizing: border-box; } + +#isFirstRowHeader { + box-shadow: none; + width: inherit; +} http://git-wip-us.apache.org/repos/asf/ambari/blob/3650059a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/upload-table.hbs -- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/upload-table.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/upload-table.hbs index 0ef4a7d..d811e34 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/upload-table.hbs +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/upload-table.hbs @@ -32,7 +32,7 @@ {{file-upload filesUploaded="filesUploaded"}} - + {{#if rows}} @@ -56,10 +56,10 @@ Table Name : {{input type="text" class="form-control" placeHolder="Table Name" value=tableName }} -Is First Row Header? :{{input type="checkbox" class="form-control" checked=isFirstRowHeader }} +Is First Row Header? :{{input id="isFirstRowHeader" type="checkbox" class="form-control" checked=isFirstRowHeader }} - + @@ -87,6 +87,6 @@ {{/each}} - {{/if}} +{{/if}} {{/unless}} \ No newline at end of file
[1/2] ambari git commit: AMBARI-14016 Backport AMS auto-start and watchdog thread changes to 2.1.2 (dsen)
Repository: ambari Updated Branches: refs/heads/branch-2.1.2 c510dc853 -> 7b1ac0f0a http://git-wip-us.apache.org/repos/asf/ambari/blob/7b1ac0f0/ambari-server/src/test/python/stacks/2.0.6/configs/default_ams_embedded.json -- diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default_ams_embedded.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default_ams_embedded.json new file mode 100644 index 000..0ce8e5a --- /dev/null +++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default_ams_embedded.json @@ -0,0 +1,1108 @@ +{ +"roleCommand": "SERVICE_CHECK", +"clusterName": "c1", +"hostname": "c6401.ambari.apache.org", +"hostLevelParams": { +"jdk_location": "http://c6401.ambari.apache.org:8080/resources/";, +"ambari_db_rca_password": "mapred", +"ambari_db_rca_url": "jdbc:postgresql://c6401.ambari.apache.org/ambarirca", +"repo_info": "[{\"baseUrl\":\"http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.6.0\",\"osType\":\"centos6\",\"repoId\":\"HDP-2.0._\",\"repoName\":\"HDP\",\"defaultBaseUrl\":\"http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.0.6.0\"}]";, +"jce_name": "UnlimitedJCEPolicyJDK7.zip", +"stack_version": "2.0", +"stack_name": "HDP", +"ambari_db_rca_driver": "org.postgresql.Driver", +"jdk_name": "jdk-7u67-linux-x64.tar.gz", +"ambari_db_rca_username": "mapred", +"java_home": "/usr/jdk64/jdk1.7.0_45", +"java_version": "8", +"db_name": "ambari", +"group_list": "[\"hadoop\",\"nobody\",\"users\"]", +"user_list": "[\"hive\",\"oozie\",\"nobody\",\"ambari-qa\",\"flume\",\"hdfs\",\"storm\",\"mapred\",\"hbase\",\"tez\",\"zookeeper\",\"falcon\",\"sqoop\",\"yarn\",\"hcat\"]" +}, +"commandType": "EXECUTION_COMMAND", +"roleParams": {}, +"serviceName": "HIVE", +"role": "HIVE_SERVER", +"commandParams": { +"command_timeout": "300", +"service_package_folder": "OOZIE", +"script_type": "PYTHON", +"script": "scripts/service_check.py", +"excluded_hosts": "host1,host2", +"mark_draining_only" : "false", +"update_exclude_file_only" : "false", +"xml_configs_list":[{"hdfs-site.xml":"hdfs-site"}], + "env_configs_list":[{"hadoop-env.sh":"hadoop-env"},{"log4j.properties":"hdfs-log4j,yarn-log4j"}], + "properties_configs_list":[{"runtime.properties":"falcon-runtime.properties"},{"startup.properties":"falcon-startup.properties"}], +"output_file":"HDFS_CLIENT-configs.tar.gz", +"refresh_topology": "True" +}, +"taskId": 152, +"public_hostname": "c6401.ambari.apache.org", +"configurations": { +"mapred-site": { +"mapreduce.jobhistory.address": "c6402.ambari.apache.org:10020", +"mapreduce.cluster.administrators": " hadoop", +"mapreduce.reduce.input.buffer.percent": "0.0", +"mapreduce.output.fileoutputformat.compress": "false", +"mapreduce.framework.name": "yarn", +"mapreduce.map.speculative": "false", +"mapreduce.reduce.shuffle.merge.percent": "0.66", +"yarn.app.mapreduce.am.resource.mb": "683", +"mapreduce.map.java.opts": "-Xmx273m", +"mapreduce.application.classpath": "$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*,$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*", +"mapreduce.job.reduce.slowstart.completedmaps": "0.05", +"mapreduce.output.fileoutputformat.compress.type": "BLOCK", +"mapreduce.reduce.speculative": "false", +"mapreduce.reduce.java.opts": "-Xmx546m", +"mapreduce.am.max-attempts": "2", +"yarn.app.mapreduce.am.admin-command-opts": "-Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN", +"mapreduce.reduce.log.level": "INFO", +"mapreduce.map.sort.spill.percent": "0.7", +"mapreduce.task.timeout": "30", +"mapreduce.map.memory.mb": "341", +"mapreduce.task.io.sort.factor": "100", +"mapreduce.jobhistory.intermediate-done-dir": "/mr-history/tmp", +"mapreduce.reduce.memory.mb": "683", +"yarn.app.mapreduce.am.log.level": "INFO", +"mapreduce.map.log.level": "INFO", +"mapreduce.shuffle.port": "13562", +"mapreduce.admin.user.env": "LD_LIBRARY_PATH=/usr/lib/hadoop/lib/native:/usr/lib/hadoop/lib/native/`$JAVA_HOME/bin/java -d32 -version &> /dev/null;if [ $? -eq 0 ]; then echo Linux-i386-32; else echo Linux-amd64-64;fi`", +"mapreduce.map.output.compress": "false", +"yarn.app.mapreduce.am.staging-dir": "/user", +"mapreduce.reduce.shuffle.parallelcopies": "30", +"mapreduce.reduce.shuffle.input.buffer.percent":
[2/2] ambari git commit: AMBARI-14016 Backport AMS auto-start and watchdog thread changes to 2.1.2 (dsen)
AMBARI-14016 Backport AMS auto-start and watchdog thread changes to 2.1.2 (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7b1ac0f0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7b1ac0f0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7b1ac0f0 Branch: refs/heads/branch-2.1.2 Commit: 7b1ac0f0a81c12acdd93e8f6ff702eb8992b662c Parents: c510dc8 Author: Dmytro Sen Authored: Mon Nov 23 19:41:54 2015 +0200 Committer: Dmytro Sen Committed: Mon Nov 23 19:41:54 2015 +0200 -- .../conf/unix/ambari-metrics-collector |8 - .../ApplicationHistoryServer.java |2 +- .../timeline/HBaseTimelineMetricStore.java | 18 + .../metrics/timeline/PhoenixHBaseAccessor.java |1 + .../timeline/TimelineMetricConfiguration.java | 40 + .../timeline/TimelineMetricStoreWatcher.java| 130 ++ .../TimelineMetricStoreWatcherTest.java | 107 ++ .../0.1.0/configuration/ams-hbase-site.xml |2 +- .../0.1.0/configuration/ams-site.xml| 26 + .../0.1.0/package/scripts/ams_service.py|3 +- .../0.1.0/package/scripts/metrics_collector.py |2 + .../AMBARI_METRICS/test_metrics_collector.py| 237 ++-- .../python/stacks/2.0.6/configs/default.json|2 +- .../2.0.6/configs/default_ams_embedded.json | 1108 ++ 14 files changed, 1584 insertions(+), 102 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7b1ac0f0/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector -- diff --git a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector index dd7ee22..06d1c7d 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector +++ b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector @@ -301,14 +301,6 @@ fi case "$1" in start) -daemon_status "${HBASE_MASTER_PID}" -HBASE_DAEMON_STATUS=$? -daemon_status "${PIDFILE}" -DAEMON_STATUS=$? - -if [[ !"${DISTRIBUTED_HBASE}" && ( ${DAEMON_STATUS} != 0 || ${HBASE_DAEMON_STATUS} != 0 ) ]]; then - stop -fi start ;; http://git-wip-us.apache.org/repos/asf/ambari/blob/7b1ac0f0/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java -- diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java index d79ca68..11c162a 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java +++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java @@ -45,7 +45,7 @@ import org.apache.hadoop.yarn.webapp.WebApps; import com.google.common.annotations.VisibleForTesting; -import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.*; +import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.DISABLE_APPLICATION_TIMELINE_STORE; /** * History server that keeps track of all types of history in the cluster. http://git-wip-us.apache.org/repos/asf/ambari/blob/7b1ac0f0/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java -- diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java index 43cb554..f069ae0 100644 --- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java +++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/HBaseTimelineMetricStore.java @@ -40,6 +40,15 @@ import java.util.HashMap; import
ambari git commit: AMBARI-14021 Empty configurations in enable kerbros wizard. (ababiichuk)
Repository: ambari Updated Branches: refs/heads/trunk 4b20e5c1a -> b26aa4ad2 AMBARI-14021 Empty configurations in enable kerbros wizard. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b26aa4ad Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b26aa4ad Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b26aa4ad Branch: refs/heads/trunk Commit: b26aa4ad22b8dd14feb850d6d2e1d5cc4c54b010 Parents: 4b20e5c Author: aBabiichuk Authored: Mon Nov 23 19:24:25 2015 +0200 Committer: aBabiichuk Committed: Mon Nov 23 19:24:59 2015 +0200 -- ambari-web/app/controllers/wizard/step7_controller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b26aa4ad/ambari-web/app/controllers/wizard/step7_controller.js -- diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index 9209add..3343c29 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -788,13 +788,15 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E var serviceName = service.get('serviceName'); if (['MISC'].concat(this.get('allSelectedServiceNames')).contains(serviceName)) { var serviceConfig = App.config.createServiceConfig(serviceName); +serviceConfig.set('showConfig', App.StackService.find(serviceName).get('isInstallable')); if (this.get('wizardController.name') == 'addServiceController') { serviceConfig.set('selected', !this.get('installedServiceNames').concat('MISC').contains(serviceName)); if (serviceName === 'MISC') { serviceConfig.set('configCategories', serviceConfig.get('configCategories').rejectProperty('name', 'Notifications')); } +} else if (this.get('wizardController.name') == 'kerberosWizardController') { + serviceConfig.set('showConfig', true); } -serviceConfig.set('showConfig', App.StackService.find(serviceName).get('isInstallable')); stepConfigs.pushObject(serviceConfig); } }, this);
[1/2] ambari git commit: AMBARI-14020. devdeploy failures on spark start (aonishuk)
Repository: ambari Updated Branches: refs/heads/branch-2.1 7effdec2a -> 2799e9aab refs/heads/trunk bd2bf2543 -> 4b20e5c1a AMBARI-14020. devdeploy failures on spark start (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4b20e5c1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4b20e5c1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4b20e5c1 Branch: refs/heads/trunk Commit: 4b20e5c1ade0e70b6027c92737af476af77ada65 Parents: bd2bf25 Author: Andrew Onishuk Authored: Mon Nov 23 19:20:03 2015 +0200 Committer: Andrew Onishuk Committed: Mon Nov 23 19:20:03 2015 +0200 -- .../SPARK/1.2.0.2.2/package/scripts/status_params.py | 2 +- .../src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/4b20e5c1/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/status_params.py -- diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/status_params.py index 2272c72..19c9a0e 100644 --- a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/status_params.py +++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/status_params.py @@ -34,4 +34,4 @@ else: spark_pid_dir = config['configurations']['spark-env']['spark_pid_dir'] spark_history_server_pid_file = format("{spark_pid_dir}/spark-{spark_user}-org.apache.spark.deploy.history.HistoryServer-1.pid") -spark_thrift_server_pid_file = format("{spark_pid_dir}/spark-{spark_user}-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid") +spark_thrift_server_pid_file = format("{spark_pid_dir}/spark-{hive_user}-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid") http://git-wip-us.apache.org/repos/asf/ambari/blob/4b20e5c1/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py -- diff --git a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py b/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py index 0ad5956..253c5f8 100644 --- a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py +++ b/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py @@ -55,7 +55,7 @@ class TestSparkThriftServer(RMFTestCase): self.assert_configure_default() self.assertResourceCalled('Execute', '/usr/hdp/current/spark-client/sbin/start-thriftserver.sh --properties-file /usr/hdp/current/spark-client/conf/spark-thrift-sparkconf.conf --driver-memory 1g', environment = {'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, -not_if = 'ls /var/run/spark/spark-spark-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid >/dev/null 2>&1 && ps -p `cat /var/run/spark/spark-spark-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid` >/dev/null 2>&1', +not_if = 'ls /var/run/spark/spark-hive-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid >/dev/null 2>&1 && ps -p `cat /var/run/spark/spark-hive-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid` >/dev/null 2>&1', user = 'hive', ) self.assertNoMoreResources() @@ -72,7 +72,7 @@ class TestSparkThriftServer(RMFTestCase): environment = {'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, user = 'hive', ) -self.assertResourceCalled('File', '/var/run/spark/spark-spark-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid', +self.assertResourceCalled('File', '/var/run/spark/spark-hive-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid', action = ['delete'], ) self.assertNoMoreResources()
[2/2] ambari git commit: AMBARI-14020. devdeploy failures on spark start (aonishuk)
AMBARI-14020. devdeploy failures on spark start (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2799e9aa Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2799e9aa Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2799e9aa Branch: refs/heads/branch-2.1 Commit: 2799e9aabc3e31fe3d9c2f5f86d3482c972652cc Parents: 7effdec Author: Andrew Onishuk Authored: Mon Nov 23 19:20:06 2015 +0200 Committer: Andrew Onishuk Committed: Mon Nov 23 19:20:06 2015 +0200 -- .../SPARK/1.2.0.2.2/package/scripts/status_params.py | 2 +- .../src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2799e9aa/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/status_params.py -- diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/status_params.py index 2272c72..19c9a0e 100644 --- a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/status_params.py +++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/status_params.py @@ -34,4 +34,4 @@ else: spark_pid_dir = config['configurations']['spark-env']['spark_pid_dir'] spark_history_server_pid_file = format("{spark_pid_dir}/spark-{spark_user}-org.apache.spark.deploy.history.HistoryServer-1.pid") -spark_thrift_server_pid_file = format("{spark_pid_dir}/spark-{spark_user}-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid") +spark_thrift_server_pid_file = format("{spark_pid_dir}/spark-{hive_user}-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid") http://git-wip-us.apache.org/repos/asf/ambari/blob/2799e9aa/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py -- diff --git a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py b/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py index 20054bc..fc85f46 100644 --- a/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py +++ b/ambari-server/src/test/python/stacks/2.3/SPARK/test_spark_thrift_server.py @@ -55,7 +55,7 @@ class TestSparkThriftServer(RMFTestCase): self.assert_configure_default() self.assertResourceCalled('Execute', '/usr/hdp/current/spark-client/sbin/start-thriftserver.sh --properties-file /usr/hdp/current/spark-client/conf/spark-thrift-sparkconf.conf --driver-memory 1g', environment = {'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, -not_if = 'ls /var/run/spark/spark-spark-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid >/dev/null 2>&1 && ps -p `cat /var/run/spark/spark-spark-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid` >/dev/null 2>&1', +not_if = 'ls /var/run/spark/spark-hive-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid >/dev/null 2>&1 && ps -p `cat /var/run/spark/spark-hive-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid` >/dev/null 2>&1', user = 'hive', ) self.assertNoMoreResources() @@ -72,7 +72,7 @@ class TestSparkThriftServer(RMFTestCase): environment = {'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'}, user = 'hive', ) -self.assertResourceCalled('File', '/var/run/spark/spark-spark-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid', +self.assertResourceCalled('File', '/var/run/spark/spark-hive-org.apache.spark.sql.hive.thriftserver.HiveThriftServer2-1.pid', action = ['delete'], ) self.assertNoMoreResources()
ambari git commit: AMBARI-14015 Different values range for yarn.nodemanager.resource.memory-mb property after page refresh. (ababiichuk)
Repository: ambari Updated Branches: refs/heads/branch-2.1 cab13ae84 -> 7effdec2a AMBARI-14015 Different values range for yarn.nodemanager.resource.memory-mb property after page refresh. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7effdec2 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7effdec2 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7effdec2 Branch: refs/heads/branch-2.1 Commit: 7effdec2a4de7b797f71bc85e63212fb86b84b13 Parents: cab13ae Author: aBabiichuk Authored: Mon Nov 23 17:58:24 2015 +0200 Committer: aBabiichuk Committed: Mon Nov 23 17:58:24 2015 +0200 -- .../app/controllers/wizard/step7_controller.js | 30 +-- ambari-web/app/utils/blueprint.js | 55 +++- ambari-web/test/utils/blueprint_test.js | 39 +- 3 files changed, 69 insertions(+), 55 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/7effdec2/ambari-web/app/controllers/wizard/step7_controller.js -- diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index a9aca28..84142d7 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -713,23 +713,19 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E if (rangerService && !rangerService.get('isInstalled') && !rangerService.get('isSelected')) { App.config.removeRangerConfigs(self.get('stepConfigs')); } -if (this.get('content.serviceConfigProperties.length') > 0) { - this.completeConfigLoading(); -} else { - this.loadServerSideConfigsRecommendations().always(function () { -if (self.get('wizardController.name') == 'addServiceController') { - // for Add Service just remove or add dependent properties and ignore config values changes - // for installed services only - self.addRemoveDependentConfigs(self.get('installedServiceNames')); - self.clearDependenciesForInstalledServices(self.get('installedServiceNames'), self.get('stepConfigs')); -} -// * add dependencies based on recommendations -// * update config values with recommended -// * remove properties received from recommendations -self.updateDependentConfigs(); -self.completeConfigLoading(); - }); -} +this.loadServerSideConfigsRecommendations().always(function () { + if (self.get('wizardController.name') == 'addServiceController') { +// for Add Service just remove or add dependent properties and ignore config values changes +// for installed services only +self.addRemoveDependentConfigs(self.get('installedServiceNames')); + self.clearDependenciesForInstalledServices(self.get('installedServiceNames'), self.get('stepConfigs')); + } + // * add dependencies based on recommendations + // * update config values with recommended + // * remove properties received from recommendations + self.updateDependentConfigs(); + self.completeConfigLoading(); +}); }, completeConfigLoading: function() { http://git-wip-us.apache.org/repos/asf/ambari/blob/7effdec2/ambari-web/app/utils/blueprint.js -- diff --git a/ambari-web/app/utils/blueprint.js b/ambari-web/app/utils/blueprint.js index 687c7fd..59290cd 100644 --- a/ambari-web/app/utils/blueprint.js +++ b/ambari-web/app/utils/blueprint.js @@ -385,39 +385,44 @@ module.exports = { }, /** + * Small helper method to update hostMap + * it perform update of object only + * if unique component per host is added + * + * @param {Object} hostMapObject + * @param {string[]} hostNames + * @param {string} componentName + * @returns {Object} + * @private + */ + _generateHostMap: function(hostMapObject, hostNames, componentName) { +Em.assert('hostMapObject, hostNames, componentName should be defined', !!hostMapObject && !!hostNames && !!componentName); +if (!hostNames.length) return hostMapObject; +hostNames.forEach(function(hostName) { + if (!hostMapObject[hostName]) +hostMapObject[hostName] = []; + + if (!hostMapObject[hostName].contains(componentName)) +hostMapObject[hostName].push(componentName); +}); +return hostMapObject; + }, + + /** * collect all component names that are present on hosts * @returns {object} */ getComponentForHosts: function() { var hostsMap = {}; App.ClientComponent.find().forEach(function(c) { - var componentName = c.get('componentName'); -
ambari git commit: AMBARI-14015 Different values range for yarn.nodemanager.resource.memory-mb property after page refresh. (ababiichuk)
Repository: ambari Updated Branches: refs/heads/trunk 2f94036e9 -> bd2bf2543 AMBARI-14015 Different values range for yarn.nodemanager.resource.memory-mb property after page refresh. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bd2bf254 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bd2bf254 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bd2bf254 Branch: refs/heads/trunk Commit: bd2bf2543337387d19c844c6f198e5839be7e1ac Parents: 2f94036 Author: aBabiichuk Authored: Mon Nov 23 17:58:24 2015 +0200 Committer: aBabiichuk Committed: Mon Nov 23 18:01:19 2015 +0200 -- ambari-web/app/utils/blueprint.js | 55 +++- ambari-web/test/utils/blueprint_test.js | 39 +--- 2 files changed, 56 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/bd2bf254/ambari-web/app/utils/blueprint.js -- diff --git a/ambari-web/app/utils/blueprint.js b/ambari-web/app/utils/blueprint.js index cd4b7b2..ea908d1 100644 --- a/ambari-web/app/utils/blueprint.js +++ b/ambari-web/app/utils/blueprint.js @@ -379,39 +379,44 @@ module.exports = { }, /** + * Small helper method to update hostMap + * it perform update of object only + * if unique component per host is added + * + * @param {Object} hostMapObject + * @param {string[]} hostNames + * @param {string} componentName + * @returns {Object} + * @private + */ + _generateHostMap: function(hostMapObject, hostNames, componentName) { +Em.assert('hostMapObject, hostNames, componentName should be defined', !!hostMapObject && !!hostNames && !!componentName); +if (!hostNames.length) return hostMapObject; +hostNames.forEach(function(hostName) { + if (!hostMapObject[hostName]) +hostMapObject[hostName] = []; + + if (!hostMapObject[hostName].contains(componentName)) +hostMapObject[hostName].push(componentName); +}); +return hostMapObject; + }, + + /** * collect all component names that are present on hosts * @returns {object} */ getComponentForHosts: function() { var hostsMap = {}; App.ClientComponent.find().forEach(function(c) { - var componentName = c.get('componentName'); - c.get('hostNames').forEach(function(hostName){ -if (hostsMap[hostName]) { - hostsMap[hostName].push(componentName); -} else { - hostsMap[hostName] = [componentName]; -} - }); -}); + hostsMap = this._generateHostMap(hostsMap, c.get('hostNames'), c.get('componentName')); +}, this); App.SlaveComponent.find().forEach(function (c) { - var componentName = c.get('componentName'); - c.get('hostNames').forEach(function (hostName) { -if (hostsMap[hostName]) { - hostsMap[hostName].push(componentName); -} else { - hostsMap[hostName] = [componentName]; -} - }); -}); + hostsMap = this._generateHostMap(hostsMap, c.get('hostNames'), c.get('componentName')); +}, this); App.HostComponent.find().forEach(function (c) { - var hostName = c.get('hostName'); - if (hostsMap[hostName]) { -hostsMap[hostName].push(c.get('componentName')); - } else { -hostsMap[hostName] = [c.get('componentName')]; - } -}); + hostsMap = this._generateHostMap(hostsMap, [c.get('hostName')], c.get('componentName')); +}, this); return hostsMap; } }; http://git-wip-us.apache.org/repos/asf/ambari/blob/bd2bf254/ambari-web/test/utils/blueprint_test.js -- diff --git a/ambari-web/test/utils/blueprint_test.js b/ambari-web/test/utils/blueprint_test.js index 29072a3..8fa3bcf 100644 --- a/ambari-web/test/utils/blueprint_test.js +++ b/ambari-web/test/utils/blueprint_test.js @@ -415,19 +415,32 @@ describe('utils/blueprint', function() { App.HostComponent.find.restore(); }); -it("", function() { - expect(blueprintUtils.getComponentForHosts()).to.eql({ -"host1": [ - "C1" -], -"host2": [ - "C1", - "C2" -], -"host3": [ - "C2", - "C3" -] +it("generate components to host map", function() { + var res = blueprintUtils.getComponentForHosts(); + expect(res['host1'][0]).to.eql("C1"); + expect(res['host2'][0]).to.eql("C1"); + expect(res['host2'][1]).to.eql("C2"); + expect(res['host3'][0]).to.eql("C2"); + expect(res['host3'][1]).to.eql("C3"); +}); + }); + + describe('#_generateHostMap', function() { +it('generate map', function() { + var map = blueprintUtils._generateHostMap({
[1/2] ambari git commit: AMBARI-14018 test_pre_upgrade_restart_ims fails on https://builds.apache.org (dlysnichenko)
Repository: ambari Updated Branches: refs/heads/branch-2.1 2d8715a53 -> cab13ae84 refs/heads/trunk 8e7eb7d17 -> 2f94036e9 AMBARI-14018 test_pre_upgrade_restart_ims fails on https://builds.apache.org (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cab13ae8 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cab13ae8 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cab13ae8 Branch: refs/heads/branch-2.1 Commit: cab13ae84de2f4d87b1cdfefb8cec60a6aed8e99 Parents: 2d8715a Author: Lisnichenko Dmitro Authored: Mon Nov 23 17:40:17 2015 +0200 Committer: Lisnichenko Dmitro Committed: Mon Nov 23 17:40:17 2015 +0200 -- .../test/python/stacks/2.1/HIVE/test_hive_metastore.py | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/cab13ae8/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py -- diff --git a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py index 42f9344..73d907e 100644 --- a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py +++ b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -''' +""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information @@ -16,7 +16,8 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -''' +""" + import json import os @@ -29,7 +30,7 @@ from resource_management.libraries.script.script import Script class TestHiveMetastore(RMFTestCase): COMMON_SERVICES_PACKAGE_DIR = "HIVE/0.12.0.2.0/package" STACK_VERSION = "2.0.6" - + def test_configure_default(self): self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_metastore.py", classname = "HiveMetastore", @@ -534,14 +535,12 @@ class TestHiveMetastore(RMFTestCase): mocks_dict['call'].call_args_list[0][0][0]) - @patch("resource_management.core.shell.call") @patch.object(Script, "is_hdp_stack_greater_or_equal") - def test_pre_upgrade_restart_ims(self, is_hdp_stack_greater_or_equal_mock, call_mock): + def test_pre_upgrade_restart_ims(self, is_hdp_stack_greater_or_equal_mock): """ Tests the state of the init_metastore_schema property on update """ is_hdp_stack_greater_or_equal_mock.side_effect = [False, False, False, False, False, False, True, False, False, False, False, False, False, False] - config_file = self.get_src_folder() + "/test/python/stacks/2.0.6/configs/default.json" with open(config_file, "r") as f: json_content = json.load(f) @@ -559,7 +558,7 @@ class TestHiveMetastore(RMFTestCase): config_dict = json_content, hdp_stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, - call_mocks = [(0, None), (0, None)], + call_mocks = [(0, None, ''), (0, None)], mocks_dict = mocks_dict) self.assertEquals(False, RMFTestCase.env.config["params"]["init_metastore_schema"])
[2/2] ambari git commit: AMBARI-14018 test_pre_upgrade_restart_ims fails on https://builds.apache.org (dlysnichenko)
AMBARI-14018 test_pre_upgrade_restart_ims fails on https://builds.apache.org (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2f94036e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2f94036e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2f94036e Branch: refs/heads/trunk Commit: 2f94036e90014f1d4d2a6484565cbe50e81db736 Parents: 8e7eb7d Author: Lisnichenko Dmitro Authored: Mon Nov 23 17:41:34 2015 +0200 Committer: Lisnichenko Dmitro Committed: Mon Nov 23 17:41:34 2015 +0200 -- .../python/stacks/2.1/HIVE/test_hive_metastore.py | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2f94036e/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py -- diff --git a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py index 63c2449..bdc0fe2 100644 --- a/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py +++ b/ambari-server/src/test/python/stacks/2.1/HIVE/test_hive_metastore.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -''' +""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information @@ -16,7 +16,8 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -''' +""" + import json import os @@ -29,7 +30,7 @@ from resource_management.libraries.script.script import Script class TestHiveMetastore(RMFTestCase): COMMON_SERVICES_PACKAGE_DIR = "HIVE/0.12.0.2.0/package" STACK_VERSION = "2.0.6" - + def test_configure_default(self): self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_metastore.py", classname = "HiveMetastore", @@ -533,15 +534,12 @@ class TestHiveMetastore(RMFTestCase): ('ambari-python-wrap', '/usr/bin/conf-select', 'create-conf-dir', '--package', 'hive', '--stack-version', '2.3.0.0-1234', '--conf-version', '0'), mocks_dict['call'].call_args_list[0][0][0]) - - @patch("resource_management.core.shell.call") @patch.object(Script, "is_hdp_stack_greater_or_equal") - def test_pre_upgrade_restart_ims(self, is_hdp_stack_greater_or_equal_mock, call_mock): + def test_pre_upgrade_restart_ims(self, is_hdp_stack_greater_or_equal_mock): """ Tests the state of the init_metastore_schema property on update """ is_hdp_stack_greater_or_equal_mock.side_effect = [False, False, False, False, False, False, True, False, False, False, False, False, False, False] - config_file = self.get_src_folder() + "/test/python/stacks/2.0.6/configs/default.json" with open(config_file, "r") as f: json_content = json.load(f) @@ -559,7 +557,7 @@ class TestHiveMetastore(RMFTestCase): config_dict = json_content, hdp_stack_version = self.STACK_VERSION, target = RMFTestCase.TARGET_COMMON_SERVICES, - call_mocks = [(0, None), (0, None)], + call_mocks = [(0, None, ''), (0, None)], mocks_dict = mocks_dict) self.assertEquals(False, RMFTestCase.env.config["params"]["init_metastore_schema"])
[1/2] ambari git commit: AMBARI-14017. Service or component install fails when a non-ambari apt-get command is running (aonishuk)
Repository: ambari Updated Branches: refs/heads/branch-2.1 adf345b4d -> 2d8715a53 refs/heads/trunk 2b539ef17 -> 8e7eb7d17 AMBARI-14017. Service or component install fails when a non-ambari apt-get command is running (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8e7eb7d1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8e7eb7d1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8e7eb7d1 Branch: refs/heads/trunk Commit: 8e7eb7d1739b85d3b3c75538019578492d85d3c5 Parents: 2b539ef Author: Andrew Onishuk Authored: Mon Nov 23 17:32:39 2015 +0200 Committer: Andrew Onishuk Committed: Mon Nov 23 17:32:39 2015 +0200 -- .../resource_management/TestPackageResource.py | 10 -- .../core/providers/package/__init__.py | 35 .../core/providers/package/apt.py | 18 +++--- .../core/providers/package/zypper.py| 9 +++-- .../core/resources/packaging.py | 7 5 files changed, 68 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/8e7eb7d1/ambari-agent/src/test/python/resource_management/TestPackageResource.py -- diff --git a/ambari-agent/src/test/python/resource_management/TestPackageResource.py b/ambari-agent/src/test/python/resource_management/TestPackageResource.py index 18b2d00..5868108 100644 --- a/ambari-agent/src/test/python/resource_management/TestPackageResource.py +++ b/ambari-agent/src/test/python/resource_management/TestPackageResource.py @@ -34,7 +34,8 @@ class TestPackageResource(TestCase): @patch.object(shell, "checked_call") @patch.object(System, "os_family", new = 'ubuntu') def test_action_install_ubuntu_update(self, shell_mock, call_mock): -call_mock.return_value= (1, None) +shell_mock.return_value= (0, '') +call_mock.return_value= (1, '') with Environment('/') as env: Package("some_package", ) @@ -43,13 +44,14 @@ class TestPackageResource(TestCase): call(['/usr/bin/apt-get', 'update', '-qq'], logoutput=False, sudo=True)]) shell_mock.assert_has_calls([call(['/usr/bin/apt-get', '-q', '-o', 'Dpkg::Options::=--force-confdef', - '--allow-unauthenticated', '--assume-yes', 'install', 'some-package'], logoutput=False, sudo=True)]) + '--allow-unauthenticated', '--assume-yes', 'install', 'some-package'], logoutput=False, sudo=True, env={'DEBIAN_FRONTEND': 'noninteractive'})]) @patch.object(shell, "call") @patch.object(shell, "checked_call") @patch.object(System, "os_family", new = 'ubuntu') def test_action_install_ubuntu(self, shell_mock, call_mock): -call_mock.side_effect = [(1, None), (0, None)] +call_mock.side_effect = [(1, ''), (0, '')] +shell_mock.return_value = (0, '') with Environment('/') as env: Package("some_package", ) @@ -124,6 +126,7 @@ class TestPackageResource(TestCase): @patch.object(shell, "checked_call") @patch.object(System, "os_family", new = 'suse') def test_action_install_suse(self, shell_mock): +shell_mock.return_value = (0,'') sys.modules['rpm'] = MagicMock() sys.modules['rpm'].TransactionSet.return_value = MagicMock() sys.modules['rpm'].TransactionSet.return_value.dbMatch.return_value = [{'name':'some_packages'}] @@ -208,6 +211,7 @@ class TestPackageResource(TestCase): @patch.object(shell, "checked_call") @patch.object(System, "os_family", new = 'suse') def test_action_remove_suse(self, shell_mock): +shell_mock.return_value = (0, '') sys.modules['rpm'] = MagicMock() sys.modules['rpm'].TransactionSet.return_value = MagicMock() sys.modules['rpm'].TransactionSet.return_value.dbMatch.return_value = [{'name':'some_package'}] http://git-wip-us.apache.org/repos/asf/ambari/blob/8e7eb7d1/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py -- diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py b/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py index 7e532bc..1fc4214 100644 --- a/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py +++ b/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py @@ -20,6 +20,8 @@ Ambari Agent """ +import subprocess +import time import re import logging @@ -27,7 +29,9 @@ from resource_management.core.base import Fail from resource_management.core.providers import Provider from resource_management.core.logger import Logger from resource_management.core.
[2/2] ambari git commit: AMBARI-14017. Service or component install fails when a non-ambari apt-get command is running (aonishuk)
AMBARI-14017. Service or component install fails when a non-ambari apt-get command is running (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2d8715a5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2d8715a5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2d8715a5 Branch: refs/heads/branch-2.1 Commit: 2d8715a5397e7fa8bd983885a19e9677e4c315b1 Parents: adf345b Author: Andrew Onishuk Authored: Mon Nov 23 17:32:42 2015 +0200 Committer: Andrew Onishuk Committed: Mon Nov 23 17:32:42 2015 +0200 -- .../resource_management/TestPackageResource.py | 10 -- .../core/providers/package/__init__.py | 35 .../core/providers/package/apt.py | 18 +++--- .../core/providers/package/zypper.py| 9 +++-- .../core/resources/packaging.py | 7 5 files changed, 68 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2d8715a5/ambari-agent/src/test/python/resource_management/TestPackageResource.py -- diff --git a/ambari-agent/src/test/python/resource_management/TestPackageResource.py b/ambari-agent/src/test/python/resource_management/TestPackageResource.py index 18b2d00..5868108 100644 --- a/ambari-agent/src/test/python/resource_management/TestPackageResource.py +++ b/ambari-agent/src/test/python/resource_management/TestPackageResource.py @@ -34,7 +34,8 @@ class TestPackageResource(TestCase): @patch.object(shell, "checked_call") @patch.object(System, "os_family", new = 'ubuntu') def test_action_install_ubuntu_update(self, shell_mock, call_mock): -call_mock.return_value= (1, None) +shell_mock.return_value= (0, '') +call_mock.return_value= (1, '') with Environment('/') as env: Package("some_package", ) @@ -43,13 +44,14 @@ class TestPackageResource(TestCase): call(['/usr/bin/apt-get', 'update', '-qq'], logoutput=False, sudo=True)]) shell_mock.assert_has_calls([call(['/usr/bin/apt-get', '-q', '-o', 'Dpkg::Options::=--force-confdef', - '--allow-unauthenticated', '--assume-yes', 'install', 'some-package'], logoutput=False, sudo=True)]) + '--allow-unauthenticated', '--assume-yes', 'install', 'some-package'], logoutput=False, sudo=True, env={'DEBIAN_FRONTEND': 'noninteractive'})]) @patch.object(shell, "call") @patch.object(shell, "checked_call") @patch.object(System, "os_family", new = 'ubuntu') def test_action_install_ubuntu(self, shell_mock, call_mock): -call_mock.side_effect = [(1, None), (0, None)] +call_mock.side_effect = [(1, ''), (0, '')] +shell_mock.return_value = (0, '') with Environment('/') as env: Package("some_package", ) @@ -124,6 +126,7 @@ class TestPackageResource(TestCase): @patch.object(shell, "checked_call") @patch.object(System, "os_family", new = 'suse') def test_action_install_suse(self, shell_mock): +shell_mock.return_value = (0,'') sys.modules['rpm'] = MagicMock() sys.modules['rpm'].TransactionSet.return_value = MagicMock() sys.modules['rpm'].TransactionSet.return_value.dbMatch.return_value = [{'name':'some_packages'}] @@ -208,6 +211,7 @@ class TestPackageResource(TestCase): @patch.object(shell, "checked_call") @patch.object(System, "os_family", new = 'suse') def test_action_remove_suse(self, shell_mock): +shell_mock.return_value = (0, '') sys.modules['rpm'] = MagicMock() sys.modules['rpm'].TransactionSet.return_value = MagicMock() sys.modules['rpm'].TransactionSet.return_value.dbMatch.return_value = [{'name':'some_package'}] http://git-wip-us.apache.org/repos/asf/ambari/blob/2d8715a5/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py -- diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py b/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py index 7e532bc..1fc4214 100644 --- a/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py +++ b/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py @@ -20,6 +20,8 @@ Ambari Agent """ +import subprocess +import time import re import logging @@ -27,7 +29,9 @@ from resource_management.core.base import Fail from resource_management.core.providers import Provider from resource_management.core.logger import Logger from resource_management.core.utils import suppress_stdout +from resource_management.core import shell +PACKAGE_MANAGER_LOCK_ACQUIRED = "Package manage
ambari git commit: AMBARI-13997. Ambari force-writing usernames to be lowercase in DB - fixing a bad merge. (mpapirkovskyy)
Repository: ambari Updated Branches: refs/heads/branch-2.1.2 8e731ab24 -> c510dc853 AMBARI-13997. Ambari force-writing usernames to be lowercase in DB - fixing a bad merge. (mpapirkovskyy) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/c510dc85 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c510dc85 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c510dc85 Branch: refs/heads/branch-2.1.2 Commit: c510dc8535a5e740b8da32087bedfa55d0899890 Parents: 8e731ab Author: Sumit Mohanty Authored: Mon Nov 23 07:22:19 2015 -0800 Committer: Sumit Mohanty Committed: Mon Nov 23 07:22:19 2015 -0800 -- .../main/java/org/apache/ambari/server/controller/AmbariServer.java | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/c510dc85/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java -- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java index 3f7fe50..e89c116 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java @@ -82,7 +82,6 @@ import org.apache.ambari.server.resources.ResourceManager; import org.apache.ambari.server.resources.api.rest.GetResource; import org.apache.ambari.server.scheduler.ExecutionScheduleManager; import org.apache.ambari.server.security.AmbariEntryPoint; -import org.apache.ambari.server.security.AmbariServerSecurityHeaderFilter; import org.apache.ambari.server.security.CertificateManager; import org.apache.ambari.server.security.SecurityFilter; import org.apache.ambari.server.security.authorization.AmbariAuthorizationFilter;
[1/2] ambari git commit: AMBARI-14013. Bunch of unit tests fail with JDK 1.8 (aonishuk)
Repository: ambari Updated Branches: refs/heads/branch-2.1 005ba8e93 -> adf345b4d refs/heads/trunk b639de038 -> 2b539ef17 AMBARI-14013. Bunch of unit tests fail with JDK 1.8 (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2b539ef1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2b539ef1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2b539ef1 Branch: refs/heads/trunk Commit: 2b539ef17d21c42690a3c98bf9e3198d31354b50 Parents: b639de0 Author: Andrew Onishuk Authored: Mon Nov 23 17:04:28 2015 +0200 Committer: Andrew Onishuk Committed: Mon Nov 23 17:04:28 2015 +0200 -- ambari-project/pom.xml | 2 +- ambari-server/pom.xml | 2 +- .../ExecutionCommandWrapperTest.java| 2 - .../services/ViewSubResourceServiceTest.java| 9 +-- .../serializers/JsonSerializerTest.java | 26 +++ .../controller/AuthToLocalBuilderTest.java | 35 ++ .../AlertTargetResourceProviderTest.java| 11 +-- .../BlueprintConfigurationProcessorTest.java| 13 +++- ...leRepositoryVersionResourceProviderTest.java | 4 +- .../StackDependencyResourceProviderTest.java| 4 +- .../internal/WidgetResourceProviderTest.java| 4 +- .../ganglia/GangliaPropertyProviderTest.java| 25 +-- .../server/metadata/RoleCommandOrderTest.java | 37 +++--- .../topology/BlueprintValidatorImplTest.java| 3 +- .../server/update/HostUpdateHelperTest.java | 12 +++- .../utils/CollectionPresentationUtils.java | 73 .../view/persistence/DataStoreImplTest.java | 2 +- .../InstanceValidationResultImplTest.java | 3 +- 18 files changed, 200 insertions(+), 67 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/2b539ef1/ambari-project/pom.xml -- diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml index cebbb2d..7410a7a 100644 --- a/ambari-project/pom.xml +++ b/ambari-project/pom.xml @@ -28,7 +28,7 @@ pom ${project.parent.basedir} -1.6.2 +1.6.3 http://git-wip-us.apache.org/repos/asf/ambari/blob/2b539ef1/ambari-server/pom.xml -- diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml index 5885693..4a37e24 100644 --- a/ambari-server/pom.xml +++ b/ambari-server/pom.xml @@ -1884,7 +1884,7 @@ org.easymock easymock - 3.3 + 3.4 test http://git-wip-us.apache.org/repos/asf/ambari/blob/2b539ef1/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java index 75e6f75..df033d1 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java @@ -69,7 +69,6 @@ public class ExecutionCommandWrapperTest { private static final String SERVICE_SITE_VAL1 = "ssv1"; private static final String SERVICE_SITE_VAL1_S = "ssv1_s"; private static final String SERVICE_SITE_VAL2 = "ssv2"; - private static final String SERVICE_SITE_VAL2_S = "ssv2_s"; private static final String SERVICE_SITE_VAL2_H = "ssv2_h"; private static final String SERVICE_SITE_VAL3 = "ssv3"; private static final String SERVICE_SITE_VAL4 = "ssv4"; @@ -117,7 +116,6 @@ public class ExecutionCommandWrapperTest { SERVICE_SITE_SERVICE = new HashMap(); SERVICE_SITE_SERVICE.put(SERVICE_SITE_NAME1, SERVICE_SITE_VAL1_S); -SERVICE_SITE_SERVICE.put(SERVICE_SITE_NAME2, SERVICE_SITE_VAL2_S); SERVICE_SITE_SERVICE.put(SERVICE_SITE_NAME5, SERVICE_SITE_VAL5_S); SERVICE_SITE_HOST = new HashMap(); http://git-wip-us.apache.org/repos/asf/ambari/blob/2b539ef1/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java index 25b477f..158ccf8 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java @@ -36
[2/2] ambari git commit: AMBARI-14013. Bunch of unit tests fail with JDK 1.8 (aonishuk)
AMBARI-14013. Bunch of unit tests fail with JDK 1.8 (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/adf345b4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/adf345b4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/adf345b4 Branch: refs/heads/branch-2.1 Commit: adf345b4ded8847a785fff656c0f6dc81575c3a7 Parents: 005ba8e Author: Andrew Onishuk Authored: Mon Nov 23 17:04:30 2015 +0200 Committer: Andrew Onishuk Committed: Mon Nov 23 17:04:30 2015 +0200 -- ambari-project/pom.xml | 2 +- ambari-server/pom.xml | 2 +- .../ExecutionCommandWrapperTest.java| 2 - .../services/ViewSubResourceServiceTest.java| 9 +-- .../serializers/JsonSerializerTest.java | 26 +++ .../controller/AuthToLocalBuilderTest.java | 35 ++ .../AlertTargetResourceProviderTest.java| 11 +-- .../BlueprintConfigurationProcessorTest.java| 13 +++- ...leRepositoryVersionResourceProviderTest.java | 4 +- .../StackDependencyResourceProviderTest.java| 4 +- .../internal/WidgetResourceProviderTest.java| 4 +- .../ganglia/GangliaPropertyProviderTest.java| 25 +-- .../server/metadata/RoleCommandOrderTest.java | 37 +++--- .../topology/BlueprintValidatorImplTest.java| 3 +- .../server/update/HostUpdateHelperTest.java | 12 +++- .../utils/CollectionPresentationUtils.java | 73 .../view/persistence/DataStoreImplTest.java | 2 +- .../InstanceValidationResultImplTest.java | 3 +- 18 files changed, 200 insertions(+), 67 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/adf345b4/ambari-project/pom.xml -- diff --git a/ambari-project/pom.xml b/ambari-project/pom.xml index f4ba977..4d0b3af 100644 --- a/ambari-project/pom.xml +++ b/ambari-project/pom.xml @@ -28,7 +28,7 @@ pom ${project.parent.basedir} -1.6.2 +1.6.3 http://git-wip-us.apache.org/repos/asf/ambari/blob/adf345b4/ambari-server/pom.xml -- diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml index c76629a..390b448 100644 --- a/ambari-server/pom.xml +++ b/ambari-server/pom.xml @@ -1872,7 +1872,7 @@ org.easymock easymock - 3.3 + 3.4 test http://git-wip-us.apache.org/repos/asf/ambari/blob/adf345b4/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java index 75e6f75..df033d1 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapperTest.java @@ -69,7 +69,6 @@ public class ExecutionCommandWrapperTest { private static final String SERVICE_SITE_VAL1 = "ssv1"; private static final String SERVICE_SITE_VAL1_S = "ssv1_s"; private static final String SERVICE_SITE_VAL2 = "ssv2"; - private static final String SERVICE_SITE_VAL2_S = "ssv2_s"; private static final String SERVICE_SITE_VAL2_H = "ssv2_h"; private static final String SERVICE_SITE_VAL3 = "ssv3"; private static final String SERVICE_SITE_VAL4 = "ssv4"; @@ -117,7 +116,6 @@ public class ExecutionCommandWrapperTest { SERVICE_SITE_SERVICE = new HashMap(); SERVICE_SITE_SERVICE.put(SERVICE_SITE_NAME1, SERVICE_SITE_VAL1_S); -SERVICE_SITE_SERVICE.put(SERVICE_SITE_NAME2, SERVICE_SITE_VAL2_S); SERVICE_SITE_SERVICE.put(SERVICE_SITE_NAME5, SERVICE_SITE_VAL5_S); SERVICE_SITE_HOST = new HashMap(); http://git-wip-us.apache.org/repos/asf/ambari/blob/adf345b4/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java -- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java index 25b477f..158ccf8 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java @@ -36,6 +36,7 @@ import javax.ws.rs.core.UriInfo; import java.lang.reflect.Method; import java.util.ArrayList; import java.ut
ambari git commit: AMBARI-14012. After upgrade, Ambari UI does not show versions tab
Repository: ambari Updated Branches: refs/heads/trunk c71a1016d -> b639de038 AMBARI-14012. After upgrade, Ambari UI does not show versions tab Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b639de03 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b639de03 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b639de03 Branch: refs/heads/trunk Commit: b639de0383304077daf0ae192bc705002dee527d Parents: c71a101 Author: Alex Antonenko Authored: Mon Nov 23 14:41:24 2015 +0200 Committer: Alex Antonenko Committed: Mon Nov 23 14:49:17 2015 +0200 -- .../app/views/main/admin/stack_upgrade/services_view.js | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/b639de03/ambari-web/app/views/main/admin/stack_upgrade/services_view.js -- diff --git a/ambari-web/app/views/main/admin/stack_upgrade/services_view.js b/ambari-web/app/views/main/admin/stack_upgrade/services_view.js index 75598a0..df0a05a 100644 --- a/ambari-web/app/views/main/admin/stack_upgrade/services_view.js +++ b/ambari-web/app/views/main/admin/stack_upgrade/services_view.js @@ -39,6 +39,9 @@ App.MainAdminStackServicesView = Em.View.extend({ didInsertElement: function () { if (!App.get('stackVersionsAvailable')) { + this.get('controller').loadStackVersionsToModel(true).done(function () { +App.set('stackVersionsAvailable', App.StackVersion.find().content.length > 0); + }); this.get('controller').loadRepositories(); } }, @@ -88,7 +91,7 @@ App.MainAdminStackServicesView = Em.View.extend({ }); var cur_group = reposGroup.findProperty('name', group.name); if (!cur_group) { -var cur_group = Ember.Object.create({ +cur_group = Ember.Object.create({ name: group.name, repositories: [] }); @@ -149,7 +152,7 @@ App.MainAdminStackServicesView = Em.View.extend({ * Handler when editing any repo group BaseUrl * @method editGroupLocalRepository */ - editGroupLocalRepository: function (event) { + editGroupLocalRepository: function () { var repos = this.get('allRepos'); repos.forEach(function (targetRepo) { targetRepo.set('undo', targetRepo.get('baseUrl') != targetRepo.get('originalBaseUrl')); @@ -196,9 +199,7 @@ App.MainAdminStackServicesView = Em.View.extend({ var self = this; var id = data.url.split('/')[10] + '-' + data.url.split('/')[8]; var targetRepo = this.get('allRepos').findProperty('id', id); -if (!targetRepo) { - return; -} else { +if (targetRepo) { App.ModalPopup.show({ header: Em.I18n.t('admin.cluster.repositories.popup.header.fail'), primary: Em.I18n.t('common.saveAnyway'), @@ -232,7 +233,6 @@ App.MainAdminStackServicesView = Em.View.extend({ */ doSaveRepoUrls: function (id, verifyBaseUrl) { var targetRepo = this.get('allRepos').findProperty('id', id); -var verifyBaseUrl = verifyBaseUrl; App.ajax.send({ name: 'wizard.advanced_repositories.valid_url', sender: this,