[infinispan-dev] Cache Store Marshalling

Ryan Emerson remerson at redhat.com
Tue Mar 14 07:26:26 EDT 2017


Hi All,

Currently the CacheWriterInterceptor utilises the internal marshaller for marshalling entries before they are sent to the configured cache stores. This causes several problems [1], most notably that changes to the internal marshaller make stored data incompatible across Infinispan versions. 

I propose that we decouple the internal and store marshaller. To allow 9.x versions to remain compatible, we should default to the internal marshaller (until 10.x at least), but optionally allow users to specify a custom StreamingMarshaller implementation as part of their PersistenceConfiguration. As we already have the protostuff and kryo bridges, users would specify an enum for the marshaller they want to use as well as an optional class string if a custom implementation is required. So for example:

enum StoreMarshaller {
   CUSTOM,
   INTERNAL,
   KRYO
   PROTOSTUFF;
}

new ConfigurationBuilder()
    .persistence()
        .marshaller(StoreMarshaller.CUSTOM)
        .marshallerClass("org.example.Marshaller")
         ...

Finally, Gustavo brought flatbuffers[2] to my attention which could be a good option to provide for users as one of the default StoreMarshaller implementations.

WDYT?

Cheers
Ryan

[1] https://docs.google.com/document/d/1PR0eYgjhqXUR5w03npS7TdOs2KDZjfdMh0au8XAsyJY
[2] https://google.github.io/flatbuffers/


More information about the infinispan-dev mailing list