flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializer.java
/**
	 * Build and return a snapshot of the serializer's parameters and currently cached serializers.
	 */
Build and return a snapshot of the serializer's parameters and currently cached serializers.
Build and return a snapshot of the serializer ' s parameters and currently cached serializers .
private static <T> PojoSerializerConfigSnapshot<T> buildConfigSnapshot(
			Class<T> pojoType,
			LinkedHashMap<Class<?>, Integer> registeredSubclassesToTags,
			TypeSerializer<?>[] registeredSubclassSerializers,
			Field[] fields,
			TypeSerializer<?>[] fieldSerializers,
			HashMap<Class<?>, TypeSerializer<?>> nonRegisteredSubclassSerializerCache) {
		final LinkedHashMap<String, Tuple2<TypeSerializer<?>, TypeSerializerConfigSnapshot>> fieldToSerializerConfigSnapshots =
			new LinkedHashMap<>(fields.length);
		for (int i = 0; i < fields.length; i++) {
			fieldToSerializerConfigSnapshots.put(
				fields[i].getName(),
				new Tuple2<TypeSerializer<?>, TypeSerializerConfigSnapshot>(fieldSerializers[i], fieldSerializers[i].snapshotConfiguration()));
		}
		final LinkedHashMap<Class<?>, Tuple2<TypeSerializer<?>, TypeSerializerConfigSnapshot>> registeredSubclassesToSerializerConfigSnapshots =
				new LinkedHashMap<>(registeredSubclassesToTags.size());
		for (Map.Entry<Class<?>, Integer> entry : registeredSubclassesToTags.entrySet()) {
			registeredSubclassesToSerializerConfigSnapshots.put(
					entry.getKey(),
					new Tuple2<TypeSerializer<?>, TypeSerializerConfigSnapshot>(
						registeredSubclassSerializers[entry.getValue()],
						registeredSubclassSerializers[entry.getValue()].snapshotConfiguration()));
		}
		final HashMap<Class<?>, Tuple2<TypeSerializer<?>, TypeSerializerConfigSnapshot>> nonRegisteredSubclassesToSerializerConfigSnapshots =
				new LinkedHashMap<>(nonRegisteredSubclassSerializerCache.size());
		for (Map.Entry<Class<?>, TypeSerializer<?>> entry : nonRegisteredSubclassSerializerCache.entrySet()) {
			nonRegisteredSubclassesToSerializerConfigSnapshots.put(
				entry.getKey(),
				new Tuple2<TypeSerializer<?>, TypeSerializerConfigSnapshot>(
					entry.getValue(),
					entry.getValue().snapshotConfiguration()));
		}
		return new PojoSerializerConfigSnapshot<>(
				pojoType,
				fieldToSerializerConfigSnapshots,
				registeredSubclassesToSerializerConfigSnapshots,
				nonRegisteredSubclassesToSerializerConfigSnapshots);
	}
private static < T > PojoSerializerConfigSnapshot < T > buildConfigSnapshot ( Class < T > pojoType , LinkedHashMap < Class < ? > , Integer > registeredSubclassesToTags , TypeSerializer < ? > [ ] registeredSubclassSerializers , Field [ ] fields , TypeSerializer < ? > [ ] fieldSerializers , HashMap < Class < ? > , TypeSerializer < ? > > nonRegisteredSubclassSerializerCache ) { final LinkedHashMap < String , Tuple2 < TypeSerializer < ? > , TypeSerializerConfigSnapshot > > fieldToSerializerConfigSnapshots = new LinkedHashMap < > ( fields . length ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { fieldToSerializerConfigSnapshots . put ( fields [ i ] . getName ( ) , new Tuple2 < TypeSerializer < ? > , TypeSerializerConfigSnapshot > ( fieldSerializers [ i ] , fieldSerializers [ i ] . snapshotConfiguration ( ) ) ) ; } final LinkedHashMap < Class < ? > , Tuple2 < TypeSerializer < ? > , TypeSerializerConfigSnapshot > > registeredSubclassesToSerializerConfigSnapshots = new LinkedHashMap < > ( registeredSubclassesToTags . size ( ) ) ; for ( Map . Entry < Class < ? > , Integer > entry : registeredSubclassesToTags . entrySet ( ) ) { registeredSubclassesToSerializerConfigSnapshots . put ( entry . getKey ( ) , new Tuple2 < TypeSerializer < ? > , TypeSerializerConfigSnapshot > ( registeredSubclassSerializers [ entry . getValue ( ) ] , registeredSubclassSerializers [ entry . getValue ( ) ] . snapshotConfiguration ( ) ) ) ; } final HashMap < Class < ? > , Tuple2 < TypeSerializer < ? > , TypeSerializerConfigSnapshot > > nonRegisteredSubclassesToSerializerConfigSnapshots = new LinkedHashMap < > ( nonRegisteredSubclassSerializerCache . size ( ) ) ; for ( Map . Entry < Class < ? > , TypeSerializer < ? > > entry : nonRegisteredSubclassSerializerCache . entrySet ( ) ) { nonRegisteredSubclassesToSerializerConfigSnapshots . put ( entry . getKey ( ) , new Tuple2 < TypeSerializer < ? > , TypeSerializerConfigSnapshot > ( entry . getValue ( ) , entry . getValue ( ) . snapshotConfiguration ( ) ) ) ; } return new PojoSerializerConfigSnapshot < > ( pojoType , fieldToSerializerConfigSnapshots , registeredSubclassesToSerializerConfigSnapshots , nonRegisteredSubclassesToSerializerConfigSnapshots ) ; }
Build and return a snapshot of the serializer's parameters and currently cached serializers.
Build and return a snapshot of the serializer ' s parameters and currently cached serializers .