Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions plugins/arrow-flight-rpc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# arrow-flight-rpc

Enable this transport with:

```
setting 'aux.transport.types', '[arrow-flight-rpc]'
setting 'aux.transport.arrow-flight-rpc.port', '9400-9500' //optional
```

## Testing

### Unit Tests

```
./gradlew run \
-PinstalledPlugins="['arrow-flight-rpc']" \
-Dtests.opensearch.aux.transport.types="[experimental-transport-arrow-flight-rpc]" \
-Dtests.opensearch.opensearch.experimental.feature.arrow.streams.enabled=true
```

### Unit Tests

```
./gradlew :plugins:arrow-flight-rpc:test
```

### Integration Tests

```
./gradlew :plugins:arrow-flight-rpc:internalClusterTest
```
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.opensearch.arrow.spi.StreamReader;
import org.opensearch.arrow.spi.StreamTicket;
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.unit.TimeValue;
import org.opensearch.plugins.Plugin;
import org.opensearch.test.OpenSearchIntegTestCase;
Expand All @@ -36,11 +37,21 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;

import static org.opensearch.arrow.flight.bootstrap.FlightService.ARROW_FLIGHT_TRANSPORT_SETTING_KEY;
import static org.opensearch.common.util.FeatureFlags.ARROW_STREAMS;
import static org.opensearch.transport.AuxTransport.AUX_TRANSPORT_TYPES_KEY;

@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.SUITE, numDataNodes = 5)
public class ArrowFlightServerIT extends OpenSearchIntegTestCase {

@Override
protected Settings nodeSettings(int nodeOrdinal) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(AUX_TRANSPORT_TYPES_KEY, ARROW_FLIGHT_TRANSPORT_SETTING_KEY)
.build();
}

@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return Collections.singleton(FlightStreamPlugin.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public Collection<Object> createComponents(
flightService.setClusterService(clusterService);
flightService.setThreadPool(threadPool);
flightService.setClient(client);
return List.of(flightService);
return Collections.emptyList();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.threadpool.ExecutorBuilder;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.AuxTransport;

import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Supplier;

import static org.opensearch.arrow.flight.bootstrap.FlightService.ARROW_FLIGHT_TRANSPORT_SETTING_KEY;
import static org.opensearch.common.util.FeatureFlags.ARROW_STREAMS;
Expand All @@ -52,24 +54,19 @@ public void setUp() throws Exception {
@LockFeatureFlag(ARROW_STREAMS)
public void testPluginEnabled() throws IOException {
FlightStreamPlugin plugin = new FlightStreamPlugin(settings);
Collection<Object> components = plugin.createComponents(
null,
clusterService,
plugin.createComponents(null, clusterService, mock(ThreadPool.class), null, null, null, null, null, null, null, null);
Map<String, Supplier<AuxTransport>> aux_map = plugin.getAuxTransports(
settings,
mock(ThreadPool.class),
null,
null,
null,
null,
null,
null,
new NetworkService(List.of()),
null,
null
);

assertNotNull(components);
assertFalse(components.isEmpty());
assertEquals(1, components.size());
assertTrue(components.iterator().next() instanceof FlightService);
AuxTransport transport = aux_map.get(ARROW_FLIGHT_TRANSPORT_SETTING_KEY).get();
assertNotNull(transport);
assertTrue(transport instanceof FlightService);

List<ExecutorBuilder<?>> executorBuilders = plugin.getExecutorBuilders(settings);
assertNotNull(executorBuilders);
Expand Down
Loading