Skip to content

Commit

Permalink
Simplify cloning and overriding logic for FlightServer and FlightClient
Browse files Browse the repository at this point in the history
Signed-off-by: Rishabh Maurya <[email protected]>
  • Loading branch information
rishabhmaurya committed Feb 13, 2025
1 parent 9477085 commit aab8bc4
Show file tree
Hide file tree
Showing 8 changed files with 490 additions and 343 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Views, simplify data access and manipulation by providing a virtual layer over one or more indices ([#11957](https://github.com/opensearch-project/OpenSearch/pull/11957))
- Added pull-based Ingestion (APIs, for ingestion source, a Kafka plugin, and IngestionEngine that pulls data from the ingestion source) ([#16958](https://github.com/opensearch-project/OpenSearch/pull/16958))
- Added ConfigurationUtils to core for the ease of configuration parsing [#17223](https://github.com/opensearch-project/OpenSearch/pull/17223)
- Arrow Flight RPC plugin with server bootstrap logic ([#16962](https://github.com/opensearch-project/OpenSearch/pull/16962))
- Arrow Flight RPC plugin with server bootstrap logic and client support for internode communication ([#16962](https://github.com/opensearch-project/OpenSearch/pull/16962))

### Dependencies
- Update Apache Lucene to 10.1.0 ([#16366](https://github.com/opensearch-project/OpenSearch/pull/16366))
Expand Down
9 changes: 9 additions & 0 deletions plugins/arrow-flight-rpc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ tasks.named('test').configure {
}
}

spotless {
java {
// Files to exclude from formatting
targetExclude 'src/main/java/org/apache/arrow/flight/**/*.java'
}
}


tasks.named("dependencyLicenses").configure {
mapping from: /netty-.*/, to: 'netty'
mapping from: /grpc-.*/, to: 'grpc'
Expand All @@ -95,6 +103,7 @@ tasks.named('forbiddenApisMain').configure {
]
}


tasks.named('thirdPartyAudit').configure {
ignoreMissingClasses(
'com.google.gson.stream.JsonReader',
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

package org.apache.arrow.flight;

import io.grpc.netty.NettyChannelBuilder;
import io.netty.channel.EventLoopGroup;
import io.netty.handler.ssl.SslContext;
import org.apache.arrow.memory.BufferAllocator;

import java.util.concurrent.ExecutorService;

/**
* Builder for FlightClient in OpenSearch. Overrides {@link OSFlightClient.Builder} to set SslContext, workerELG,
* executorService and channelType
*/
public class OSFlightClientBuilder extends OSFlightClient.Builder {
private EventLoopGroup workerELG;
private ExecutorService executorService;
private Class<? extends io.netty.channel.Channel> channelType;
private SslContext sslContext;

public OSFlightClientBuilder(BufferAllocator allocator,
Location location,
Class<? extends io.netty.channel.Channel> channelType,
ExecutorService executorService,
EventLoopGroup workerELG,
SslContext sslContext) {
super(allocator, location);
this.channelType = channelType;
this.executorService = executorService;
this.workerELG = workerELG;
if (sslContext != null) {
this.sslContext = sslContext;
}
}

@Override
public void configureBuilder(NettyChannelBuilder builder) {
if (workerELG != null) {
builder.eventLoopGroup(workerELG);
}
if (executorService != null) {
builder.executor(executorService);
}
if (channelType != null) {
builder.channelType(channelType);
}
if (sslContext != null) {
builder.sslContext(sslContext);
}
}
}
Loading

0 comments on commit aab8bc4

Please sign in to comment.