Java Code Examples for org.apache.flink.api.common.operators.Keys#isEmpty()

The following examples show how to use org.apache.flink.api.common.operators.Keys#isEmpty() . 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: JoinOperatorSetsBase.java    From flink with Apache License 2.0 6 votes vote down vote up
protected DefaultJoin<I1, I2> createDefaultJoin(Keys<I2> keys2) {
	if (keys2 == null) {
		throw new NullPointerException("The join keys may not be null.");
	}

	if (keys2.isEmpty()) {
		throw new InvalidProgramException("The join keys may not be empty.");
	}

	try {
		keys1.areCompatible(keys2);
	} catch (Keys.IncompatibleKeysException e) {
		throw new InvalidProgramException("The pair of join keys are not compatible with each other.", e);
	}
	return new DefaultJoin<>(input1, input2, keys1, keys2, joinHint, Utils.getCallLocationName(4), joinType);
}
 
Example 2
Source File: CoGroupOperator.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
/**
 * Intermediate step of a CoGroup transformation.
 *
 * <p>To continue the CoGroup transformation, provide a {@link org.apache.flink.api.common.functions.RichCoGroupFunction} by calling
 * {@link org.apache.flink.api.java.operators.CoGroupOperator.CoGroupOperatorSets.CoGroupOperatorSetsPredicate.CoGroupOperatorWithoutFunction#with(org.apache.flink.api.common.functions.CoGroupFunction)}.
 *
 */
private CoGroupOperatorWithoutFunction createCoGroupOperator(Keys<I2> keys2) {
	if (keys2 == null) {
		throw new NullPointerException();
	}

	if (keys2.isEmpty()) {
		throw new InvalidProgramException("The co-group keys must not be empty.");
	}
	try {
		keys1.areCompatible(keys2);
	} catch (IncompatibleKeysException ike) {
		throw new InvalidProgramException("The pair of co-group keys are not compatible with each other.", ike);
	}

	return new CoGroupOperatorWithoutFunction(keys2);
}
 
Example 3
Source File: JoinOperatorSetsBase.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
protected DefaultJoin<I1, I2> createDefaultJoin(Keys<I2> keys2) {
	if (keys2 == null) {
		throw new NullPointerException("The join keys may not be null.");
	}

	if (keys2.isEmpty()) {
		throw new InvalidProgramException("The join keys may not be empty.");
	}

	try {
		keys1.areCompatible(keys2);
	} catch (Keys.IncompatibleKeysException e) {
		throw new InvalidProgramException("The pair of join keys are not compatible with each other.", e);
	}
	return new DefaultJoin<>(input1, input2, keys1, keys2, joinHint, Utils.getCallLocationName(4), joinType);
}
 
