public abstract class FileLockHolder extends Object implements AutoCloseable
lockInfo() that will appear in error message for concurrent processes
that will try to lock the same file and warningMessage(String) to print on each lock try.| Modifier | Constructor and Description |
|---|---|
protected |
FileLockHolder(String rootDir,
IgniteLogger log) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes file channel
|
boolean |
isLocked()
Locked or not.
|
abstract String |
lockInfo()
This info will appear in error message of concurrent processes that will try to lock on the same file.
|
String |
lockPath() |
void |
release()
Releases file lock
|
void |
tryLock(long lockWaitTimeMillis) |
protected abstract String |
warningMessage(String lockInfo) |
protected FileLockHolder(String rootDir, IgniteLogger log)
rootDir - Root directory for lock file.log - Log.public abstract String lockInfo()
protected abstract String warningMessage(String lockInfo)
lockInfo - Existing lock info.public void tryLock(long lockWaitTimeMillis)
throws IgniteCheckedException
lockWaitTimeMillis - During which time thread will try capture file lock.IgniteCheckedException - If failed to capture file lock.public boolean isLocked()
public void release()
public void close()
close in interface AutoCloseablepublic String lockPath()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023