private SdkComponents(RunnerApi.Components components) { if (components == null) { return; } reservedIds.addAll(components.getTransformsMap().keySet()); reservedIds.addAll(components.getPcollectionsMap().keySet()); reservedIds.addAll(components.getWindowingStrategiesMap().keySet()); reservedIds.addAll(components.getCodersMap().keySet()); reservedIds.addAll(components.getEnvironmentsMap().keySet()); componentsBuilder.mergeFrom(components); }
/** Indicates whether the given pipeline has any unbounded PCollections. */ private static boolean hasUnboundedPCollections(RunnerApi.Pipeline pipeline) { checkNotNull(pipeline); Collection<RunnerApi.PCollection> pCollecctions = pipeline.getComponents().getPcollectionsMap().values(); // Assume that all PCollections are consumed at some point in the pipeline. return pCollecctions .stream() .anyMatch(pc -> pc.getIsBounded() == RunnerApi.IsBounded.Enum.UNBOUNDED); } }
/** Indicates whether the given pipeline has any unbounded PCollections. */ private static boolean hasUnboundedPCollections(RunnerApi.Pipeline pipeline) { checkNotNull(pipeline); Collection<RunnerApi.PCollection> pCollecctions = pipeline.getComponents().getPcollectionsMap().values(); // Assume that all PCollections are consumed at some point in the pipeline. return pCollecctions .stream() .anyMatch(pc -> pc.getIsBounded() == RunnerApi.IsBounded.Enum.UNBOUNDED); } }
result.getDeduplicatedComponents().getPcollectionsMap().keySet(), hasItems(introducedIds.toArray(new String[0]))); assertThat(
result.getDeduplicatedComponents().getPcollectionsMap().keySet(), hasItems(introduced.getTransform().getInputsMap().values().toArray(new String[0]))); result.getDeduplicatedComponents().getPcollectionsMap().keySet(), hasItems(stageOutputs.toArray(new String[0]))); assertThat(
result.getDeduplicatedComponents().getPcollectionsMap().keySet(), hasItems(introduced.getTransform().getInputsMap().values().toArray(new String[0]))); containsInAnyOrder(introducedOutputs.toArray(new String[0]))); assertThat( result.getDeduplicatedComponents().getPcollectionsMap().keySet(), hasItems(introducedOutputs.toArray(new String[0]))); assertThat(
equalTo(protoPipeline.getComponents().getEnvironmentsMap())); assertThat( fusedPipelineProto.getComponents().getPcollectionsMap(), equalTo(protoPipeline.getComponents().getPcollectionsMap()));
for (String pcollectionId : components.getPcollectionsMap().keySet()) { PCollection pc = components.getPcollectionsOrThrow(pcollectionId); checkArgument(
stage .getComponents() .getPcollectionsMap() .entrySet() .stream()