@Override public ActualProperties visitTableWriter(TableWriterNode node, List<ActualProperties> inputProperties) { ActualProperties properties = Iterables.getOnlyElement(inputProperties); if (properties.isCoordinatorOnly()) { return ActualProperties.builder() .global(coordinatorSingleStreamPartition()) .build(); } return ActualProperties.builder() .global(properties.isSingleNode() ? singleStreamPartition() : arbitraryPartition()) .build(); }
@Override public PlanWithProperties visitTableFinish(TableFinishNode node, PreferredProperties preferredProperties) { PlanWithProperties child = planChild(node, PreferredProperties.any()); // if the child is already a gathering exchange, don't add another if ((child.getNode() instanceof ExchangeNode) && ((ExchangeNode) child.getNode()).getType().equals(GATHER)) { return rebaseAndDeriveProperties(node, child); } if (!child.getProperties().isCoordinatorOnly()) { child = withDerivedProperties( gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()), child.getProperties()); } return rebaseAndDeriveProperties(node, child); }
@Override public ActualProperties visitTableWriter(TableWriterNode node, List<ActualProperties> inputProperties) { ActualProperties properties = Iterables.getOnlyElement(inputProperties); if (properties.isCoordinatorOnly()) { return ActualProperties.builder() .global(coordinatorSingleStreamPartition()) .build(); } return ActualProperties.builder() .global(properties.isSingleNode() ? singleStreamPartition() : arbitraryPartition()) .build(); }
@Override public PlanWithProperties visitTableFinish(TableFinishNode node, Context context) { PlanWithProperties child = planChild(node, context.withPreferredProperties(PreferredProperties.any())); // if the child is already a gathering exchange, don't add another if ((child.getNode() instanceof ExchangeNode) && ((ExchangeNode) child.getNode()).getType().equals(ExchangeNode.Type.GATHER)) { return rebaseAndDeriveProperties(node, child); } if (!child.getProperties().isSingleNode() || !child.getProperties().isCoordinatorOnly()) { child = withDerivedProperties( gatheringExchange(idAllocator.getNextId(), child.getNode()), child.getProperties()); } return rebaseAndDeriveProperties(node, child); }