Class ElasticsearchRollupAsyncClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Field Summary
Fields inherited from class co.elastic.clients.ApiClient
transport, transportOptions
-
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchRollupAsyncClient
(ElasticsearchTransport transport, TransportOptions transportOptions) -
Method Summary
Modifier and TypeMethodDescriptiondeleteJob
(DeleteJobRequest request) Delete a rollup job.Delete a rollup job.getJobs()
Get rollup job information.getJobs
(GetJobsRequest request) Get rollup job information.final CompletableFuture<GetJobsResponse>
Get rollup job information.Get the rollup job capabilities.getRollupCaps
(GetRollupCapsRequest request) Get the rollup job capabilities.Get the rollup job capabilities.Get the rollup index capabilities.getRollupIndexCaps
(Function<GetRollupIndexCapsRequest.Builder, ObjectBuilder<GetRollupIndexCapsRequest>> fn) Get the rollup index capabilities.putJob
(PutJobRequest request) Create a rollup job.final CompletableFuture<PutJobResponse>
Create a rollup job.rollupSearch
(RollupSearchRequest request) Overload ofrollupSearch(RollupSearchRequest, Class)
, where Class is defined as Void, meaning the documents will not be deserialized.<TDocument>
CompletableFuture<RollupSearchResponse<TDocument>>rollupSearch
(RollupSearchRequest request, Class<TDocument> tDocumentClass) Search rolled-up data.<TDocument>
CompletableFuture<RollupSearchResponse<TDocument>>rollupSearch
(RollupSearchRequest request, Type tDocumentType) Search rolled-up data.Overload ofrollupSearch(Function, Class)
, where Class is defined as Void, meaning the documents will not be deserialized.final <TDocument>
CompletableFuture<RollupSearchResponse<TDocument>>rollupSearch
(Function<RollupSearchRequest.Builder, ObjectBuilder<RollupSearchRequest>> fn, Class<TDocument> tDocumentClass) Search rolled-up data.final <TDocument>
CompletableFuture<RollupSearchResponse<TDocument>>rollupSearch
(Function<RollupSearchRequest.Builder, ObjectBuilder<RollupSearchRequest>> fn, Type tDocumentType) Search rolled-up data.startJob
(StartJobRequest request) Start rollup jobs.Start rollup jobs.stopJob
(StopJobRequest request) Stop rollup jobs.final CompletableFuture<StopJobResponse>
Stop rollup jobs.withTransportOptions
(TransportOptions transportOptions) Creates a new client with some request optionsMethods inherited from class co.elastic.clients.ApiClient
_jsonpMapper, _transport, _transportOptions, close, getDeserializer, withTransportOptions
-
Constructor Details
-
ElasticsearchRollupAsyncClient
-
ElasticsearchRollupAsyncClient
public ElasticsearchRollupAsyncClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions)
-
-
Method Details
-
withTransportOptions
public ElasticsearchRollupAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) Description copied from class:ApiClient
Creates a new client with some request options- Specified by:
withTransportOptions
in classApiClient<ElasticsearchTransport,
ElasticsearchRollupAsyncClient>
-
deleteJob
Delete a rollup job.A job must be stopped before it can be deleted. If you attempt to delete a started job, an error occurs. Similarly, if you attempt to delete a nonexistent job, an exception occurs.
IMPORTANT: When you delete a job, you remove only the process that is actively monitoring and rolling up data. The API does not delete any previously rolled up data. This is by design; a user may wish to roll up a static data set. Because the data set is static, after it has been fully rolled up there is no need to keep the indexing rollup job around (as there will be no new data). Thus the job can be deleted, leaving behind the rolled up data for analysis. If you wish to also remove the rollup data and the rollup index contains the data for only a single job, you can delete the whole rollup index. If the rollup index stores data from several jobs, you must issue a delete-by-query that targets the rollup job's identifier in the rollup index. For example:
POST my_rollup_index/_delete_by_query { "query": { "term": { "_rollup.id": "the_rollup_job_id" } } }
- See Also:
-
deleteJob
public final CompletableFuture<DeleteJobResponse> deleteJob(Function<DeleteJobRequest.Builder, ObjectBuilder<DeleteJobRequest>> fn) Delete a rollup job.A job must be stopped before it can be deleted. If you attempt to delete a started job, an error occurs. Similarly, if you attempt to delete a nonexistent job, an exception occurs.
IMPORTANT: When you delete a job, you remove only the process that is actively monitoring and rolling up data. The API does not delete any previously rolled up data. This is by design; a user may wish to roll up a static data set. Because the data set is static, after it has been fully rolled up there is no need to keep the indexing rollup job around (as there will be no new data). Thus the job can be deleted, leaving behind the rolled up data for analysis. If you wish to also remove the rollup data and the rollup index contains the data for only a single job, you can delete the whole rollup index. If the rollup index stores data from several jobs, you must issue a delete-by-query that targets the rollup job's identifier in the rollup index. For example:
POST my_rollup_index/_delete_by_query { "query": { "term": { "_rollup.id": "the_rollup_job_id" } } }
- Parameters:
fn
- a function that initializes a builder to create theDeleteJobRequest
- See Also:
-
getJobs
Get rollup job information. Get the configuration, stats, and status of rollup jobs.NOTE: This API returns only active (both
STARTED
andSTOPPED
) jobs. If a job was created, ran for a while, then was deleted, the API does not return any details about it. For details about a historical rollup job, the rollup capabilities API may be more useful.- See Also:
-
getJobs
public final CompletableFuture<GetJobsResponse> getJobs(Function<GetJobsRequest.Builder, ObjectBuilder<GetJobsRequest>> fn) Get rollup job information. Get the configuration, stats, and status of rollup jobs.NOTE: This API returns only active (both
STARTED
andSTOPPED
) jobs. If a job was created, ran for a while, then was deleted, the API does not return any details about it. For details about a historical rollup job, the rollup capabilities API may be more useful.- Parameters:
fn
- a function that initializes a builder to create theGetJobsRequest
- See Also:
-
getJobs
Get rollup job information. Get the configuration, stats, and status of rollup jobs.NOTE: This API returns only active (both
STARTED
andSTOPPED
) jobs. If a job was created, ran for a while, then was deleted, the API does not return any details about it. For details about a historical rollup job, the rollup capabilities API may be more useful.- See Also:
-
getRollupCaps
Get the rollup job capabilities. Get the capabilities of any rollup jobs that have been configured for a specific index or index pattern.This API is useful because a rollup job is often configured to rollup only a subset of fields from the source index. Furthermore, only certain aggregations can be configured for various fields, leading to a limited subset of functionality depending on that configuration. This API enables you to inspect an index and determine:
- Does this index have associated rollup data somewhere in the cluster?
- If yes to the first question, what fields were rolled up, what aggregations can be performed, and where does the data live?
- See Also:
-
getRollupCaps
public final CompletableFuture<GetRollupCapsResponse> getRollupCaps(Function<GetRollupCapsRequest.Builder, ObjectBuilder<GetRollupCapsRequest>> fn) Get the rollup job capabilities. Get the capabilities of any rollup jobs that have been configured for a specific index or index pattern.This API is useful because a rollup job is often configured to rollup only a subset of fields from the source index. Furthermore, only certain aggregations can be configured for various fields, leading to a limited subset of functionality depending on that configuration. This API enables you to inspect an index and determine:
- Does this index have associated rollup data somewhere in the cluster?
- If yes to the first question, what fields were rolled up, what aggregations can be performed, and where does the data live?
- Parameters:
fn
- a function that initializes a builder to create theGetRollupCapsRequest
- See Also:
-
getRollupCaps
Get the rollup job capabilities. Get the capabilities of any rollup jobs that have been configured for a specific index or index pattern.This API is useful because a rollup job is often configured to rollup only a subset of fields from the source index. Furthermore, only certain aggregations can be configured for various fields, leading to a limited subset of functionality depending on that configuration. This API enables you to inspect an index and determine:
- Does this index have associated rollup data somewhere in the cluster?
- If yes to the first question, what fields were rolled up, what aggregations can be performed, and where does the data live?
- See Also:
-
getRollupIndexCaps
public CompletableFuture<GetRollupIndexCapsResponse> getRollupIndexCaps(GetRollupIndexCapsRequest request) Get the rollup index capabilities. Get the rollup capabilities of all jobs inside of a rollup index. A single rollup index may store the data for multiple rollup jobs and may have a variety of capabilities depending on those jobs. This API enables you to determine:- What jobs are stored in an index (or indices specified via a pattern)?
- What target indices were rolled up, what fields were used in those rollups, and what aggregations can be performed on each job?
- See Also:
-
getRollupIndexCaps
public final CompletableFuture<GetRollupIndexCapsResponse> getRollupIndexCaps(Function<GetRollupIndexCapsRequest.Builder, ObjectBuilder<GetRollupIndexCapsRequest>> fn) Get the rollup index capabilities. Get the rollup capabilities of all jobs inside of a rollup index. A single rollup index may store the data for multiple rollup jobs and may have a variety of capabilities depending on those jobs. This API enables you to determine:- What jobs are stored in an index (or indices specified via a pattern)?
- What target indices were rolled up, what fields were used in those rollups, and what aggregations can be performed on each job?
- Parameters:
fn
- a function that initializes a builder to create theGetRollupIndexCapsRequest
- See Also:
-
putJob
Create a rollup job.WARNING: From 8.15.0, calling this API in a cluster with no rollup usage will fail with a message about the deprecation and planned removal of rollup features. A cluster needs to contain either a rollup job or a rollup index in order for this API to be allowed to run.
The rollup job configuration contains all the details about how the job should run, when it indexes documents, and what future queries will be able to run against the rollup index.
There are three main sections to the job configuration: the logistical details about the job (for example, the cron schedule), the fields that are used for grouping, and what metrics to collect for each group.
Jobs are created in a
STOPPED
state. You can start them with the start rollup jobs API.- See Also:
-
putJob
public final CompletableFuture<PutJobResponse> putJob(Function<PutJobRequest.Builder, ObjectBuilder<PutJobRequest>> fn) Create a rollup job.WARNING: From 8.15.0, calling this API in a cluster with no rollup usage will fail with a message about the deprecation and planned removal of rollup features. A cluster needs to contain either a rollup job or a rollup index in order for this API to be allowed to run.
The rollup job configuration contains all the details about how the job should run, when it indexes documents, and what future queries will be able to run against the rollup index.
There are three main sections to the job configuration: the logistical details about the job (for example, the cron schedule), the fields that are used for grouping, and what metrics to collect for each group.
Jobs are created in a
STOPPED
state. You can start them with the start rollup jobs API.- Parameters:
fn
- a function that initializes a builder to create thePutJobRequest
- See Also:
-
rollupSearch
public <TDocument> CompletableFuture<RollupSearchResponse<TDocument>> rollupSearch(RollupSearchRequest request, Class<TDocument> tDocumentClass) Search rolled-up data. The rollup search endpoint is needed because, internally, rolled-up documents utilize a different document structure than the original data. It rewrites standard Query DSL into a format that matches the rollup documents then takes the response and rewrites it back to what a client would expect given the original query.The request body supports a subset of features from the regular search API. The following functionality is not available:
size
: Because rollups work on pre-aggregated data, no search hits can be returned and so size must be set to zero or omitted entirely.highlighter
,suggestors
,post_filter
,profile
,explain
: These are similarly disallowed.Searching both historical rollup and non-rollup data
The rollup search API has the capability to search across both "live" non-rollup data and the aggregated rollup data. This is done by simply adding the live indices to the URI. For example:
GET sensor-1,sensor_rollup/_rollup_search { "size": 0, "aggregations": { "max_temperature": { "max": { "field": "temperature" } } } }
The rollup search endpoint does two things when the search runs:
- The original request is sent to the non-rollup index unaltered.
- A rewritten version of the original request is sent to the rollup index.
When the two responses are received, the endpoint rewrites the rollup response and merges the two together. During the merging process, if there is any overlap in buckets between the two responses, the buckets from the non-rollup index are used.
- See Also:
-
rollupSearch
public final <TDocument> CompletableFuture<RollupSearchResponse<TDocument>> rollupSearch(Function<RollupSearchRequest.Builder, ObjectBuilder<RollupSearchRequest>> fn, Class<TDocument> tDocumentClass) Search rolled-up data. The rollup search endpoint is needed because, internally, rolled-up documents utilize a different document structure than the original data. It rewrites standard Query DSL into a format that matches the rollup documents then takes the response and rewrites it back to what a client would expect given the original query.The request body supports a subset of features from the regular search API. The following functionality is not available:
size
: Because rollups work on pre-aggregated data, no search hits can be returned and so size must be set to zero or omitted entirely.highlighter
,suggestors
,post_filter
,profile
,explain
: These are similarly disallowed.Searching both historical rollup and non-rollup data
The rollup search API has the capability to search across both "live" non-rollup data and the aggregated rollup data. This is done by simply adding the live indices to the URI. For example:
GET sensor-1,sensor_rollup/_rollup_search { "size": 0, "aggregations": { "max_temperature": { "max": { "field": "temperature" } } } }
The rollup search endpoint does two things when the search runs:
- The original request is sent to the non-rollup index unaltered.
- A rewritten version of the original request is sent to the rollup index.
When the two responses are received, the endpoint rewrites the rollup response and merges the two together. During the merging process, if there is any overlap in buckets between the two responses, the buckets from the non-rollup index are used.
- Parameters:
fn
- a function that initializes a builder to create theRollupSearchRequest
- See Also:
-
rollupSearch
Overload ofrollupSearch(RollupSearchRequest, Class)
, where Class is defined as Void, meaning the documents will not be deserialized. -
rollupSearch
public final CompletableFuture<RollupSearchResponse<Void>> rollupSearch(Function<RollupSearchRequest.Builder, ObjectBuilder<RollupSearchRequest>> fn) Overload ofrollupSearch(Function, Class)
, where Class is defined as Void, meaning the documents will not be deserialized. -
rollupSearch
public <TDocument> CompletableFuture<RollupSearchResponse<TDocument>> rollupSearch(RollupSearchRequest request, Type tDocumentType) Search rolled-up data. The rollup search endpoint is needed because, internally, rolled-up documents utilize a different document structure than the original data. It rewrites standard Query DSL into a format that matches the rollup documents then takes the response and rewrites it back to what a client would expect given the original query.The request body supports a subset of features from the regular search API. The following functionality is not available:
size
: Because rollups work on pre-aggregated data, no search hits can be returned and so size must be set to zero or omitted entirely.highlighter
,suggestors
,post_filter
,profile
,explain
: These are similarly disallowed.Searching both historical rollup and non-rollup data
The rollup search API has the capability to search across both "live" non-rollup data and the aggregated rollup data. This is done by simply adding the live indices to the URI. For example:
GET sensor-1,sensor_rollup/_rollup_search { "size": 0, "aggregations": { "max_temperature": { "max": { "field": "temperature" } } } }
The rollup search endpoint does two things when the search runs:
- The original request is sent to the non-rollup index unaltered.
- A rewritten version of the original request is sent to the rollup index.
When the two responses are received, the endpoint rewrites the rollup response and merges the two together. During the merging process, if there is any overlap in buckets between the two responses, the buckets from the non-rollup index are used.
- See Also:
-
rollupSearch
public final <TDocument> CompletableFuture<RollupSearchResponse<TDocument>> rollupSearch(Function<RollupSearchRequest.Builder, ObjectBuilder<RollupSearchRequest>> fn, Type tDocumentType) Search rolled-up data. The rollup search endpoint is needed because, internally, rolled-up documents utilize a different document structure than the original data. It rewrites standard Query DSL into a format that matches the rollup documents then takes the response and rewrites it back to what a client would expect given the original query.The request body supports a subset of features from the regular search API. The following functionality is not available:
size
: Because rollups work on pre-aggregated data, no search hits can be returned and so size must be set to zero or omitted entirely.highlighter
,suggestors
,post_filter
,profile
,explain
: These are similarly disallowed.Searching both historical rollup and non-rollup data
The rollup search API has the capability to search across both "live" non-rollup data and the aggregated rollup data. This is done by simply adding the live indices to the URI. For example:
GET sensor-1,sensor_rollup/_rollup_search { "size": 0, "aggregations": { "max_temperature": { "max": { "field": "temperature" } } } }
The rollup search endpoint does two things when the search runs:
- The original request is sent to the non-rollup index unaltered.
- A rewritten version of the original request is sent to the rollup index.
When the two responses are received, the endpoint rewrites the rollup response and merges the two together. During the merging process, if there is any overlap in buckets between the two responses, the buckets from the non-rollup index are used.
- Parameters:
fn
- a function that initializes a builder to create theRollupSearchRequest
- See Also:
-
startJob
Start rollup jobs. If you try to start a job that does not exist, an exception occurs. If you try to start a job that is already started, nothing happens.- See Also:
-
startJob
public final CompletableFuture<StartJobResponse> startJob(Function<StartJobRequest.Builder, ObjectBuilder<StartJobRequest>> fn) Start rollup jobs. If you try to start a job that does not exist, an exception occurs. If you try to start a job that is already started, nothing happens.- Parameters:
fn
- a function that initializes a builder to create theStartJobRequest
- See Also:
-
stopJob
Stop rollup jobs. If you try to stop a job that does not exist, an exception occurs. If you try to stop a job that is already stopped, nothing happens.Since only a stopped job can be deleted, it can be useful to block the API until the indexer has fully stopped. This is accomplished with the
wait_for_completion
query parameter, and optionally a timeout. For example:POST _rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s
The parameter blocks the API call from returning until either the job has moved to STOPPED or the specified time has elapsed. If the specified time elapses without the job moving to STOPPED, a timeout exception occurs.
- See Also:
-
stopJob
public final CompletableFuture<StopJobResponse> stopJob(Function<StopJobRequest.Builder, ObjectBuilder<StopJobRequest>> fn) Stop rollup jobs. If you try to stop a job that does not exist, an exception occurs. If you try to stop a job that is already stopped, nothing happens.Since only a stopped job can be deleted, it can be useful to block the API until the indexer has fully stopped. This is accomplished with the
wait_for_completion
query parameter, and optionally a timeout. For example:POST _rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s
The parameter blocks the API call from returning until either the job has moved to STOPPED or the specified time has elapsed. If the specified time elapses without the job moving to STOPPED, a timeout exception occurs.
- Parameters:
fn
- a function that initializes a builder to create theStopJobRequest
- See Also:
-