mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 13:47:09 +00:00
(improvement)(headless) refactor duck source configure (#1170)
This commit is contained in:
@@ -36,6 +36,7 @@ public class FlightSqlListener implements CommandLineRunner {
|
||||
private ExecutorService executorService;
|
||||
private FlightServer flightServer;
|
||||
private BufferAllocator allocator;
|
||||
private Boolean isRunning = false;
|
||||
|
||||
public FlightSqlListener(FlightService flightService) {
|
||||
this.allocator = new RootAllocator();
|
||||
@@ -60,12 +61,27 @@ public class FlightSqlListener implements CommandLineRunner {
|
||||
try {
|
||||
log.info("Arrow Flight JDBC server started on {} {}", host, port);
|
||||
flightServer.start();
|
||||
isRunning = true;
|
||||
} catch (Exception e) {
|
||||
log.error("FlightSqlListener start error {}", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Boolean isRunning() {
|
||||
return isRunning;
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
try {
|
||||
log.info("Arrow Flight JDBC server stop on {} {}", host, port);
|
||||
flightServer.close();
|
||||
allocator.close();
|
||||
} catch (Exception e) {
|
||||
log.error("FlightSqlListener start error {}", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
if (enable) {
|
||||
|
||||
Reference in New Issue
Block a user