Package com.influxdb.client.flux
Interface FluxClient
- All Known Implementing Classes:
FluxApiImpl
@ThreadSafe
public interface FluxClient
The client that allows perform Flux queries against the InfluxDB /api/v2/query endpoint.
- Author:
- Jakub Bednar (bednar@github) (01/10/2018 12:17)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Shutdown and close the client.Gets theLogLevel
that is used for logging requests and responses.ping()
Check the status of InfluxDB Server.Executes the Flux query against the InfluxDB and synchronously map whole response toList<FluxTable>
.<M> List
<M> Executes the Flux query against the InfluxDB and synchronously map whole response to list of object with given type.<M> void
query
(String query, Class<M> measurementType, BiConsumer<Cancellable, M> onNext) Executes the Flux query against the InfluxDB and asynchronously stream POJO classes toonNext
consumer.<M> void
query
(String query, Class<M> measurementType, BiConsumer<Cancellable, M> onNext, Consumer<? super Throwable> onError) Executes the Flux query against the InfluxDB and asynchronously stream POJO classes toonNext
consumer.<M> void
query
(String query, Class<M> measurementType, BiConsumer<Cancellable, M> onNext, Consumer<? super Throwable> onError, Runnable onComplete) Executes the Flux query and asynchronously stream result as POJO.void
query
(String query, BiConsumer<Cancellable, FluxRecord> onNext) Executes the Flux query against the InfluxDB and asynchronously streamFluxRecord
s toonNext
consumer.void
query
(String query, BiConsumer<Cancellable, FluxRecord> onNext, Consumer<? super Throwable> onError) Executes the Flux query against the InfluxDB and asynchronously streamFluxRecord
s toonNext
consumer.void
query
(String query, BiConsumer<Cancellable, FluxRecord> onNext, Consumer<? super Throwable> onError, Runnable onComplete) Executes the Flux query against the InfluxDB and asynchronously streamFluxRecord
s toonNext
consumer.Executes the Flux query against the InfluxDB and synchronously map whole response toString
result.Executes the Flux query against the InfluxDB and synchronously map whole response toString
result.void
queryRaw
(String query, String dialect, BiConsumer<Cancellable, String> onResponse) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.void
queryRaw
(String query, String dialect, BiConsumer<Cancellable, String> onResponse, Consumer<? super Throwable> onError) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.void
queryRaw
(String query, String dialect, BiConsumer<Cancellable, String> onResponse, Consumer<? super Throwable> onError, Runnable onComplete) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.void
queryRaw
(String query, BiConsumer<Cancellable, String> onResponse) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.void
queryRaw
(String query, BiConsumer<Cancellable, String> onResponse, Consumer<? super Throwable> onError) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.void
queryRaw
(String query, BiConsumer<Cancellable, String> onResponse, Consumer<? super Throwable> onError, Runnable onComplete) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.setLogLevel
(LogLevel logLevel) Sets the log level for the request and response information.version()
Returns the version of the connected InfluxDB Server.
-
Method Details
-
query
Executes the Flux query against the InfluxDB and synchronously map whole response toList<FluxTable>
.NOTE: This method is not intended for large query results. Use
query(String, BiConsumer, Consumer, Runnable)
for large data streaming.- Parameters:
query
- the flux query to execute- Returns:
List<FluxTable>
which are matched the query
-
query
Executes the Flux query against the InfluxDB and synchronously map whole response to list of object with given type.NOTE: This method is not intended for large query results. Use
query(String, Class, BiConsumer, Consumer, Runnable)
for large data streaming.- Parameters:
query
- the flux query to executemeasurementType
- the type of measurement- Returns:
List<FluxTable>
which are matched the query
-
query
Executes the Flux query against the InfluxDB and asynchronously streamFluxRecord
s toonNext
consumer.- Parameters:
query
- the flux query to executeonNext
- the callback to consume the FluxRecord result with capability to discontinue a streaming query
-
query
<M> void query(@Nonnull String query, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable, M> onNext) Executes the Flux query against the InfluxDB and asynchronously stream POJO classes toonNext
consumer.- Type Parameters:
M
- the type of the measurement (POJO)- Parameters:
query
- the flux query to executemeasurementType
- the measurement type (POJO)onNext
- the callback to consume the FluxRecord result with capability to discontinue a streaming query
-
query
void query(@Nonnull String query, @Nonnull BiConsumer<Cancellable, FluxRecord> onNext, @Nonnull Consumer<? super Throwable> onError) Executes the Flux query against the InfluxDB and asynchronously streamFluxRecord
s toonNext
consumer.- Parameters:
query
- the flux query to executeonNext
- the callback to consume FluxRecord result with capability to discontinue a streaming queryonError
- the callback to consume any error notification
-
query
<M> void query(@Nonnull String query, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable, M> onNext, @Nonnull Consumer<? super Throwable> onError) Executes the Flux query against the InfluxDB and asynchronously stream POJO classes toonNext
consumer.- Type Parameters:
M
- the type of the measurement (POJO)- Parameters:
query
- the flux query to executemeasurementType
- the measurement type (POJO)onNext
- the callback to consume POJO record with capability to discontinue a streaming queryonError
- the callback to consume any error notification
-
query
void query(@Nonnull String query, @Nonnull BiConsumer<Cancellable, FluxRecord> onNext, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete) Executes the Flux query against the InfluxDB and asynchronously streamFluxRecord
s toonNext
consumer.- Parameters:
query
- the flux query to executeonNext
- the callback to consume FluxRecord result with capability to discontinue a streaming queryonError
- the callback to consume any error notificationonComplete
- the callback to consume a notification about successfully end of stream
-
query
<M> void query(@Nonnull String query, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable, M> onNext, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete) Executes the Flux query and asynchronously stream result as POJO.- Type Parameters:
M
- the type of the measurement (POJO)- Parameters:
query
- the flux query to executemeasurementType
- the measurement type (POJO)onNext
- the callback to consume POJO record with capability to discontinue a streaming queryonError
- the callback to consume any error notificationonComplete
- the callback to consume a notification about successfully end of stream
-
queryRaw
Executes the Flux query against the InfluxDB and synchronously map whole response toString
result.NOTE: This method is not intended for large responses, that do not fit into memory. Use
queryRaw(String, BiConsumer, Consumer, Runnable)
for large data streaming.- Parameters:
query
- the flux query to execute- Returns:
- the raw response that matched the query
-
queryRaw
Executes the Flux query against the InfluxDB and synchronously map whole response toString
result.NOTE: This method is not intended for large responses, that do not fit into memory. Use
queryRaw(String, String, BiConsumer, Consumer, Runnable)
for large data streaming.- Parameters:
query
- the flux query to executedialect
- Dialect is an object defining the options to use when encoding the response. See dialect SPEC..- Returns:
- the raw response that matched the query
-
queryRaw
Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.- Parameters:
query
- the flux query to executeonResponse
- callback to consume the response line by line with capability to discontinue a streaming query
-
queryRaw
void queryRaw(@Nonnull String query, @Nullable String dialect, @Nonnull BiConsumer<Cancellable, String> onResponse) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.- Parameters:
query
- the flux query to executedialect
- Dialect is an object defining the options to use when encoding the response. See dialect SPEC..onResponse
- the callback to consume the response line by line with capability to discontinue a streaming query
-
queryRaw
void queryRaw(@Nonnull String query, @Nonnull BiConsumer<Cancellable, String> onResponse, @Nonnull Consumer<? super Throwable> onError) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.- Parameters:
query
- the flux query to executeonResponse
- the callback to consume the response line by line with capability to discontinue a streaming queryonError
- callback to consume any error notification
-
queryRaw
void queryRaw(@Nonnull String query, @Nullable String dialect, @Nonnull BiConsumer<Cancellable, String> onResponse, @Nonnull Consumer<? super Throwable> onError) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.- Parameters:
query
- the flux query to executedialect
- Dialect is an object defining the options to use when encoding the response. See dialect SPEC..onResponse
- the callback to consume the response line by line with capability to discontinue a streaming queryonError
- callback to consume any error notification
-
queryRaw
void queryRaw(@Nonnull String query, @Nonnull BiConsumer<Cancellable, String> onResponse, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.- Parameters:
query
- the flux query to executeonResponse
- the callback to consume the response line by line with capability to discontinue a streaming queryonError
- callback to consume any error notificationonComplete
- callback to consume a notification about successfully end of stream
-
queryRaw
void queryRaw(@Nonnull String query, @Nullable String dialect, @Nonnull BiConsumer<Cancellable, String> onResponse, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.- Parameters:
query
- the flux query to executedialect
- Dialect is an object defining the options to use when encoding the response. See dialect SPEC..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.onError
- callback to consume any error notificationonComplete
- callback to consume a notification about successfully end of stream
-
ping
Check the status of InfluxDB Server.- Returns:
Boolean.TRUE
if server is healthy otherwise returnBoolean.FALSE
-
version
Returns the version of the connected InfluxDB Server.- Returns:
- the version String, otherwise unknown.
-
getLogLevel
Gets theLogLevel
that is used for logging requests and responses.- Returns:
- the
LogLevel
that is used for logging requests and responses
-
setLogLevel
Sets the log level for the request and response information.- Parameters:
logLevel
- the log level to set.- Returns:
- the FluxClient instance to be able to use it in a fluent manner.
-
close
void close()Shutdown and close the client.
-