/** * Transforms a {@code UnionTransformation}. * * <p>This is easy, we only have to transform the inputs and return all the IDs in a list so * that downstream operations can connect to all upstream nodes. */ private <T> Collection<Integer> transformUnion(UnionTransformation<T> union) { List<StreamTransformation<T>> inputs = union.getInputs(); List<Integer> resultIds = new ArrayList<>(); for (StreamTransformation<T> input: inputs) { resultIds.addAll(transform(input)); } return resultIds; }
private <T> void validateSplitTransformation(StreamTransformation<T> input) { if (input instanceof SelectTransformation || input instanceof SplitTransformation) { throw new IllegalStateException("Consecutive multiple splits are not supported. Splits are deprecated. Please use side-outputs."); } else if (input instanceof SideOutputTransformation) { throw new IllegalStateException("Split after side-outputs are not supported. Splits are deprecated. Please use side-outputs."); } else if (input instanceof UnionTransformation) { for (StreamTransformation<T> transformation : ((UnionTransformation<T>) input).getInputs()) { validateSplitTransformation(transformation); } } else if (input instanceof PartitionTransformation) { validateSplitTransformation(((PartitionTransformation) input).getInput()); } else { return; } } }
/** * Transforms a {@code UnionTransformation}. * * <p>This is easy, we only have to transform the inputs and return all the IDs in a list so * that downstream operations can connect to all upstream nodes. */ private <T> Collection<Integer> transformUnion(UnionTransformation<T> union) { List<StreamTransformation<T>> inputs = union.getInputs(); List<Integer> resultIds = new ArrayList<>(); for (StreamTransformation<T> input: inputs) { resultIds.addAll(transform(input)); } return resultIds; }
/** * Transforms a {@code UnionTransformation}. * * <p>This is easy, we only have to transform the inputs and return all the IDs in a list so * that downstream operations can connect to all upstream nodes. */ private <T> Collection<Integer> transformUnion(UnionTransformation<T> union) { List<StreamTransformation<T>> inputs = union.getInputs(); List<Integer> resultIds = new ArrayList<>(); for (StreamTransformation<T> input: inputs) { resultIds.addAll(transform(input)); } return resultIds; }
/** * Transforms a {@code UnionTransformation}. * * <p>This is easy, we only have to transform the inputs and return all the IDs in a list so * that downstream operations can connect to all upstream nodes. */ private <T> Collection<Integer> transformUnion(UnionTransformation<T> union) { List<StreamTransformation<T>> inputs = union.getInputs(); List<Integer> resultIds = new ArrayList<>(); for (StreamTransformation<T> input: inputs) { resultIds.addAll(transform(input)); } return resultIds; }
private <T> void validateSplitTransformation(StreamTransformation<T> input) { if (input instanceof SelectTransformation || input instanceof SplitTransformation) { throw new IllegalStateException("Consecutive multiple splits are not supported. Splits are deprecated. Please use side-outputs."); } else if (input instanceof SideOutputTransformation) { throw new IllegalStateException("Split after side-outputs are not supported. Splits are deprecated. Please use side-outputs."); } else if (input instanceof UnionTransformation) { for (StreamTransformation<T> transformation : ((UnionTransformation<T>) input).getInputs()) { validateSplitTransformation(transformation); } } else if (input instanceof PartitionTransformation) { validateSplitTransformation(((PartitionTransformation) input).getInput()); } else { return; } } }