com.hazelcast.hibernate
Class VersionAwareMapMergePolicy

java.lang.Object
  extended by com.hazelcast.hibernate.VersionAwareMapMergePolicy
All Implemented Interfaces:
MapMergePolicy, DataSerializable

public class VersionAwareMapMergePolicy
extends Object
implements MapMergePolicy

A merge policy implementation to handle split brain remerges based on the timestamps stored in the values.


Constructor Summary
VersionAwareMapMergePolicy()
           
 
Method Summary
 Object merge(String mapName, EntryView mergingEntry, EntryView existingEntry)
          Returns the value of the entry after the merge of entries with the same key.
 void readData(ObjectDataInput in)
          Reads fields from the input stream
 void writeData(ObjectDataOutput out)
          Writes object fields to output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionAwareMapMergePolicy

public VersionAwareMapMergePolicy()
Method Detail

merge

public Object merge(String mapName,
                    EntryView mergingEntry,
                    EntryView existingEntry)
Description copied from interface: MapMergePolicy
Returns the value of the entry after the merge of entries with the same key. You should consider the case where existingEntry's value is null.

Specified by:
merge in interface MapMergePolicy
Parameters:
mapName - name of the map
mergingEntry - entry merging into the destination cluster
existingEntry - existing entry in the destination cluster
Returns:
final value of the entry. If returns null then entry will be removed.

writeData

public void writeData(ObjectDataOutput out)
               throws IOException
Description copied from interface: DataSerializable
Writes object fields to output stream

Specified by:
writeData in interface DataSerializable
Parameters:
out - output
Throws:
IOException

readData

public void readData(ObjectDataInput in)
              throws IOException
Description copied from interface: DataSerializable
Reads fields from the input stream

Specified by:
readData in interface DataSerializable
Parameters:
in - input
Throws:
IOException


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.