/** * Registers the given type with the serialization stack. If the type is eventually * serialized as a POJO, then the type is registered with the POJO serializer. If the * type ends up being serialized with Kryo, then it will be registered at Kryo to make * sure that only tags are written. * * @param type The class of the type to register. */ public void registerType(Class<?> type) { if (type == null) { throw new NullPointerException("Cannot register null type class."); } TypeInformation<?> typeInfo = TypeExtractor.createTypeInfo(type); if (typeInfo instanceof PojoTypeInfo) { config.registerPojoType(type); } else { config.registerKryoType(type); } }
/** * Registers the given type with the serialization stack. If the type is * eventually serialized as a POJO, then the type is registered with the * POJO serializer. If the type ends up being serialized with Kryo, then it * will be registered at Kryo to make sure that only tags are written. * * @param type * The class of the type to register. */ public void registerType(Class<?> type) { if (type == null) { throw new NullPointerException("Cannot register null type class."); } TypeInformation<?> typeInfo = TypeExtractor.createTypeInfo(type); if (typeInfo instanceof PojoTypeInfo) { config.registerPojoType(type); } else { config.registerKryoType(type); } }
@Override protected TypeSerializer<TestUserInterface> createSerializer() { // only register one of the two child classes ExecutionConfig conf = new ExecutionConfig(); conf.registerPojoType(TestUserClass2.class); TypeSerializer<TestUserInterface> serializer = type.createSerializer(conf); assert(serializer instanceof KryoSerializer); return serializer; }
@Override protected TypeSerializer<TestUserClassBase> createSerializer() { // only register one of the three child classes, the third child class is NO POJO ExecutionConfig conf = new ExecutionConfig(); conf.registerPojoType(TestUserClass1.class); TypeSerializer<TestUserClassBase> serializer = type.createSerializer(conf); assert(serializer instanceof PojoSerializer); return serializer; }
public void testReconfigureDifferentSubclassRegistrationOrder() throws Exception { ExecutionConfig executionConfig = new ExecutionConfig(); executionConfig.registerPojoType(SubTestUserClassA.class); executionConfig.registerPojoType(SubTestUserClassB.class); executionConfig.registerPojoType(SubTestUserClassB.class); // test with B registered before A executionConfig.registerPojoType(SubTestUserClassA.class);
newExecutionConfig.registerPojoType(SubTestUserClassA.class); newExecutionConfig.registerPojoType(SubTestUserClassB.class); pojoSerializer = (PojoSerializer<TestUserClass>) type.createSerializer(newExecutionConfig);
/** * Registers the given type with the serialization stack. If the type is eventually * serialized as a POJO, then the type is registered with the POJO serializer. If the * type ends up being serialized with Kryo, then it will be registered at Kryo to make * sure that only tags are written. * * @param type The class of the type to register. */ public void registerType(Class<?> type) { if (type == null) { throw new NullPointerException("Cannot register null type class."); } TypeInformation<?> typeInfo = TypeExtractor.createTypeInfo(type); if (typeInfo instanceof PojoTypeInfo) { config.registerPojoType(type); } else { config.registerKryoType(type); } }
/** * Registers the given type with the serialization stack. If the type is eventually * serialized as a POJO, then the type is registered with the POJO serializer. If the * type ends up being serialized with Kryo, then it will be registered at Kryo to make * sure that only tags are written. * * @param type The class of the type to register. */ public void registerType(Class<?> type) { if (type == null) { throw new NullPointerException("Cannot register null type class."); } TypeInformation<?> typeInfo = TypeExtractor.createTypeInfo(type); if (typeInfo instanceof PojoTypeInfo) { config.registerPojoType(type); } else { config.registerKryoType(type); } }
/** * Registers the given type with the serialization stack. If the type is * eventually serialized as a POJO, then the type is registered with the * POJO serializer. If the type ends up being serialized with Kryo, then it * will be registered at Kryo to make sure that only tags are written. * * @param type * The class of the type to register. */ public void registerType(Class<?> type) { if (type == null) { throw new NullPointerException("Cannot register null type class."); } TypeInformation<?> typeInfo = TypeExtractor.createTypeInfo(type); if (typeInfo instanceof PojoTypeInfo) { config.registerPojoType(type); } else { config.registerKryoType(type); } }
/** * Registers the given type with the serialization stack. If the type is eventually * serialized as a POJO, then the type is registered with the POJO serializer. If the * type ends up being serialized with Kryo, then it will be registered at Kryo to make * sure that only tags are written. * * @param type The class of the type to register. */ public void registerType(Class<?> type) { if (type == null) { throw new NullPointerException("Cannot register null type class."); } TypeInformation<?> typeInfo = TypeExtractor.createTypeInfo(type); if (typeInfo instanceof PojoTypeInfo) { config.registerPojoType(type); } else { config.registerKryoType(type); } }
/** * Registers the given type with the serialization stack. If the type is * eventually serialized as a POJO, then the type is registered with the * POJO serializer. If the type ends up being serialized with Kryo, then it * will be registered at Kryo to make sure that only tags are written. * * @param type * The class of the type to register. */ public void registerType(Class<?> type) { if (type == null) { throw new NullPointerException("Cannot register null type class."); } TypeInformation<?> typeInfo = TypeExtractor.createTypeInfo(type); if (typeInfo instanceof PojoTypeInfo) { config.registerPojoType(type); } else { config.registerKryoType(type); } }
/** * Registers the given type with the serialization stack. If the type is * eventually serialized as a POJO, then the type is registered with the * POJO serializer. If the type ends up being serialized with Kryo, then it * will be registered at Kryo to make sure that only tags are written. * * @param type * The class of the type to register. */ public void registerType(Class<?> type) { if (type == null) { throw new NullPointerException("Cannot register null type class."); } TypeInformation<?> typeInfo = TypeExtractor.createTypeInfo(type); if (typeInfo instanceof PojoTypeInfo) { config.registerPojoType(type); } else { config.registerKryoType(type); } }
/** * Registers the given type with the serialization stack. If the type is * eventually serialized as a POJO, then the type is registered with the * POJO serializer. If the type ends up being serialized with Kryo, then it * will be registered at Kryo to make sure that only tags are written. * * @param type * The class of the type to register. */ public void registerType(Class<?> type) { if (type == null) { throw new NullPointerException("Cannot register null type class."); } TypeInformation<?> typeInfo = TypeExtractor.createTypeInfo(type); if (typeInfo instanceof PojoTypeInfo) { config.registerPojoType(type); } else { config.registerKryoType(type); } }