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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the client, initiates shutdown, no new running calls are accepted during shutdown.Gets theLogLevelthat 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> voidquery(String query, Class<M> measurementType, BiConsumer<Cancellable, M> onNext) Executes the Flux query against the InfluxDB and asynchronously stream POJO classes toonNextconsumer.<M> voidquery(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 toonNextconsumer.<M> voidquery(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.voidquery(String query, BiConsumer<Cancellable, FluxRecord> onNext) Executes the Flux query against the InfluxDB and asynchronously streamFluxRecords toonNextconsumer.voidquery(String query, BiConsumer<Cancellable, FluxRecord> onNext, Consumer<? super Throwable> onError) Executes the Flux query against the InfluxDB and asynchronously streamFluxRecords toonNextconsumer.voidquery(String query, BiConsumer<Cancellable, FluxRecord> onNext, Consumer<? super Throwable> onError, Runnable onComplete) Executes the Flux query against the InfluxDB and asynchronously streamFluxRecords toonNextconsumer.Executes the Flux query against the InfluxDB and synchronously map whole response toStringresult.Executes the Flux query against the InfluxDB and synchronously map whole response toStringresult.voidqueryRaw(String query, String dialect, BiConsumer<Cancellable, String> onNext) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse.voidqueryRaw(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.voidqueryRaw(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.voidqueryRaw(String query, BiConsumer<Cancellable, String> onResponse) Executes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse.voidqueryRaw(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.voidqueryRaw(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, queryRawIteratorMethods inherited from class com.influxdb.internal.AbstractRestClient
execute, getLogLevel, ping, responseToError, setLogLevel, toInfluxException, version
-
Constructor Details
-
FluxApiImpl
-
-
Method Details
-
query
Description copied from interface:FluxClientExecutes 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:
queryin interfaceFluxClient- Parameters:
query- the flux query to execute- Returns:
List<FluxTable>which are matched the query
-
query
Description copied from interface:FluxClientExecutes 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:
queryin 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:FluxClientExecutes the Flux query against the InfluxDB and asynchronously streamFluxRecords toonNextconsumer.- Specified by:
queryin 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:FluxClientExecutes the Flux query against the InfluxDB and asynchronously stream POJO classes toonNextconsumer.- Specified by:
queryin 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:FluxClientExecutes the Flux query against the InfluxDB and asynchronously streamFluxRecords toonNextconsumer.- Specified by:
queryin 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:FluxClientExecutes the Flux query against the InfluxDB and asynchronously stream POJO classes toonNextconsumer.- Specified by:
queryin 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:FluxClientExecutes the Flux query against the InfluxDB and asynchronously streamFluxRecords toonNextconsumer.- Specified by:
queryin 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:FluxClientExecutes the Flux query and asynchronously stream result as POJO.- Specified by:
queryin 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:FluxClientExecutes the Flux query against the InfluxDB and synchronously map whole response toStringresult.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:
queryRawin interfaceFluxClient- Parameters:
query- the flux query to execute- Returns:
- the raw response that matched the query
-
queryRaw
Description copied from interface:FluxClientExecutes the Flux query against the InfluxDB and synchronously map whole response toStringresult.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:
queryRawin 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:FluxClientExecutes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse.- Specified by:
queryRawin 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:FluxClientExecutes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse.- Specified by:
queryRawin 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:FluxClientExecutes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse.- Specified by:
queryRawin 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:FluxClientExecutes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse.- Specified by:
queryRawin 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:FluxClientExecutes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse.- Specified by:
queryRawin 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:FluxClientExecutes the Flux query against the InfluxDB and asynchronously stream response (line by line) toonResponse.- Specified by:
queryRawin 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:FluxClientCheck the status of InfluxDB Server.- Specified by:
pingin interfaceFluxClient- Returns:
Boolean.TRUEif server is healthy otherwise returnBoolean.FALSE
-
version
Description copied from interface:FluxClientReturns the version of the connected InfluxDB Server.- Specified by:
versionin interfaceFluxClient- Returns:
- the version String, otherwise unknown.
-
getLogLevel
Description copied from interface:FluxClientGets theLogLevelthat is used for logging requests and responses.- Specified by:
getLogLevelin interfaceFluxClient- Returns:
- the
LogLevelthat is used for logging requests and responses
-
setLogLevel
Description copied from interface:FluxClientSets the log level for the request and response information.- Specified by:
setLogLevelin 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:
closein interfaceFluxClient
-