You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ad...@apache.org on 2017/11/16 19:39:15 UTC
[3/3] ambari git commit: AMBARI-22297. componentInfos should be keyed
by component name, not service name (adoroszlai)
AMBARI-22297. componentInfos should be keyed by component name, not service name (adoroszlai)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/35834d5f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/35834d5f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/35834d5f
Branch: refs/heads/branch-feature-AMBARI-14714-blueprintv2
Commit: 35834d5f91967eaebac099e134c4b5b9b11e900c
Parents: 1a05827
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Thu Nov 16 20:36:28 2017 +0100
Committer: Attila Doroszlai <ad...@hortonworks.com>
Committed: Thu Nov 16 20:36:28 2017 +0100
----------------------------------------------------------------------
.../server/controller/StackV2Factory.java | 21 ++++++++------------
1 file changed, 8 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/35834d5f/ambari-server/src/main/java/org/apache/ambari/server/controller/StackV2Factory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackV2Factory.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackV2Factory.java
index 5d3bcfd..201fcb1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackV2Factory.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackV2Factory.java
@@ -18,16 +18,12 @@
package org.apache.ambari.server.controller;
-import static java.util.AbstractMap.SimpleImmutableEntry;
-
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.stream.Collectors;
import org.apache.ambari.server.AmbariException;
import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
@@ -97,19 +93,18 @@ public class StackV2Factory {
}
private void getComponentInfos(StackData stackData) {
- List<Map.Entry<String, String>> componentServices = stackData.serviceComponents.entrySet().stream().
- flatMap(e -> e.getValue().stream().map( v -> new SimpleImmutableEntry<>(e.getKey(), v))).
- collect(Collectors.toList());
- componentServices.forEach( componentService -> {
+ stackData.componentService.forEach( (componentName, serviceName) -> {
try {
- ComponentInfo componentInfo = controller.getAmbariMetaInfo().getComponent(stackData.stackName,
- stackData.stackVersion, componentService.getKey(), componentService.getValue());
+ ComponentInfo componentInfo = controller.getAmbariMetaInfo().getComponent(stackData.stackName, stackData.stackVersion, serviceName, componentName);
if (null != componentInfo) {
- stackData.componentInfos.put(componentService.getKey(), componentInfo);
+ stackData.componentInfos.put(componentName, componentInfo);
+ } else {
+ LOG.debug("No component info for service: {}, component: {}, stack name: {}, stack version: {}",
+ serviceName, componentName, stackData.stackName, stackData.stackVersion);
}
} catch (AmbariException e) {
- LOG.debug("No component info for service: {}, component: {}, stack name: {}, stack version: {}, Exception: {}",
- componentService.getKey(), componentService.getValue(), stackData.stackName, stackData.stackVersion, e);
+ LOG.debug("No component info for service: {}, component: {}, stack name: {}, stack version: {}",
+ serviceName, componentName, stackData.stackName, stackData.stackVersion, e);
}
});
}