public class BambooClusterLockRawJdbcDao extends AbstractBambooRawJdbcDao implements ClusterLockBootstrapDao
dbmsBean, hibernateConfig, postBoostrap
Constructor and Description |
---|
BambooClusterLockRawJdbcDao() |
Modifier and Type | Method and Description |
---|---|
void |
deleteLocksHeldByNode(String nodeId) |
void |
ensureClusterLockTableExists()
Creates lock table if required.
|
List<com.atlassian.beehive.core.ClusterLockStatus> |
getAllHeldClusterLocks() |
com.atlassian.beehive.core.ClusterLockStatus |
getClusterLockStatusByName(String lockName) |
void |
insertEmptyClusterLock(String lockName,
long updateTime) |
boolean |
tryUpdateAcquireLock(String lockName,
String nodeId,
long updateTime) |
boolean |
tryUpdateAcquireNodeScopedLock(String lockName,
String nodeId,
long updateTime)
Try to acquire an existing lock for the given node.
|
void |
unlock(String lockName,
String nodeId,
long updateTime) |
contextDestroyed, contextInitialized, ensureClusterTableExists, supplierWithConnection, withDatabaseConnection
@NotNull 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(@NotNull String lockName)
getClusterLockStatusByName
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public boolean tryUpdateAcquireLock(@NotNull String lockName, @NotNull String nodeId, long updateTime)
tryUpdateAcquireLock
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public boolean tryUpdateAcquireNodeScopedLock(@NotNull String lockName, @NotNull String nodeId, long updateTime)
ClusterLockBootstrapDao
ClusterLockDao.tryUpdateAcquireLock(java.lang.String, java.lang.String, long)
tryUpdateAcquireNodeScopedLock
in interface ClusterLockBootstrapDao
lockName
- name of the lock to acquirenodeId
- this node idupdateTime
- time (in milliseconds) at which this update is madepublic void insertEmptyClusterLock(@NotNull String lockName, long updateTime)
insertEmptyClusterLock
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public void unlock(@NotNull String lockName, @NotNull String nodeId, long updateTime)
unlock
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public void deleteLocksHeldByNode(String nodeId)
deleteLocksHeldByNode
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public void ensureClusterLockTableExists()
ClusterLockBootstrapDao
ensureClusterLockTableExists
in interface ClusterLockBootstrapDao
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.