public interface SplitBrainMergePolicy
| Modifier and Type | Method and Description |
|---|---|
<K,V> V |
merge(SplitBrainMergeEntryView<K,V> mergingEntry,
SplitBrainMergeEntryView<K,V> existingEntry)
Selects one of the merging and existing data structure entries to be merged.
|
void |
setSerializationService(SerializationService serializationService)
Sets the
SerializationService for this merge policy. |
<K,V> V merge(SplitBrainMergeEntryView<K,V> mergingEntry, SplitBrainMergeEntryView<K,V> existingEntry)
Note that as mentioned also in arguments, the SplitBrainMergeEntryView instance that represents
the existing data structure entry may be null if there is no existing entry for the specified key
in the SplitBrainMergeEntryView instance that represents the merging data structure entry.
K - the type of the keyV - the type of the valuemergingEntry - SplitBrainMergeEntryView instance that has the data structure entry to be mergedexistingEntry - SplitBrainMergeEntryView instance that has the existing data structure entry
or null if there is no existing data structure entryvoid setSerializationService(SerializationService serializationService)
SerializationService for this merge policy.
The keys and values of merging and existing SplitBrainMergeEntryViews are always in the in-memory format of the
backing data structure. This can be a serialized format, so the content cannot be processed without deserialization.
For most merge policies this will be fine, since the key or value are not used. If your implementation needs the
deserialized data, you can use SerializationService.toObject(Object) of the injected SerializationService.
The deserialization is not done eagerly for two main reasons:
InMemoryFormat.BINARY with a different
classpath on client and server. In this case a deserialization could throw a ClassNotFoundException.serializationService - the SerializationServiceCopyright © 2018. All Rights Reserved.