Example 4
Source File: CoGroupOperator.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Intermediate step of a CoGroup transformation.
 *
 * <p>To continue the CoGroup transformation, provide a {@link org.apache.flink.api.common.functions.RichCoGroupFunction} by calling
 * {@link org.apache.flink.api.java.operators.CoGroupOperator.CoGroupOperatorSets.CoGroupOperatorSetsPredicate.CoGroupOperatorWithoutFunction#with(org.apache.flink.api.common.functions.CoGroupFunction)}.
 *
 */
private CoGroupOperatorWithoutFunction createCoGroupOperator(Keys<I2> keys2) {
	if (keys2 == null) {
		throw new NullPointerException();
	}

	if (keys2.isEmpty()) {
		throw new InvalidProgramException("The co-group keys must not be empty.");
	}
	try {
		keys1.areCompatible(keys2);
	} catch (IncompatibleKeysException ike) {
		throw new InvalidProgramException("The pair of co-group keys are not compatible with each other.", ike);
	}

	return new CoGroupOperatorWithoutFunction(keys2);
}
 
Example 5
Source File: CoGroupOperator.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Intermediate step of a CoGroup transformation.
 *
 * <p>To continue the CoGroup transformation, provide a {@link org.apache.flink.api.common.functions.RichCoGroupFunction} by calling
 * {@link org.apache.flink.api.java.operators.CoGroupOperator.CoGroupOperatorSets.CoGroupOperatorSetsPredicate.CoGroupOperatorWithoutFunction#with(org.apache.flink.api.common.functions.CoGroupFunction)}.
 *
 */
private CoGroupOperatorWithoutFunction createCoGroupOperator(Keys<I2> keys2) {
	if (keys2 == null) {
		throw new NullPointerException();
	}

	if (keys2.isEmpty()) {
		throw new InvalidProgramException("The co-group keys must not be empty.");
	}
	try {
		keys1.areCompatible(keys2);
	} catch (IncompatibleKeysException ike) {
		throw new InvalidProgramException("The pair of co-group keys are not compatible with each other.", ike);
	}

	return new CoGroupOperatorWithoutFunction(keys2);
}
 
Example 6
Source File: JoinOperatorSetsBase.java    From flink with Apache License 2.0 6 votes vote down vote up
protected DefaultJoin<I1, I2> createDefaultJoin(Keys<I2> keys2) {
	if (keys2 == null) {
		throw new NullPointerException("The join keys may not be null.");
	}

	if (keys2.isEmpty()) {
		throw new InvalidProgramException("The join keys may not be empty.");
	}

	try {
		keys1.areCompatible(keys2);
	} catch (Keys.IncompatibleKeysException e) {
		throw new InvalidProgramException("The pair of join keys are not compatible with each other.", e);
	}
	return new DefaultJoin<>(input1, input2, keys1, keys2, joinHint, Utils.getCallLocationName(4), joinType);
}
 
Example 7
Source File: CoGroupOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
private CoGroupOperatorWithoutFunction(Keys<I2> keys2) {
	if (keys2 == null) {
		throw new NullPointerException();
	}
	if (keys2.isEmpty()) {
		throw new InvalidProgramException("The co-group keys must not be empty.");
	}

	this.keys2 = keys2;

	this.groupSortKeyOrderFirst = new ArrayList<>();
	this.groupSortKeyOrderSecond = new ArrayList<>();
}
 
Example 8
Source File: JoinOperatorSetsBase.java    From flink with Apache License 2.0 5 votes vote down vote up
protected JoinOperatorSetsPredicateBase(Keys<I1> keys1) {
	if (keys1 == null) {
		throw new NullPointerException();
	}

	if (keys1.isEmpty()) {
		throw new InvalidProgramException("The join keys must not be empty.");
	}

	this.keys1 = keys1;
}
 
Example 9
Source File: CoGroupOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
private CoGroupOperatorWithoutFunction(Keys<I2> keys2) {
	if (keys2 == null) {
		throw new NullPointerException();
	}
	if (keys2.isEmpty()) {
		throw new InvalidProgramException("The co-group keys must not be empty.");
	}

	this.keys2 = keys2;

	this.groupSortKeyOrderFirst = new ArrayList<>();
	this.groupSortKeyOrderSecond = new ArrayList<>();
}
 
Example 10
Source File: CoGroupOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
private CoGroupOperatorSetsPredicate(Keys<I1> keys1) {
	if (keys1 == null) {
		throw new NullPointerException();
	}

	if (keys1.isEmpty()) {
		throw new InvalidProgramException("The co-group keys must not be empty.");
	}

	this.keys1 = keys1;
}
 
Example 11
Source File: Grouping.java    From flink with Apache License 2.0 5 votes vote down vote up
public Grouping(DataSet<T> set, Keys<T> keys) {
	if (set == null || keys == null) {
		throw new NullPointerException();
	}

	if (keys.isEmpty()) {
		throw new InvalidProgramException("The grouping keys must not be empty.");
	}

	this.inputDataSet = set;
	this.keys = keys;
}
 
Example 12
Source File: JoinOperatorSetsBase.java    From flink with Apache License 2.0 5 votes vote down vote up
protected JoinOperatorSetsPredicateBase(Keys<I1> keys1) {
	if (keys1 == null) {
		throw new NullPointerException();
	}

	if (keys1.isEmpty()) {
		throw new InvalidProgramException("The join keys must not be empty.");
	}

	this.keys1 = keys1;
}
 
Example 13
Source File: Grouping.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public Grouping(DataSet<T> set, Keys<T> keys) {
	if (set == null || keys == null) {
		throw new NullPointerException();
	}

	if (keys.isEmpty()) {
		throw new InvalidProgramException("The grouping keys must not be empty.");
	}

	this.inputDataSet = set;
	this.keys = keys;
}
 
Example 14
Source File: CoGroupOperator.java    From flink with Apache License 2.0 5 votes vote down vote up
private CoGroupOperatorSetsPredicate(Keys<I1> keys1) {
	if (keys1 == null) {
		throw new NullPointerException();
	}

	if (keys1.isEmpty()) {
		throw new InvalidProgramException("The co-group keys must not be empty.");
	}

	this.keys1 = keys1;
}
 
Example 15
Source File: Grouping.java    From flink with Apache License 2.0 5 votes vote down vote up
public Grouping(DataSet<T> set, Keys<T> keys) {
	if (set == null || keys == null) {
		throw new NullPointerException();
	}

	if (keys.isEmpty()) {
		throw new InvalidProgramException("The grouping keys must not be empty.");
	}

	this.inputDataSet = set;
	this.keys = keys;
}
 
Example 16
Source File: JoinOperatorSetsBase.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
protected JoinOperatorSetsPredicateBase(Keys<I1> keys1) {
	if (keys1 == null) {
		throw new NullPointerException();
	}

	if (keys1.isEmpty()) {
		throw new InvalidProgramException("The join keys must not be empty.");
	}

	this.keys1 = keys1;
}
 
Example 17
Source File: CoGroupOperator.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private CoGroupOperatorWithoutFunction(Keys<I2> keys2) {
	if (keys2 == null) {
		throw new NullPointerException();
	}
	if (keys2.isEmpty()) {
		throw new InvalidProgramException("The co-group keys must not be empty.");
	}

	this.keys2 = keys2;

	this.groupSortKeyOrderFirst = new ArrayList<>();
	this.groupSortKeyOrderSecond = new ArrayList<>();
}
 
Example 18
Source File: CoGroupOperator.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private CoGroupOperatorSetsPredicate(Keys<I1> keys1) {
	if (keys1 == null) {
		throw new NullPointerException();
	}

	if (keys1.isEmpty()) {
		throw new InvalidProgramException("The co-group keys must not be empty.");
	}

	this.keys1 = keys1;
}