So you want to contribute code to this project? Excellent! We're glad you're here. Here's what you need to do.
Fork this repository on GitHub, and clone locally with git clone
.
OpenSearch components build using Java 14 at a minimum. This means you must have a JDK 14 installed with the environment variable JAVA_HOME
referencing the path to Java home for your JDK 14 installation, e.g. JAVA_HOME=/usr/lib/jvm/jdk-14
.
- Check out this package from version control.
- Launch Intellij IDEA, choose Import Project, and select the
settings.gradle
file in the root of this package. - To build from the command line, set
JAVA_HOME
to point to a JDK >= 14 before running./gradlew
.
-
Unix System
export JAVA_HOME=jdk-install-dir
: Replacejdk-install-dir
with the JAVA_HOME directory of your system.export PATH=$JAVA_HOME/bin:$PATH
-
Windows System
- Find My Computers from file directory, right click and select properties.
- Select the Advanced tab, select Environment variables.
- Edit JAVA_HOME to path of where JDK software is installed.
The JobScheduler plugin uses the Gradle build system.
- Checkout this package from version control.
- To build from command line set
JAVA_HOME
to point to a JDK >=14 - Run
./gradlew build
Then you will find the built artifact located at build/distributions
directory
Once you have built the plugin from source code, run
opensearch-plugin install file:///path/to/target/releases/opensearch-job-scheduler-<version>.zip
to install the JobScheduler plugin to your OpenSearch.
JobScheduler plugin provides a SPI for other plugins to implement. Essentially, you need to
- Define your JobParameter type by implementing
ScheduledJobParameter
interface - Implement your JobParameter parser function that can deserialize your JobParameter from XContent
- Create your JobRunner implementation by implementing
ScheduledJobRunner
interface - 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 opensearch logs according to the specified Schedule. And it also exposes a REST endpoint for end users to create/delete jobs.
Launch Intellij IDEA, choose Import Project, and select the settings.gradle
file in the root of this package.
See CONTRIBUTING.