Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.8][Transform] fix page size return in cat transform, add dps #57912

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions docs/reference/cat/transforms.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Returns configuration and usage information about {transforms}.
[[cat-transforms-api-prereqs]]
==== {api-prereq-title}

* If the {es} {security-features} are enabled, you must have `monitor_transform`
cluster privileges to use this API. The built-in `transform_user` role has these
privileges. For more information, see <<security-privileges>> and
* If the {es} {security-features} are enabled, you must have `monitor_transform`
cluster privileges to use this API. The built-in `transform_user` role has these
privileges. For more information, see <<security-privileges>> and
<<built-in-roles>>.

//[[cat-transforms-api-desc]]
Expand Down Expand Up @@ -77,6 +77,10 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=dest-index]
`documents_indexed`, `doci`:::
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=docs-indexed]

`docs_per_second`, `dps`:::
(Default)
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-settings-docs-per-second]

`documents_processed`, `docp`:::
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=docs-processed]

Expand Down Expand Up @@ -139,7 +143,7 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=state-transform]

`transform_type`, `tt`:::
(Default)
Indicates the type of {transform}: `batch` or `continuous`.
Indicates the type of {transform}: `batch` or `continuous`.

`trigger_count`, `tc`:::
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=trigger-count]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ teardown:
transform_id: "airline-transform-stats"
- match:
$body: |
/^ #id \s+ create_time \s+ version \s+ source_index \s+ dest_index \s+ pipeline \s+ transform_type \s+ frequency \s+ max_page_search_size \s+ state \n
(airline\-transform\-stats \s+ [^\s]+ \s+ [^\s]+ \s+ airline-data \s+ airline-data-by-airline \s+ \s+ batch \s+ 1m \s+ 500 \s+ STOPPED \n)+ $/
/^ #id \s+ create_time \s+ version \s+ source_index \s+ dest_index \s+ pipeline \s+ transform_type \s+ frequency \s+ max_page_search_size \s+ docs_per_second \s+ state \n
(airline\-transform\-stats \s+ [^\s]+ \s+ [^\s]+ \s+ airline-data \s+ airline-data-by-airline \s+ \s+ batch \s+ 1m \s+ 500 \s+ - \s+ STOPPED \n)+ $/

---
"Test cat transform stats with column selection":
Expand Down Expand Up @@ -95,8 +95,8 @@ teardown:
v: true
- match:
$body: |
/^ id \s+ create_time \s+ version \s+ source_index \s+ dest_index \s+ pipeline \s+ description \s+ transform_type \s+ frequency \s+ max_page_search_size \s+ state \n
(airline\-transform\-batch \s+ [^\s]+ \s+ [^\s]+ \s+ airline-data,airline-data-other \s+ airline-data-by-airline-batch \s+ \s+ description \s+ batch \s+ 1m \s+ 500 \s+ STOPPED \n)+ $/
/^ id \s+ create_time \s+ version \s+ source_index \s+ dest_index \s+ pipeline \s+ description \s+ transform_type \s+ frequency \s+ max_page_search_size \s+ docs_per_second \s+ state \n
(airline\-transform\-batch \s+ [^\s]+ \s+ [^\s]+ \s+ airline-data,airline-data-other \s+ airline-data-by-airline-batch \s+ \s+ description \s+ batch \s+ 1m \s+ 500 \s+ - \s+ STOPPED \n)+ $/
- do:
transform.delete_transform:
transform_id: "airline-transform-batch"
Expand Down Expand Up @@ -131,8 +131,8 @@ teardown:
v: true
- match:
$body: |
/^ id \s+ create_time \s+ version \s+ source_index \s+ dest_index \s+ pipeline \s+ description \s+ transform_type \s+ frequency \s+ max_page_search_size \s+ state \n
(airline\-transform\-continuous \s+ [^\s]+ \s+ [^\s]+ \s+ airline-data,airline-data-other \s+ airline-data-by-airline-continuous \s+ \s+ description \s+ continuous \s+ 10s \s+ 500 \s+ STOPPED \n)+ $/
/^ id \s+ create_time \s+ version \s+ source_index \s+ dest_index \s+ pipeline \s+ description \s+ transform_type \s+ frequency \s+ max_page_search_size \s+ docs_per_second \s+ state \n
(airline\-transform\-continuous \s+ [^\s]+ \s+ [^\s]+ \s+ airline-data,airline-data-other \s+ airline-data-by-airline-continuous \s+ \s+ description \s+ continuous \s+ 10s \s+ 500 \s+ - \s+ STOPPED \n)+ $/
- do:
transform.delete_transform:
transform_id: "airline-transform-continuous"
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.common.settings.SettingsModule;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.NamedXContentRegistry.Entry;
import org.elasticsearch.env.Environment;
Expand Down Expand Up @@ -132,6 +133,8 @@ public class Transform extends Plugin implements SystemIndexPlugin, PersistentTa
private final SetOnce<TransformServices> transformServices = new SetOnce<>();

public static final int DEFAULT_FAILURE_RETRIES = 10;
public static final Integer DEFAULT_INITIAL_MAX_PAGE_SEARCH_SIZE = Integer.valueOf(500);
public static final TimeValue DEFAULT_TRANSFORM_FREQUENCY = TimeValue.timeValueMillis(60000);

// How many times the transform task can retry on an non-critical failure
public static final Setting<Integer> NUM_FAILURE_RETRIES_SETTING = Setting.intSetting(
Expand Down Expand Up @@ -283,12 +286,7 @@ public Collection<Object> createComponents(

TransformConfigManager configManager = new IndexBasedTransformConfigManager(client, xContentRegistry);
TransformAuditor auditor = new TransformAuditor(client, clusterService.getNodeName());
TransformCheckpointService checkpointService = new TransformCheckpointService(
settings,
clusterService,
configManager,
auditor
);
TransformCheckpointService checkpointService = new TransformCheckpointService(settings, clusterService, configManager, auditor);
SchedulerEngine scheduler = new SchedulerEngine(settings, Clock.systemUTC());

transformServices.set(new TransformServices(configManager, checkpointService, auditor, scheduler));
Expand Down
Loading