@Override public void checkSupportsRegionInvalidate() throws UnsupportedOperationInTransactionException { getProxy().checkSupportsRegionInvalidate(); }
@Override public void checkSupportsRegionDestroy() throws UnsupportedOperationInTransactionException { getProxy().checkSupportsRegionDestroy(); }
public Entry getEntry(final KeyInfo keyInfo, final LocalRegion region, boolean allowTombstones) { TXEntryState tx = txReadEntry(keyInfo, region, true, true/*create txEntry is absent*/); if (tx != null && tx.existsLocally()) { return new TXEntry(region, keyInfo, getProxy()); } else { return null; } }
/** * Place the entry at the end of queue to order the update events. * * @since 7.0 */ protected final void updateForCommit(final TXState txState) { // mark TX as dirty txState.getProxy().markDirty(); final TXEntryState head = txState.head; // assuming TXRegionState is locked, the access to next for this entry need // not be synchronized TXEntryState next = this.next; // return immediately if this is already the last entry if (next == head) { return; } final NonReentrantLock headLock = txState.headLock; headLock.lock(); try { updateForCommitNoLock(txState, false); } finally { headLock.unlock(); } }
/** * Acquire lock on an entry for reading. For updates the read lock will be * upgraded to write once the row is qualified. */ public static boolean lockForRead(final TXState tx, final LockingPolicy lockPolicy, final LockMode mode, final int lockFlags, final RegionEntry entry, final GemFireContainer container, final LocalRegion dataRegion, final GemFireXDQueryObserver observer) { assert dataRegion != null: "unexpected null data region for " + entry + " in container " + container; final TXId txId = tx.getTransactionId(); if (observer != null) { observer.lockingRowForTX(tx.getProxy(), container, entry, false); } lockPolicy.acquireLock(entry, mode, lockFlags, txId, dataRegion, null); if (!entry.isDestroyedOrRemoved()) { return true; } unlockEntryAfterRead(txId, lockPolicy, mode, entry, container, dataRegion); return false; }
/** * Acquire lock on an entry for reading. For updates the read lock will be * upgraded to write once the row is qualified. */ public static boolean lockForRead(final TXState tx, final LockingPolicy lockPolicy, final LockMode mode, final int lockFlags, final RegionEntry entry, final GemFireContainer container, final LocalRegion dataRegion, final GemFireXDQueryObserver observer) { assert dataRegion != null: "unexpected null data region for " + entry + " in container " + container; final TXId txId = tx.getTransactionId(); if (observer != null) { observer.lockingRowForTX(tx.getProxy(), container, entry, false); } lockPolicy.acquireLock(entry, mode, lockFlags, txId, dataRegion, null); if (!entry.isDestroyedOrRemoved()) { return true; } unlockEntryAfterRead(txId, lockPolicy, mode, entry, container, dataRegion); return false; }
/** * Acquire lock on an entry for reading. For updates the read lock will be * upgraded to write once the row is qualified. */ public static boolean lockForRead(final TXState tx, final LockingPolicy lockPolicy, final LockMode mode, final int lockFlags, final RegionEntry entry, final GemFireContainer container, final LocalRegion dataRegion, final GemFireXDQueryObserver observer) { assert dataRegion != null: "unexpected null data region for " + entry + " in container " + container; final TXId txId = tx.getTransactionId(); if (observer != null) { observer.lockingRowForTX(tx.getProxy(), container, entry, false); } lockPolicy.acquireLock(entry, mode, lockFlags, txId, dataRegion, null); if (!entry.isDestroyedOrRemoved()) { return true; } unlockEntryAfterRead(txId, lockPolicy, mode, entry, container, dataRegion); return false; }
/** * @see InternalDataView#postPutAll(DistributedPutAllOperation, * VersionedObjectList, LocalRegion) */ public void postPutAll(DistributedPutAllOperation putAllOp, VersionedObjectList successfulPuts, LocalRegion region) { // nothing to be done here final LogWriterI18n logger = region.getLogWriterI18n(); if (isSnapshot()) { if (logger.fineEnabled()) { logger.info(LocalizedStrings.DEBUG, "TXState: in postPutAll with tx " + this); } getProxy().addAffectedRegion(region); region.getSharedDataView().postPutAll(putAllOp, successfulPuts, region); return; } }
this.localTXState.getProxy().remoteBatching(false); this.restoreBatching = true;
public void rmRegion(final LocalRegion r) { final TXRegionState txr = this.regions.removeKey(r); if (txr != null) { final LockingPolicy lockPolicy = getLockingPolicy(); txr.lock(); try { txr.cleanup(lockPolicy, lockPolicy.getWriteLockMode(), false, true, null); txr.processPendingExpires(); txr.cleanupSnapshotRegionEntries(); } finally { txr.unlock(); } } if (isEmpty()) { getProxy().removeSelfFromHostedIfEmpty(null); } }
@Override public final void upgradeCurrentRowLocationLockToWrite() throws StandardException { if (this.currentRowLocation != null && this.currentDataRegion != null) { final RegionEntry entry = this.currentRowLocation .getUnderlyingRegionEntry(); final TXStateProxy txProxy = this.localTXState.getProxy(); if (this.observer != null) { this.observer.lockingRowForTX(txProxy, this.baseContainer, entry, true); } try { // upgrade the lock since the entry has been qualified txProxy.lockEntry(entry, entry.getKey(), GemFireXDUtils .getRoutingObject(this.currentRowLocation.getBucketID()), this.baseContainer.getRegion(), this.currentDataRegion, true, TXEntryState.getLockForUpdateOp()); } finally { // now release the SH lock after the atomic lock upgrade, or as // cleanup in case of lock upgrade failure GemFireXDUtils.releaseLockForReadOnPreviousEntry(entry, this.localTXState, this.txId, this.lockPolicy, this.readLockMode, this.baseContainer, this.currentDataRegion, this.lockContext); } this.currentDataRegion = null; } }
@Override public final void upgradeCurrentRowLocationLockToWrite() throws StandardException { if (this.currentRowLocation != null && this.currentDataRegion != null) { final RegionEntry entry = this.currentRowLocation .getUnderlyingRegionEntry(); final TXStateProxy txProxy = this.localTXState.getProxy(); if (this.observer != null) { this.observer.lockingRowForTX(txProxy, this.baseContainer, entry, true); } try { // upgrade the lock since the entry has been qualified txProxy.lockEntry(entry, entry.getKey(), GemFireXDUtils .getRoutingObject(this.currentRowLocation.getBucketID()), this.baseContainer.getRegion(), this.currentDataRegion, true, TXEntryState.getLockForUpdateOp()); } finally { // now release the SH lock after the atomic lock upgrade, or as // cleanup in case of lock upgrade failure GemFireXDUtils.releaseLockForReadOnPreviousEntry(entry, this.localTXState, this.txId, this.lockPolicy, this.readLockMode, this.baseContainer, this.currentDataRegion, this.lockContext); } this.currentDataRegion = null; } }
@Override public final void upgradeCurrentRowLocationLockToWrite() throws StandardException { if (this.currentRowLocation != null && this.currentDataRegion != null) { final RegionEntry entry = this.currentRowLocation .getUnderlyingRegionEntry(); final TXStateProxy txProxy = this.localTXState.getProxy(); if (this.observer != null) { this.observer.lockingRowForTX(txProxy, this.baseContainer, entry, true); } try { // upgrade the lock since the entry has been qualified txProxy.lockEntry(entry, entry.getKey(), GemFireXDUtils .getRoutingObject(this.currentRowLocation.getBucketID()), this.baseContainer.getRegion(), this.currentDataRegion, true, TXEntryState.getLockForUpdateOp()); } finally { // now release the SH lock after the atomic lock upgrade, or as // cleanup in case of lock upgrade failure GemFireXDUtils.releaseLockForReadOnPreviousEntry(entry, this.localTXState, this.txId, this.lockPolicy, this.readLockMode, this.baseContainer, this.currentDataRegion, this.lockContext); } this.currentDataRegion = null; } }
@Override public final void upgradeCurrentRowLocationLockToWrite() throws StandardException { if (this.currentRowLocation != null && this.currentDataRegion != null) { final RegionEntry entry = this.currentRowLocation .getUnderlyingRegionEntry(); final TXStateProxy txProxy = this.localTXState.getProxy(); if (this.observer != null) { this.observer.lockingRowForTX(txProxy, this.gfContainer, entry, true); } try { // upgrade the lock since the entry has been qualified txProxy.lockEntry(entry, entry.getKey(), GemFireXDUtils .getRoutingObject(this.currentRowLocation.getBucketID()), this.gfContainer.getRegion(), this.currentDataRegion, true, TXEntryState.getLockForUpdateOp()); } finally { // now release the SH lock after the atomic lock upgrade, or as // cleanup in case of lock upgrade failure GemFireXDUtils.releaseLockForReadOnPreviousEntry(entry, this.localTXState, this.txId, this.lockPolicy, this.readLockMode, this.gfContainer, this.currentDataRegion, this.lockContext); } this.currentDataRegion = null; } }
@Override public final void upgradeCurrentRowLocationLockToWrite() throws StandardException { if (this.currentRowLocation != null && this.currentDataRegion != null) { final RegionEntry entry = this.currentRowLocation .getUnderlyingRegionEntry(); final TXStateProxy txProxy = this.localTXState.getProxy(); if (this.observer != null) { this.observer.lockingRowForTX(txProxy, this.gfContainer, entry, true); } try { // upgrade the lock since the entry has been qualified txProxy.lockEntry(entry, entry.getKey(), GemFireXDUtils .getRoutingObject(this.currentRowLocation.getBucketID()), this.gfContainer.getRegion(), this.currentDataRegion, true, TXEntryState.getLockForUpdateOp()); } finally { // now release the SH lock after the atomic lock upgrade, or as // cleanup in case of lock upgrade failure GemFireXDUtils.releaseLockForReadOnPreviousEntry(entry, this.localTXState, this.txId, this.lockPolicy, this.readLockMode, this.gfContainer, this.currentDataRegion, this.lockContext); } this.currentDataRegion = null; } }
@Override public final void upgradeCurrentRowLocationLockToWrite() throws StandardException { if (this.currentRowLocation != null && this.currentDataRegion != null) { final RegionEntry entry = this.currentRowLocation .getUnderlyingRegionEntry(); final TXStateProxy txProxy = this.localTXState.getProxy(); if (this.observer != null) { this.observer.lockingRowForTX(txProxy, this.gfContainer, entry, true); } try { // upgrade the lock since the entry has been qualified txProxy.lockEntry(entry, entry.getKey(), GemFireXDUtils .getRoutingObject(this.currentRowLocation.getBucketID()), this.gfContainer.getRegion(), this.currentDataRegion, true, TXEntryState.getLockForUpdateOp()); } finally { // now release the SH lock after the atomic lock upgrade, or as // cleanup in case of lock upgrade failure GemFireXDUtils.releaseLockForReadOnPreviousEntry(entry, this.localTXState, this.txId, this.lockPolicy, this.readLockMode, this.gfContainer, this.currentDataRegion, this.lockContext); } this.currentDataRegion = null; } }
THashMap versionSources = tx.getProxy().regionDiskVersionSources; if (versionSources != null) { vs = (VersionSource<?>)versionSources.get(r);
final TXStateProxy txProxy = tx.getProxy(); if (this.observer != null) { this.observer.lockingRowForTX(txProxy, container, entry, true);
final TXStateProxy txProxy = tx.getProxy(); if (this.observer != null) { this.observer.lockingRowForTX(txProxy, container, entry, true);
final TXStateProxy txProxy = tx.getProxy(); if (this.observer != null) { this.observer.lockingRowForTX(txProxy, container, entry, true);