To build a custom serializer, implement the KeySerializerPlugin and/or the ValueSerializerPlugin interfaces.
To build a custom serializer that works with the HashIndex plug-in and query, the DataSerializer implementations must build and return a DataDescriptor. The DataDescriptor is defined in the {@link com.ibm.websphere.objectgrid.plugins.io.datadescriptor.DataDescriptor} class and package.
To enable eXtreme Scale to use a custom serializer plug-in:
backingMapPluginCollection
in the ObjectGrid deployment XML file.
The MapSerializer defines the KeyDataSerializer and ValueDataSerializer to use
for a map, and also allows defining relationships between maps.
The {@link com.ibm.websphere.objectgrid.plugins.io.BasicMapSerializerPlugin} can be used directly,
or can be extended to add additional configuration options.
copyMode="COPY_TO_BYTES"
<objectGridConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ibm.com/ws/objectgrid/config ../objectGrid.xsd" xmlns="http://ibm.com/ws/objectgrid/config"> <objectGrids> <objectGrid name="BookstoreGrid" txTimeout="5"> <backingMap name="Customer" pluginCollectionRef="plugin_Customer" copyMode="COPY_TO_BYTES" /> </objectGrid> </objectGrids> <backingMapPluginCollections> <backingMapPluginCollection id="plugin_Customer"> <bean id="MapSerializer" className="com.ibm.websphere.objectgrid.plugins.io.BasicMapSerializerPlugin"> <property name="keyDataSerializerClass" type="java.lang.String" value="com.ibm.websphere.samples.xs.serializer.proto.ProtoKeySerializer" /> <property name="keyProperties" type="java.lang.String" value="type=com.ibm.websphere.samples.xs.serializer.proto.DataObjects1$CustomerKey" /> <property name="valueDataSerializerClass" type="java.lang.String" value="com.ibm.websphere.samples.xs.serializer.proto.ProtoValueSerializer" /> <property name="valueProperties" type="java.lang.String" value="type=com.ibm.websphere.samples.xs.serializer.proto.DataObjects1$Customer" /> </bean> </backingMapPluginCollection> </backingMapPluginCollections> </objectGridConfig>