Skip to content
Davit Petrosyan edited this page Mar 11, 2021 · 4 revisions

Introduction to Work4j

Work4j is an open-source library to create distributed, highly available job scheduler.

Main concepts

In Work4j, there are several central concepts such as:

  • Job Definition: The data structure to define a "template" of a job that should run on a cluster.
  • Job Execution: An object that represents desired job execution on one or more machines in the cluster.
  • Iteration: A special structure that is created by a worker as a result of a single occasion of a particular job's execution.
  • Cluster: A virtual group of machines or worker instances that the job execution is assigned to.

Rather than that, here are some important modules and their responsibilities:

  • Scheduler Controller: The entry point for any job operations including defining jobs, executing them, reporting iterations, and cluster management.
  • Scheduler Data Repository: The underlying data provider for the Scheduler Controller to act as an interim layer for storing and manipulating the scheduling data (jobs, executions, iterations, clusters, more).
  • Worker Controller: An entry point for the worker application that is responsible to execute all the jobs assigned to the particular cluster according to their schedule or triggers.
  • Scheduler Channel: An interface to act as a communication channel between worker and scheduler applications.

Main artifacts

Artifact Group Description
work4j-worker io.imast The package contains worker logic to execute jobs according to their schedule
work4j-controller io.imast The package contains the scheduler controller logic which allows to define, store, execute and manipulate jobs
work4j-model io.imast The package contains all the necessary models for defining or executing jobs
work4j-data io.imast The package contains a necessary data storage provider interface that can be implemented for a specific database
work4j-data-mongo io.imast The package implements work4j-data provider for the MongoDB database
work4j-channel io.imast The package contains main interfaces for worker-scheduler interaction including direct and event-driven communication
work4j-execution io.imast The package contains necessary interfaces for implementing the logic of a concrete job type and its behavior