public class ClusterLockDAOHibernate extends HibernateDao<ClusterLockEntity>
| Modifier and Type | Field and Description |
|---|---|
static String |
SUPPRESS_LOGGING_MDC_KEY |
batchFinder, batchProcessor, logger, statelessSessionBatchProcessor, timeSourcesessionFactory| Constructor and Description |
|---|
ClusterLockDAOHibernate() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteLocksHeldByNode(String nodeId) |
List<ClusterLockEntity> |
getAllHeldClusterLocks() |
ClusterLockEntity |
getLockByName(String lockName) |
Class<ClusterLockEntity> |
getPersistentClass()
All subclasses of HibernateDao must implement this method for
HibernateDao.load(Serializable) to work
correctly. |
void |
insertEmptyClusterLock(String lockName,
long currentTime)
Attempt to insert an "unlocked" DB row for the named lock.
|
List<ClusterLockEntity> |
list() |
void |
renewLease(String lockName,
String nodeId,
long currentTime) |
boolean |
tryUpdateAcquireLock(String lockName,
String nodeId,
long currentTime,
long lockExpiryTimeout)
Attempt to acquire an existing named lock for the given nodeId.
|
void |
unlock(String lockName,
String nodeId,
long currentTime)
Unlock the named lock, if this node still holds the lock.
|
createDeleteQuery, createDeleteQuery, createQuery, createQuery, executeHQLQuery, findAllInternal, findByProperties, findByPropertiesOptional, findByProperty, findByProperty, findByPropertyOptional, findByPropertyOrThrow, getCountByProperties, load, load, loadOptional, loadReference, loadReference, remove, removeByIdIfPresent, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setClock, setStatelessSessionBatchProcessor, toPredicates, updatesetSessionFactory, withStatelessSessionpublic static final String SUPPRESS_LOGGING_MDC_KEY
public Class<ClusterLockEntity> getPersistentClass()
HibernateDaoHibernateDao.load(Serializable) to work
correctly.getPersistentClass in class HibernateDao<ClusterLockEntity>public List<ClusterLockEntity> getAllHeldClusterLocks()
public ClusterLockEntity getLockByName(String lockName)
public boolean tryUpdateAcquireLock(@Nonnull String lockName, @Nonnull String nodeId, long currentTime, long lockExpiryTimeout)
lockName - the globally unique id of the locknodeId - This node's IDcurrentTime - the time in milliseconds that this update was writtenlockExpiryTimeout - the timeout for the lock expiry, should be sourced from com.atlassian.beehive.db.LockExpiryConfiguration#getExpiryPeriodDurationSeconds()public void renewLease(@Nonnull String lockName, @Nonnull String nodeId, long currentTime)
public void insertEmptyClusterLock(@Nonnull String lockName, long currentTime)
lockName - the lock identifiercurrentTime - the time in milliseconds that this insert was writtenpublic void unlock(String lockName, String nodeId, long currentTime)
lockName - the lock identifiernodeId - This node's IDcurrentTime - the time in milliseconds that this update was writtenpublic List<ClusterLockEntity> list()
public void deleteLocksHeldByNode(String nodeId)
Copyright © 2023 Atlassian. All rights reserved.