Class FluxApiImpl
java.lang.Object
com.influxdb.internal.AbstractRestClient
com.influxdb.internal.AbstractQueryApi
com.influxdb.client.flux.internal.FluxApiImpl
- All Implemented Interfaces:
FluxClient
- Author:
- Jakub Bednar (bednar@github) (03/10/2018 14:20)
-
Nested Class Summary
Nested classes/interfaces inherited from class com.influxdb.internal.AbstractQueryApi
AbstractQueryApi.FluxRecordIterator, AbstractQueryApi.RawIterator
-
Field Summary
Fields inherited from class com.influxdb.internal.AbstractQueryApi
DEFAULT_DIALECT, EMPTY_ACTION, ERROR_CONSUMER, fluxCsvParser, LOG, resultMapper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the client, initiates shutdown, no new running calls are accepted during shutdown.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> onNext) 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.Methods inherited from class com.influxdb.internal.AbstractQueryApi
createBody, query, query, queryIterator, queryRaw, queryRawIterator
Methods inherited from class com.influxdb.internal.AbstractRestClient
execute, getLogLevel, ping, responseToError, setLogLevel, toInfluxException, version
-
Constructor Details
-
FluxApiImpl
-
-
Method Details
-
query
Description copied from interface:FluxClient
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
FluxClient.query(String, BiConsumer, Consumer, Runnable)
for large data streaming.- Specified by:
query
in interfaceFluxClient
- Parameters:
query
- the flux query to execute- Returns:
List<FluxTable>
which are matched the query
-
query
Description copied from interface:FluxClient
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
FluxClient.query(String, Class, BiConsumer, Consumer, Runnable)
for large data streaming.- Specified by:
query
in interfaceFluxClient
- Parameters:
query
- the flux query to executemeasurementType
- the type of measurement- Returns:
List<FluxTable>
which are matched the query
-
query
Description copied from interface:FluxClient
Executes the Flux query against the InfluxDB and asynchronously streamFluxRecord
s toonNext
consumer.- Specified by:
query
in interfaceFluxClient
- Parameters:
query
- the flux query to executeonNext
- the callback to consume the FluxRecord result with capability to discontinue a streaming query
-
query
public <M> void query(@Nonnull String query, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable, M> onNext) Description copied from interface:FluxClient
Executes the Flux query against the InfluxDB and asynchronously stream POJO classes toonNext
consumer.- Specified by:
query
in interfaceFluxClient
- 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
public void query(@Nonnull String query, @Nonnull BiConsumer<Cancellable, FluxRecord> onNext, @Nonnull Consumer<? super Throwable> onError) Description copied from interface:FluxClient
Executes the Flux query against the InfluxDB and asynchronously streamFluxRecord
s toonNext
consumer.- Specified by:
query
in interfaceFluxClient
- 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
public <M> void query(@Nonnull String query, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable, M> onNext, @Nonnull Consumer<? super Throwable> onError) Description copied from interface:FluxClient
Executes the Flux query against the InfluxDB and asynchronously stream POJO classes toonNext
consumer.- Specified by:
query
in interfaceFluxClient
- 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
public void query(@Nonnull String query, @Nonnull BiConsumer<Cancellable, FluxRecord> onNext, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete) Description copied from interface:FluxClient
Executes the Flux query against the InfluxDB and asynchronously streamFluxRecord
s toonNext
consumer.- Specified by:
query
in interfaceFluxClient
- 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
public <M> void query(@Nonnull String query, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable, M> onNext, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete) Description copied from interface:FluxClient
Executes the Flux query and asynchronously stream result as POJO.- Specified by:
query
in interfaceFluxClient
- 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
Description copied from interface:FluxClient
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
FluxClient.queryRaw(String, BiConsumer, Consumer, Runnable)
for large data streaming.- Specified by:
queryRaw
in interfaceFluxClient
- Parameters:
query
- the flux query to execute- Returns:
- the raw response that matched the query
-
queryRaw
Description copied from interface:FluxClient
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
FluxClient.queryRaw(String, String, BiConsumer, Consumer, Runnable)
for large data streaming.- Specified by:
queryRaw
in interfaceFluxClient
- 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
Description copied from interface:FluxClient
Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.- Specified by:
queryRaw
in interfaceFluxClient
- Parameters:
query
- the flux query to executeonResponse
- callback to consume the response line by line with capability to discontinue a streaming query
-
queryRaw
public void queryRaw(@Nonnull String query, @Nullable String dialect, @Nonnull BiConsumer<Cancellable, String> onNext) Description copied from interface:FluxClient
Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.- Specified by:
queryRaw
in interfaceFluxClient
- Parameters:
query
- the flux query to executedialect
- Dialect is an object defining the options to use when encoding the response. See dialect SPEC..onNext
- the callback to consume the response line by line with capability to discontinue a streaming query
-
queryRaw
public void queryRaw(@Nonnull String query, @Nonnull BiConsumer<Cancellable, String> onResponse, @Nonnull Consumer<? super Throwable> onError) Description copied from interface:FluxClient
Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.- Specified by:
queryRaw
in interfaceFluxClient
- 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
public void queryRaw(@Nonnull String query, @Nullable String dialect, @Nonnull BiConsumer<Cancellable, String> onResponse, @Nonnull Consumer<? super Throwable> onError) Description copied from interface:FluxClient
Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.- Specified by:
queryRaw
in interfaceFluxClient
- 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
public void queryRaw(@Nonnull String query, @Nonnull BiConsumer<Cancellable, String> onResponse, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete) Description copied from interface:FluxClient
Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.- Specified by:
queryRaw
in interfaceFluxClient
- 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
public void queryRaw(@Nonnull String query, @Nullable String dialect, @Nonnull BiConsumer<Cancellable, String> onResponse, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete) Description copied from interface:FluxClient
Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse
.- Specified by:
queryRaw
in interfaceFluxClient
- 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
Description copied from interface:FluxClient
Check the status of InfluxDB Server.- Specified by:
ping
in interfaceFluxClient
- Returns:
Boolean.TRUE
if server is healthy otherwise returnBoolean.FALSE
-
version
Description copied from interface:FluxClient
Returns the version of the connected InfluxDB Server.- Specified by:
version
in interfaceFluxClient
- Returns:
- the version String, otherwise unknown.
-
getLogLevel
Description copied from interface:FluxClient
Gets theLogLevel
that is used for logging requests and responses.- Specified by:
getLogLevel
in interfaceFluxClient
- Returns:
- the
LogLevel
that is used for logging requests and responses
-
setLogLevel
Description copied from interface:FluxClient
Sets the log level for the request and response information.- Specified by:
setLogLevel
in interfaceFluxClient
- Parameters:
logLevel
- the log level to set.- Returns:
- the FluxClient instance to be able to use it in a fluent manner.
-
close
public void close()Closes the client, initiates shutdown, no new running calls are accepted during shutdown.- Specified by:
close
in interfaceFluxClient
-