|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.websphere.objectgrid.CopyMode
public final class CopyMode
This class is used to define the "copy" mode when the
setCopyMode
method of the BackingMap
interface is used.
The application is expected to pass one of the final static
variables that are defined in this class to the
setCopyMode
method.
BackingMap.setCopyMode(CopyMode, Class)
,
ObjectTransformer.copyValue(Object)
Field Summary | |
---|---|
static CopyMode |
COPY_ON_READ
The COPY_ON_READ mode improves performance over the COPY_ON_READ_AND_COMMIT mode by eliminating the copy that occurs when a transaction is committed. |
static CopyMode |
COPY_ON_READ_AND_COMMIT
The COPY_ON_READ_AND_COMMIT mode is the default mode. |
static CopyMode |
COPY_ON_WRITE
The COPY_ON_WRITE mode improves performance over the COPY_ON_READ_AND_COMMIT mode by eliminating the copy that occurs when ObjectMap.get is called for the
first time by a transaction for a given key. |
static CopyMode |
COPY_TO_BYTES
The COPY_TO_BYTES mode is similar to the COPY_ON_READ_AND_COMMIT mode in that it ensures that an application never has a reference to the value object that is in the BackingMap. |
static CopyMode |
COPY_TO_BYTES_RAW
When set, all ObjectMap APIs that return a SerializedValue rather than the
original Java Object, allowing access to the serialized form of the data, preventing inflation
of object into Java Object form. |
static CopyMode |
NO_COPY
The NO_COPY mode allows an application to promise that it will never modify a value object obtained using an ObjectMap.get method in exchange for performance improvements. |
Method Summary | |
---|---|
boolean |
isBytes()
Is the copy mode one of the copy modes that indicate copy to bytes? |
String |
toString()
Returns a string representation of the CopyMode . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final CopyMode COPY_ON_READ_AND_COMMIT
ObjectMap.get
method for a given key,
and it is the first access of the ObjectMap entry for that key, a copy
of the value is returned. When the transaction is committed, any changes
the application committed are copied to the BackingMap to ensure that
the application does not have reference to the committed value in the BackingMap.
public static final CopyMode COPY_ON_READ
ObjectMap.get
method returning a copy of the value rather than a reference
to the value to ensure that changes made by the application to the
value does not affect the BackingMap value until the transaction is committed.
However, when the transaction does commit, a copy of changes is not made.
Instead, the reference to the copy that was returned by ObjectMap.get
is stored in the BackingMap. This is the reason the application
must agree to destroy all map entry references once the transaction
is committed. If application fails to keep its promise, the application
could cause the data cached in BackingMap to become corrupted. If an
application is using this mode and it is having problems, then switch
to the COPY_ON_READ_AND_COMMIT mode to see if the problem still exists. If the problem
goes away, then more than likely the application is failing to destroy
all of its references after the transaction has committed.
public static final CopyMode COPY_ON_WRITE
ObjectMap.get
is called for the
first time by a transaction for a given key. Instead, the ObjectMap.get method
returns a proxy to the value rather than a direct reference to the value object
itself. The proxy ensures that a copy of the value is not made unless the
application calls a set method on the value interface that is passed on the
BackingMap.setCopyMode(CopyMode, Class)
method. Thus, the proxy provides
a "copy on write" implementation. When a transaction commits, the
BackingMap
examines the proxy to determine if any copy was made
as a result of a set method being called. If a copy was made, then the reference
to that copy is stored in the BackingMap. The big advantage of this mode
is a value is never copied on read or at commit when the transaction never
calls a set method to mutate the value.
BackingMap.setCopyMode(CopyMode, Class)
public static final CopyMode NO_COPY
public static final CopyMode COPY_TO_BYTES
A copy of the value is returned when an application transaction calls an
ObjectMap.get
method for a given key,
and it is the first time that the ObjectMap entry is accessed for that key.
When the transaction is committed, any changes
the application committed are copied to bytes in the BackingMap to ensure that
the application does not have reference to the committed value in the BackingMap.
public static final CopyMode COPY_TO_BYTES_RAW
SerializedValue
rather than the
original Java Object, allowing access to the serialized form of the data, preventing inflation
of object into Java Object form.
ValueDataSerializer
Method Detail |
---|
public String toString()
CopyMode
.
toString
in class Object
CopyMode
.public boolean isBytes()
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |