Java Code Examples for org.apache.flink.optimizer.dataproperties.LocalProperties#getOrdering()

The following examples show how to use org.apache.flink.optimizer.dataproperties.LocalProperties#getOrdering() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OperatorDescriptorDual.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
protected boolean checkSameOrdering(LocalProperties produced1, LocalProperties produced2, int numRelevantFields) {
	Ordering prod1 = produced1.getOrdering();
	Ordering prod2 = produced2.getOrdering();

	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;
}
 
Example 2
Source File: CoGroupRawDescriptor.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@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;
}
 
Example 3
Source File: OperatorDescriptorDual.java    From flink with Apache License 2.0 6 votes vote down vote up
protected boolean checkSameOrdering(LocalProperties produced1, LocalProperties produced2, int numRelevantFields) {
	Ordering prod1 = produced1.getOrdering();
	Ordering prod2 = produced2.getOrdering();

	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;
}
 
Example 4
Source File: CoGroupRawDescriptor.java    From flink with Apache License 2.0 6 votes vote down vote up
@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;
}
 
Example 5
Source File: OperatorDescriptorDual.java    From flink with Apache License 2.0 6 votes vote down vote up
protected boolean checkSameOrdering(LocalProperties produced1, LocalProperties produced2, int numRelevantFields) {
	Ordering prod1 = produced1.getOrdering();
	Ordering prod2 = produced2.getOrdering();

	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;
}
 
Example 6
Source File: CoGroupRawDescriptor.java    From flink with Apache License 2.0 6 votes vote down vote up
@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;
}