public interface StorageTypeAwareCacheMergePolicy extends CacheMergePolicy
CacheEntryView
will be not converted to their original types.
The motivation of this interface is that generally while merging cache entries, actual key and value are not checked. So there is no need to convert them to their original types.
In the worst case, the value is returned from the merge method as selected, which means that in all cases
the value is accessed. So although the conversion is done lazily, it will be processed at this point.
But by default, the key and value are converted to their original types
unless this StorageTypeAwareCacheMergePolicy
is used.
Another motivation for using this interface is that at server side
there is no need to locate classes of stored entries.
It means that entries can be put from client with BINARY
in-memory format and
classpath of client can be different from server.
So in this case, if entries are tried to convert to their original types while merging,
ClassNotFoundException
is thrown here.
As a result, both of performance and ClassNotFoundException
as mentioned above,
it is strongly recommended to use this interface if original values of key and values are not needed.
CacheMergePolicy
merge
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.