Package

agora.api

exchange

Permalink

package exchange

Visibility
  1. Public
  2. All

Type Members

  1. trait AsClient[-In, +Out] extends AnyRef

    Permalink

    Something which can create instances of T from Dispatch details to send to REST services (or wherever, but that's the intent)

  2. case class BlockingSubmitJobResponse(matchId: MatchId, jobId: JobId, matchedAt: LocalDateTime, workerCoords: List[WorkerRedirectCoords], workers: List[WorkerDetails]) extends ClientResponse with Product with Serializable

    Permalink
  3. case class CancelJobs(ids: Set[JobId]) extends ClientRequest with Product with Serializable

    Permalink
  4. case class CancelJobsResponse(canceledJobs: Map[JobId, Boolean]) extends ClientResponse with Product with Serializable

    Permalink
  5. case class CancelSubscriptions(ids: Set[worker.SubscriptionKey]) extends ClientRequest with Product with Serializable

    Permalink
  6. case class CancelSubscriptionsResponse(canceledSubscriptions: Map[worker.SubscriptionKey, Boolean]) extends ClientResponse with Product with Serializable

    Permalink
  7. case class Candidate(subscriptionKey: worker.SubscriptionKey, subscription: WorkSubscription, remaining: Int) extends Product with Serializable

    Permalink
  8. sealed trait ClientRequest extends AnyRef

    Permalink

    A 'client' represents something which submits work to the exchange

  9. sealed trait ClientResponse extends AnyRef

    Permalink
  10. case class Dispatch[+T](request: T, job: SubmitJob, matchDetails: MatchDetails, matchedWorker: WorkerDetails) extends Product with Serializable

    Permalink

    A client-side representation of a SubmitJob / WorkerDetails match produced by an Exchange, created

    A client-side representation of a SubmitJob / WorkerDetails match produced by an Exchange, created

    by the AsClient which made the initial request.

    The workflow is:

    1) Some custom request object 'Foo' -> 2) a 'SubmitJob' containing the json form for 'Foo' -> 3) a call to an Exchange with the SubmitJob -> 4) a reply w/ a match from the exchange -> 5) the exchnage client taking initial Foo, SubmitJob, and MatchDetails/WorkerDetails from the match response and producing a Dispatch 6) an implicit AsClient typeclass using the info in 'Dispatch' to make some request, presumably against the worker defined in 'WorkerDetails'

    T

    the original request type before it was serialised into json in the submit job

    request

    the initial request object used to produce the SubmitJob

    job

    the SubmitJob instance which was produced from request request and sent to the exchange

    matchDetails

    the match details from the Exchange

    matchedWorker

    the worker details matched to the SubmitJob

  11. trait Exchange extends JobSyntax

    Permalink

    An exchange supports both 'client' requests (e.g.

    An exchange supports both 'client' requests (e.g. offering and cancelling work to be done) and work subscriptions

  12. trait JobPredicate extends AnyRef

    Permalink

    Exposes the course-grained signature of pairing up jobs with worker subscriptions.

    Exposes the course-grained signature of pairing up jobs with worker subscriptions.

    In practice there is just one implementation which evaluates the json matchers of the SubmitJob and WorkSubscription, but in theory you could implement any test to pair up jobs with work subscriptions

  13. case class MatchNotification(jobId: JobId, job: SubmitJob, chosen: CandidateSelection) extends Product with Serializable

    Permalink
  14. trait MatchObserver extends OnMatch with StrictLogging

    Permalink

    Represents a match 'handler' which delegates out to other observers

  15. case class PendingSubscription(key: worker.SubscriptionKey, subscription: WorkSubscription, requested: Int) extends Product with Serializable

    Permalink
  16. case class QueueState(workerSubscriptionMatcher: JMatcher = JMatcher.matchAll, submitJobMatcher: JMatcher = JMatcher.matchAll, submitJobSubmissionDetailsMatcher: JMatcher = JMatcher.matchAll) extends ClientRequest with Product with Serializable

    Permalink

    Queries the exchange for a view of the pending jobs and subscriptions

    Queries the exchange for a view of the pending jobs and subscriptions

    workerSubscriptionMatcher

    the same as what a SubmitJob matcher would be, used to match work subscriptions

    submitJobMatcher

    the same as a subscription matcher would be, used to match submitted job requests

    submitJobSubmissionDetailsMatcher

    also as per a subscription matcher, this time matching the submissionDetails

  17. case class QueueStateResponse(jobs: List[SubmitJob], subscriptions: List[PendingSubscription]) extends ClientResponse with Product with Serializable

    Permalink
  18. case class RequestWork(id: worker.SubscriptionKey, itemsRequested: Int) extends SubscriptionRequest with Product with Serializable

    Permalink
  19. case class RequestWorkAck(id: worker.SubscriptionKey, previousItemsPending: Int, totalItemsPending: Int) extends SubscriptionResponse with Product with Serializable

    Permalink
  20. trait SelectComparable extends SelectionMode

    Permalink
  21. case class SelectIntMax(path: JPath) extends SelectionMode with SelectComparable with Product with Serializable

    Permalink
  22. case class SelectIntMin(path: JPath) extends SelectionMode with SelectComparable with Product with Serializable

    Permalink
  23. case class SelectN(n: Int) extends SelectionMode with Product with Serializable

    Permalink

  24. case class SelectionFirst() extends SelectionMode with Product with Serializable

    Permalink

    chooses all the eligible (matched) workers on the exchange.

    chooses all the eligible (matched) workers on the exchange. The assumption is the work will be sent to all the workers, though the requesting client will just return the first to finish

  25. abstract class SelectionMode extends AnyRef

    Permalink

    A SelectionMode determines which matched candidate(s) are chosen from an Exchange selection.

    A SelectionMode determines which matched candidate(s) are chosen from an Exchange selection.

    For example, if there is a pool of 10 work subscriptions, and a job is submitted which matches three of them, the SelectionMode determines which of the three are selected.

    Typically just the _best_ one of the list is chosen for some configurable meaning of _best_, though it could select any number of work candidates.

  26. case class ServerSideExchange(underlying: Exchange, observer: MatchObserver = MatchObserver())(implicit ec: ExecutionContext) extends Exchange with Product with Serializable

    Permalink

    Adds a special type for local exchanges.

    Adds a special type for local exchanges. also exposing a means to observe jobs.

    This way the 'MatchObserver' provided to the Exchange is accessible. Also, as convenient as it is to provide multiple implementations of a generic Exchange (i.e. local and remote), It's useful to know the intent when wiring together components (e.g. so we don't have a REST service configured which just sends exchange requests to itself)

  27. case class SubmissionDetails(aboutMe: Json, selection: SelectionMode, awaitMatch: Boolean, workMatcher: JMatcher, orElse: List[JMatcher]) extends JsonAppendable with Product with Serializable

    Permalink

    The SubmissionDetails is the ansillary information submitted with a job request.

    The SubmissionDetails is the ansillary information submitted with a job request.

    Where a typical REST endpoint would just take some POSTed json request, the SubmitJob requests wraps that json together will some information intended for the Exchange in order for it to match the job with a worker.

    The SubmissionDetails is that additional information to act as instructions/information specific to the job scheduling/matching. It contains:

    aboutMe

    a hold-all json blob which can include any details a client request wishes to expose to potential workers. It could contain e.g. session information, the submitting or 'run-as' user, etc.

    selection

    an instruction on which/how to select matching work subscriptions as an opportunity to filter on best-fit

    awaitMatch

    if true, the job submission to the exchange should block until one or more matching worker(s) is found

    workMatcher

    the json criteria used to match work subscriptions

    orElse

    should the 'workMatcher' not match _any_ current work subscriptions, the SubmitJob is resubmitted with the 'orElse' criteria

  28. case class SubmitJob(submissionDetails: SubmissionDetails, job: Json) extends ClientRequest with Product with Serializable

    Permalink

    Represents anything which can be run as a job, together with some submissionDetails which are used to instruct the Exchange.

    Represents anything which can be run as a job, together with some submissionDetails which are used to instruct the Exchange.

    Where a basic REST endpoint would typically be POSTed some json data, a 'SubmitJob' acts as an envelope for that 'job', pairing it with some additional SubmissionDetails.

    The Exchange can then use both the job and submission details to match work with pulling work subscriptions based on the criteria/selection mode/etc specified by the submission details and work subscription.

    job

    represents the job submission. As the job repo is heterogeneous, it could match anything really that's asking for work

  29. case class SubmitJobResponse(id: JobId) extends ClientResponse with Product with Serializable

    Permalink
  30. trait Submitable[T] extends AnyRef

    Permalink

    The ability to create SubmitJob instances from some value

    The ability to create SubmitJob instances from some value

    T

    the type which will be represented by the SubmitJob's 'job' json value

  31. sealed trait SubscriptionRequest extends AnyRef

    Permalink
  32. sealed trait SubscriptionResponse extends AnyRef

    Permalink
  33. case class UpdateSubscription(id: worker.SubscriptionKey, condition: JMatcher = MatchAll, delta: JsonDelta = JsonDelta()) extends SubscriptionRequest with Product with Serializable

    Permalink

    Updates the subscription's work details if the 'condition' matches

    Updates the subscription's work details if the 'condition' matches

    The condition can be used to assert the update it is about to perform. For instance, it could be used to check the value 'version == foo' to ensure it's updating the latest version, or to only add/remove values should some other condition hold. Basically I'm just trying to say the same thing over and over again.

    id

    the subscription to update

    condition

    the condition to check on the current WorkDetails data before performing the update

    delta

    the changes to apply

  34. case class UpdateSubscriptionAck(id: worker.SubscriptionKey, oldDetails: Option[WorkerDetails], newDetails: Option[WorkerDetails]) extends SubscriptionResponse with Product with Serializable

    Permalink
  35. case class WorkSubscription(details: WorkerDetails, jobMatcher: JMatcher, submissionMatcher: JMatcher, subscriptionReferences: Set[worker.SubscriptionKey]) extends SubscriptionRequest with Product with Serializable

    Permalink

    The details contain info about the worker subscribing to work, such as it's location (where work should be sent to), and any arbitrary json data it wants to expose (nr of CPUs, runAs user, available memory, OS, a 'topic', etc)

    The details contain info about the worker subscribing to work, such as it's location (where work should be sent to), and any arbitrary json data it wants to expose (nr of CPUs, runAs user, available memory, OS, a 'topic', etc)

    Once a WorkSubscription is sent

    details

    represents a json blob of data which can be matched by SubmissionDetails match criteria to filter out workers

    jobMatcher

    the criteria used to match submitted job data

    submissionMatcher

    the criteria used to match submitted jobs' submission details

    subscriptionReferences

    If non-empty, changes to the number of work items requested for this subscription will be performed on the referenced subscriptions

  36. case class WorkSubscriptionAck(id: worker.SubscriptionKey) extends SubscriptionResponse with Product with Serializable

    Permalink

