Skip to content

Commit

Permalink
Review response. Remove unused scope ticket resolver.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinrsmith committed Dec 11, 2024
1 parent 65775e9 commit 919eb33
Showing 1 changed file with 2 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import io.deephaven.qst.table.TableSpec;
import io.deephaven.qst.table.TicketTable;
import io.deephaven.server.auth.AuthorizationProvider;
import io.deephaven.server.console.ScopeTicketResolver;
import io.deephaven.server.session.ActionResolver;
import io.deephaven.server.session.CommandResolver;
import io.deephaven.server.session.SessionState;
Expand Down Expand Up @@ -170,10 +169,6 @@ public final class FlightSqlResolver implements ActionResolver, CommandResolver
@VisibleForTesting
static final Schema DATASET_SCHEMA_SENTINEL = new Schema(List.of(Field.nullable("DO_NOT_USE", Utf8.INSTANCE)));

// Unable to depends on TicketRouter, would be a circular dependency atm (since TicketRouter depends on all the
// TicketResolvers).
// private final TicketRouter router;
private final ScopeTicketResolver scopeTicketResolver;
private final Scheduler scheduler;
private final Authorization authorization;
private final KeyedObjectHashMap<ByteString, QueryBase> queries;
Expand All @@ -182,10 +177,8 @@ public final class FlightSqlResolver implements ActionResolver, CommandResolver
@Inject
public FlightSqlResolver(
final AuthorizationProvider authProvider,
final ScopeTicketResolver scopeTicketResolver,
final Scheduler scheduler) {
this.authorization = Objects.requireNonNull(authProvider.getTicketResolverAuthorization());
this.scopeTicketResolver = Objects.requireNonNull(scopeTicketResolver);
this.scheduler = Objects.requireNonNull(scheduler);
this.queries = new KeyedObjectHashMap<>(QUERY_KEY);
this.preparedStatements = new KeyedObjectHashMap<>(PREPARED_STATEMENT_KEY);
Expand Down Expand Up @@ -648,8 +641,7 @@ interface TicketHandlerReleasable extends TicketHandler {
}

private Table executeSqlQuery(String sql) {
final ExecutionContext executionContext = ExecutionContext.getContext();
final QueryScope queryScope = executionContext.getQueryScope();
final QueryScope queryScope = ExecutionContext.getContext().getQueryScope();
// We aren't managing the liveness of Tables that come verbatim (authorization un-transformed) from the query
// scope (we are ensuring that any transformed, or operation created, tables don't escape to a higher-layer's
// liveness scope). In the case where they either are already not live, or become not live by the time the
Expand Down Expand Up @@ -716,17 +708,7 @@ private Table queryScopeTableMapper(QueryScope queryScope, Object object) {

private Table queryScopeAuthorizedTableMapper(QueryScope queryScope, Object object) {
final Table table = queryScopeTableMapper(queryScope, object);
if (table == null) {
return null;
}
Table transform = authorization.transform(table);
if (transform != table) {

}



return table == null ? null : transform;
return table == null ? null : authorization.transform(table);
}

/**
Expand Down

0 comments on commit 919eb33

Please sign in to comment.