public class FluxApiImpl extends AbstractQueryApi implements FluxClient
DEFAULT_DIALECT, EMPTY_ACTION, ERROR_CONSUMER, fluxCsvParser, resultMapper| Constructor and Description |
|---|
FluxApiImpl(FluxConnectionOptions options) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the client, initiates shutdown, no new running calls are accepted during shutdown.
|
LogLevel |
getLogLevel()
Gets the
LogLevel that is used for logging requests and responses. |
Boolean |
ping()
Check the status of InfluxDB Server.
|
List<FluxTable> |
query(String query)
Executes the Flux query against the InfluxDB and synchronously map whole response to
List<FluxTable>. |
void |
query(String query,
BiConsumer<Cancellable,FluxRecord> onNext)
Executes the Flux query against the InfluxDB and asynchronously stream
FluxRecords
to onNext consumer. |
void |
query(String query,
BiConsumer<Cancellable,FluxRecord> onNext,
Consumer<? super Throwable> onError)
Executes the Flux query against the InfluxDB and asynchronously stream
FluxRecords
to onNext consumer. |
void |
query(String query,
BiConsumer<Cancellable,FluxRecord> onNext,
Consumer<? super Throwable> onError,
Runnable onComplete)
Executes the Flux query against the InfluxDB and asynchronously stream
FluxRecords
to onNext consumer. |
<M> List<M> |
query(String query,
Class<M> measurementType)
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
to
onNext 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
to
onNext 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.
|
String |
queryRaw(String query)
Executes the Flux query against the InfluxDB and synchronously map whole response to
String result. |
void |
queryRaw(String query,
BiConsumer<Cancellable,String> onResponse)
Executes the Flux query against the InfluxDB and asynchronously stream response
(line by line) to
onResponse. |
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) to
onResponse. |
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) to
onResponse. |
String |
queryRaw(String query,
String dialect)
Executes the Flux query against the InfluxDB and synchronously map whole response to
String 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) to
onResponse. |
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) to
onResponse. |
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) to
onResponse. |
FluxClient |
setLogLevel(LogLevel logLevel)
Sets the log level for the request and response information.
|
String |
version()
Returns the version of the connected InfluxDB Server.
|
createBody, query, query, queryRawexecute, getLogLevel, responseToError, setLogLevelpublic FluxApiImpl(@Nonnull FluxConnectionOptions options)
@Nonnull public List<FluxTable> query(@Nonnull String query)
FluxClientList<FluxTable>.
NOTE: This method is not intended for large query results.
Use FluxClient.query(String, BiConsumer, Consumer, Runnable) for large data streaming.
query in interface FluxClientquery - the flux query to executeList<FluxTable> which are matched the query@Nonnull public <M> List<M> query(@Nonnull String query, @Nonnull Class<M> measurementType)
FluxClient
NOTE: This method is not intended for large query results.
Use FluxClient.query(String, Class, BiConsumer, Consumer, Runnable) for large data streaming.
query in interface FluxClientquery - the flux query to executemeasurementType - the type of measurementList<FluxTable> which are matched the querypublic void query(@Nonnull String query, @Nonnull BiConsumer<Cancellable,FluxRecord> onNext)
FluxClientFluxRecords
to onNext consumer.query in interface FluxClientquery - the flux query to executeonNext - the callback to consume the FluxRecord result with capability to discontinue a streaming querypublic <M> void query(@Nonnull String query, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable,M> onNext)
FluxClientonNext consumer.query in interface FluxClientM - the type of the measurement (POJO)query - the flux query to executemeasurementType - the measurement type (POJO)onNext - the callback to consume the FluxRecord result with capability to discontinue a streaming querypublic void query(@Nonnull String query, @Nonnull BiConsumer<Cancellable,FluxRecord> onNext, @Nonnull Consumer<? super Throwable> onError)
FluxClientFluxRecords
to onNext consumer.query in interface FluxClientquery - the flux query to executeonNext - the callback to consume FluxRecord result with capability to discontinue a streaming queryonError - the callback to consume any error notificationpublic <M> void query(@Nonnull String query, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable,M> onNext, @Nonnull Consumer<? super Throwable> onError)
FluxClientonNext consumer.query in interface FluxClientM - the type of the measurement (POJO)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 notificationpublic void query(@Nonnull String query, @Nonnull BiConsumer<Cancellable,FluxRecord> onNext, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete)
FluxClientFluxRecords
to onNext consumer.query in interface FluxClientquery - 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 streampublic <M> void query(@Nonnull String query, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable,M> onNext, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete)
FluxClientquery in interface FluxClientM - the type of the measurement (POJO)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@Nonnull public String queryRaw(@Nonnull String query)
FluxClientString 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.
queryRaw in interface FluxClientquery - the flux query to execute@Nonnull public String queryRaw(@Nonnull String query, @Nullable String dialect)
FluxClientString 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.
queryRaw in interface FluxClientquery - the flux query to executedialect - Dialect is an object defining the options to use when encoding the response.
See dialect SPEC..public void queryRaw(@Nonnull String query, @Nonnull BiConsumer<Cancellable,String> onResponse)
FluxClientonResponse.queryRaw in interface FluxClientquery - the flux query to executeonResponse - callback to consume the response line by line with capability to discontinue a streaming querypublic void queryRaw(@Nonnull String query, @Nullable String dialect, @Nonnull BiConsumer<Cancellable,String> onNext)
FluxClientonResponse.queryRaw in interface FluxClientquery - 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 querypublic void queryRaw(@Nonnull String query, @Nonnull BiConsumer<Cancellable,String> onResponse, @Nonnull Consumer<? super Throwable> onError)
FluxClientonResponse.queryRaw in interface FluxClientquery - 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 notificationpublic void queryRaw(@Nonnull String query, @Nullable String dialect, @Nonnull BiConsumer<Cancellable,String> onResponse, @Nonnull Consumer<? super Throwable> onError)
FluxClientonResponse.queryRaw in interface FluxClientquery - 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 notificationpublic void queryRaw(@Nonnull String query, @Nonnull BiConsumer<Cancellable,String> onResponse, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete)
FluxClientonResponse.queryRaw in interface FluxClientquery - 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 streampublic void queryRaw(@Nonnull String query, @Nullable String dialect, @Nonnull BiConsumer<Cancellable,String> onResponse, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete)
FluxClientonResponse.queryRaw in interface FluxClientquery - 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@Nonnull public Boolean ping()
FluxClientping in interface FluxClientBoolean.TRUE if server is healthy otherwise return Boolean.FALSE@Nonnull public String version()
FluxClientversion in interface FluxClient@Nonnull public LogLevel getLogLevel()
FluxClientLogLevel that is used for logging requests and responses.getLogLevel in interface FluxClientLogLevel that is used for logging requests and responses@Nonnull public FluxClient setLogLevel(@Nonnull LogLevel logLevel)
FluxClientsetLogLevel in interface FluxClientlogLevel - the log level to set.public void close()
close in interface FluxClientCopyright © 2018–2020 InfluxData, Inc.. All rights reserved.