Skip to content

Commit

Permalink
Add public doc
Browse files Browse the repository at this point in the history
  • Loading branch information
noCharger committed Sep 4, 2024
1 parent 7967199 commit 2595439
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
70 changes: 70 additions & 0 deletions docs/user/admin/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,76 @@ Request::
}
}

plugins.query.executionengine.async_query.external_scheduler.enabled
=====================================================================

Description
-----------
This setting controls whether the external scheduler is enabled for async queries.

* Default Value: true
* Scope: Node-level
* Dynamic Update: Yes, this setting can be updated dynamically.

To disable the external scheduler, use the following command:

Request ::

sh$ curl -sS -H 'Content-Type: application/json' -X PUT localhost:9200/_cluster/settings \
... -d '{"transient":{"plugins.query.executionengine.async_query.external_scheduler.enabled":"false"}}'
{
"acknowledged": true,
"persistent": {},
"transient": {
"plugins": {
"query": {
"executionengine": {
"async_query": {
"external_scheduler": {
"enabled": "false"
}
}
}
}
}
}
}

plugins.query.executionengine.async_query.external_scheduler.interval
=====================================================================

Description
-----------
This setting specifies the interval at which the external scheduler runs to check for pending async queries.

* Default Value: None (must be explicitly set)
* Format: A string representing a time duration follows Spark [CalendarInterval](https://spark.apache.org/docs/latest/api/java/org/apache/spark/unsafe/types/CalendarInterval.html)
format (e.g., "10m" for 10 minutes, "1h" for 1 hour)

To modify the interval to 10 minutes for example, use this command:

Request ::

sh$ curl -sS -H 'Content-Type: application/json' -X PUT localhost:9200/_cluster/settings \
... -d '{"transient":{"plugins.query.executionengine.async_query.external_scheduler.interval":"10 minutes"}}'
{
"acknowledged": true,
"persistent": {},
"transient": {
"plugins": {
"query": {
"executionengine": {
"async_query": {
"external_scheduler": {
"interval": "10 minutes"
}
}
}
}
}
}
}

plugins.query.executionengine.spark.streamingjobs.housekeeper.interval
======================================================================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,19 @@ public class OpenSearchSettings extends Settings {
Setting.Property.NodeScope,
Setting.Property.Dynamic);

public static final Setting<Boolean> ASYNC_QUERY_EXTERNAL_SCHEDULER_ENABLED_SETTING =
Setting.boolSetting(
Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_ENABLED.getKeyValue(),
true,
Setting.Property.NodeScope,
Setting.Property.Dynamic);

public static final Setting<String> ASYNC_QUERY_EXTERNAL_SCHEDULER_INTERVAL_SETTING =
Setting.simpleString(
Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_INTERVAL.getKeyValue(),
Setting.Property.NodeScope,
Setting.Property.Dynamic);

public static final Setting<String> SPARK_EXECUTION_ENGINE_CONFIG =
Setting.simpleString(
Key.SPARK_EXECUTION_ENGINE_CONFIG.getKeyValue(),
Expand Down Expand Up @@ -298,6 +311,18 @@ public OpenSearchSettings(ClusterSettings clusterSettings) {
Key.ASYNC_QUERY_ENABLED,
ASYNC_QUERY_ENABLED_SETTING,
new Updater(Key.ASYNC_QUERY_ENABLED));
register(
settingBuilder,
clusterSettings,
Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_ENABLED,
ASYNC_QUERY_EXTERNAL_SCHEDULER_ENABLED_SETTING,
new Updater(Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_ENABLED));
register(
settingBuilder,
clusterSettings,
Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_INTERVAL,
ASYNC_QUERY_EXTERNAL_SCHEDULER_INTERVAL_SETTING,
new Updater(Key.ASYNC_QUERY_EXTERNAL_SCHEDULER_INTERVAL));
register(
settingBuilder,
clusterSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,22 @@ void getSparkExecutionEngineConfigSetting() {
.put(SPARK_EXECUTION_ENGINE_CONFIG.getKey(), sparkConfig)
.build()));
}

@Test
void getAsyncQueryExternalSchedulerEnabledSetting() {
// Default is true
assertEquals(
true,
ASYNC_QUERY_EXTERNAL_SCHEDULER_ENABLED_SETTING.get(
org.opensearch.common.settings.Settings.builder().build()));
}

@Test
void getAsyncQueryExternalSchedulerIntervalSetting() {
// Default is empty string
assertEquals(
"",
ASYNC_QUERY_EXTERNAL_SCHEDULER_INTERVAL_SETTING.get(
org.opensearch.common.settings.Settings.builder().build()));
}
}

0 comments on commit 2595439

Please sign in to comment.