Tuning copy operations with the ObjectTransformer interface
The ObjectTransformer interface uses callbacks to the application to provide custom implementations of common and expensive operations such as object serialization and deep copies on objects.
The ObjectTransformer interface has been replaced by the DataSerializer plug-ins, which you can use to efficiently store arbitrary data in WebSphere® eXtreme Scale so that existing product APIs can efficiently interact with your data.
Overview
Copies of values are always made except when the NO_COPY mode is used. The default copying mechanism that is employed in eXtreme Scale is serialization, which is known as an expensive operation. The ObjectTransformer interface is used in this situation. The ObjectTransformer interface uses callbacks to the application to provide a custom implementation of common and expensive operations, such as object serialization and deep copies on objects.
public interface ObjectTransformer {
void serializeKey(Object key, ObjectOutputStream stream) throws IOException;
void serializeValue(Object value, ObjectOutputStream stream) throws IOException;
Object inflateKey(ObjectInputStream stream) throws IOException, ClassNotFoundException;
Object inflateValue(ObjectInputStream stream) throws IOException, ClassNotFoundException;
Object copyValue(Object value);
Object copyKey(Object key);
}
ObjectGrid g = ...;
BackingMap bm = g.defineMap("PERSON");
MyObjectTransformer ot = new MyObjectTransformer();
bm.setObjectTransformer(ot);