@Test void testDetermineImpact2() { Impact change = createSingleEntityImpact("A", null); Set<Impact> registeredIndexActions = ImmutableSet.of(change); when(dependencyModel.getEntityTypesDependentOn("A")).thenReturn(Stream.of("A", "B", "C")); Set<Impact> actual = indexingStrategy.determineImpact(registeredIndexActions, dependencyModel); assertEquals( of( createWholeRepositoryImpact("A"), createWholeRepositoryImpact("B"), createWholeRepositoryImpact("C")), actual); }
Set<Impact> determineImpact(Set<Impact> changes, IndexDependencyModel dependencyModel) { Stopwatch sw = Stopwatch.createStarted(); Map<Boolean, List<Impact>> split = changes.stream().collect(partitioningBy(Impact::isWholeRepository)); ImmutableSet<String> allEntityTypeIds = changes.stream().map(Impact::getEntityTypeId).collect(toImmutableSet()); Set<String> dependentEntities = allEntityTypeIds.stream() .flatMap(dependencyModel::getEntityTypesDependentOn) .collect(toImmutableSet()); Set<Impact> result = collectResult(split.get(false), split.get(true), dependentEntities); if (LOG.isDebugEnabled()) { LOG.debug("Determined {} necessary actions in {}", result.size(), sw); } return result; }
IndexingStrategy { Set<Impact> determineImpact(Set<Impact> changes, IndexDependencyModel dependencyModel) { Stopwatch sw = Stopwatch.createStarted(); Map<Boolean, List<Impact>> split = changes.stream().collect(partitioningBy(Impact::isWholeRepository)); ImmutableSet<String> allEntityTypeIds = changes.stream().map(Impact::getEntityTypeId).collect(toImmutableSet()); Set<String> dependentEntities = allEntityTypeIds.stream() .flatMap(dependencyModel::getEntityTypesDependentOn) .collect(toImmutableSet()); Set<Impact> result = collectResult(split.get(false), split.get(true), dependentEntities); if (LOG.isDebugEnabled()) { LOG.debug("Determined {} necessary actions in {}", result.size(), sw); } return result; } }
IndexingStrategy { Set<Impact> determineImpact(Set<Impact> changes, IndexDependencyModel dependencyModel) { Stopwatch sw = Stopwatch.createStarted(); Map<Boolean, List<Impact>> split = changes.stream().collect(partitioningBy(Impact::isWholeRepository)); ImmutableSet<String> allEntityTypeIds = changes.stream().map(Impact::getEntityTypeId).collect(toImmutableSet()); Set<String> dependentEntities = allEntityTypeIds.stream() .flatMap(dependencyModel::getEntityTypesDependentOn) .collect(toImmutableSet()); Set<Impact> result = collectResult(split.get(false), split.get(true), dependentEntities); if (LOG.isDebugEnabled()) { LOG.debug("Determined {} necessary actions in {}", result.size(), sw); } return result; }  }
IndexingStrategy { Set<Impact> determineImpact(Set<Impact> changes, IndexDependencyModel dependencyModel) { Stopwatch sw = Stopwatch.createStarted(); Map<Boolean, List<Impact>> split = changes.stream().collect(partitioningBy(Impact::isWholeRepository)); ImmutableSet<String> allEntityTypeIds = changes.stream().map(Impact::getEntityTypeId).collect(toImmutableSet()); Set<String> dependentEntities = allEntityTypeIds.stream() .flatMap(dependencyModel::getEntityTypesDependentOn) .collect(toImmutableSet()); Set<Impact> result = collectResult(split.get(false), split.get(true), dependentEntities); if (LOG.isDebugEnabled()) { LOG.debug("Determined {} necessary actions in {}", result.size(), sw); } return result; }   }
IndexingStrategy { Set<Impact> determineImpact(Set<Impact> changes, IndexDependencyModel dependencyModel) { Stopwatch sw = Stopwatch.createStarted(); Map<Boolean, List<Impact>> split = changes.stream().collect(partitioningBy(Impact::isWholeRepository)); ImmutableSet<String> allEntityTypeIds = changes.stream().map(Impact::getEntityTypeId).collect(toImmutableSet()); Set<String> dependentEntities = allEntityTypeIds.stream() .flatMap(dependencyModel::getEntityTypesDependentOn) .collect(toImmutableSet()); Set<Impact> result = collectResult(split.get(false), split.get(true), dependentEntities); if (LOG.isDebugEnabled()) { LOG.debug("Determined {} necessary actions in {}", result.size(), sw); } return result; }    }