com.ibm.websphere.objectgrid.plugins.io
Interface ValueDataSerializer.Mergeable
- All Superinterfaces:
- DataSerializer, DataSerializer.DataAttributeInflatable, ValueDataSerializer
- Enclosing interface:
- ValueDataSerializer
public static interface ValueDataSerializer.Mergeable
- extends ValueDataSerializer
ValueDataSerializers implement the optional Mergeable interface when it is
possible that the clients or replicas in the grid may have multiple versions
of the serializer. The Mergeable interface allows the VersionDataSerializer
to merge the two serialized forms when the data is updated, to prevent
data loss.
- Since:
- 7.1.1
mergeDataObjects
ValueDataSerializer.Mergeable.MergeType mergeDataObjects(DataObjectContext ctx,
XsDataInputStream existingDataObjectInputStream,
XsDataInputStream updatedDataObjectInputStream,
XsDataOutputStream mergedDataObjectOutputStream)
throws IOException
- This method is invoked when updating a cache value. If the existing object contains
data that the current DataSerializer doesn't recognize, the two data streams can be combined
into the resulting merged data output stream.
Do not store or use the data streams beyond the confines of this
method call. The data streams are owned by the WebSphere eXtreme Scale
framework and my be closed, pooled or reused as required.
- Parameters:
ctx
- the context of the method call.existingDataObjectInputStream
- the data input stream to read the old object, produced from
DataSerializer.serializeDataObject(DataObjectContext, Object, XsDataOutputStream)
before the update.
Must not be null.updatedDataObjectInputStream
- the data input stream to read the old object, produced from
DataSerializer.serializeDataObject(DataObjectContext, Object, XsDataOutputStream)
before the update.
Must not be null.mergedDataObjectOutputStream
- the data output stream to store the merged object, compatible with
that produced from DataSerializer.serializeDataObject(DataObjectContext, Object, XsDataOutputStream)
for the merged object. Ignored if the return value is not ValueDataSerializer.Mergeable.MergeType.MERGE
.
Must not be null.
- Returns:
- One of the MergeType attributes representing the form
of the object merge. Data in the mergedObject stream is ignored
if the value is other than
ValueDataSerializer.Mergeable.MergeType.MERGE
- Throws:
IOException
- thrown if there is a problem reading or writing the data.
© Copyright International Business Machines Corp 2005,2012. All rights reserved.