Class CheckpointTimeoutLock
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointTimeoutLock
-
public class CheckpointTimeoutLock extends Object
Checkpoint lock for outer usage which should be used to protect data during writing to memory. It contains complex logic for the correct taking of inside checkpoint lock(timeout, force checkpoint, etc.).
-
-
Field Summary
Fields Modifier and Type Field Description protected IgniteLoggerlogIgnite logger.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckpointLockIsHeldByThread()voidcheckpointReadLock()Gets the checkpoint read lock.longcheckpointReadLockTimeout()Timeout for checkpoint read lock acquisition.voidcheckpointReadLockTimeout(long val)Sets timeout for checkpoint read lock acquisition.voidcheckpointReadUnlock()Releases the checkpoint read lock.voidstart()Prepare the lock to further usage.voidstop()Forbid to take this lock.
-
-
-
Field Detail
-
log
protected final IgniteLogger log
Ignite logger.
-
-
Method Detail
-
checkpointReadLock
public void checkpointReadLock()
Gets the checkpoint read lock. While this lock is held, checkpoint thread will not acquireSnapshotWorker memory state.- Throws:
IgniteException- If failed.
-
checkpointReadUnlock
public void checkpointReadUnlock()
Releases the checkpoint read lock.
-
checkpointReadLockTimeout
public long checkpointReadLockTimeout()
Timeout for checkpoint read lock acquisition.- Returns:
- Timeout for checkpoint read lock acquisition in milliseconds.
-
checkpointReadLockTimeout
public void checkpointReadLockTimeout(long val)
Sets timeout for checkpoint read lock acquisition.- Parameters:
val- New timeout in milliseconds, non-positive value denotes infinite timeout.
-
checkpointLockIsHeldByThread
public boolean checkpointLockIsHeldByThread()
- Returns:
- true if checkpoint lock is held by current thread
-
stop
public void stop()
Forbid to take this lock.
-
start
public void start()
Prepare the lock to further usage.
-
-