All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.influxdb.client.QueryApi Maven / Gradle / Ivy

/*
 * The MIT License
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package com.influxdb.client;

import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.ThreadSafe;

import com.influxdb.Cancellable;
import com.influxdb.client.domain.Dialect;
import com.influxdb.client.domain.Query;
import com.influxdb.query.FluxRecord;
import com.influxdb.query.FluxTable;

/**
 * The client of the InfluxDB 2.x that implement Query HTTP API endpoint.
 *
 * @author Jakub Bednar (bednar@github) (01/10/2018 12:17)
 */
@ThreadSafe
public interface QueryApi {

    /**
     * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response
     * to {@code List}.
     * 

* NOTE: This method is not intended for large query results. * Use {@link QueryApi#query(String, String, BiConsumer, Consumer, Runnable)} for large data streaming. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @return {@code List} which are matched the query */ @Nonnull List query(@Nonnull final String query); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to {@code List}. *

* NOTE: This method is not intended for large query results. * Use {@link QueryApi#query(String, String, BiConsumer, Consumer, Runnable)} for large data streaming. * * @param query the flux query to execute * @param org specifies the source organization * @return {@code List} which are matched the query */ @Nonnull List query(@Nonnull final String query, @Nonnull final String org); /** * Executes the Parameterized Flux query against the InfluxDB 2.x and synchronously map whole response * to {@code List}. Query parameters currently are supported only in InfluxDB Cloud. *

* NOTE: This method is not intended for large query results. * Use {@link QueryApi#query(String, String, BiConsumer, Consumer, Runnable, Map)} for large data streaming. *

* Parameterized Flux queries support int, float, and string data types. * To convert the supported data types into other Flux basic data types, use Flux type conversion functions. *

* * Example: *

*
*
{@code
     * Instant yesterday = Instant.now().minus(Period.ofDays(1));
     * QueryApi queryApi = client.getQueryApi();
     * Map params = new HashMap<>();
     * params.put("bucketParam", bucket);
     * params.put("startParam", yesterday.toString());
     * String parametrizedQuery = "from(bucket: params.bucketParam) |> range(start: time(v: params.startParam))";
     * List query = queryApi.query(parametrizedQuery, org, params);
     * }
     * 
*
* * @param query the flux query to execute * @param org specifies the source organization * @param params the map of query parameters. * * @return {@code List} which are matched the query * * @see InfluxDB Cloud * Parametrized Queries */ @Nonnull List query(@Nonnull final String query, @Nonnull final String org, @Nullable Map params); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to {@code List}. *

* NOTE: This method is not intended for large query results. * Use {@link QueryApi#query(String, String, BiConsumer, Consumer, Runnable)} for large data streaming. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @return {@code List} which are matched the query */ @Nonnull List query(@Nonnull final Query query); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to {@code List}. *

* NOTE: This method is not intended for large query results. * Use {@link QueryApi#query(String, String, BiConsumer, Consumer, Runnable)} for large data streaming. * * @param query the flux query to execute * @param org specifies the source organization * @return {@code List} which are matched the query */ @Nonnull List query(@Nonnull final Query query, @Nonnull final String org); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to list of object with given type. *

* NOTE: This method is not intended for large query results. * Use {@link QueryApi#query(String, String, Class, BiConsumer, Consumer, Runnable)} for large data streaming. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param the type of the measurement (POJO) * @param query the flux query to execute * @param measurementType the type of measurement * @return {@code List} which are matched the query */ @Nonnull List query(@Nonnull final String query, @Nonnull final Class measurementType); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to list of object with given type. *

* NOTE: This method is not intended for large query results. * Use {@link QueryApi#query(String, String, Class, BiConsumer, Consumer, Runnable)} for large data streaming. * * @param the type of the measurement (POJO) * @param query the flux query to execute * @param org specifies the source organization * @param measurementType the type of measurement * @return {@code List} which are matched the query */ @Nonnull List query(@Nonnull final String query, @Nonnull final String org, @Nonnull final Class measurementType); /** * Executes the Parameterized Flux query against the InfluxDB 2.x and synchronously map whole response * to list of object with given type. *

* NOTE: This method is not intended for large query results. * Use {@link QueryApi#query(String, String, Class, BiConsumer, Consumer, Runnable)} for large data streaming. * * @param the type of the measurement (POJO) * @param query the flux query to execute * @param org specifies the source organization * @param measurementType the type of measurement * @param params the map of query parameters. See {@link QueryApi#query(String, String, Map)} for parameter * usage. * * @return {@code List} which are matched the query */ List query(@Nonnull final String query, @Nonnull final String org, @Nonnull final Class measurementType, @Nullable final Map params); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to list of object with given type. *

* NOTE: This method is not intended for large query results. * Use {@link QueryApi#query(String, String, Class, BiConsumer, Consumer, Runnable)} for large data streaming. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param the type of the measurement (POJO) * @param query the flux query to execute * @param measurementType the type of measurement * @return {@code List} which are matched the query */ @Nonnull List query(@Nonnull final Query query, @Nonnull final Class measurementType); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to list of object with given type. *

* NOTE: This method is not intended for large query results. * Use {@link QueryApi#query(String, String, Class, BiConsumer, Consumer, Runnable)} for large data streaming. * * @param the type of the measurement (POJO) * @param query the flux query to execute * @param org specifies the source organization * @param measurementType the type of measurement * @return {@code List} which are matched the query */ @Nonnull List query(@Nonnull final Query query, @Nonnull final String org, @Nonnull final Class measurementType); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param onNext the callback to consume the FluxRecord result with capability * to discontinue a streaming query */ void query(@Nonnull final String query, @Nonnull final BiConsumer onNext); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * * @param query the flux query to execute * @param org specifies the source organization * @param onNext the callback to consume the FluxRecord result with capability * to discontinue a streaming query */ void query(@Nonnull final String query, @Nonnull final String org, @Nonnull final BiConsumer onNext); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param onNext the callback to consume the FluxRecord result with capability * to discontinue a streaming query */ void query(@Nonnull final Query query, @Nonnull final BiConsumer onNext); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * * @param query the flux query to execute * @param org specifies the source organization * @param onNext the callback to consume the FluxRecord result with capability * to discontinue a streaming query */ void query(@Nonnull final Query query, @Nonnull final String org, @Nonnull final BiConsumer onNext); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream POJO classes * to {@code onNext} consumer. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param the type of the measurement (POJO) * @param query the flux query to execute * @param measurementType the measurement type (POJO) * @param onNext the callback to consume the mapped Measurements with capability to discontinue * a streaming query */ void query(@Nonnull final String query, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream POJO classes * to {@code onNext} consumer. * * @param the type of the measurement (POJO) * @param query the flux query to execute * @param org specifies the source organization * @param measurementType the measurement type (POJO) * @param onNext the callback to consume the mapped Measurements with capability to discontinue * a streaming query */ void query(@Nonnull final String query, @Nonnull final String org, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream POJO classes * to {@code onNext} consumer. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param the type of the measurement (POJO) * @param query the flux query to execute * @param measurementType the measurement type (POJO) * @param onNext the callback to consume the mapped Measurements with capability to discontinue * a streaming query */ void query(@Nonnull final Query query, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream POJO classes * to {@code onNext} consumer. * * @param the type of the measurement (POJO) * @param query the flux query to execute * @param org specifies the source organization * @param measurementType the measurement type (POJO) * @param onNext the callback to consume the mapped Measurements with capability to discontinue * a streaming query */ void query(@Nonnull final Query query, @Nonnull final String org, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param onNext the callback to consume FluxRecord result with capability to discontinue a streaming query * @param onError the callback to consume any error notification */ void query(@Nonnull final String query, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * * @param query the flux query to execute * @param org specifies the source organization * @param onNext the callback to consume FluxRecord result with capability to discontinue a streaming query * @param onError the callback to consume any error notification */ void query(@Nonnull final String query, @Nonnull final String org, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param onNext the callback to consume FluxRecord result with capability to discontinue a streaming query * @param onError the callback to consume any error notification */ void query(@Nonnull final Query query, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * * @param query the flux query to execute * @param org specifies the source organization * @param onNext the callback to consume FluxRecord result with capability to discontinue a streaming query * @param onError the callback to consume any error notification */ void query(@Nonnull final Query query, @Nonnull final String org, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream POJO classes * to {@code onNext} consumer. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param the type of the measurement (POJO) * @param query the flux query to execute * @param measurementType the measurement type (POJO) * @param onNext the callback to consume POJO record with capability to discontinue a streaming query * @param onError the callback to consume any error notification */ void query(@Nonnull final String query, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream POJO classes * to {@code onNext} consumer. * * @param the type of the measurement (POJO) * @param query the flux query to execute * @param org specifies the source organization * @param measurementType the measurement type (POJO) * @param onNext the callback to consume POJO record with capability to discontinue a streaming query * @param onError the callback to consume any error notification */ void query(@Nonnull final String query, @Nonnull final String org, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream POJO classes * to {@code onNext} consumer. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param the type of the measurement (POJO) * @param query the flux query to execute * @param measurementType the measurement type (POJO) * @param onNext the callback to consume POJO record with capability to discontinue a streaming query * @param onError the callback to consume any error notification */ void query(@Nonnull final Query query, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream POJO classes * to {@code onNext} consumer. * * @param the type of the measurement (POJO) * @param query the flux query to execute * @param org specifies the source organization * @param measurementType the measurement type (POJO) * @param onNext the callback to consume POJO record with capability to discontinue a streaming query * @param onError the callback to consume any error notification */ void query(@Nonnull final Query query, @Nonnull final String org, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param onNext the callback to consume FluxRecord result with capability to discontinue a streaming query * @param onError the callback to consume any error notification * @param onComplete the callback to consume a notification about successfully end of stream */ void query(@Nonnull final String query, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * * @param query the flux query to execute * @param org specifies the source organization * @param onNext the callback to consume FluxRecord result with capability to discontinue a streaming query * @param onError the callback to consume any error notification * @param onComplete the callback to consume a notification about successfully end of stream */ void query(@Nonnull final String query, @Nonnull final String org, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Parameterized Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * * @param query the flux query to execute * @param org specifies the source organization * @param onNext the callback to consume FluxRecord result with capability to discontinue a streaming query * @param onError the callback to consume any error notification * @param onComplete the callback to consume a notification about successfully end of stream * @param params the map of query parameters, see {@link QueryApi#query(String, String, Map)} for parameter * usage. */ void query(@Nonnull final String query, @Nonnull final String org, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete, @Nullable final Map params); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param onNext the callback to consume FluxRecord result with capability to discontinue a streaming query * @param onError the callback to consume any error notification * @param onComplete the callback to consume a notification about successfully end of stream */ void query(@Nonnull final Query query, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream {@link FluxRecord}s * to {@code onNext} consumer. * * @param query the flux query to execute * @param org specifies the source organization * @param onNext the callback to consume FluxRecord result with capability to discontinue a streaming query * @param onError the callback to consume any error notification * @param onComplete the callback to consume a notification about successfully end of stream */ void query(@Nonnull final Query query, @Nonnull final String org, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Flux query and asynchronously stream result as POJO. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param the type of the measurement (POJO) * @param query the flux query to execute * @param measurementType the measurement type (POJO) * @param onNext the callback to consume POJO record with capability to discontinue a streaming query * @param onError the callback to consume any error notification * @param onComplete the callback to consume a notification about successfully end of stream */ void query(@Nonnull final String query, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Flux query and asynchronously stream result as POJO. * * @param the type of the measurement (POJO) * @param query the flux query to execute * @param org specifies the source organization * @param measurementType the measurement type (POJO) * @param onNext the callback to consume POJO record with capability to discontinue a streaming query * @param onError the callback to consume any error notification * @param onComplete the callback to consume a notification about successfully end of stream */ void query(@Nonnull final String query, @Nonnull final String org, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Parameterized Flux query and asynchronously stream result as POJO. * * @param the type of the measurement (POJO) * @param query the flux query to execute * @param org specifies the source organization * @param measurementType the measurement type (POJO) * @param onNext the callback to consume POJO record with capability to discontinue a streaming query * @param onError the callback to consume any error notification * @param onComplete the callback to consume a notification about successfully end of stream * @param params the map of query parameters, See {@link QueryApi#query(String, String, Map)} for parameter * usage. */ void query(@Nonnull final String query, @Nonnull final String org, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete, @Nullable final Map params); /** * Executes the Flux query and asynchronously stream result as POJO. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param the type of the measurement (POJO) * @param query the flux query to execute * @param measurementType the measurement type (POJO) * @param onNext the callback to consume POJO record with capability to discontinue a streaming query * @param onError the callback to consume any error notification * @param onComplete the callback to consume a notification about successfully end of stream */ void query(@Nonnull final Query query, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Flux query and asynchronously stream result as POJO. * * @param the type of the measurement (POJO) * @param query the flux query to execute * @param org specifies the source organization * @param measurementType the measurement type (POJO) * @param onNext the callback to consume POJO record with capability to discontinue a streaming query * @param onError the callback to consume any error notification * @param onComplete the callback to consume a notification about successfully end of stream */ void query(@Nonnull final Query query, @Nonnull final String org, @Nonnull final Class measurementType, @Nonnull final BiConsumer onNext, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to {@link String} result. *

* NOTE: This method is not intended for large responses, that do not fit into memory. * Use {@link QueryApi#queryRaw(String, String, BiConsumer, Consumer, Runnable)} for large data streaming. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @return the raw response that matched the query */ @Nonnull String queryRaw(@Nonnull final String query); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to {@link String} result. *

* NOTE: This method is not intended for large responses, that do not fit into memory. * Use {@link QueryApi#queryRaw(String, String, BiConsumer, Consumer, Runnable)} for large data streaming. * * @param query the flux query to execute * @param org specifies the source organization * @return the raw response that matched the query */ @Nonnull String queryRaw(@Nonnull final String query, @Nonnull final String org); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to {@link String} result. *

* NOTE: This method is not intended for large responses, that do not fit into memory. * Use {@link QueryApi#queryRaw(String, String, BiConsumer, Consumer, Runnable)} for large data streaming. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param dialect Dialect is an object defining the options to use when encoding the response. * See dialect SPEC.. * @return the raw response that matched the query */ @Nonnull String queryRaw(@Nonnull final String query, @Nullable final Dialect dialect); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to {@link String} result. *

* NOTE: This method is not intended for large responses, that do not fit into memory. * Use {@link QueryApi#queryRaw(String, String, BiConsumer, Consumer, Runnable)} for large data streaming. * * @param query the flux query to execute * @param dialect Dialect is an object defining the options to use when encoding the response. * See dialect SPEC.. * @param org specifies the source organization * @return the raw response that matched the query */ @Nonnull String queryRaw(@Nonnull final String query, @Nullable final Dialect dialect, @Nonnull final String org); /** * Executes the Parameterized Flux query against the InfluxDB 2.x and synchronously map whole response * to {@link String} result. *

* NOTE: This method is not intended for large responses, that do not fit into memory. * Use {@link QueryApi#queryRaw(String, String, BiConsumer, Consumer, Runnable)} for large data streaming. * * @param query the flux query to execute * @param dialect Dialect is an object defining the options to use when encoding the response. * See dialect SPEC.. * @param org specifies the source organization * @param params the map of query parameters, See {@link QueryApi#query(String, String, Map)} for parameter * usage. * @return the raw response that matched the query */ @Nonnull String queryRaw(@Nonnull final String query, @Nullable final Dialect dialect, @Nonnull final String org, @Nullable final Map params); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to {@link String} result. *

* NOTE: This method is not intended for large responses, that do not fit into memory. * Use {@link QueryApi#queryRaw(String, String, BiConsumer, Consumer, Runnable)} for large data streaming. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @return the raw response that matched the query */ @Nonnull String queryRaw(@Nonnull final Query query); /** * Executes the Flux query against the InfluxDB 2.x and synchronously map whole response * to {@link String} result. *

* NOTE: This method is not intended for large responses, that do not fit into memory. * Use {@link QueryApi#queryRaw(String, String, BiConsumer, Consumer, Runnable)} for large data streaming. * * @param query the flux query to execute * @param org specifies the source organization * @return the raw response that matched the query */ @Nonnull String queryRaw(@Nonnull final Query query, @Nonnull final String org); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param onResponse callback to consume the response line by line with capability * to discontinue a streaming query */ void queryRaw(@Nonnull final String query, @Nonnull final BiConsumer onResponse); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * * @param query the flux query to execute * @param org specifies the source organization * @param onResponse callback to consume the response line by line with capability * to discontinue a streaming query */ void queryRaw(@Nonnull final String query, @Nonnull final String org, @Nonnull final BiConsumer onResponse); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * * @param query the flux query to execute * @param org specifies the source organization * @param onResponse callback to consume the response line by line with capability * to discontinue a streaming query */ void queryRaw(@Nonnull final Query query, @Nonnull final String org, @Nonnull final BiConsumer onResponse); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param onResponse callback to consume the response line by line with capability * to discontinue a streaming query */ void queryRaw(@Nonnull final Query query, @Nonnull final BiConsumer onResponse); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param dialect Dialect is an object defining the options to use when encoding the response. * See dialect SPEC.. * @param onResponse the callback to consume the response line by line */ void queryRaw(@Nonnull final String query, @Nullable final Dialect dialect, @Nonnull final BiConsumer onResponse); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * * @param query the flux query to execute * @param dialect Dialect is an object defining the options to use when encoding the response. * See dialect SPEC.. * @param org specifies the source organization * @param onResponse the callback to consume the response line by line */ void queryRaw(@Nonnull final String query, @Nullable final Dialect dialect, @Nonnull final String org, @Nonnull final BiConsumer onResponse); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * @param onError callback to consume any error notification */ void queryRaw(@Nonnull final String query, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * * @param query the flux query to execute * @param org specifies the source organization * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * @param onError callback to consume any error notification */ void queryRaw(@Nonnull final String query, @Nonnull final String org, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError); /** * Executes the Parameterized Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * * @param query the flux query to execute * @param org specifies the source organization * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * @param onError callback to consume any error notification * @param params the map of query parameters, See {@link QueryApi#query(String, String, Map)} for parameter * usage. */ void queryRaw(@Nonnull final String query, @Nonnull final String org, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError, @Nullable final Map params); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * @param onError callback to consume any error notification */ void queryRaw(@Nonnull final Query query, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * * @param query the flux query to execute * @param org specifies the source organization * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * @param onError callback to consume any error notification */ void queryRaw(@Nonnull final Query query, @Nonnull final String org, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param dialect Dialect is an object defining the options to use when encoding the response. * See dialect SPEC.. * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * @param onError callback to consume any error notification */ void queryRaw(@Nonnull final String query, @Nullable final Dialect dialect, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * * @param query the flux query to execute * @param dialect Dialect is an object defining the options to use when encoding the response. * See dialect SPEC.. * @param org specifies the source organization * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * @param onError callback to consume any error notification */ void queryRaw(@Nonnull final String query, @Nullable final Dialect dialect, @Nonnull final String org, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * * @param query the flux query to execute * @param org specifies the source organization * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * @param onError callback to consume any error notification * @param onComplete callback to consume a notification about successfully end of stream */ void queryRaw(@Nonnull final String query, @Nonnull final String org, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * @param onError callback to consume any error notification * @param onComplete callback to consume a notification about successfully end of stream */ void queryRaw(@Nonnull final String query, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param dialect Dialect is an object defining the options to use when encoding the response. * See dialect SPEC.. * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * The callback call contains the one line of the response. * @param onError callback to consume any error notification * @param onComplete callback to consume a notification about successfully end of stream */ void queryRaw(@Nonnull final String query, @Nullable final Dialect dialect, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * * @param query the flux query to execute * @param dialect Dialect is an object defining the options to use when encoding the response. * See dialect SPEC.. * @param org specifies the source organization * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * The callback call contains the one line of the response. * @param onError callback to consume any error notification * @param onComplete callback to consume a notification about successfully end of stream */ void queryRaw(@Nonnull final String query, @Nullable final Dialect dialect, @Nonnull final String org, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Parameterized Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * * @param query the flux query to execute * @param dialect Dialect is an object defining the options to use when encoding the response. * See dialect SPEC.. * @param org specifies the source organization * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * The callback call contains the one line of the response. * @param onError callback to consume any error notification * @param onComplete callback to consume a notification about successfully end of stream * @param params the map of query parameters, See {@link QueryApi#query(String, String, Map)} for parameter * usage. */ void queryRaw(@Nonnull final String query, @Nullable final Dialect dialect, @Nonnull final String org, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete, @Nullable final Map params); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * * @param query the flux query to execute * @param org specifies the source organization * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * @param onError callback to consume any error notification * @param onComplete callback to consume a notification about successfully end of stream */ void queryRaw(@Nonnull final Query query, @Nonnull final String org, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); /** * Executes the Flux query against the InfluxDB 2.x and asynchronously stream response * (line by line) to {@code onResponse}. * *

The {@link InfluxDBClientOptions#getOrg()} will be used as source organization.

* * @param query the flux query to execute * @param onResponse the callback to consume the response line by line * with capability to discontinue a streaming query * @param onError callback to consume any error notification * @param onComplete callback to consume a notification about successfully end of stream */ void queryRaw(@Nonnull final Query query, @Nonnull final BiConsumer onResponse, @Nonnull final Consumer onError, @Nonnull final Runnable onComplete); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy