de.kaufhof.hajobs

LockRepository

class LockRepository extends AnyRef

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. LockRepository
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new LockRepository(session: Session, lockTypes: LockTypes)

    session

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def acquireLock(jobType: JobType, jobId: UUID, ttl: Duration = 60 seconds)(implicit ec: ExecutionContext): Future[Boolean]

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clear(): Future[ResultSet]

  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def delete(jobType: JobType): Future[ResultSet]

    Delete lock for the given job type.

  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def getAll()(implicit ec: ExecutionContext): Future[Seq[Lock]]

    Returns a list of Locks (jobType + jobId).

    Returns a list of Locks (jobType + jobId). To avoid select * statement without key in where clause, we do multiple select statements with given primary key

  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. def getIdForType(jobType: JobType)(implicit ec: ExecutionContext): Future[Option[UUID]]

    jobType

    the job type of the job, e.g. "product_full_import"

  17. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. def releaseLock(jobType: JobType, jobId: UUID)(implicit ec: ExecutionContext): Future[Boolean]

  23. def save(jobType: JobType): Future[ResultSet]

  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. def toString(): String

    Definition Classes
    AnyRef → Any
  26. def updateLock(jobType: JobType, jobId: UUID, ttl: Duration = 60 seconds)(implicit ec: ExecutionContext): Future[Boolean]

    we use the concept of lightweight transactions (or compare and set, CAS) here as implemented by C* with the PAXOS consensus protocol.

    we use the concept of lightweight transactions (or compare and set, CAS) here as implemented by C* with the PAXOS consensus protocol. see http://www.datastax.com/documentation/cassandra/2.0/cassandra/dml/dml_ltwt_transaction_c.html for more info

  27. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped