本文整理汇总了Java中org.apache.flink.api.common.operators.Ordering.getOrder方法的典型用法代码示例。如果您正苦于以下问题:Java Ordering.getOrder方法的具体用法?Java Ordering.getOrder怎么用?Java Ordering.getOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.api.common.operators.Ordering
的用法示例。
在下文中一共展示了Ordering.getOrder方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkSameOrdering
import org.apache.flink.api.common.operators.Ordering; //导入方法依赖的package包/类
protected boolean checkSameOrdering(GlobalProperties produced1, GlobalProperties produced2, int numRelevantFields) {
Ordering prod1 = produced1.getPartitioningOrdering();
Ordering prod2 = produced2.getPartitioningOrdering();
if (prod1 == null || prod2 == null) {
throw new CompilerException("The given properties do not meet this operators requirements.");
}
// check that order of fields is equivalent
if (!checkEquivalentFieldPositionsInKeyFields(
prod1.getInvolvedIndexes(), prod2.getInvolvedIndexes(), numRelevantFields)) {
return false;
}
// check that both inputs have the same directions of order
for (int i = 0; i < numRelevantFields; i++) {
if (prod1.getOrder(i) != prod2.getOrder(i)) {
return false;
}
}
return true;
}
示例2: GroupReduceWithCombineProperties
import org.apache.flink.api.common.operators.Ordering; //导入方法依赖的package包/类
public GroupReduceWithCombineProperties(FieldSet groupKeys, Ordering additionalOrderKeys, Partitioner<?> customPartitioner) {
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.customPartitioner = customPartitioner;
}
示例3: GroupReduceProperties
import org.apache.flink.api.common.operators.Ordering; //导入方法依赖的package包/类
public GroupReduceProperties(FieldSet groupKeys, Ordering additionalOrderKeys, Partitioner<?> customPartitioner) {
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.customPartitioner = customPartitioner;
}
示例4: GroupCombineProperties
import org.apache.flink.api.common.operators.Ordering; //导入方法依赖的package包/类
public GroupCombineProperties(FieldSet groupKeys, Ordering additionalOrderKeys) {
super(groupKeys);
// if we have an additional ordering, construct the ordering to have primarily the grouping fields
this.ordering = new Ordering();
for (Integer key : this.keyList) {
this.ordering.appendOrdering(key, null, Order.ANY);
}
// and next the additional order fields
if (additionalOrderKeys != null) {
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);
}
}
}
示例5: areCoFulfilled
import org.apache.flink.api.common.operators.Ordering; //导入方法依赖的package包/类
@Override
public boolean areCoFulfilled(RequestedLocalProperties requested1, RequestedLocalProperties requested2,
LocalProperties produced1, LocalProperties produced2) {
int numRelevantFields = this.keys1.size();
Ordering prod1 = produced1.getOrdering();
Ordering prod2 = produced2.getOrdering();
if (prod1 == null || prod2 == null || prod1.getNumberOfFields() < numRelevantFields
|| prod2.getNumberOfFields() < numRelevantFields) {
throw new CompilerException("The given properties do not meet this operators requirements.");
}
for (int i = 0; i < numRelevantFields; i++) {
if (prod1.getOrder(i) != prod2.getOrder(i)) {
return false;
}
}
return true;
}
示例6: GroupReduceWithCombineProperties
import org.apache.flink.api.common.operators.Ordering; //导入方法依赖的package包/类
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;
}
}
示例7: GroupReduceProperties
import org.apache.flink.api.common.operators.Ordering; //导入方法依赖的package包/类
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;
}
}
示例8: areCoFulfilled
import org.apache.flink.api.common.operators.Ordering; //导入方法依赖的package包/类
@Override
public boolean areCoFulfilled(RequestedLocalProperties requested1, RequestedLocalProperties requested2,
LocalProperties produced1, LocalProperties produced2)
{
int numRelevantFields = this.keys1.size();
Ordering prod1 = produced1.getOrdering();
Ordering prod2 = produced2.getOrdering();
if (prod1 == null || prod2 == null || prod1.getNumberOfFields() < numRelevantFields ||
prod2.getNumberOfFields() < prod2.getNumberOfFields())
{
throw new CompilerException("The given properties do not meet this operators requirements.");
}
for (int i = 0; i < numRelevantFields; i++) {
if (prod1.getOrder(i) != prod2.getOrder(i)) {
return false;
}
}
return true;
}
示例9: matchesOrderedPartitioning
import org.apache.flink.api.common.operators.Ordering; //导入方法依赖的package包/类
public boolean matchesOrderedPartitioning(Ordering o) {
if (this.partitioning == PartitioningProperty.RANGE_PARTITIONED) {
if (this.ordering.getNumberOfFields() > o.getNumberOfFields()) {
return false;
}
for (int i = 0; i < this.ordering.getNumberOfFields(); i++) {
if (!this.ordering.getFieldNumber(i).equals(o.getFieldNumber(i))) {
return false;
}
// if this one request no order, everything is good
final Order oo = o.getOrder(i);
final Order to = this.ordering.getOrder(i);
if (oo != Order.NONE) {
if (oo == Order.ANY) {
// if any order is requested, any not NONE order is good
if (to == Order.NONE) {
return false;
}
} else if (oo != to) {
// the orders must be equal
return false;
}
}
}
return true;
} else {
return false;
}
}
示例10: matchesOrderedPartitioning
import org.apache.flink.api.common.operators.Ordering; //导入方法依赖的package包/类
public boolean matchesOrderedPartitioning(Ordering o) {
if (this.partitioning == PartitioningProperty.RANGE_PARTITIONED) {
if (this.ordering.getNumberOfFields() > o.getNumberOfFields()) {
return false;
}
for (int i = 0; i < this.ordering.getNumberOfFields(); i++) {
if (this.ordering.getFieldNumber(i) != o.getFieldNumber(i)) {
return false;
}
// if this one request no order, everything is good
final Order oo = o.getOrder(i);
final Order to = this.ordering.getOrder(i);
if (oo != Order.NONE) {
if (oo == Order.ANY) {
// if any order is requested, any not NONE order is good
if (to == Order.NONE) {
return false;
}
} else if (oo != to) {
// the orders must be equal
return false;
}
}
}
return true;
} else {
return false;
}
}