
public class OAtomicOperationsManager extends Object implements OAtomicOperationsMangerMXBean
| Modifier and Type | Field and Description |
|---|---|
static String |
MBEAN_NAME |
| Constructor and Description |
|---|
OAtomicOperationsManager(OAbstractPaginatedStorage storage) |
| Modifier and Type | Method and Description |
|---|---|
void |
acquireExclusiveLockTillOperationComplete(OAtomicOperation operation,
String lockName)
Acquires exclusive lock with the given lock name in the given atomic operation.
|
void |
acquireExclusiveLockTillOperationComplete(ODurableComponent durableComponent)
Acquires exclusive lock in the active atomic operation running on the current thread for the
durableComponent. |
void |
acquireReadLock(ODurableComponent durableComponent) |
void |
doNotTrackAtomicOperations() |
String |
dumpActiveAtomicOperations() |
OAtomicOperation |
endAtomicOperation(boolean rollback,
Exception exception,
ODurableComponent component) |
OAtomicOperation |
endAtomicOperation(boolean rollback,
Exception exception,
String lockName) |
void |
ensureThatComponentsUnlocked() |
long |
freezeAtomicOperations(Class<? extends OException> exceptionClass,
String message) |
OAtomicOperation |
getCurrentOperation() |
boolean |
isFrozen() |
void |
registerMBean() |
void |
releaseAtomicOperations(long id) |
void |
releaseReadLock(ODurableComponent durableComponent) |
OAtomicOperation |
startAtomicOperation(ODurableComponent durableComponent,
boolean trackNonTxOperations) |
OAtomicOperation |
startAtomicOperation(String lockName,
boolean trackNonTxOperations)
Starts atomic operation inside of current thread.
|
void |
switchOffUnsafeMode()
Switch off unsafe mode.
|
void |
switchOnUnsafeMode()
Switch off unsafe mode.
|
void |
trackAtomicOperations() |
void |
unregisterMBean() |
public static final String MBEAN_NAME
public OAtomicOperationsManager(OAbstractPaginatedStorage storage)
public OAtomicOperation startAtomicOperation(ODurableComponent durableComponent, boolean trackNonTxOperations) throws IOException
IOExceptionstartAtomicOperation(String, boolean)public OAtomicOperation startAtomicOperation(String lockName, boolean trackNonTxOperations) throws IOException
In current implementation of atomic operation, each component which is participated in atomic operation is hold under exclusive lock till atomic operation will not be completed (committed or rollbacked).
If other thread is going to read data from component it has to acquire read lock inside of atomic operation manager acquireReadLock(ODurableComponent), otherwise data consistency will be compromised.
Atomic operation may be delayed if start of atomic operations is prohibited by call of freezeAtomicOperations(Class, String) method. If mentioned above method is called then execution of current method will be
stopped till call of releaseAtomicOperations(long) method or exception will be thrown. Concrete behaviour depends on
real values of parameters of freezeAtomicOperations(Class, String) method.
trackNonTxOperations - If this flag set to true then special record ONonTxOperationPerformedWALRecord
will be added to WAL in case of atomic operation is started outside of active storage transaction.
During storage restore procedure this record is monitored and if given record is present then
rebuild of all indexes is performed.lockName - Name of lock (usually name of component) which is going participate in atomic operation.IOExceptionpublic void switchOnUnsafeMode()
To switch off unsafe mode call switchOffUnsafeMode()
public void switchOffUnsafeMode()
OStorage.synch() after calling of this method.
Otherwise there is risk that database may be in broken state after crash/restore cycle if this method will not be called.public long freezeAtomicOperations(Class<? extends OException> exceptionClass, String message)
public boolean isFrozen()
public void releaseAtomicOperations(long id)
public OAtomicOperation getCurrentOperation()
public OAtomicOperation endAtomicOperation(boolean rollback, Exception exception, ODurableComponent component) throws IOException
IOExceptionpublic OAtomicOperation endAtomicOperation(boolean rollback, Exception exception, String lockName) throws IOException
IOExceptionpublic void ensureThatComponentsUnlocked()
public void acquireExclusiveLockTillOperationComplete(OAtomicOperation operation, String lockName)
operation - the atomic operation to acquire the lock in.lockName - the lock name to acquire.public void acquireExclusiveLockTillOperationComplete(ODurableComponent durableComponent)
durableComponent.public void acquireReadLock(ODurableComponent durableComponent)
public void releaseReadLock(ODurableComponent durableComponent)
public void registerMBean()
public void unregisterMBean()
public void trackAtomicOperations()
trackAtomicOperations in interface OAtomicOperationsMangerMXBeanpublic void doNotTrackAtomicOperations()
doNotTrackAtomicOperations in interface OAtomicOperationsMangerMXBeanpublic String dumpActiveAtomicOperations()
dumpActiveAtomicOperations in interface OAtomicOperationsMangerMXBeanCopyright © 2009–2025 OrientDB. All rights reserved.