Class

de.kaufhof.hajobs

LockRepository

Related Doc: package hajobs

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

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

    Permalink
  5. final def asInstanceOf[T0]: T0

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

    Permalink
  7. def clone(): AnyRef

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

    Permalink

    Delete lock for the given job type.

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

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

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

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

    Permalink

    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

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

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

    Permalink

    jobType

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

  15. def hashCode(): Int

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

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

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

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

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

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

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

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

    Permalink

    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

  25. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped