public class BambooClusterLockRawJdbcDao extends AbstractBambooRawJdbcDao implements ClusterLockBootstrapDao
dbmsBean, hibernateConfig
Constructor and Description |
---|
BambooClusterLockRawJdbcDao(@NotNull ClusterNodeHeartbeatBootstrapDao clusterNodeHeartbeatBootstrapDao) |
Modifier and Type | Method and Description |
---|---|
void |
deleteLocksHeldByNode(String nodeId) |
void |
ensureClusterLockTableExists()
Creates lock table if required.
|
@NotNull List<com.atlassian.beehive.core.ClusterLockStatus> |
getAllHeldClusterLocks() |
@Nullable com.atlassian.beehive.core.ClusterLockStatus |
getClusterLockStatusByName(@NotNull String lockName) |
void |
insertEmptyClusterLock(@NotNull String lockName) |
void |
releaseLocksHeldByNode() |
void |
renewLease(@NotNull String lockName) |
void |
renewLease(@NotNull String lockName,
@NotNull String nodeId) |
boolean |
tryAcquireLock(@NotNull String lockName) |
boolean |
tryUpdateAcquireNodeScopedLock(@NotNull String lockName,
@NotNull String nodeId,
long lockTimeoutSeconds)
Try to acquire an existing lock for the given node.
|
void |
unlock(@NotNull String lockName) |
void |
unlock(@NotNull String lockName,
@NotNull String nodeId)
Force unlock a lock held by a specified node.
|
ensureClusterTableExists, supplierWithConnection, withDatabaseConnection
public BambooClusterLockRawJdbcDao(@NotNull @NotNull ClusterNodeHeartbeatBootstrapDao clusterNodeHeartbeatBootstrapDao)
@NotNull public @NotNull List<com.atlassian.beehive.core.ClusterLockStatus> getAllHeldClusterLocks()
getAllHeldClusterLocks
in interface com.atlassian.beehive.db.spi.ClusterLockDao
@Nullable public @Nullable com.atlassian.beehive.core.ClusterLockStatus getClusterLockStatusByName(@NotNull @NotNull String lockName)
getClusterLockStatusByName
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public boolean tryAcquireLock(@NotNull @NotNull String lockName)
tryAcquireLock
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public boolean tryUpdateAcquireNodeScopedLock(@NotNull @NotNull String lockName, @NotNull @NotNull String nodeId, long lockTimeoutSeconds)
ClusterLockBootstrapDao
ClusterLockDao.tryAcquireLock(String)
tryUpdateAcquireNodeScopedLock
in interface ClusterLockBootstrapDao
lockName
- name of the lock to acquirenodeId
- this node idlockTimeoutSeconds
- time (in seconds) after which the lock can be taken overpublic void insertEmptyClusterLock(@NotNull @NotNull String lockName)
insertEmptyClusterLock
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public void unlock(@NotNull @NotNull String lockName)
unlock
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public void renewLease(@NotNull @NotNull String lockName)
renewLease
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public void renewLease(@NotNull @NotNull String lockName, @NotNull @NotNull String nodeId)
public void unlock(@NotNull @NotNull String lockName, @NotNull @NotNull String nodeId)
ClusterLockBootstrapDao
unlock
in interface ClusterLockBootstrapDao
public void releaseLocksHeldByNode()
releaseLocksHeldByNode
in interface com.atlassian.beehive.db.spi.ClusterLockDao
public void deleteLocksHeldByNode(String nodeId)
public void ensureClusterLockTableExists()
ClusterLockBootstrapDao
ensureClusterLockTableExists
in interface ClusterLockBootstrapDao
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.
View cookie preferences