/** * @param index * @param type * @param order */ public Ordering(int index, Class<? extends Key<?>> type, Order order) { appendOrdering(index, type, order); }
/** * @param index * @param type * @param order */ public Ordering(int index, Class<? extends Key<?>> type, Order order) { appendOrdering(index, type, order); }
/** * Creates a new ordering the represents an ordering on a prefix of the fields. If the * exclusive index up to which to create the ordering is <code>0</code>, then there is * no resulting ordering and this method return <code>null</code>. * * @param exclusiveIndex The index (exclusive) up to which to create the ordering. * @return The new ordering on the prefix of the fields, or <code>null</code>, if the prefix is empty. */ public Ordering createNewOrderingUpToIndex(int exclusiveIndex) { if (exclusiveIndex == 0) { return null; } final Ordering newOrdering = new Ordering(); for (int i = 0; i < exclusiveIndex; i++) { newOrdering.appendOrdering(this.indexes.get(i), this.types.get(i), this.orders.get(i)); } return newOrdering; }
/** * Creates a new ordering the represents an ordering on a prefix of the fields. If the * exclusive index up to which to create the ordering is <code>0</code>, then there is * no resulting ordering and this method return <code>null</code>. * * @param exclusiveIndex The index (exclusive) up to which to create the ordering. * @return The new ordering on the prefix of the fields, or <code>null</code>, if the prefix is empty. */ public Ordering createNewOrderingUpToIndex(int exclusiveIndex) { if (exclusiveIndex == 0) { return null; } final Ordering newOrdering = new Ordering(); for (int i = 0; i < exclusiveIndex; i++) { newOrdering.appendOrdering(this.indexes.get(i), this.types.get(i), this.orders.get(i)); } return newOrdering; }
public static final Ordering createOrdering(FieldList fields) { final Ordering o = new Ordering(); for (int i = 0; i < fields.size(); i++) { o.appendOrdering(fields.get(i), null, Order.ANY); } return o; }
public static final Ordering createOrdering(FieldList fields, boolean[] directions) { final Ordering o = new Ordering(); for (int i = 0; i < fields.size(); i++) { o.appendOrdering(fields.get(i), null, directions == null || directions[i] ? Order.ASCENDING : Order.DESCENDING); } return o; }
public static final Ordering createOrdering(FieldList fields, boolean[] directions) { final Ordering o = new Ordering(); for (int i = 0; i < fields.size(); i++) { o.appendOrdering(fields.get(i), null, directions == null || directions[i] ? Order.ASCENDING : Order.DESCENDING); } return o; }
public static final Ordering createOrdering(FieldList fields) { final Ordering o = new Ordering(); for (int i = 0; i < fields.size(); i++) { o.appendOrdering(fields.get(i), null, Order.ANY); } return o; }
public GroupReduceWithCombineProperties(FieldSet groupKeys, Ordering additionalOrderKeys) { super(groupKeys); // if we have an additional ordering, construct the ordering to have primarily the grouping fields if (additionalOrderKeys != null) { this.ordering = new Ordering(); for (Integer key : this.keyList) { this.ordering.appendOrdering(key, null, Order.ANY); } // and next the additional order fields for (int i = 0; i < additionalOrderKeys.getNumberOfFields(); i++) { Integer field = additionalOrderKeys.getFieldNumber(i); Order order = additionalOrderKeys.getOrder(i); this.ordering.appendOrdering(field, additionalOrderKeys.getType(i), order); } } else { this.ordering = null; } }
public GroupReduceProperties(FieldSet groupKeys, Ordering additionalOrderKeys) { super(groupKeys); // if we have an additional ordering, construct the ordering to have primarily the grouping fields if (additionalOrderKeys != null) { this.ordering = new Ordering(); for (Integer key : this.keyList) { this.ordering.appendOrdering(key, null, Order.ANY); } // and next the additional order fields for (int i = 0; i < additionalOrderKeys.getNumberOfFields(); i++) { Integer field = additionalOrderKeys.getFieldNumber(i); Order order = additionalOrderKeys.getOrder(i); this.ordering.appendOrdering(field, additionalOrderKeys.getType(i), order); } } else { this.ordering = null; } }
public GroupReduceProperties(FieldSet groupKeys, Ordering additionalOrderKeys) { super(groupKeys); // if we have an additional ordering, construct the ordering to have primarily the grouping fields if (additionalOrderKeys != null) { this.ordering = new Ordering(); for (Integer key : this.keyList) { this.ordering.appendOrdering(key, null, Order.ANY); } // and next the additional order fields for (int i = 0; i < additionalOrderKeys.getNumberOfFields(); i++) { Integer field = additionalOrderKeys.getFieldNumber(i); Order order = additionalOrderKeys.getOrder(i); this.ordering.appendOrdering(field, additionalOrderKeys.getType(i), order); } } else { this.ordering = null; } }
public GroupReduceWithCombineProperties(FieldSet groupKeys, Ordering additionalOrderKeys) { super(groupKeys); // if we have an additional ordering, construct the ordering to have primarily the grouping fields if (additionalOrderKeys != null) { this.ordering = new Ordering(); for (Integer key : this.keyList) { this.ordering.appendOrdering(key, null, Order.ANY); } // and next the additional order fields for (int i = 0; i < additionalOrderKeys.getNumberOfFields(); i++) { Integer field = additionalOrderKeys.getFieldNumber(i); Order order = additionalOrderKeys.getOrder(i); this.ordering.appendOrdering(field, additionalOrderKeys.getType(i), order); } } else { this.ordering = null; } }
this.ordering1 = new Ordering(); for (Integer key : this.keys1) { this.ordering1.appendOrdering(key, null, Order.ANY); Integer field = additionalOrdering1.getFieldNumber(i); Order order = additionalOrdering1.getOrder(i); this.ordering1.appendOrdering(field, additionalOrdering1.getType(i), order); this.ordering2 = new Ordering(); for (Integer key : this.keys2) { this.ordering2.appendOrdering(key, null, Order.ANY); Integer field = additionalOrdering2.getFieldNumber(i); Order order = additionalOrdering2.getOrder(i); this.ordering2.appendOrdering(field, additionalOrdering2.getType(i), order);
this.ordering1 = new Ordering(); for (Integer key : this.keys1) { this.ordering1.appendOrdering(key, null, Order.ANY); Integer field = additionalOrdering1.getFieldNumber(i); Order order = additionalOrdering1.getOrder(i); this.ordering1.appendOrdering(field, additionalOrdering1.getType(i), order); this.ordering2 = new Ordering(); for (Integer key : this.keys2) { this.ordering2.appendOrdering(key, null, Order.ANY); Integer field = additionalOrdering2.getFieldNumber(i); Order order = additionalOrdering2.getOrder(i); this.ordering2.appendOrdering(field, additionalOrdering2.getType(i), order);
o.appendOrdering(sortKeyPositions[i], null, sortOrders[i]);
.appendOrdering(1, IntValue.class, Order.ASCENDING) .appendOrdering(2, IntValue.class, Order.DESCENDING), new TripleIntDistribution(Order.DESCENDING, Order.ASCENDING, Order.DESCENDING)); sink.setInput(source);