Java Code Examples for org.apache.flink.util.LinkedOptionalMap#size()

The following examples show how to use org.apache.flink.util.LinkedOptionalMap#size() . 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: PojoSerializerSnapshot.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
/**
 * Checks whether the new {@link PojoSerializer} has new or removed fields compared to the previous one.
 */
private static boolean newPojoHasNewOrRemovedFields(
		LinkedOptionalMap<Field, TypeSerializerSnapshot<?>> fieldSerializerSnapshots,
		PojoSerializer<?> newPojoSerializer) {
	int numRemovedFields = fieldSerializerSnapshots.absentKeysOrValues().size();
	int numPreexistingFields = fieldSerializerSnapshots.size() - numRemovedFields;

	boolean hasRemovedFields = numRemovedFields > 0;
	boolean hasNewFields = newPojoSerializer.getFields().length - numPreexistingFields > 0;
	return hasRemovedFields || hasNewFields;
}
 
Example 2
Source File: PojoSerializerSnapshot.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Checks whether the new {@link PojoSerializer} has new or removed fields compared to the previous one.
 */
private static boolean newPojoHasNewOrRemovedFields(
		LinkedOptionalMap<Field, TypeSerializerSnapshot<?>> fieldSerializerSnapshots,
		PojoSerializer<?> newPojoSerializer) {
	int numRemovedFields = fieldSerializerSnapshots.absentKeysOrValues().size();
	int numPreexistingFields = fieldSerializerSnapshots.size() - numRemovedFields;

	boolean hasRemovedFields = numRemovedFields > 0;
	boolean hasNewFields = newPojoSerializer.getFields().length - numPreexistingFields > 0;
	return hasRemovedFields || hasNewFields;
}
 
Example 3
Source File: PojoSerializerSnapshot.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Checks whether the new {@link PojoSerializer} has new or removed fields compared to the previous one.
 */
private static boolean newPojoHasNewOrRemovedFields(
		LinkedOptionalMap<Field, TypeSerializerSnapshot<?>> fieldSerializerSnapshots,
		PojoSerializer<?> newPojoSerializer) {
	int numRemovedFields = fieldSerializerSnapshots.absentKeysOrValues().size();
	int numPreexistingFields = fieldSerializerSnapshots.size() - numRemovedFields;

	boolean hasRemovedFields = numRemovedFields > 0;
	boolean hasNewFields = newPojoSerializer.getFields().length - numPreexistingFields > 0;
	return hasRemovedFields || hasNewFields;
}
 
Example 4
Source File: PojoSerializerSnapshot.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
/**
 * Checks whether the previous serializer, represented by this snapshot, has
 * non-registered subclasses.
 */
private static boolean previousSerializerHasNonRegisteredSubclasses(
		LinkedOptionalMap<Class<?>, TypeSerializerSnapshot<?>> nonRegisteredSubclassSerializerSnapshots) {
	return nonRegisteredSubclassSerializerSnapshots.size() > 0;
}
 
Example 5
Source File: PojoSerializerSnapshot.java    From flink with Apache License 2.0 4 votes vote down vote up
/**
 * Checks whether the previous serializer, represented by this snapshot, has
 * non-registered subclasses.
 */
private static boolean previousSerializerHasNonRegisteredSubclasses(
		LinkedOptionalMap<Class<?>, TypeSerializerSnapshot<?>> nonRegisteredSubclassSerializerSnapshots) {
	return nonRegisteredSubclassSerializerSnapshots.size() > 0;
}
 
Example 6
Source File: PojoSerializerSnapshot.java    From flink with Apache License 2.0 4 votes vote down vote up
/**
 * Checks whether the previous serializer, represented by this snapshot, has
 * non-registered subclasses.
 */
private static boolean previousSerializerHasNonRegisteredSubclasses(
		LinkedOptionalMap<Class<?>, TypeSerializerSnapshot<?>> nonRegisteredSubclassSerializerSnapshots) {
	return nonRegisteredSubclassSerializerSnapshots.size() > 0;
}