This interface represents a loader which is capable of handling a retry (redo) update
from ObjectGrid runtime.
A retryable loader takes a retry hint from the ObjectGrid runtime to know whether the
LogSequence passed to the Loader.batchUpdate(com.ibm.websphere.objectgrid.TxID, LogSequence)
method is a retry sequence or not. The retryable loader checks the retry indication Boolean by
calling TxID.getSlot(int) method. If the slot contains a Boolean.TRUE object, then
the log sequence is a retry sequence. If the slot contains a null object or a Boolean.FALSE,
then the log sequence is not a retry sequence. The slot number is set by ObjectGrid runtime using
setRetryIndicationSlot(int) method.
In some extreme cases, mainly during the failover, ObjectGrid could send the same log sequence twice
to the database to avoid data loss. This requires the loader to
be idempotent, which means whenever the
Loader.batchUpdate(com.ibm.websphere.objectgrid.TxID, LogSequence)
method is called twice with the same value, it gives the same result as if it were applied once.
A retryable loader is more than idempotent. ObjectGrid could send a different log sequence
to the database and requires the Loader treat it as a retry. In that case, the Loader has to
consult the database and take appropriate behaviors. Here are a few guidelines:
For an insert type log element, if the database already has that record, treat it as an update.
For an update type log element, if the database does not have that record, treat it as an insert.
For a delete type log element, if the database does not have that record, treat it as no-op.
Currently, the retry function is only enabled if the map is configured with write-behind enabled to ensure no
data will be lost. This will only work with synchronous replica. If the replica is asynchronous, there
could still be data loss.
set the slot number which contains whether the batch update from ObjectGrid is a
retry of previous transaction. The retryable loader checks the retry indication Boolean by
calling TxID.getSlot(int) method. If the slot contains a Boolean.TRUE object, then
the log sequence is a retry sequence. If the slot contains a null object or a Boolean.FALSE,
then the log sequence is not a retry sequence.