class
LockRepository extends AnyRef
Instance Constructors
-
new
LockRepository(session: Session, lockTypes: LockTypes)
Value Members
-
final
def
!=(arg0: AnyRef): Boolean
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: AnyRef): Boolean
-
final
def
==(arg0: Any): Boolean
-
def
acquireLock(jobType: JobType, jobId: UUID, ttl: Duration = 60 seconds)(implicit ec: ExecutionContext): Future[Boolean]
-
final
def
asInstanceOf[T0]: T0
-
def
clear(): Future[ResultSet]
-
def
clone(): AnyRef
-
def
delete(jobType: JobType): Future[ResultSet]
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
finalize(): Unit
-
def
getAll()(implicit ec: ExecutionContext): Future[Seq[Lock]]
-
final
def
getClass(): Class[_]
-
def
getIdForType(jobType: JobType)(implicit ec: ExecutionContext): Future[Option[UUID]]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
releaseLock(jobType: JobType, jobId: UUID)(implicit ec: ExecutionContext): Future[Boolean]
-
def
save(jobType: JobType): Future[ResultSet]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
def
updateLock(jobType: JobType, jobId: UUID, ttl: Duration = 60 seconds)(implicit ec: ExecutionContext): Future[Boolean]
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
Inherited from AnyRef
Inherited from Any
This repository manages locks for jobs syncronization in distributed environments. To work every kind of job needs an unique identifier (jobType) and every job run an unique identifier (jobId) If a job acquires a lock, it will only get it, if there isn't already a jobId saved for that jobType. The jobId of the running job will be saved with a ttl to the lock table. A running job needs to renew its lock to show it's still active and not died.
We use Consistency Level Quorum to ensure that a Job is Locked or is not Locked. The CL makes the Lock mechanism more deterministic.