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
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested 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 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/csvin theAcceptheader.queryCSV(InfluxQLQuery influxQLQuery, InfluxQLQueryResult.Series.ValueExtractor valueExtractor) Convenience method to specify use of the mime typeapplication/csvin theAcceptheader.queryJSON(InfluxQLQuery influxQLQuery) Convenience method to specify use of the mime typeapplication/jsonin theAcceptheader.queryJSON(InfluxQLQuery influxQLQuery, InfluxQLQueryResult.Series.ValueExtractor valueExtractor) Convenience method to specify use of the mime typeapplication/jsonin theAcceptheader.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
-
InfluxQLQueryApiImpl
-
-
Method Details
-
query
Description copied from interface:InfluxQLQueryApiExecutes an InfluxQL query against the legacy endpoint.- Specified by:
queryin 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:InfluxQLQueryApiExecutes 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:
queryin interfaceInfluxQLQueryApi- Parameters:
influxQLQuery- the queryvalueExtractor- a callback, to convert column values- Returns:
- the result
-
queryCSV
Description copied from interface:InfluxQLQueryApiConvenience method to specify use of the mime typeapplication/csvin theAcceptheader. Result timestamps will be in the Epoch format.- Specified by:
queryCSVin interfaceInfluxQLQueryApi- Parameters:
influxQLQuery- the query- Returns:
- the result
-
queryCSV
public InfluxQLQueryResult queryCSV(@Nonnull InfluxQLQuery influxQLQuery, @Nullable InfluxQLQueryResult.Series.ValueExtractor valueExtractor) Description copied from interface:InfluxQLQueryApiConvenience method to specify use of the mime typeapplication/csvin theAcceptheader. Result timestamps will be in the Epoch format.- Specified by:
queryCSVin interfaceInfluxQLQueryApi- Parameters:
influxQLQuery- the queryvalueExtractor- a callback, to convert column values- Returns:
- the result
-
queryJSON
Description copied from interface:InfluxQLQueryApiConvenience method to specify use of the mime typeapplication/jsonin theAcceptheader. Result timestamps will be in the RFC3339 format.- Specified by:
queryJSONin 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:InfluxQLQueryApiConvenience method to specify use of the mime typeapplication/jsonin theAcceptheader. Result timestamps will be in the RFC3339 format.- Specified by:
queryJSONin interfaceInfluxQLQueryApi- Parameters:
influxQLQuery- the queryvalueExtractor- a callback, to convert column values- Returns:
- the result
-