public interface LogOps
The writeOp
and takeOp
methods can
be called under a transaction. For these methods an in-progress
transaction is indicated by a non-null txnId
parameter.
The txnId
is an identifier for a transaction.
Each unique transaction must have a unique identifier and all
write or take operations under the same transaction should
use the same identifier. The store does not interpret the
identifier in any way.
Note: Because the transaction identifier
must be unique, it can not be ServerTransaction.id
.
Instead this identifier is the Txn
ID.
When a transaction is closed, the prepareOp
,
commitOp
, and abortOp
methods are
passed the identifier (txnId
) for that transaction. If
prepareOp
is called and there is a restart, the
txnId
passed to the write and take operations will
be passed back to the server via the Recover.recoverWrite
and Recover.recoverTake
methods. Likewise the same
identifier will be passed to Recover.recoverTransaction
.
Modifier and Type | Method and Description |
---|---|
void |
abortOp(Long txnId)
Log a transaction
abort . |
void |
bootOp(long time,
long sessionId)
Log a server boot (first time start or any reactivation).
|
void |
cancelOp(Uuid cookie,
boolean expired)
Log a
cancel and entry or registration. |
void |
commitOp(Long txnId)
Log a transaction
commit or
prepareAndCommit . |
void |
joinStateOp(StorableObject state)
Log an update to the join state
|
void |
prepareOp(Long txnId,
StorableObject transaction)
Log a transaction
prepare . |
void |
registerOp(StorableResource registration,
String type,
StorableObject[] templates)
Log a
notify operation. |
void |
renewOp(Uuid cookie,
long expiration)
Log a
renew operation. |
void |
takeOp(Uuid[] cookies,
Long txnId)
Log a batch
take operation. |
void |
takeOp(Uuid cookie,
Long txnId)
Log a
take operation. |
void |
uuidOp(Uuid uuid)
Log the
Uuid that identifies the space as a whole. |
void |
writeOp(StorableResource[] entries,
Long txnId)
Log a batch
write operation. |
void |
writeOp(StorableResource entry,
Long txnId)
Log a
write operation. |
void bootOp(long time, long sessionId)
time
- stamp for this bootsessionId
- of this bootRecover.recoverSessionId(long)
void joinStateOp(StorableObject state)
state
- to be loggedRecover.recoverJoinState(com.sun.jini.outrigger.StoredObject)
void writeOp(StorableResource entry, Long txnId)
write
operation. If the operation was
performed under a transaction the txnId
is
the identifier for that transaction.entry
- to be loggedtxnId
- transaction identifier or null
if
no transaction is active for this writeRecover.recoverWrite(com.sun.jini.outrigger.StoredResource, java.lang.Long)
void writeOp(StorableResource[] entries, Long txnId)
write
operation. If the operation was
performed under a transaction the txnId
is
the identifier for that transaction.entries
- to be loggedtxnId
- transaction identifier or null
if
no transaction is active for this writeRecover.recoverWrite(com.sun.jini.outrigger.StoredResource, java.lang.Long)
void takeOp(Uuid cookie, Long txnId)
take
operation. If the operation was
performed under a transaction the txnId
is
the identifier for that transaction.cookie
- ID identifying the entry target to be takentxnId
- transaction identifier or null
if
no transaction is active for this takeRecover.recoverTake(net.jini.id.Uuid, java.lang.Long)
void takeOp(Uuid[] cookies, Long txnId)
take
operation. If the operation was
performed under a transaction the txnId
is
the identifier for that transaction.cookies
- IDs identifying the entries to be takentxnId
- transaction identifier or null
if
no transaction is active for this takeRecover.recoverTake(net.jini.id.Uuid, java.lang.Long)
void registerOp(StorableResource registration, String type, StorableObject[] templates)
notify
operation. Notifications under
transactions are lost at the end of the transaction, so the
only ones that are logged are those that are under no
transaction.registration
- to be loggedtype
- of registration, passed back via type
parameter of corresponding recoverRegister
calltemplates
- associated with this registrationRecover.recoverRegister(com.sun.jini.outrigger.StoredResource, java.lang.String, com.sun.jini.outrigger.StoredObject[])
void renewOp(Uuid cookie, long expiration)
renew
operation. We use the expiration, not
the extension, because we don't want to calculate the
expiration relative to when we read the log -- we want to use
the exact expiration granted.cookie
- ID of the entry or registration associated with this
renewexpiration
- timeStoredResource
void cancelOp(Uuid cookie, boolean expired)
cancel
and entry or registration. The entry or
registration associated with cookie
will no longer
be recoverable and may be removed from the log records.cookie
- ID of the entry or registration to cancelexpired
- is true if the cancel was due to a lease expirationvoid prepareOp(Long txnId, StorableObject transaction)
prepare
. If there is a restart
before either commitOp
or abortOp
is
called for the transaction identified by txnId
,
all write and take operations associated with txnId
will be recovered and Recover.recoverTransaction
called with the the same txnId
.txnId
- identifier of the transaction to be preparedtransaction
- object associated with this transactionRecover.recoverTransaction(java.lang.Long, com.sun.jini.outrigger.StoredObject)
void commitOp(Long txnId)
commit
or
prepareAndCommit
. The store will commit the write
and take operations associated with txnId
. A call
to prepareOP
is not required for
commitOp
to be called.txnId
- identifier of the transaction to be committedvoid abortOp(Long txnId)
abort
. Any write and take operations
associated with txnId
will no longer be recoverable
and may be removed from the log records.txnId
- identifier of the transaction to be abortedvoid uuidOp(Uuid uuid)
Uuid
that identifies the space as a whole.uuid
- The Uuid
to be stored.Recover.recoverUuid(net.jini.id.Uuid)
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.