Value Members

  1. object AsClient

    Permalink
  2. object BlockingSubmitJobResponse extends TimeInstances with Serializable

    Permalink
  3. object CancelJobs extends Serializable

    Permalink
  4. object Exchange

    Permalink
  5. object JobPredicate extends StrictLogging

    Permalink
  6. object MatchObserver

    Permalink
  7. object QueueState extends Serializable

    Permalink
  8. object QueueStateResponse extends Serializable

    Permalink
  9. object RequestWork extends Serializable

    Permalink
  10. object RequestWorkAck extends Serializable

    Permalink
  11. object Requested

    Permalink
  12. object SelectionAll extends SelectionMode with Product with Serializable

    Permalink
  13. object SelectionMode

    Permalink
  14. object SelectionOne extends SelectionMode with Product with Serializable

    Permalink

    just chooses one of the eligible workers

  15. object ServerSideExchange extends Serializable

    Permalink
  16. object SubmissionDetails extends Serializable

    Permalink
  17. object SubmitJob extends Serializable

    Permalink
  18. object SubmitJobResponse extends Serializable

    Permalink
  19. object Submitable

    Permalink
  20. object UpdateSubscription extends Serializable

    Permalink
  21. object WorkSubscription extends Serializable

    Permalink
  22. object WorkSubscriptionAck extends Serializable

    Permalink
  23. package dsl

    Permalink
  24. package instances

    Permalink

Ungrouped