hyrise / Cockpit

A Cockpit for Self-Driving Databases.
15 stars 3 forks source link

Add asynchrone job handler #752

Closed Alexander-Dubrawski closed 4 years ago

Alexander-Dubrawski commented 4 years ago

This PR is the first of four which aims to refactor the handling of Hyrise jobs (it aims to split #664). Hyrise jobs are interacting directly with the Hyrise to get the meta information and managing the Hyrise settings. We have three kinds of jobs:

  1. jobs that need to be continuously in the background (for example: get the system information)
  2. jobs that will be done asynchronously (for example: loading the tables)
  3. jobs that are done synchronously (for example: sending a SQL query over the SQL endpoint)

Both continuous and asynchronous jobs are executed via the apscheduler (https://apscheduler.readthedocs.io/en/stable/). Esspacillay with the asynchronous jobs that's not necessary and increases the complexity (we could just use normal python threads). All three kinds of jobs are scattered in the database and background_scheduler component. The goal of the refactoring is now to have a clear separation for the jobs in the three categories (continuous, asynchronous, and synchronous) and define handlers for that. Moreover, we can stop the continuous jobs while loading/deleting tables (hyrise/hyrise#2180).

This PR implements the handler for the asynchronous jobs. It uses normal python threads (https://docs.python.org/3/library/threading.html#threading.Thread) for that.

ToDo: