Interface CustomHandler
- All Superinterfaces:
Handler
Handler for custom transactional operations. Undo operations are applied to roll back
transactions, and redo operations are applied by recovery and replication. A companion
instance for writing custom operations is provided by the
Database.customWriter
method.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
redo
(Transaction txn, byte[] message) Called to write or apply an idempotent redo operation.void
redo
(Transaction txn, byte[] message, long indexId, byte[] key) Called to write or apply an idempotent redo operation which locked an index key.void
undo
(Transaction txn, byte[] message) Called to write or apply an idempotent undo operation.
-
Method Details
-
redo
Called to write or apply an idempotent redo operation.- Parameters:
txn
- transaction the operation applies to; can be modifiedmessage
- custom message- Throws:
NullPointerException
- if transaction or message is nullIOException
-
redo
Called to write or apply an idempotent redo operation which locked an index key. The lock ensures that redo operations are ordered with respect to other transactions which locked the same key.- Parameters:
txn
- transaction the operation applies to; can be modifiedmessage
- custom messageindexId
- non-zero index for lock acquisitionkey
- non-null key which has been locked exclusively- Throws:
NullPointerException
- if transaction or message is nullIllegalStateException
- if index and key are provided but lock isn't heldIllegalArgumentException
- if index id is zero and key is non-nullIOException
-
undo
Called to write or apply an idempotent undo operation.- Parameters:
txn
- transaction the operation applies to; is null when rolling backmessage
- custom message- Throws:
NullPointerException
- if transaction or message is null; applicable to writer instance onlyIOException
-