@Deprecated public Collection<MaterialRevision> computeRevisionsForReporting(CaseInsensitiveString pipelineName, PipelineTimeline pipelineTimeline) { Pair<List<RootFanInNode>, List<DependencyFanInNode>> scmAndDepMaterialsChildren = getScmAndDepMaterialsChildren(); List<RootFanInNode> scmChildren = scmAndDepMaterialsChildren.first(); List<DependencyFanInNode> depChildren = scmAndDepMaterialsChildren.last(); if (depChildren.isEmpty()) { //No fanin required all are SCMs return null; } FanInGraphContext context = buildContext(pipelineTimeline); root.initialize(context); initChildren(depChildren, pipelineName, context); iterateAndMakeAllUniqueScmRevisionsForChildrenSame(depChildren, pipelineName, context); List<MaterialRevision> finalRevisionsForScmChildren = createFinalRevisionsForScmChildren(root.latestPipelineTimelineEntry(context), scmChildren, depChildren); List<MaterialRevision> finalRevisionsForDepChildren = createFinalRevisionsForDepChildren(depChildren); return CollectionUtils.union(finalRevisionsForScmChildren, finalRevisionsForDepChildren); }
public MaterialRevisions computeRevisions(MaterialRevisions actualRevisions, PipelineTimeline pipelineTimeline) { assertAllDirectDependenciesArePresentInInput(actualRevisions, pipelineName); Pair<List<RootFanInNode>, List<DependencyFanInNode>> scmAndDepMaterialsChildren = getScmAndDepMaterialsChildren(); List<RootFanInNode> scmChildren = scmAndDepMaterialsChildren.first(); List<DependencyFanInNode> depChildren = scmAndDepMaterialsChildren.last(); if (depChildren.isEmpty()) { //No fanin required all are SCMs return actualRevisions; } FanInGraphContext context = buildContext(pipelineTimeline); root.initialize(context); initChildren(depChildren, pipelineName, context); if (fanInEventListener != null) { fanInEventListener.iterationComplete(0, depChildren); } iterateAndMakeAllUniqueScmRevisionsForChildrenSame(depChildren, pipelineName, context); List<MaterialRevision> finalRevisionsForScmChildren = createFinalRevisionsForScmChildren(root.latestPipelineTimelineEntry(context), scmChildren, depChildren); List<MaterialRevision> finalRevisionsForDepChildren = createFinalRevisionsForDepChildren(depChildren); return new MaterialRevisions(CollectionUtils.union(getMaterialsFromCurrentPipeline(finalRevisionsForScmChildren, actualRevisions), finalRevisionsForDepChildren)); }
/** * Returns a {@link Collection} containing the union of the given {@link Collection}s. * * @param <E> the type of the elements in the collection * @param a the first collection, must be non-null * @param b the second collection, must be non-null * @return the union of the two collections */ public <E> Collection<E> union(Collection<E> a, Collection<E> b) { if (a == null) { return b; } else if (b == null) { return a; } return CollectionUtils.union(a, b); }
private Collection<? extends String> getEnvironmentTypeTopLevelVariables(String applicationId, String topologyVersion) { applicationService.checkAndGetApplication(applicationId); return Arrays.stream(EnvironmentType.values()) .map(environmentType -> editorFileService.loadEnvironmentTypeVariables(Csar.createId(applicationId, topologyVersion), environmentType).keySet()) .reduce(Sets.newHashSet(), (set, anotherSet) -> Sets.newHashSet(CollectionUtils.union(set, anotherSet))); }
private Collection<? extends String> getEnvironmentTopLevelVariables(String applicationId, String topologyVersion) { applicationService.checkAndGetApplication(applicationId); return Arrays.stream(applicationEnvironmentService.getAuthorizedByApplicationId(applicationId)) .map(env -> editorFileService.loadEnvironmentVariables(Csar.createId(applicationId, topologyVersion), env.getId()).keySet()) .reduce(Sets.newHashSet(), (set, anotherSet) -> Sets.newHashSet(CollectionUtils.union(set, anotherSet))); }
UpdatePermission.class, collectionName, CollectionUtils.union(CollectionUtils.emptyIfNull(collection), singleton), original); if (collection == null) {
UpdatePermission.class, collectionName, CollectionUtils.union(CollectionUtils.emptyIfNull(collection), singleton), original); if (collection == null) {