/** * Sets the key order for these global properties. * * @param keyOrder * The key order to set. */ public void setOrdering(Ordering ordering) { this.ordering = ordering; this.groupedFields = ordering.getInvolvedIndexes(); }
public void setRangePartitioned(Ordering ordering) { this.partitioning = PartitioningProperty.RANGE_PARTITIONED; this.ordering = ordering; this.partitioningFields = ordering.getInvolvedIndexes(); }
public void setRangePartitioned(Ordering ordering) { this.partitioning = PartitioningProperty.RANGE_PARTITIONED; this.ordering = ordering; this.partitioningFields = ordering.getInvolvedIndexes(); }
/** * Sets the key order for these global properties. * * @param keyOrder * The key order to set. */ public void setOrdering(Ordering ordering) { this.ordering = ordering; this.groupedFields = ordering.getInvolvedIndexes(); }
/** * Filters these properties by what can be preserved by the given node when propagated down * to the given input. * * @param node The node representing the contract. * @param input The index of the input. * @return True, if any non-default value is preserved, false otherwise. */ public RequestedGlobalProperties filterByNodesConstantSet(OptimizerNode node, int input) { // check if partitioning survives if (this.ordering != null) { for (int col : this.ordering.getInvolvedIndexes()) { if (!node.isFieldConstant(input, col)) { return null; } } } else if (this.partitioningFields != null) { for (int colIndex : this.partitioningFields) { if (!node.isFieldConstant(input, colIndex)) { return null; } } } if (this.partitioning == PartitioningProperty.FULL_REPLICATION) { return null; } return this; }
/** * Filters these properties by what can be preserved by the given node when propagated down * to the given input. * * @param node The node representing the contract. * @param input The index of the input. * @return True, if any non-default value is preserved, false otherwise. */ public RequestedGlobalProperties filterByNodesConstantSet(OptimizerNode node, int input) { // check if partitioning survives if (this.ordering != null) { for (int col : this.ordering.getInvolvedIndexes()) { if (!node.isFieldConstant(input, col)) { return null; } } } else if (this.partitioningFields != null) { for (int colIndex : this.partitioningFields) { if (!node.isFieldConstant(input, colIndex)) { return null; } } } if (this.partitioning == PartitioningProperty.FULL_REPLICATION) { return null; } return this; }
/** * Parameterizes the local strategy fields of a channel such that the channel produces the desired local properties. * * @param channel The channel to parameterize. */ public void parameterizeChannel(Channel channel) { if (this.ordering != null) { channel.setLocalStrategy(LocalStrategy.SORT, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections()); } else if (this.groupedFields != null) { boolean[] dirs = new boolean[this.groupedFields.size()]; Arrays.fill(dirs, true); channel.setLocalStrategy(LocalStrategy.SORT, Utils.createOrderedFromSet(this.groupedFields), dirs); } }
for (int col : this.ordering.getInvolvedIndexes()) { if (!node.isFieldConstant(input, col)) { return new GlobalProperties();
/** * Parameterizes the local strategy fields of a channel such that the channel produces the desired local properties. * * @param channel The channel to parameterize. */ public void parameterizeChannel(Channel channel) { if (this.ordering != null) { channel.setLocalStrategy(LocalStrategy.SORT, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections()); } else if (this.groupedFields != null) { boolean[] dirs = new boolean[this.groupedFields.size()]; Arrays.fill(dirs, true); channel.setLocalStrategy(LocalStrategy.SORT, Utils.createOrderedFromSet(this.groupedFields), dirs); } }
for (int col : this.ordering.getInvolvedIndexes()) { if (!node.isFieldConstant(input, col)) { return new GlobalProperties();
final FieldList involvedIndexes = this.ordering.getInvolvedIndexes(); for (int i = 0; i < involvedIndexes.size(); i++) { if (!node.isFieldConstant(input, involvedIndexes.get(i))) { } else { no = this.ordering.createNewOrderingUpToIndex(i); ngf = no.getInvolvedIndexes();
final FieldList involvedIndexes = this.ordering.getInvolvedIndexes(); for (int i = 0; i < involvedIndexes.size(); i++) { if (!node.isFieldConstant(input, involvedIndexes.get(i))) { } else { no = this.ordering.createNewOrderingUpToIndex(i); ngf = no.getInvolvedIndexes();
/** * Filters these properties by what can be preserved through a user function's constant fields set. * Since interesting properties are filtered top-down, anything that partially destroys the ordering * makes the properties uninteresting. * * @param node The optimizer node that potentially modifies the properties. * @param input The input of the node which is relevant. * * @return True, if the resulting properties are non trivial. */ public RequestedLocalProperties filterByNodesConstantSet(OptimizerNode node, int input) { if (this.ordering != null) { final FieldList involvedIndexes = this.ordering.getInvolvedIndexes(); for (int i = 0; i < involvedIndexes.size(); i++) { if (!node.isFieldConstant(input, involvedIndexes.get(i))) { return null; } } } else if (this.groupedFields != null) { // check, whether the local key grouping is preserved for (Integer index : this.groupedFields) { if (!node.isFieldConstant(input, index)) { return null; } } } return this; }
/** * Filters these properties by what can be preserved through a user function's constant fields set. * Since interesting properties are filtered top-down, anything that partially destroys the ordering * makes the properties uninteresting. * * @param node The optimizer node that potentially modifies the properties. * @param input The input of the node which is relevant. * * @return True, if the resulting properties are non trivial. */ public RequestedLocalProperties filterByNodesConstantSet(OptimizerNode node, int input) { if (this.ordering != null) { final FieldList involvedIndexes = this.ordering.getInvolvedIndexes(); for (int i = 0; i < involvedIndexes.size(); i++) { if (!node.isFieldConstant(input, involvedIndexes.get(i))) { return null; } } } else if (this.groupedFields != null) { // check, whether the local key grouping is preserved for (Integer index : this.groupedFields) { if (!node.isFieldConstant(input, index)) { return null; } } } return this; }
public void parameterizeChannel(Channel channel, boolean globalDopChange) { switch (this.partitioning) { case RANDOM: channel.setShipStrategy(globalDopChange ? ShipStrategyType.PARTITION_RANDOM : ShipStrategyType.FORWARD); break; case FULL_REPLICATION: channel.setShipStrategy(ShipStrategyType.BROADCAST); break; case ANY_PARTITIONING: case HASH_PARTITIONED: channel.setShipStrategy(ShipStrategyType.PARTITION_HASH, Utils.createOrderedFromSet(this.partitioningFields)); break; case RANGE_PARTITIONED: channel.setShipStrategy(ShipStrategyType.PARTITION_RANGE, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections()); break; default: throw new CompilerException(); } }
public void parameterizeChannel(Channel channel, boolean globalDopChange) { switch (this.partitioning) { case RANDOM: channel.setShipStrategy(globalDopChange ? ShipStrategyType.PARTITION_RANDOM : ShipStrategyType.FORWARD); break; case FULL_REPLICATION: channel.setShipStrategy(ShipStrategyType.BROADCAST); break; case ANY_PARTITIONING: case HASH_PARTITIONED: channel.setShipStrategy(ShipStrategyType.PARTITION_HASH, Utils.createOrderedFromSet(this.partitioningFields)); break; case RANGE_PARTITIONED: channel.setShipStrategy(ShipStrategyType.PARTITION_RANGE, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections()); break; default: throw new CompilerException(); } }
case RANGE_PARTITIONED: channel.setShipStrategy(ShipStrategyType.PARTITION_RANGE, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections()); if(this.dataDistribution != null) { channel.setDataDistribution(this.dataDistribution);
case RANGE_PARTITIONED: channel.setShipStrategy(ShipStrategyType.PARTITION_RANGE, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections()); if(this.dataDistribution != null) { channel.setDataDistribution(this.dataDistribution);