Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Sep 13, 2023
1 parent 61f63a5 commit 27d56d2
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 1,109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2629,7 +2629,7 @@ public List<ResultRow> executeInternalQuery() {
}
}

public void executeArrowFlightQuery(FlightStatementContext<Statement> flightStatementContext) {
public void executeArrowFlightQuery(FlightStatementContext flightStatementContext) {
LOG.debug("ARROW FLIGHT QUERY: " + originStmt.toString());
try {
try {
Expand Down Expand Up @@ -2673,12 +2673,13 @@ public void executeArrowFlightQuery(FlightStatementContext<Statement> flightStat
coord.exec();
} catch (Exception e) {
queryScheduleSpan.recordException(e);
LOG.warn("Failed to coord exec, because: {}", e.getMessage(), e);
throw new InternalQueryExecutionException(e.getMessage() + Util.getRootCauseMessage(e), e);
} finally {
queryScheduleSpan.end();
}
} finally {
QeProcessorImpl.INSTANCE.unregisterQuery(context.queryId());
QeProcessorImpl.INSTANCE.unregisterQuery(context.queryId()); // TODO for query profile
}
flightStatementContext.setFinstId(coord.getFinstId());
flightStatementContext.setResultFlightServerAddr(coord.getResultFlightServerAddr());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
* authentication specialized implementation of BasicAuthValidator. Authenticates with provided
* credentials.
*/
public class FlightServerBasicAuth implements BasicServerAuthHandler.BasicAuthValidator {
public class FlightServerBasicAuthValidator implements BasicServerAuthHandler.BasicAuthValidator {

private static final String myToken = "DORIS_READ_WRITE_TOKEN";

public FlightServerBasicAuth() {
public FlightServerBasicAuthValidator() {
}

@Override
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ public class FlightSqlService {
= FlightServerMiddleware.Key.of(FLIGHT_CLIENT_PROPERTIES_MIDDLEWARE);

public FlightSqlService(int port) {
BufferAllocator allocator = new RootAllocator(100000);
BufferAllocator allocator = new RootAllocator();
Location location = Location.forGrpcInsecure("0.0.0.0", port);
FlightSqlServiceImpl producer = new FlightSqlServiceImpl(location);
flightServer = FlightServer.builder(allocator, location, producer)
.middleware(FLIGHT_CLIENT_PROPERTIES_MIDDLEWARE_KEY,
new ServerCookieMiddleware.Factory())
.authHandler(new BasicServerAuthHandler(new FlightServerBasicAuth())).build();
.authHandler(new BasicServerAuthHandler(new FlightServerBasicAuthValidator())).build();
}

// start Flightsql protocol service
Expand Down
Loading

0 comments on commit 27d56d2

Please sign in to comment.