public abstract class LocalTransaction extends AbstractCacheTransaction
RemoteTransaction
.affectedKeys, backupKeyLocks, hasLocalOnlyModifications, keyEquivalence, lockedKeys, lookedUpEntries, modifications, topologyId, tx
Constructor and Description |
---|
LocalTransaction(Transaction transaction,
GlobalTransaction tx,
boolean implicitTransaction,
int topologyId,
Equivalence<Object> keyEquivalence) |
Modifier and Type | Method and Description |
---|---|
void |
addModification(WriteCommand mod) |
void |
addReadKey(Object key) |
void |
clearRemoteLocksAcquired() |
boolean |
equals(Object o) |
Collection<Address> |
getCommitNodes(Collection<Address> recipients,
int currentTopologyId,
Collection<Address> members)
Calculates the list of nodes to which a commit/rollback needs to be sent based on the nodes to which prepare
was sent.
|
Map<Object,CacheEntry> |
getLookedUpEntries() |
Collection<Address> |
getRemoteLocksAcquired() |
Transaction |
getTransaction() |
int |
hashCode() |
boolean |
isCommitOrRollbackSent() |
abstract boolean |
isEnlisted() |
boolean |
isFromRemoteSite()
When x-site replication is used, this returns when this operation
happens as a result of backing up data from a remote site.
|
boolean |
isFromStateTransfer() |
boolean |
isImplicitTransaction() |
boolean |
isPrepareSent() |
boolean |
isReadOnly() |
boolean |
keyRead(Object key) |
void |
locksAcquired(Collection<Address> nodes) |
void |
markCommitOrRollbackSent()
Sets the commit or rollback sent for this transaction
|
void |
markPrepareSent()
Sets the prepare sent for this transaction
|
void |
putLookedUpEntries(Map<Object,CacheEntry> entries) |
void |
putLookedUpEntry(Object key,
CacheEntry e) |
void |
setFromRemoteSite(boolean fromRemoteSite) |
void |
setFromStateTransfer(boolean isFromStateTransfer) |
String |
toString() |
addAffectedKey, addAllAffectedKeys, addBackupLockForKey, addVersionRead, clearLockedKeys, clearLookedUpEntries, getAffectedKeys, getAllModifications, getBackupLockedKeys, getGlobalTransaction, getLockedKeys, getLookedUpRemoteVersion, getModifications, getTopologyId, getUpdatedEntryVersions, getVersionsRead, hasModification, isMarkedForRollback, lookupEntry, markForRollback, notifyOnTransactionFinished, ownsLock, putLookedUpRemoteVersion, registerLockedKey, removeLookedUpEntry, replaceVersionRead, setModifications, setUpdatedEntryVersions, waitForLockRelease
public LocalTransaction(Transaction transaction, GlobalTransaction tx, boolean implicitTransaction, int topologyId, Equivalence<Object> keyEquivalence)
public final void addModification(WriteCommand mod)
public void locksAcquired(Collection<Address> nodes)
public Collection<Address> getRemoteLocksAcquired()
public void clearRemoteLocksAcquired()
public Transaction getTransaction()
public Map<Object,CacheEntry> getLookedUpEntries()
getLookedUpEntries
in interface CacheTransaction
getLookedUpEntries
in class AbstractCacheTransaction
public boolean isImplicitTransaction()
public void putLookedUpEntry(Object key, CacheEntry e)
public void putLookedUpEntries(Map<Object,CacheEntry> entries)
public boolean isReadOnly()
public abstract boolean isEnlisted()
public void addReadKey(Object key)
addReadKey
in interface CacheTransaction
addReadKey
in class AbstractCacheTransaction
public boolean keyRead(Object key)
keyRead
in interface CacheTransaction
keyRead
in class AbstractCacheTransaction
public boolean isFromStateTransfer()
public void setFromStateTransfer(boolean isFromStateTransfer)
public boolean isFromRemoteSite()
public void setFromRemoteSite(boolean fromRemoteSite)
isFromRemoteSite()
public Collection<Address> getCommitNodes(Collection<Address> recipients, int currentTopologyId, Collection<Address> members)
AbstractCacheTransaction.getTopologyId()
then
this method returns the reunion between 'recipients' and getRemoteLocksAcquired()
from which it discards
the members that left.public final void markPrepareSent()
public final boolean isPrepareSent()
public final void markCommitOrRollbackSent()
public final boolean isCommitOrRollbackSent()
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.