Package com.influxdb.client.internal
Class InfluxQLQueryApiImpl
java.lang.Object
com.influxdb.internal.AbstractRestClient
com.influxdb.internal.AbstractQueryApi
com.influxdb.client.internal.InfluxQLQueryApiImpl
- All Implemented Interfaces:
InfluxQLQueryApi
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
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 TypeMethodDescriptionquery
(InfluxQLQuery influxQLQuery) Executes an InfluxQL query against the legacy endpoint.query
(InfluxQLQuery influxQLQuery, InfluxQLQueryResult.Series.ValueExtractor valueExtractor) Executes an InfluxQL query against the legacy endpoint.queryCSV
(InfluxQLQuery influxQLQuery) Convenience method to specify use of the mime typeapplication/csv
in theAccept
header.queryCSV
(InfluxQLQuery influxQLQuery, InfluxQLQueryResult.Series.ValueExtractor valueExtractor) Convenience method to specify use of the mime typeapplication/csv
in theAccept
header.queryJSON
(InfluxQLQuery influxQLQuery) Convenience method to specify use of the mime typeapplication/json
in theAccept
header.queryJSON
(InfluxQLQuery influxQLQuery, InfluxQLQueryResult.Series.ValueExtractor valueExtractor) Convenience method to specify use of the mime typeapplication/json
in theAccept
header.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
-
InfluxQLQueryApiImpl
-
-
Method Details
-
query
Description copied from interface:InfluxQLQueryApi
Executes an InfluxQL query against the legacy endpoint.- Specified by:
query
in interfaceInfluxQLQueryApi
- Parameters:
influxQLQuery
- the query- Returns:
- the result
-
query
@Nonnull public InfluxQLQueryResult query(@Nonnull InfluxQLQuery influxQLQuery, @Nullable InfluxQLQueryResult.Series.ValueExtractor valueExtractor) Description copied from interface:InfluxQLQueryApi
Executes an InfluxQL query against the legacy endpoint. The value extractor is called for each resulting column to convert the string value returned by query into a custom type.Example:
InfluxQLQueryResult result = influxQLQueryApi.query( new InfluxQLQuery("SELECT FIRST(\"free\") FROM \"influxql\"", DATABASE_NAME) .setPrecision(InfluxQLQuery.InfluxQLPrecision.SECONDS), (columnName, rawValue, resultIndex, seriesName) -> { switch (columnName) { case "time": return Instant.ofEpochSecond(Long.parseLong(rawValue)); case "first": return new BigDecimal(rawValue); default: throw new IllegalArgumentException("unexpected column " + columnName); } } );
- Specified by:
query
in interfaceInfluxQLQueryApi
- Parameters:
influxQLQuery
- the queryvalueExtractor
- a callback, to convert column values- Returns:
- the result
-
queryCSV
Description copied from interface:InfluxQLQueryApi
Convenience method to specify use of the mime typeapplication/csv
in theAccept
header. Result timestamps will be in the Epoch format.- Specified by:
queryCSV
in interfaceInfluxQLQueryApi
- Parameters:
influxQLQuery
- the query- Returns:
- the result
-
queryCSV
public InfluxQLQueryResult queryCSV(@Nonnull InfluxQLQuery influxQLQuery, @Nullable InfluxQLQueryResult.Series.ValueExtractor valueExtractor) Description copied from interface:InfluxQLQueryApi
Convenience method to specify use of the mime typeapplication/csv
in theAccept
header. Result timestamps will be in the Epoch format.- Specified by:
queryCSV
in interfaceInfluxQLQueryApi
- Parameters:
influxQLQuery
- the queryvalueExtractor
- a callback, to convert column values- Returns:
- the result
-
queryJSON
Description copied from interface:InfluxQLQueryApi
Convenience method to specify use of the mime typeapplication/json
in theAccept
header. Result timestamps will be in the RFC3339 format.- Specified by:
queryJSON
in interfaceInfluxQLQueryApi
- Parameters:
influxQLQuery
- the query- Returns:
- the result
-
queryJSON
@Nonnull public InfluxQLQueryResult queryJSON(@Nonnull InfluxQLQuery influxQLQuery, @Nullable InfluxQLQueryResult.Series.ValueExtractor valueExtractor) Description copied from interface:InfluxQLQueryApi
Convenience method to specify use of the mime typeapplication/json
in theAccept
header. Result timestamps will be in the RFC3339 format.- Specified by:
queryJSON
in interfaceInfluxQLQueryApi
- Parameters:
influxQLQuery
- the queryvalueExtractor
- a callback, to convert column values- Returns:
- the result
-