Java Code Examples for org.apache.flink.cep.pattern.Quantifier.ConsumingStrategy#NOT_FOLLOW

The following examples show how to use org.apache.flink.cep.pattern.Quantifier.ConsumingStrategy#NOT_FOLLOW . 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: Pattern.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
/**
 * Appends a new pattern to the existing one. The new pattern enforces that there is no event matching this pattern
 * between the preceding pattern and succeeding this one.
 *
 * <p><b>NOTE:</b> There has to be other pattern after this one.
 *
 * @param name Name of the new pattern
 * @return A new pattern which is appended to this one
 */
public Pattern<T, T> notFollowedBy(final String name) {
	if (quantifier.hasProperty(Quantifier.QuantifierProperty.OPTIONAL)) {
		throw new UnsupportedOperationException(
				"Specifying a pattern with an optional path to NOT condition is not supported yet. " +
				"You can simulate such pattern with two independent patterns, one with and the other without " +
				"the optional part.");
	}
	return new Pattern<>(name, this, ConsumingStrategy.NOT_FOLLOW, afterMatchSkipStrategy);
}
 
Example 2
Source File: Pattern.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Appends a new pattern to the existing one. The new pattern enforces that there is no event matching this pattern
 * between the preceding pattern and succeeding this one.
 *
 * <p><b>NOTE:</b> There has to be other pattern after this one.
 *
 * @param name Name of the new pattern
 * @return A new pattern which is appended to this one
 */
public Pattern<T, T> notFollowedBy(final String name) {
	if (quantifier.hasProperty(Quantifier.QuantifierProperty.OPTIONAL)) {
		throw new UnsupportedOperationException(
				"Specifying a pattern with an optional path to NOT condition is not supported yet. " +
				"You can simulate such pattern with two independent patterns, one with and the other without " +
				"the optional part.");
	}
	return new Pattern<>(name, this, ConsumingStrategy.NOT_FOLLOW, afterMatchSkipStrategy);
}
 
Example 3
Source File: Pattern.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Appends a new pattern to the existing one. The new pattern enforces that there is no event matching this pattern
 * between the preceding pattern and succeeding this one.
 *
 * <p><b>NOTE:</b> There has to be other pattern after this one.
 *
 * @param name Name of the new pattern
 * @return A new pattern which is appended to this one
 */
public Pattern<T, T> notFollowedBy(final String name) {
	if (quantifier.hasProperty(Quantifier.QuantifierProperty.OPTIONAL)) {
		throw new UnsupportedOperationException(
				"Specifying a pattern with an optional path to NOT condition is not supported yet. " +
				"You can simulate such pattern with two independent patterns, one with and the other without " +
				"the optional part.");
	}
	return new Pattern<>(name, this, ConsumingStrategy.NOT_FOLLOW, afterMatchSkipStrategy);
}
 
Example 4
Source File: Pattern.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
private void checkIfNoNotPattern() {
	if (quantifier.getConsumingStrategy() == ConsumingStrategy.NOT_FOLLOW ||
			quantifier.getConsumingStrategy() == ConsumingStrategy.NOT_NEXT) {
		throw new MalformedPatternException("Option not applicable to NOT pattern");
	}
}
 
Example 5
Source File: Pattern.java    From flink with Apache License 2.0 4 votes vote down vote up
private void checkIfNoNotPattern() {
	if (quantifier.getConsumingStrategy() == ConsumingStrategy.NOT_FOLLOW ||
			quantifier.getConsumingStrategy() == ConsumingStrategy.NOT_NEXT) {
		throw new MalformedPatternException("Option not applicable to NOT pattern");
	}
}
 
Example 6
Source File: Pattern.java    From flink with Apache License 2.0 4 votes vote down vote up
private void checkIfNoNotPattern() {
	if (quantifier.getConsumingStrategy() == ConsumingStrategy.NOT_FOLLOW ||
			quantifier.getConsumingStrategy() == ConsumingStrategy.NOT_NEXT) {
		throw new MalformedPatternException("Option not applicable to NOT pattern");
	}
}