Class InfluxDBClientImpl
- All Implemented Interfaces:
InfluxDBClient,AutoCloseable
Please use InfluxDBClient to create an instance.
-
Constructor Summary
ConstructorsConstructorDescriptionInfluxDBClientImpl(ClientConfig config) Creates an instance using the specified config. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Get InfluxDB server version.Query data from InfluxDB IOx using FlightSQL.query(String query, QueryOptions options) Query data from InfluxDB IOx using FlightSQL.Query data from InfluxDB IOx using FlightSQL.Query data from InfluxDB IOx using FlightSQL.Stream<org.apache.arrow.vector.VectorSchemaRoot>queryBatches(String query) Query data from InfluxDB IOx using FlightSQL.Stream<org.apache.arrow.vector.VectorSchemaRoot>queryBatches(String query, QueryOptions options) Query data from InfluxDB IOx using FlightSQL.Stream<org.apache.arrow.vector.VectorSchemaRoot>queryBatches(String query, Map<String, Object> parameters) Query data from InfluxDB IOx using FlightSQL.Stream<org.apache.arrow.vector.VectorSchemaRoot>queryBatches(String query, Map<String, Object> parameters, QueryOptions options) Query data from InfluxDB IOx using FlightSQL.queryPoints(String query) Query data from InfluxDB IOx into Point structure using FlightSQL.queryPoints(String query, QueryOptions options) Query data from InfluxDB IOx into Point structure using FlightSQL.queryPoints(String query, Map<String, Object> parameters) Query data from InfluxDB IOx into Point structure using FlightSQL.queryPoints(String query, Map<String, Object> parameters, QueryOptions options) Query data from InfluxDB IOx into Point structure using FlightSQL.Query data from InfluxDB IOx using FlightSQL.queryRows(String query, QueryOptions options) Query data from InfluxDB IOx using FlightSQL.Query data from InfluxDB IOx using FlightSQL.Query data from InfluxDB IOx using FlightSQL.voidwritePoint(Point point) Write aPointto the InfluxDB server.voidwritePoint(Point point, WriteOptions options) Write aPointto the InfluxDB server.voidwritePoints(List<Point> points) Write a list ofPointto the InfluxDB server.voidwritePoints(List<Point> points, WriteOptions options) Write a list ofPointto the InfluxDB server.voidwriteRecord(String record) Write a record specified in the InfluxDB Line Protocol to the InfluxDB server.voidwriteRecord(String record, WriteOptions options) Write a record specified in the InfluxDB Line Protocol to the InfluxDB server.voidwriteRecords(List<String> records) Write records specified in the InfluxDB Line Protocol to the InfluxDB server.voidwriteRecords(List<String> records, WriteOptions options) Write records specified in the InfluxDB Line Protocol to the InfluxDB server.
-
Constructor Details
-
InfluxDBClientImpl
Creates an instance using the specified config.Please use
InfluxDBClientto create an instance.- Parameters:
config- the client config.
-
-
Method Details
-
writeRecord
Description copied from interface:InfluxDBClientWrite a record specified in the InfluxDB Line Protocol to the InfluxDB server.- Specified by:
writeRecordin interfaceInfluxDBClient- Parameters:
record- the record specified in the InfluxDB Line Protocol, can be null
-
writeRecord
Description copied from interface:InfluxDBClientWrite a record specified in the InfluxDB Line Protocol to the InfluxDB server.- Specified by:
writeRecordin interfaceInfluxDBClient- Parameters:
record- the record specified in the InfluxDB Line Protocol, can be nulloptions- the options for writing data to InfluxDB
-
writeRecords
Description copied from interface:InfluxDBClientWrite records specified in the InfluxDB Line Protocol to the InfluxDB server.- Specified by:
writeRecordsin interfaceInfluxDBClient- Parameters:
records- the records specified in the InfluxDB Line Protocol, cannot be null
-
writeRecords
Description copied from interface:InfluxDBClientWrite records specified in the InfluxDB Line Protocol to the InfluxDB server.- Specified by:
writeRecordsin interfaceInfluxDBClient- Parameters:
records- the records specified in the InfluxDB Line Protocol, cannot be nulloptions- the options for writing data to InfluxDB
-
writePoint
Description copied from interface:InfluxDBClientWrite aPointto the InfluxDB server.- Specified by:
writePointin interfaceInfluxDBClient- Parameters:
point- thePointto write, can be nullNote: the timestamp passed will be converted to nanoseconds since the Unix epoch by NanosecondConverter helper class
-
writePoint
Description copied from interface:InfluxDBClientWrite aPointto the InfluxDB server.- Specified by:
writePointin interfaceInfluxDBClient- Parameters:
point- thePointto write, can be nulloptions- the options for writing data to InfluxDBNote: the timestamp passed will be converted to nanoseconds since the Unix epoch by NanosecondConverter helper class
-
writePoints
Description copied from interface:InfluxDBClientWrite a list ofPointto the InfluxDB server.- Specified by:
writePointsin interfaceInfluxDBClient- Parameters:
points- the list ofPointto write, cannot be nullNote: the timestamp passed will be converted to nanoseconds since the Unix epoch by NanosecondConverter helper class
-
writePoints
Description copied from interface:InfluxDBClientWrite a list ofPointto the InfluxDB server.- Specified by:
writePointsin interfaceInfluxDBClient- Parameters:
points- the list ofPointto write, cannot be nulloptions- the options for writing data to InfluxDBNote: the timestamp passed will be converted to nanoseconds since the Unix epoch by NanosecondConverter helper class
-
query
Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<Object[]> rows = client.query("select * from cpu")) { rows.forEach(row -> { // process row } });- Specified by:
queryin interfaceInfluxDBClient- Parameters:
query- the SQL query string to execute, cannot be null- Returns:
- Batches of rows returned by the query
Note: the timestamp will be returned as a number of nanoseconds since the Unix epoch
-
query
Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<Object[]> rows = client.query("select * from cpu", options)) { rows.forEach(row -> { // process row } });- Specified by:
queryin interfaceInfluxDBClient- Parameters:
query- the query string to execute, cannot be nulloptions- the options for querying data from InfluxDB- Returns:
- Batches of rows returned by the query
Note: the timestamp will be returned as a number of nanoseconds since the Unix epoch
-
query
@Nonnull public Stream<Object[]> query(@Nonnull String query, @Nonnull Map<String, Object> parameters) Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<Object[]> rows = client.query("select * from cpu where host=$host", Map.of("host", "server-a")) { rows.forEach(row -> { // process row } });- Specified by:
queryin interfaceInfluxDBClient- Parameters:
query- the SQL query string to execute, cannot be nullparameters- query named parameters- Returns:
- Batches of rows returned by the query
Note: the timestamp will be returned as a number of nanoseconds since the Unix epoch
-
query
@Nonnull public Stream<Object[]> query(@Nonnull String query, @Nonnull Map<String, Object> parameters, @Nonnull QueryOptions options) Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<Object[]> rows = client.query("select * from cpu where host=$host", Map.of("host", "server-a"), options)) { rows.forEach(row -> { // process row } });- Specified by:
queryin interfaceInfluxDBClient- Parameters:
query- the query string to execute, cannot be nullparameters- query named parametersoptions- the options for querying data from InfluxDB- Returns:
- Batches of rows returned by the query
Note: the timestamp will be returned as a number of nanoseconds since the Unix epoch
-
queryRows
Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<Map<String, Object>> rows = client.queryRows("select * from cpu where host=intel")) { rows.forEach(row -> { // process row }); };- Specified by:
queryRowsin interfaceInfluxDBClient- Parameters:
query- the query string to execute, cannot be null- Returns:
- Batches of rows returned by the query
-
queryRows
@Nonnull public Stream<Map<String,Object>> queryRows(@Nonnull String query, @Nonnull Map<String, Object> parameters) Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<Map<String, Object>> rows = client.queryRows("select * from cpu where host=$host", Map.of("host", "server-a"))) { rows.forEach(row -> { // process row }) };- Specified by:
queryRowsin interfaceInfluxDBClient- Parameters:
query- the query string to execute, cannot be nullparameters- query named parameters- Returns:
- Batches of rows returned by the query
-
queryRows
@Nonnull public Stream<Map<String,Object>> queryRows(@Nonnull String query, @Nonnull QueryOptions options) Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<Map<String, Object>> rows = client.queryRows("select * from cpu where host=intel", options)) { rows.forEach(row -> { // process row }) };- Specified by:
queryRowsin interfaceInfluxDBClient- Parameters:
query- the query string to execute, cannot be nulloptions- the options for querying data from InfluxDB- Returns:
- Batches of rows returned by the query
-
queryRows
@Nonnull public Stream<Map<String,Object>> queryRows(@Nonnull String query, @Nonnull Map<String, Object> parameters, @Nonnull QueryOptions options) Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<Map<String, Object>> rows = client.queryRows("select * from cpu where host=$host", Map.of("host", "server-a"), options)) { rows.forEach(row -> { // process row }) };- Specified by:
queryRowsin interfaceInfluxDBClient- Parameters:
query- the query string to execute, cannot be nullparameters- query named parametersoptions- the options for querying data from InfluxDB- Returns:
- Batches of rows returned by the query
-
queryPoints
Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx into Point structure using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<PointValues> rows = client.queryPoints("select * from cpu", options)) { rows.forEach(row -> { // process row } });- Specified by:
queryPointsin interfaceInfluxDBClient- Parameters:
query- the SQL query string to execute, cannot be null- Returns:
- Batches of PointValues returned by the query
Note: the timestamp will be returned as a number of nanoseconds since the Unix epoch
-
queryPoints
@Nonnull public Stream<PointValues> queryPoints(@Nonnull String query, @Nonnull QueryOptions options) Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx into Point structure using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<PointValues> rows = client.queryPoints("select * from cpu", options)) { rows.forEach(row -> { // process row } });- Specified by:
queryPointsin interfaceInfluxDBClient- Parameters:
query- the query string to execute, cannot be nulloptions- the options for querying data from InfluxDB- Returns:
- Batches of PointValues returned by the query
Note: the timestamp will be returned as a number of nanoseconds since the Unix epoch
-
queryPoints
@Nonnull public Stream<PointValues> queryPoints(@Nonnull String query, @Nonnull Map<String, Object> parameters) Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx into Point structure using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<PointValues> rows = client.queryPoints("select * from cpu where host=$host", Map.of("host", "server-a"))) { rows.forEach(row -> { // process row } });- Specified by:
queryPointsin interfaceInfluxDBClient- Parameters:
query- the SQL query string to execute, cannot be nullparameters- query named parameters- Returns:
- Batches of PointValues returned by the query
Note: the timestamp will be returned as a number of nanoseconds since the Unix epoch
-
queryPoints
@Nonnull public Stream<PointValues> queryPoints(@Nonnull String query, @Nonnull Map<String, Object> parameters, @Nonnull QueryOptions options) Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx into Point structure using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<PointValues> rows = client.queryPoints("select * from cpu where host=$host", Map.of("host", "server-a"), options)) { rows.forEach(row -> { // process row } });- Specified by:
queryPointsin interfaceInfluxDBClient- Parameters:
query- the query string to execute, cannot be nullparameters- query named parametersoptions- the options for querying data from InfluxDB- Returns:
- Batches of PointValues returned by the query
Note: the timestamp will be returned as a number of nanoseconds since the Unix epoch
-
queryBatches
@Nonnull public Stream<org.apache.arrow.vector.VectorSchemaRoot> queryBatches(@Nonnull String query) Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<VectorSchemaRoot> batches = client.queryBatches("select * from cpu")) { batches.forEach(batch -> { // process batch } });- Specified by:
queryBatchesin interfaceInfluxDBClient- Parameters:
query- the SQL query string to execute, cannot be null- Returns:
- Batches of rows returned by the query
-
queryBatches
@Nonnull public Stream<org.apache.arrow.vector.VectorSchemaRoot> queryBatches(@Nonnull String query, @Nonnull QueryOptions options) Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx using FlightSQL.try (Stream<VectorSchemaRoot> batches = client.queryBatches("select * from cpu", options)) { batches.forEach(batch -> { // process batch } });- Specified by:
queryBatchesin interfaceInfluxDBClient- Parameters:
query- the query string to execute, cannot be nulloptions- the options for querying data from InfluxDB- Returns:
- Batches of rows returned by the query
-
queryBatches
@Nonnull public Stream<org.apache.arrow.vector.VectorSchemaRoot> queryBatches(@Nonnull String query, @Nonnull Map<String, Object> parameters) Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx using FlightSQL.The result stream should be closed after use, you can use try-resource pattern to close it automatically:
try (Stream<VectorSchemaRoot> batches = client.queryBatches("select * from cpu where host=$host", Map.of("host", "server-a"))) { batches.forEach(batch -> { // process batch } });- Specified by:
queryBatchesin interfaceInfluxDBClient- Parameters:
query- the SQL query string to execute, cannot be nullparameters- query named parameters- Returns:
- Batches of rows returned by the query
-
queryBatches
@Nonnull public Stream<org.apache.arrow.vector.VectorSchemaRoot> queryBatches(@Nonnull String query, @Nonnull Map<String, Object> parameters, @Nonnull QueryOptions options) Description copied from interface:InfluxDBClientQuery data from InfluxDB IOx using FlightSQL.try (Stream<VectorSchemaRoot> batches = client.queryBatches("select * from cpu where host=$host", Map.of("host", "server-a"), options)) { batches.forEach(batch -> { // process batch } });- Specified by:
queryBatchesin interfaceInfluxDBClient- Parameters:
query- the query string to execute, cannot be nullparameters- query named parametersoptions- the options for querying data from InfluxDB- Returns:
- Batches of rows returned by the query
-
getServerVersion
Description copied from interface:InfluxDBClientGet InfluxDB server version.- Specified by:
getServerVersionin interfaceInfluxDBClient- Returns:
- a string representing the server version.
Returns
nullif the server version can't be determined.
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-