Java Code Examples for org.apache.flink.api.java.typeutils.runtime.WritableComparator

The following examples show how to use org.apache.flink.api.java.typeutils.runtime.WritableComparator. These examples are extracted from open source projects. 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 Project: Flink-CEPplus   Source File: WritableTypeInfo.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@PublicEvolving
public TypeComparator<T> createComparator(boolean sortOrderAscending, ExecutionConfig executionConfig) {
	if (Comparable.class.isAssignableFrom(typeClass)) {
		return new WritableComparator(sortOrderAscending, typeClass);
	}
	else {
		throw new UnsupportedOperationException("Cannot create Comparator for " + typeClass.getCanonicalName() + ". " +
												"Class does not implement Comparable interface.");
	}
}
 
Example 2
Source Project: flink   Source File: WritableTypeInfo.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@PublicEvolving
public TypeComparator<T> createComparator(boolean sortOrderAscending, ExecutionConfig executionConfig) {
	if (Comparable.class.isAssignableFrom(typeClass)) {
		return new WritableComparator(sortOrderAscending, typeClass);
	}
	else {
		throw new UnsupportedOperationException("Cannot create Comparator for " + typeClass.getCanonicalName() + ". " +
												"Class does not implement Comparable interface.");
	}
}
 
Example 3
Source Project: flink   Source File: WritableTypeInfo.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@PublicEvolving
public TypeComparator<T> createComparator(boolean sortOrderAscending, ExecutionConfig executionConfig) {
	if (Comparable.class.isAssignableFrom(typeClass)) {
		return new WritableComparator(sortOrderAscending, typeClass);
	}
	else {
		throw new UnsupportedOperationException("Cannot create Comparator for " + typeClass.getCanonicalName() + ". " +
												"Class does not implement Comparable interface.");
	}
}