Class SerializerConfigImpl

    • Constructor Detail

      • SerializerConfigImpl

        public SerializerConfigImpl()
    • Method Detail

      • addDefaultKryoSerializer

        public <T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> void addDefaultKryoSerializer​(Class<?> type,
                                                                                                                T serializer)
        Adds a new Kryo default serializer to the Runtime.

        Note that the serializer instance must be serializable (as defined by java.io.Serializable), because it may be distributed to the worker nodes by java serialization.

        Specified by:
        addDefaultKryoSerializer in interface SerializerConfig
        Parameters:
        type - The class of the types serialized with the given serializer.
        serializer - The serializer to use.
      • addDefaultKryoSerializer

        public void addDefaultKryoSerializer​(Class<?> type,
                                             Class<? extends com.esotericsoftware.kryo.Serializer<?>> serializerClass)
        Adds a new Kryo default serializer to the Runtime.
        Specified by:
        addDefaultKryoSerializer in interface SerializerConfig
        Parameters:
        type - The class of the types serialized with the given serializer.
        serializerClass - The class of the serializer to use.
      • registerTypeWithKryoSerializer

        public <T extends com.esotericsoftware.kryo.Serializer<?> & Serializable> void registerTypeWithKryoSerializer​(Class<?> type,
                                                                                                                      T serializer)
        Registers the given type with a Kryo Serializer.

        Note that the serializer instance must be serializable (as defined by java.io.Serializable), because it may be distributed to the worker nodes by java serialization.

        Specified by:
        registerTypeWithKryoSerializer in interface SerializerConfig
        Parameters:
        type - The class of the types serialized with the given serializer.
        serializer - The serializer to use.
      • registerTypeWithKryoSerializer

        public void registerTypeWithKryoSerializer​(Class<?> type,
                                                   Class<? extends com.esotericsoftware.kryo.Serializer> serializerClass)
        Registers the given Serializer via its class as a serializer for the given type at the KryoSerializer.
        Specified by:
        registerTypeWithKryoSerializer in interface SerializerConfig
        Parameters:
        type - The class of the types serialized with the given serializer.
        serializerClass - The class of the serializer to use.
      • registerPojoType

        public void registerPojoType​(Class<?> 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.
        Specified by:
        registerPojoType in interface SerializerConfig
        Parameters:
        type - The class of the type to register.
      • registerKryoType

        public void registerKryoType​(Class<?> 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.
        Specified by:
        registerKryoType in interface SerializerConfig
        Parameters:
        type - The class of the type to register.
      • hasGenericTypesDisabled

        public boolean hasGenericTypesDisabled()
        Checks whether generic types are supported. Generic types are types that go through Kryo during serialization.

        Generic types are enabled by default.

        Specified by:
        hasGenericTypesDisabled in interface SerializerConfig
      • setGenericTypes

        public void setGenericTypes​(boolean genericTypes)
        Description copied from interface: SerializerConfig
        The method will be converted to private in the next Flink major version after removing its deprecated caller methods.
        Specified by:
        setGenericTypes in interface SerializerConfig
      • isForceKryoEnabled

        public boolean isForceKryoEnabled()
        Returns whether Kryo is the serializer for POJOs.
        Specified by:
        isForceKryoEnabled in interface SerializerConfig
      • setForceKryo

        public void setForceKryo​(boolean forceKryo)
        Description copied from interface: SerializerConfig
        The method will be converted to private in the next Flink major version after removing its deprecated caller methods.
        Specified by:
        setForceKryo in interface SerializerConfig
      • isForceAvroEnabled

        public boolean isForceAvroEnabled()
        Returns whether the Apache Avro is the serializer for POJOs.
        Specified by:
        isForceAvroEnabled in interface SerializerConfig
      • setForceAvro

        public void setForceAvro​(boolean forceAvro)
        Description copied from interface: SerializerConfig
        The method will be converted to private in the next Flink major version after removing its deprecated caller methods.
        Specified by:
        setForceAvro in interface SerializerConfig
      • setForceKryoAvro

        public void setForceKryoAvro​(boolean forceKryoAvro)
        Description copied from interface: SerializerConfig
        The method will be converted to private in the next Flink major version after removing its deprecated caller methods.
        Specified by:
        setForceKryoAvro in interface SerializerConfig
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • configure

        public void configure​(ReadableConfig configuration,
                              ClassLoader classLoader)
        Sets all relevant options contained in the ReadableConfig such as e.g. PipelineOptions.FORCE_KRYO.

        It will change the value of a setting only if a corresponding option was set in the configuration. If a key is not present, the current value of a field will remain untouched.

        Specified by:
        configure in interface SerializerConfig
        Parameters:
        configuration - a configuration to read the values from
        classLoader - a class loader to use when loading classes