Skip to content

Commit

Permalink
GH 41262:[Java][FlightSQL] Implement stateless prepared statement
Browse files Browse the repository at this point in the history
Attempt to get TempDir clean up
  • Loading branch information
stevelorddremio committed May 16, 2024
1 parent cabf9d8 commit 2391a83
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
public class FlightSqlExample implements FlightSqlProducer, AutoCloseable {
private static final Logger LOGGER = getLogger(FlightSqlExample.class);
protected static final Calendar DEFAULT_CALENDAR = JdbcToArrowUtils.getUtcCalendar();
public static final Path DB_PATH = Paths.get("target", "derbyDB");
public static final Path DB_PATH = Paths.get("target", "tmp");
private final String databaseUri;
// ARROW-15315: Use ExecutorService to simulate an async scenario
private final ExecutorService executorService = Executors.newFixedThreadPool(10);
Expand Down Expand Up @@ -195,7 +195,7 @@ private String toUri(Path path) {

public FlightSqlExample(final Location location, final Path dbName) {
// TODO Constructor should not be doing work.
final String derbyDatabaseUri = toUri(dbName);
final String derbyDatabaseUri = toUri(dbName) + "/derbyDB";
databaseUri = "jdbc:derby:" + derbyDatabaseUri;
checkState(
populateDerbyDatabase(databaseUri),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
*/
public class FlightSqlStatelessExample extends FlightSqlExample {
private static final Logger LOGGER = getLogger(FlightSqlStatelessExample.class);
public static final Path DB_PATH = Paths.get("target", "derbyStatelessDB");
public static final Path DB_PATH = Paths.get("target", "tmpStateless");


public FlightSqlStatelessExample(final Location location, final Path dbPath) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.io.CleanupMode.ALWAYS;

import java.nio.file.Path;
import java.sql.SQLException;
Expand Down Expand Up @@ -98,7 +99,7 @@ public class TestFlightSql {
protected static FlightSqlClient sqlClient;

@TempDir
private static Path dbPath = FlightSqlExample.DB_PATH;
static Path dbPath;

@BeforeAll
public static void setUp() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static org.apache.arrow.flight.sql.util.FlightStreamUtils.getResults;
import static org.apache.arrow.util.AutoCloseables.close;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.jupiter.api.io.CleanupMode.ALWAYS;

import java.nio.file.Path;

Expand Down Expand Up @@ -48,7 +49,7 @@
*/
public class TestFlightSqlStateless extends TestFlightSql {
@TempDir
private static Path dbPath = FlightSqlStatelessExample.DB_PATH;
static Path dbPath;


@BeforeAll
Expand Down

0 comments on commit 2391a83

Please sign in to comment.