[infinispan-issues] [JBoss JIRA] (ISPN-11424) Deprecate StorageType Configuration in favour of MediaType

Dan Berindei (Jira) issues at jboss.org
Thu Mar 5 08:09:12 EST 2020


    [ https://issues.redhat.com/browse/ISPN-11424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13989924#comment-13989924 ] 

Dan Berindei commented on ISPN-11424:
-------------------------------------

I would really like some shortcuts to avoid writing {{application/x-protostream}} and {{application/x-java-serialized-object}} for both the key and the value.
Maybe it's enough to add some predefined cache templates for these two cases, but I'd prefer something like

{code:xml}
<encoding media-type="application/x-protostream"/>
{code}

which would be equivalent to

{code:xml}
<encoding key-media-type="application/x-protostream" value-media-type="application/x-protostream"/>
{code}

I would also like different attribute names for memory-based eviction vs. count-based eviction in the memory configuration /cc [~william.burns] 

E.g.

{code:xml}
<memory off-heap="true" max-size="12MB" when-full="exception"/>
{code}

{code:xml}
<memory off-heap="true" max-count="12MB" when-full="remove"/>
{code}


> Deprecate StorageType Configuration in favour of MediaType
> ----------------------------------------------------------
>
>                 Key: ISPN-11424
>                 URL: https://issues.redhat.com/browse/ISPN-11424
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 11.0.0.Alpha2
>            Reporter: Gustavo Fernandes
>            Assignee: Gustavo Fernandes
>            Priority: Major
>
> Currently caches have configuration to specify memory storing aspects that affects eviction, e.g.
> {code:xml}
> <memory>
>     <object size="20000"/>
> </memory>
> {code}
> {code:xml}
> <memory>
>    <off-heap size="10000000" eviction="MEMORY"/>
> </memory>
> {code}
> {code:xml}
> <memory>
>    <binary strategy="EXCEPTION" eviction="MEMORY" size="5000"/>
> </memory>
> {code}
> Each of those configurations affect the format that the data will be stored, being {{object}} the default on-heap storage, {{off-heap}} the {{byte[]}} out of heap storage and {{binary}} an on-heap format that mix {{byte[]}}, {{String}} and primitives.
> This ticket proposes to have the {{MediaType}} of the keys and values to dictate the storage format, and let the {{<memory>}} element to be responsible to choose between on-heap and off-heap storage, eliminating the {{Binary}} option altogether. The configuration would be something like:
> {code:xml}
> <!-- Default configuration, heap storage with POJOs -->
> <memory storage="heap">
>     <eviction size="20000"/>
> </memory>
> {code}
> {code:xml}
> <!-- Storing java serialized objects, on-heap -->
> <encoding>
>     <key media-type="application/x-java-serialized-object"/>
>     <value media-type="application/x-java-serialized-object"/>
> </encoding>
> <memory storage="heap">
>     <eviction size="20000"/>
> </memory>
> {code}
> {code:xml}
> <!-- Off-heap configuration, in protobuf format -->
> <encoding>
>     <key media-type="application/x-protostream"/>
>     <value media-type="application/x-protostream"/>
> </encoding>
> <memory storage="off-heap">
>     <eviction size="10000000" eviction="MEMORY"/>
> </memory>
> {code}



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the infinispan-issues mailing list