2828
2929import org .apache .arrow .vector .VectorSchemaRoot ;
3030
31- import com .influxdb .v3 .client .config .InfluxDBClientConfigs ;
31+ import com .influxdb .v3 .client .config .ClientConfig ;
3232import com .influxdb .v3 .client .internal .InfluxDBClientImpl ;
33- import com .influxdb .v3 .client .query .QueryParameters ;
33+ import com .influxdb .v3 .client .query .QueryOptions ;
3434import com .influxdb .v3 .client .write .Point ;
35- import com .influxdb .v3 .client .write .WriteParameters ;
35+ import com .influxdb .v3 .client .write .WriteOptions ;
3636
3737/**
3838 * The InfluxDBClient interface provides a client for interact with InfluxDB 3.
@@ -51,10 +51,10 @@ public interface InfluxDBClient extends AutoCloseable {
5151 /**
5252 * Write a record specified in the InfluxDB Line Protocol to the InfluxDB server.
5353 *
54- * @param record the record specified in the InfluxDB Line Protocol, can be null
55- * @param parameters the parameters for writing data to InfluxDB
54+ * @param record the record specified in the InfluxDB Line Protocol, can be null
55+ * @param options the options for writing data to InfluxDB
5656 */
57- void writeRecord (@ Nullable final String record , @ Nonnull final WriteParameters parameters );
57+ void writeRecord (@ Nullable final String record , @ Nonnull final WriteOptions options );
5858
5959 /**
6060 * Write records specified in the InfluxDB Line Protocol to the InfluxDB server.
@@ -67,9 +67,9 @@ public interface InfluxDBClient extends AutoCloseable {
6767 * Write records specified in the InfluxDB Line Protocol to the InfluxDB server.
6868 *
6969 * @param records the records specified in the InfluxDB Line Protocol, cannot be null
70- * @param parameters the parameters for writing data to InfluxDB
70+ * @param options the options for writing data to InfluxDB
7171 */
72- void writeRecords (@ Nonnull final List <String > records , @ Nonnull final WriteParameters parameters );
72+ void writeRecords (@ Nonnull final List <String > records , @ Nonnull final WriteOptions options );
7373
7474 /**
7575 * Write a {@link Point} to the InfluxDB server.
@@ -82,9 +82,9 @@ public interface InfluxDBClient extends AutoCloseable {
8282 * Write a {@link Point} to the InfluxDB server.
8383 *
8484 * @param point the {@link Point} to write, can be null
85- * @param parameters the parameters for writing data to InfluxDB
85+ * @param options the options for writing data to InfluxDB
8686 */
87- void writePoint (@ Nullable final Point point , @ Nonnull final WriteParameters parameters );
87+ void writePoint (@ Nullable final Point point , @ Nonnull final WriteOptions options );
8888
8989 /**
9090 * Write a list of {@link Point} to the InfluxDB server.
@@ -97,9 +97,9 @@ public interface InfluxDBClient extends AutoCloseable {
9797 * Write a list of {@link Point} to the InfluxDB server.
9898 *
9999 * @param points the list of {@link Point} to write, cannot be null
100- * @param parameters the parameters for writing data to InfluxDB
100+ * @param options the options for writing data to InfluxDB
101101 */
102- void writePoints (@ Nonnull final List <Point > points , @ Nonnull final WriteParameters parameters );
102+ void writePoints (@ Nonnull final List <Point > points , @ Nonnull final WriteOptions options );
103103
104104 /**
105105 * Query data from InfluxDB IOx using FlightSQL.
@@ -124,19 +124,19 @@ public interface InfluxDBClient extends AutoCloseable {
124124 * <p>
125125 * The result stream should be closed after use, you can use try-resource pattern to close it automatically:
126126 * <pre>
127- * try (Stream<Object[]> rows = client.query("select * from cpu", parameters )) {
127+ * try (Stream<Object[]> rows = client.query("select * from cpu", options )) {
128128 * rows.forEach(row -> {
129129 * // process row
130130 * }
131131 * });
132132 * </pre>
133133 *
134134 * @param query the SQL query string to execute, cannot be null
135- * @param parameters the parameters for querying data from InfluxDB
135+ * @param options the options for querying data from InfluxDB
136136 * @return Batches of rows returned by the query
137137 */
138138 @ Nonnull
139- Stream <Object []> query (@ Nonnull final String query , @ Nonnull final QueryParameters parameters );
139+ Stream <Object []> query (@ Nonnull final String query , @ Nonnull final QueryOptions options );
140140
141141 /**
142142 * Query data from InfluxDB IOx using FlightSQL.
@@ -159,52 +159,52 @@ public interface InfluxDBClient extends AutoCloseable {
159159 /**
160160 * Query data from InfluxDB IOx using FlightSQL.
161161 * <pre>
162- * try (Stream<VectorSchemaRoot> batches = client.queryBatches("select * from cpu", parameters )) {
162+ * try (Stream<VectorSchemaRoot> batches = client.queryBatches("select * from cpu", options )) {
163163 * batches.forEach(batch -> {
164164 * // process batch
165165 * }
166166 * });
167167 * </pre>
168168 *
169169 * @param query the SQL query string to execute, cannot be null
170- * @param parameters the parameters for querying data from InfluxDB
170+ * @param options the options for querying data from InfluxDB
171171 * @return Batches of rows returned by the query
172172 */
173173 @ Nonnull
174- Stream <VectorSchemaRoot > queryBatches (@ Nonnull final String query , @ Nonnull final QueryParameters parameters );
174+ Stream <VectorSchemaRoot > queryBatches (@ Nonnull final String query , @ Nonnull final QueryOptions options );
175175
176176 /**
177177 * Creates a new instance of the {@link InfluxDBClient} for interacting with an InfluxDB server, simplifying
178178 * common operations such as writing, querying.
179179 *
180- * @param hostUrl the hostname or IP address of the InfluxDB server
181- * @param authToken the authentication token for accessing the InfluxDB server, can be null
180+ * @param host the URL of the InfluxDB server
181+ * @param token the authentication token for accessing the InfluxDB server, can be null
182182 * @param database the database to be used for InfluxDB operations, can be null
183183 * @return new instance of the {@link InfluxDBClient}
184184 */
185185 @ Nonnull
186- static InfluxDBClient getInstance (@ Nonnull final String hostUrl ,
187- @ Nullable final char [] authToken ,
186+ static InfluxDBClient getInstance (@ Nonnull final String host ,
187+ @ Nullable final char [] token ,
188188 @ Nullable final String database ) {
189- InfluxDBClientConfigs configs = new InfluxDBClientConfigs .Builder ()
190- .hostUrl ( hostUrl )
191- .authToken ( authToken )
189+ ClientConfig config = new ClientConfig .Builder ()
190+ .host ( host )
191+ .token ( token )
192192 .database (database )
193193 .build ();
194194
195- return getInstance (configs );
195+ return getInstance (config );
196196 }
197197
198198 /**
199199 * Creates a new instance of the {@link InfluxDBClient} for interacting with an InfluxDB server, simplifying
200200 * common operations such as writing, querying.
201- * For possible configuration options see {@link InfluxDBClientConfigs }.
201+ * For possible configuration options see {@link ClientConfig }.
202202 *
203- * @param configs the configuration for the InfluxDB client
203+ * @param config the configuration for the InfluxDB client
204204 * @return new instance of the {@link InfluxDBClient}
205205 */
206206 @ Nonnull
207- static InfluxDBClient getInstance (@ Nonnull final InfluxDBClientConfigs configs ) {
208- return new InfluxDBClientImpl (configs );
207+ static InfluxDBClient getInstance (@ Nonnull final ClientConfig config ) {
208+ return new InfluxDBClientImpl (config );
209209 }
210210}
0 commit comments