public abstract class JiraClusterLockQueryDSLDao extends Object implements com.atlassian.beehive.db.spi.ClusterLockDao, ClusterLockCleanupDao
Modifier and Type | Field and Description |
---|---|
static long |
LEASE_EXPIRY_TIME_MS |
Constructor and Description |
---|
JiraClusterLockQueryDSLDao(QueryDslAccessor queryDslAccessor,
ClusterNodeHeartBeatDao clusterNodeHeartBeatDao,
DatabaseSystemTimeReaderFactory databaseSystemTimeReaderFactory) |
Modifier and Type | Method and Description |
---|---|
protected abstract com.querydsl.sql.dml.SQLUpdateClause |
getAcquireLockQuery(DbConnection dbConnection,
String lockName,
Long dbTime) |
List<com.atlassian.beehive.core.ClusterLockStatus> |
getAllHeldClusterLocks() |
com.atlassian.beehive.core.ClusterLockStatus |
getClusterLockStatusByName(String lockName) |
protected long |
getDatabaseTime() |
protected abstract com.querydsl.sql.SQLQuery |
getHeldClusterLocksQuery(DbConnection dbConnection,
Long dbTime) |
void |
insertEmptyClusterLock(String lockName) |
void |
releaseAllClusterLocks()
Release all cluster locks.
|
void |
releaseLocksHeldByNode() |
void |
renewLease(String lockName) |
boolean |
tryAcquireLock(String lockName) |
void |
unlock(String lockName) |
public JiraClusterLockQueryDSLDao(QueryDslAccessor queryDslAccessor, ClusterNodeHeartBeatDao clusterNodeHeartBeatDao, DatabaseSystemTimeReaderFactory databaseSystemTimeReaderFactory)
@Nonnull public List<com.atlassian.beehive.core.ClusterLockStatus> getAllHeldClusterLocks()
getAllHeldClusterLocks
in interface com.atlassian.beehive.db.spi.ClusterLockDao
@Nullable public com.atlassian.beehive.core.ClusterLockStatus getClusterLockStatusByName(@Nonnull String lockName)
getClusterLockStatusByName
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public boolean tryAcquireLock(@Nonnull String lockName)
tryAcquireLock
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public void insertEmptyClusterLock(@Nonnull String lockName)
insertEmptyClusterLock
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public void unlock(@Nonnull String lockName)
unlock
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public void releaseAllClusterLocks()
ClusterLockCleanupDao
releaseAllClusterLocks
in interface ClusterLockCleanupDao
public void renewLease(@Nonnull String lockName)
renewLease
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public void releaseLocksHeldByNode()
releaseLocksHeldByNode
in interface com.atlassian.beehive.db.spi.ClusterLockDao
protected long getDatabaseTime()
protected abstract com.querydsl.sql.SQLQuery getHeldClusterLocksQuery(DbConnection dbConnection, Long dbTime)
protected abstract com.querydsl.sql.dml.SQLUpdateClause getAcquireLockQuery(DbConnection dbConnection, String lockName, Long dbTime)
Copyright © 2002-2019 Atlassian. All Rights Reserved.