Class/Object

com.coxautodata.waimak.dataflow

ParallelActionScheduler

Related Docs: object ParallelActionScheduler | package dataflow

Permalink

class ParallelActionScheduler extends ActionScheduler with Logging

Can run multiple actions in parallel with multiple execution pools support.

It was originally designed to benefit from Spark fair scheduler https://spark.apache.org/docs/latest/job-scheduling.html#fair-scheduler-pools Execution pool names must be the same as the Fair Scheduler pool names and number of parallel jobs within a pool is the number of Java threads.

Example: to configure 2 pools for Spark Fair Scheduler following xml must be passed to spark :

<?xml version="1.0"?> <allocations> <pool name="high"> <schedulingMode>FAIR</schedulingMode> <weight>1000</weight> <minShare>0</minShare> </pool> <pool name="medium"> <schedulingMode>FAIR</schedulingMode> <weight>25</weight> <minShare>0</minShare> </pool> </allocations>

following configuration options need to be specified:

  1. spark.scheduler.mode=FAIR 2. spark.scheduler.allocation.file=PATH_TO_THE_XML

in code pools parameter: Map( ("high" -> ExecutionPoolDesc("high", 10, Set.Empty, None)), ("medium" -> ExecutionPoolDesc("medium", 20, Set.Empty, None)) )

Created by Alexei Perelighin on 2018/07/10

Linear Supertypes
Logging, ActionScheduler, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ParallelActionScheduler
  2. Logging
  3. ActionScheduler
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ParallelActionScheduler(pools: Map[String, ExecutionPoolDesc], actionFinishedNotificationQueue: BlockingQueue[(String, DataFlowAction, Try[ActionResult])])

    Permalink

    pools

    details of the execution pools: name, limits, running actions, thread pool

    actionFinishedNotificationQueue

    thread safe queue through which threads that have finished actions will communicate back to the scheduler

Type Members

  1. type actionType = DataFlowAction

    Permalink
  2. type futureResult = (String, actionType, Try[ActionResult])

    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. val actionFinishedNotificationQueue: BlockingQueue[(String, DataFlowAction, Try[ActionResult])]

    Permalink

    thread safe queue through which threads that have finished actions will communicate back to the scheduler

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def availableExecutionPools: Option[Set[String]]

    Permalink

    finds execution pools that have slots to run actions.

    finds execution pools that have slots to run actions.

    returns

    None if none of the pools are available for scheduling and Some(Set[AVAILABLE POOL NAME]) - all pools that are available for scheduling

    Definition Classes
    ParallelActionSchedulerActionScheduler
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def dropRunning(poolNames: Set[String], from: Seq[DataFlowAction]): Seq[DataFlowAction]

    Permalink

    Removes actions that are already running in the specified set pools.

    Removes actions that are already running in the specified set pools.

    poolNames

    pool names to which the from actions belong to

    from

    list of actions from poolNames that DataFlow knows have not been marked as executed and can be scheduled

    returns

    list of actions that are not currently running

    Definition Classes
    ParallelActionSchedulerActionScheduler
  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. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hasRunningActions: Boolean

    Permalink

    Checks if there are actions running at all, regardless of the execution pool.

    Checks if there are actions running at all, regardless of the execution pool.

    returns

    true if at least one action is running in any of the pools

    Definition Classes
    ParallelActionSchedulerActionScheduler
  14. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  16. def isTraceEnabled(): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  17. def logAndReturn[A](a: A, msg: String, level: Level): A

    Permalink

    Takes a value of type A and a msg to log, returning a and logging the message at the desired level

    Takes a value of type A and a msg to log, returning a and logging the message at the desired level

    returns

    a

    Definition Classes
    Logging
  18. def logAndReturn[A](a: A, message: (A) ⇒ String, level: Level): A

    Permalink

    Takes a value of type A and a function message from A to String, logs the value of invoking message(a) at the level described by the level parameter

    Takes a value of type A and a function message from A to String, logs the value of invoking message(a) at the level described by the level parameter

    returns

    a

    Definition Classes
    Logging
    Example:
    1. logAndReturn(1, (num: Int) => s"number: $num", Info)
      // In the log we would see a log corresponding to "number 1"
  19. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  20. def logDebug(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  21. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  22. def logError(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  23. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  24. def logInfo(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  25. def logName: String

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  26. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  27. def logTrace(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  28. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  29. def logWarning(msg: ⇒ String): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Logging
  30. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  33. val pools: Map[String, ExecutionPoolDesc]

    Permalink

    details of the execution pools: name, limits, running actions, thread pool

  34. def schedule(poolName: String, action: DataFlowAction, entities: DataFlowEntities, flowContext: FlowContext, flowReporter: FlowReporter): ActionScheduler

    Permalink

    Submits action into the specified execution pool.

    Submits action into the specified execution pool.

    poolName

    pool into which to schedule the action

    action

    action to schedule

    entities

    action labels that have data

    flowContext

    object that allows access to the context of the flow and application

    flowReporter

    object that is used to signal start and end of the action execution

    Definition Classes
    ParallelActionSchedulerActionScheduler
  35. def shutDown(): Try[ActionScheduler]

    Permalink

    Executors must call it before exiting the execution of the flow to release resources.

    Executors must call it before exiting the execution of the flow to release resources.

    Definition Classes
    ParallelActionSchedulerActionScheduler
  36. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  38. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. def waitToFinish(flowContext: FlowContext, flowReporter: FlowReporter): (ActionScheduler, Seq[(DataFlowAction, Try[ActionResult])])

    Permalink

    Locks and waits for at least one action to finish running, can return more than one action if they have finished and their results are available.

    Locks and waits for at least one action to finish running, can return more than one action if they have finished and their results are available.

    flowContext

    object that allows access to the context of the flow and application

    flowReporter

    object that is used to signal start and end of the action execution

    Definition Classes
    ParallelActionSchedulerActionScheduler

Inherited from Logging

Inherited from ActionScheduler

Inherited from AnyRef

Inherited from Any

Ungrouped