Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-38255: [Java] Implement Flight SQL Bulk Ingestion #43551

Merged
merged 15 commits into from
Sep 5, 2024
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
*/
package org.apache.arrow.flight.integration.tests;

import com.google.common.util.concurrent.ThreadFactoryBuilder;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.apache.arrow.flight.FlightClient;
import org.apache.arrow.flight.FlightServer;
import org.apache.arrow.flight.Location;
Expand Down Expand Up @@ -98,8 +102,14 @@ void sessionOptions() throws Exception {
void testScenario(String scenarioName) throws Exception {
TestBufferAllocationListener listener = new TestBufferAllocationListener();
try (final BufferAllocator allocator = new RootAllocator(listener, Long.MAX_VALUE)) {
final ExecutorService exec =
Executors.newCachedThreadPool(
new ThreadFactoryBuilder()
.setNameFormat("integration-test-flight-server-executor-%d")
.build());
final FlightServer.Builder builder =
FlightServer.builder()
.executor(exec)
.allocator(allocator)
.location(Location.forGrpcInsecure("0.0.0.0", 0));
final Scenario scenario = Scenarios.getScenario(scenarioName);
Expand All @@ -114,6 +124,8 @@ void testScenario(String scenarioName) throws Exception {
scenario.client(allocator, location, client);
}
}
exec.shutdown();
final boolean unused = exec.awaitTermination(3, TimeUnit.SECONDS);
eramitmittal marked this conversation as resolved.
Show resolved Hide resolved
} catch (IllegalStateException e) {
// this could be due to Allocator detecting memory leak. Add allocation trail to help debug
listener.reThrowWithAddedAllocatorInfo(e);
Expand Down
Loading