Git Product home page Git Product logo

job-scheduler's Introduction

Open Distro for Elasticsearch Job Scheduler

Open Distro for Elasticsearch JobScheduler plugin provides a framework for Elasticsearch plugin developers to schedule periodical jobs running within Elasticsearch nodes. You can schedule jobs by specify an interval, or using Unix Cron expression to define more flexible schedule to execute your job.

Elasticsearch plugin developers can easily extend JobScheduler plugin to schedule jobs like running aggregation query against raw data and save the aggregated data into a new index every hour, or keep monitoring the shard allocation by calling Elasticsearch API and post the output to a Webhook.

Build

The JobScheduler plugin uses the Gradle build system.

  1. Checkout this package from version control.
  2. To build from command line set JAVA_HOME to point to a JDK >=14
  3. Run ./gradlew build

Then you will find the built artifact located at build/distributions directory

Install

Once you have built the plugin from source code, run

elasticsearch-plugin install file://${PLUGIN_ZIP_FILE_PATH}

to install the JobScheduler plugin to your Elasticsearch.

Develop a plugin that extends JobScheduler

JobScheduler plugin provides a SPI for other plugins to implement. Essentially, you need to

  1. Define your JobParameter type by implementing ScheduledJobParameter interface
  2. Implement your JobParameter parser function that can deserialize your JobParameter from XContent
  3. Create your JobRunner implementation by implementing ScheduledJobRunner interface
  4. Create your own plugin which implements JobSchedulerExtension interface
    • don't forget to create the service provider configuration file in your resources folder and bundle it into your plugin artifact

Please refer to the sample-extension-plugin subproject in this project, which provides a complete example of using JobScheduler to run periodical jobs.

The sample extension plugin takes an index name as input and logs the index shards to elasticsearch logs according to the specified Schedule. And it also exposes a REST endpoint for end users to create/delete jobs.

Code of Conduct

This project has adopted an Open Source Code of Conduct.

Security issue notifications

If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our vulnerability reporting page. Please do not create a public GitHub issue.

Licensing

See the LICENSE file for our project's licensing. We will ask you to confirm the licensing of your contribution.

job-scheduler's People

Contributors

zengyan-amazon avatar ftianli-amzn avatar weicongs-amazon avatar hyandell avatar jinsoor-amzn avatar gaiksaya avatar dbbaughe avatar bowenlan-amzn avatar praveensameneni avatar alolita avatar aetter avatar elfisher avatar qreshi avatar rishabh6788 avatar saratvemulapalli avatar ylwu-amzn avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.