public class TransactionManager
extends java.lang.Object
Constructor and Description |
---|
TransactionManager(ObjectDB database) |
Modifier and Type | Method and Description |
---|---|
void |
abortTransaction(Principal worker,
long transactionID)
Instruct the transaction manager that the given transaction is aborting
|
void |
commitTransaction(RemoteIdentity<RemoteWorker> workerIdentity,
long transactionID)
Execute the commit phase of two phase commit.
|
ObjectGlob |
getGlob(long onum,
RemoteWorker subscriber)
Returns a Glob containing the specified object.
|
ObjectGroup |
getGroup(Principal principal,
RemoteWorker subscriber,
long onum)
Returns an ObjectGroup containing the specified object.
|
long[] |
newOnums(Principal worker,
int num) |
void |
prepare(Principal worker,
PrepareRequest req)
Execute the prepare phase of two phase commit.
|
public TransactionManager(ObjectDB database)
public void abortTransaction(Principal worker, long transactionID) throws AccessException
AccessException
public void commitTransaction(RemoteIdentity<RemoteWorker> workerIdentity, long transactionID) throws TransactionCommitFailedException
TransactionCommitFailedException
public void prepare(Principal worker, PrepareRequest req) throws TransactionPrepareFailedException
Execute the prepare phase of two phase commit. Validates the transaction to make sure that no conflicts would occur if this transaction were committed. Once prepare returns successfully, the corresponding transaction can only fail if the coordinator aborts it.
The prepare method must check a large number of conditions:
worker
- The worker requesting the prepareTransactionPrepareFailedException
- If the transaction would cause a conflict or if the worker is
insufficiently privileged to execute the transaction.public ObjectGlob getGlob(long onum, RemoteWorker subscriber) throws AccessException
subscriber
- If non-null, then the given worker will be subscribed to the
object as a dissemination node.AccessException
public ObjectGroup getGroup(Principal principal, RemoteWorker subscriber, long onum) throws AccessException
principal
- The principal performing the read.subscriber
- If non-null, then the given worker will be subscribed to the
object as a worker.onum
- The onum for an object that should be in the group.handler
- Used to track read statistics.AccessException
public long[] newOnums(Principal worker, int num) throws AccessException
AccessException
- if the principal is not allowed to create objects on this store.