Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
### Features

1. [#229](https://github.com/InfluxCommunity/influxdb3-java/pull/229): Support proxy and custom ssl root certificates
2. [#233](https://github.com/InfluxCommunity/influxdb3-java/pull/233): More detailed documentation about timestamp handling for query and write functions
2. [#232](https://github.com/InfluxCommunity/influxdb3-java/pull/232): Allow set rpc max message size through maxInboundMessageSize in ClientConfig
3. [#233](https://github.com/InfluxCommunity/influxdb3-java/pull/233): More detailed documentation about timestamp handling for query and write functions

## 1.0.0 [2024-12-11]

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/influxdb/v3/client/config/ClientConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
* <li><code>disableServerCertificateValidation</code> -
* disable server certificate validation for HTTPS connections
* </li>
* <li><code>proxyUrl</code> - Proxy url for query api and write api</li>
* <li><code>proxyUrl</code> - proxy url for query api and write api</li>
* <li><code>authenticator</code> - HTTP proxy authenticator</li>
* <li><code>headers</code> - headers to be added to requests</li>
* <li><code>sslRootsFilePath</code> - Path to the stored certificates file in PEM format</li>
* <li><code>sslRootsFilePath</code> - path to the stored certificates file in PEM format</li>
* </ul>
* <p>
* If you want to create a client with custom configuration, you can use following code:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
import org.apache.arrow.flight.CallOption;
import org.apache.arrow.flight.FlightClient;
import org.apache.arrow.flight.FlightGrpcUtils;
import org.apache.arrow.flight.FlightStream;
Expand Down Expand Up @@ -106,7 +107,8 @@ Stream<VectorSchemaRoot> execute(@Nonnull final String query,
@Nonnull final String database,
@Nonnull final QueryType queryType,
@Nonnull final Map<String, Object> queryParameters,
@Nonnull final Map<String, String> headers) {
@Nonnull final Map<String, String> headers,
final CallOption... callOptions) {

Map<String, Object> ticketData = new HashMap<>() {{
put("database", database);
Expand All @@ -126,8 +128,10 @@ Stream<VectorSchemaRoot> execute(@Nonnull final String query,
}

HeaderCallOption headerCallOption = metadataHeader(headers);
CallOption[] callOptionArray = GrpcCallOptions.mergeCallOptions(callOptions, headerCallOption);

Ticket ticket = new Ticket(json.getBytes(StandardCharsets.UTF_8));
FlightStream stream = client.getStream(ticket, headerCallOption);
FlightStream stream = client.getStream(ticket, callOptionArray);
FlightSqlIterator iterator = new FlightSqlIterator(stream);

Spliterator<VectorSchemaRoot> spliterator = Spliterators.spliteratorUnknownSize(iterator, Spliterator.NONNULL);
Expand All @@ -141,11 +145,10 @@ public void close() throws Exception {

@Nonnull
private FlightClient createFlightClient(@Nonnull final ClientConfig config) {
Location location = createLocation(config);

final NettyChannelBuilder nettyChannelBuilder = NettyChannelBuilder.forTarget(location.getUri().getHost());
URI uri = createLocation(config).getUri();
final NettyChannelBuilder nettyChannelBuilder = NettyChannelBuilder.forAddress(uri.getHost(), uri.getPort());

if (LocationSchemes.GRPC_TLS.equals(location.getUri().getScheme())) {
if (LocationSchemes.GRPC_TLS.equals(uri.getScheme())) {
nettyChannelBuilder.useTransportSecurity();

SslContext nettySslContext = createNettySslContext(config);
Expand All @@ -164,7 +167,6 @@ private FlightClient createFlightClient(@Nonnull final ClientConfig config) {
}

nettyChannelBuilder.maxTraceEvents(0)
.maxInboundMessageSize(Integer.MAX_VALUE)
.maxInboundMetadataSize(Integer.MAX_VALUE);

return FlightGrpcUtils.createFlightClient(new RootAllocator(Long.MAX_VALUE), nettyChannelBuilder.build());
Expand Down
Loading
Loading