Class SerializerConfig


  • public class SerializerConfig
    extends java.lang.Object
    Serializer Config class that is passed to SerializerFactory for creating serializer.
    • Method Detail

      • isCreateGroup

        public boolean isCreateGroup()
      • getGroupId

        @NonNull
        public @NonNull java.lang.String getGroupId()
        Name of the group.
      • getNamespace

        public java.lang.String getNamespace()
        Namespace for the group.
      • isRegisterSchema

        public boolean isRegisterSchema()
        Flag to tell the serializer if the schema should be automatically registered before using it in EventStreamWriter. It is recommended to register keep this flag as false in production systems and manage schema evolution explicitly and in lockstep with upgrade of existing pravega client applications.
      • isRegisterCodec

        public boolean isRegisterCodec()
        Flag to tell the serializer if the codec should be automatically registered before using the serializer in EventStreamWriter. It is recommended to register keep this flag as false in production systems and manage codecTypes used by writers explicitly so that readers are aware of encodings used.
      • getEncoder

        public Encoder getEncoder()
        Codec to use for encoding events after serializing them.
      • isFailOnCodecMismatch

        public boolean isFailOnCodecMismatch()
        Tells the deserializer that if supplied decoder codecTypes do not match group codecTypes then fail and exit upfront. This is important when the writers have used a custom codec for which reader should be instantiated with a corresponding decoder otherwise it would fail to decode and read the data. As an example, if writer applications had implemented a custom encryption encoder which encrypted the data after serializing it, then the data will include an encoding id that will be resolved to the schema and the codec type name for the encryption codec. If the readers are not provided with a decoder for all data encoded with that codec type, it would fail to decode that data. This flag ensures that the readers check retrieve all the registered codec types with the registry service and fail if they are not instantiated with decoders for all the registered codec types. The default value for this is true.
      • isWriteEncodingHeader

        public boolean isWriteEncodingHeader()
        Flag to tell the serializer/deserializer if the encoding id should be added as a header with each event. By default this is set to true. If users choose to not add the header, they should do so in all their writer and reader applications for the given stream. Adding the event header is a requirement for following cases: If SerializationFormat.Avro is chosen for a group, the event header cannot be false. If streams can have multiple types of events, this cannot be false. If streams can multiple formats of events, this cannot be false.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object