|
| 1 | +# Example - Presto Plan Checker Router Scheduler Plugin |
| 2 | +This package contains a custom scheduler plugin - Presto Plan Checker Router Scheduler Plugin. |
| 3 | + |
| 4 | +## Add the Custom Scheduler Plugin to the Presto Router |
| 5 | +Place the plugin jar and all the dependent jars for the plugin in the `plugin` directory relative to the Presto install directory. |
| 6 | + |
| 7 | +Create a configuration file for this plugin. The file must be named `router-scheduler.properties` and must be in the `etc/router-config/` directory relative to the Presto install directory. |
| 8 | + |
| 9 | +Set the scheduler name to `CUSTOM_PLUGIN_SCHEDULER` in `etc/router-config.json`. |
| 10 | +``scheduler``: ``CUSTOM_PLUGIN_SCHEDULER`` |
| 11 | + |
| 12 | +## Main Classes: |
| 13 | +* `RouterSchedulerPlugin` - Custom Scheduler Plugin class to be loaded by the Router plugin manager. |
| 14 | + This class implements the interface `com.facebook.presto.spi.RouterPlugin`. |
| 15 | +* `PlanCheckerRouterPluginSchedulerFactory` - Factory for creating plan checker custom scheduler. |
| 16 | + This class implements the interface `com.facebook.presto.spi.SchedulerFactory`. |
| 17 | +* `PlanCheckerRouterPluginScheduler` - Plan checker custom scheduler implementing the scheduling logic for clusters. |
| 18 | + This class implements the interface `com.facebook.presto.spi.router.Scheduler`. |
| 19 | + |
| 20 | +## Configuration: |
| 21 | +The following configuration properties must be set in `etc/router-config/router-scheduler.properties`: |
| 22 | + |
| 23 | +| Property Name | Type | Description | |
| 24 | +|--------------------------|--------|-------------------------------------------------------------------------| |
| 25 | +| router-scheduler.name | String | The name of the custom scheduler factory | |
| 26 | +| | | Example: `router-scheduler.name=plan-checker` | |
| 27 | +| plan-check-clusters-uris | String | The URIs of the plan checker clusters. | | |
| 28 | +| router-java-url | String | The router URI dedicated to java clusters. | |
| 29 | +| router-native-url | String | The router URI dedicated to native clusters. | |
| 30 | +| client-request-timeout | String | The maximum time the client will wait for a response before timing out. | |
| 31 | +| | | Default : `2 minutes` | |
| 32 | + |
0 commit comments