Skip to content

Commit f745e7d

Browse files
wip
1 parent 795b1de commit f745e7d

File tree

7 files changed

+131
-135
lines changed

7 files changed

+131
-135
lines changed

src/main/java/com/influxdb/v3/client/InfluxDBClient.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ public interface InfluxDBClient extends AutoCloseable {
8080
* Write a {@link Point} to the InfluxDB server.
8181
*
8282
* @param point the {@link Point} to write, can be null
83-
* <p>
84-
* Note: the timestamp passed will be converted to nanoseconds since the Unix epoch
85-
* by NanosecondConverter helper class
83+
* <p>
84+
* Note: the timestamp passed will be converted to nanoseconds since the Unix epoch
85+
* by NanosecondConverter helper class
8686
*/
8787
void writePoint(@Nullable final Point point);
8888

@@ -91,19 +91,19 @@ public interface InfluxDBClient extends AutoCloseable {
9191
*
9292
* @param point the {@link Point} to write, can be null
9393
* @param options the options for writing data to InfluxDB
94-
* <p>
95-
* Note: the timestamp passed will be converted to nanoseconds since the Unix epoch
96-
* by NanosecondConverter helper class
94+
* <p>
95+
* Note: the timestamp passed will be converted to nanoseconds since the Unix epoch
96+
* by NanosecondConverter helper class
9797
*/
9898
void writePoint(@Nullable final Point point, @Nonnull final WriteOptions options);
9999

100100
/**
101101
* Write a list of {@link Point} to the InfluxDB server.
102102
*
103103
* @param points the list of {@link Point} to write, cannot be null
104-
* <p>
105-
* Note: the timestamp passed will be converted to nanoseconds since the Unix epoch
106-
* by NanosecondConverter helper class
104+
* <p>
105+
* Note: the timestamp passed will be converted to nanoseconds since the Unix epoch
106+
* by NanosecondConverter helper class
107107
*/
108108
void writePoints(@Nonnull final List<Point> points);
109109

@@ -112,9 +112,9 @@ public interface InfluxDBClient extends AutoCloseable {
112112
*
113113
* @param points the list of {@link Point} to write, cannot be null
114114
* @param options the options for writing data to InfluxDB
115-
* <p>
116-
* Note: the timestamp passed will be converted to nanoseconds since the Unix epoch
117-
* by NanosecondConverter helper class
115+
* <p>
116+
* Note: the timestamp passed will be converted to nanoseconds since the Unix epoch
117+
* by NanosecondConverter helper class
118118
*/
119119
void writePoints(@Nonnull final List<Point> points, @Nonnull final WriteOptions options);
120120

@@ -460,7 +460,8 @@ Stream<VectorSchemaRoot> queryBatches(@Nonnull final String query,
460460
* Returns <code>null</code> if the server version can't be determined.
461461
*/
462462
@Nullable
463-
String getServerVersion() throws RuntimeException, ExecutionException, InterruptedException, JsonProcessingException;
463+
String getServerVersion()
464+
throws RuntimeException, ExecutionException, InterruptedException, JsonProcessingException;
464465

465466
/**
466467
* Creates a new instance of the {@link InfluxDBClient} for interacting with an InfluxDB server, simplifying
@@ -498,7 +499,8 @@ static InfluxDBClient getInstance(@Nonnull final String host,
498499
static InfluxDBClient getInstance(@Nonnull final String host,
499500
@Nullable final char[] token,
500501
@Nullable final String database,
501-
@Nullable Map<String, String> defaultTags) throws URISyntaxException, SSLException {
502+
@Nullable Map<String, String> defaultTags)
503+
throws URISyntaxException, SSLException {
502504

503505
ClientConfig config = new ClientConfig.Builder()
504506
.host(host)

src/main/java/com/influxdb/v3/client/config/ClientConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ public Builder disableGRPCCompression(final boolean disableGRPCCompression) {
731731
}
732732

733733
@Nonnull
734-
public Builder nettyHttpClientConfig(NettyHttpClientConfig nettyHttpClientConfig) {
734+
public Builder nettyHttpClientConfig(final NettyHttpClientConfig nettyHttpClientConfig) {
735735
this.nettyHttpClientConfig = nettyHttpClientConfig;
736736
return this;
737737
}

src/main/java/com/influxdb/v3/client/internal/ClientChannelInitializer.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public class ClientChannelInitializer extends ChannelInitializer<OioSocketChanne
4040

4141
private final SslContext sslCtx;
4242

43-
// private final Promise<FullHttpResponse> promise;
44-
4543
private final String host;
4644

4745
private final Integer port;
@@ -50,10 +48,10 @@ public class ClientChannelInitializer extends ChannelInitializer<OioSocketChanne
5048

5149
private ChannelHandler[] h;
5250

53-
public ClientChannelInitializer(@Nonnull String host,
54-
@Nonnull Integer port,
55-
@Nullable SslContext sslCtx,
56-
@Nullable HttpProxyHandler proxyHandler,
51+
public ClientChannelInitializer(@Nonnull final String host,
52+
@Nonnull final Integer port,
53+
@Nullable final SslContext sslCtx,
54+
@Nullable final HttpProxyHandler proxyHandler,
5755
ChannelHandler... handlers
5856

5957
) {
@@ -65,7 +63,7 @@ public ClientChannelInitializer(@Nonnull String host,
6563
}
6664

6765
@Override
68-
public void initChannel(OioSocketChannel ch) {
66+
public void initChannel(final OioSocketChannel ch) {
6967
ChannelPipeline p = ch.pipeline();
7068
p.addLast(new LoggingHandler(LogLevel.INFO));
7169
if (proxyHandler != null) {

src/main/java/com/influxdb/v3/client/internal/ClientHandler.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ public void channelRead0(final ChannelHandlerContext ctx, final FullHttpResponse
4242
this.responseFuture.complete(msg.retain());
4343
}
4444

45-
@Override
46-
public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
47-
ctx.fireChannelInactive();
48-
}
49-
5045
@Override
5146
public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
5247
this.responseFuture.completeExceptionally(cause);

src/main/java/com/influxdb/v3/client/internal/RestClient.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ final class RestClient implements AutoCloseable {
139139
this.timeout = config.getWriteTimeout();
140140

141141
if ("https".equalsIgnoreCase(scheme)) {
142-
if (config.getNettyHttpClientConfig() != null &&
143-
config.getNettyHttpClientConfig().getSslContext() != null) {
142+
if (config.getNettyHttpClientConfig() != null
143+
&& config.getNettyHttpClientConfig().getSslContext() != null) {
144144
this.sslContext = config.getNettyHttpClientConfig().getSslContext();
145145
} else {
146146
this.sslContext = SslContextBuilder.forClient().build();
@@ -157,8 +157,8 @@ final class RestClient implements AutoCloseable {
157157
//fixme `clientHandler`should store in a list and pass to `ClientChannelInitializer()`
158158
this.clientHandler = new ClientHandler();
159159

160-
if (this.config.getNettyHttpClientConfig() != null &&
161-
this.config.getNettyHttpClientConfig().getHttpProxyHandler() != null) {
160+
if (this.config.getNettyHttpClientConfig() != null
161+
&& this.config.getNettyHttpClientConfig().getHttpProxyHandler() != null) {
162162
this.proxyHandler = this.config.getNettyHttpClientConfig().getHttpProxyHandler();
163163
}
164164

@@ -192,7 +192,8 @@ public String getServerVersion() throws ExecutionException, InterruptedException
192192
return influxdbVersion;
193193
}
194194

195-
public FullHttpResponse request(@Nonnull HttpMethod method, @Nonnull final String path, @Nonnull final Map<String, String> headers)
195+
public FullHttpResponse request(@Nonnull final HttpMethod method, @Nonnull final String path,
196+
@Nonnull final Map<String, String> headers)
196197
throws RuntimeException, InterruptedException, ExecutionException {
197198
return request(method, path, headers, null, null);
198199
}

src/test/java/com/influxdb/v3/client/TestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public static MockWebServer customDispatchServer(@NotNull final String host, @No
174174
server.setDispatcher(new Dispatcher() {
175175
@NotNull
176176
@Override
177-
public MockResponse dispatch(@NotNull RecordedRequest recordedRequest) {
177+
public MockResponse dispatch(@NotNull final RecordedRequest recordedRequest) {
178178
return mockResponse != null ? mockResponse : new MockResponse(200, Headers.EMPTY, "Success");
179179
}
180180
});

0 commit comments

Comments
 (0)