Skip to content

Commit

Permalink
OperatorHelper updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
lbooker42 committed Feb 14, 2024
1 parent b1a38b3 commit 4c0e3f3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,43 @@
import io.deephaven.auth.AuthContext;
import io.deephaven.auth.ServiceAuthWiring;
import io.deephaven.engine.table.Table;
import io.deephaven.proto.backplane.grpc.*;

import io.deephaven.proto.backplane.grpc.AggregateAllRequest;
import io.deephaven.proto.backplane.grpc.AggregateRequest;
import io.deephaven.proto.backplane.grpc.AjRajTablesRequest;
import io.deephaven.proto.backplane.grpc.ApplyPreviewColumnsRequest;
import io.deephaven.proto.backplane.grpc.AsOfJoinTablesRequest;
import io.deephaven.proto.backplane.grpc.ColumnStatisticsRequest;
import io.deephaven.proto.backplane.grpc.ComboAggregateRequest;
import io.deephaven.proto.backplane.grpc.CreateInputTableRequest;
import io.deephaven.proto.backplane.grpc.CrossJoinTablesRequest;
import io.deephaven.proto.backplane.grpc.DropColumnsRequest;
import io.deephaven.proto.backplane.grpc.EmptyTableRequest;
import io.deephaven.proto.backplane.grpc.ExactJoinTablesRequest;
import io.deephaven.proto.backplane.grpc.ExportedTableUpdatesRequest;
import io.deephaven.proto.backplane.grpc.FetchTableRequest;
import io.deephaven.proto.backplane.grpc.FilterTableRequest;
import io.deephaven.proto.backplane.grpc.FlattenRequest;
import io.deephaven.proto.backplane.grpc.HeadOrTailByRequest;
import io.deephaven.proto.backplane.grpc.HeadOrTailRequest;
import io.deephaven.proto.backplane.grpc.LeftJoinTablesRequest;
import io.deephaven.proto.backplane.grpc.MergeTablesRequest;
import io.deephaven.proto.backplane.grpc.MetaTableRequest;
import io.deephaven.proto.backplane.grpc.MultiJoinTablesRequest;
import io.deephaven.proto.backplane.grpc.NaturalJoinTablesRequest;
import io.deephaven.proto.backplane.grpc.RangeJoinTablesRequest;
import io.deephaven.proto.backplane.grpc.RunChartDownsampleRequest;
import io.deephaven.proto.backplane.grpc.SeekRowRequest;
import io.deephaven.proto.backplane.grpc.SelectDistinctRequest;
import io.deephaven.proto.backplane.grpc.SelectOrUpdateRequest;
import io.deephaven.proto.backplane.grpc.SnapshotTableRequest;
import io.deephaven.proto.backplane.grpc.SnapshotWhenTableRequest;
import io.deephaven.proto.backplane.grpc.SortTableRequest;
import io.deephaven.proto.backplane.grpc.Ticket;
import io.deephaven.proto.backplane.grpc.TimeTableRequest;
import io.deephaven.proto.backplane.grpc.UngroupRequest;
import io.deephaven.proto.backplane.grpc.UnstructuredFilterTableRequest;
import io.deephaven.proto.backplane.grpc.UpdateByRequest;
import io.deephaven.proto.backplane.grpc.WhereInRequest;
import java.lang.Override;
import java.util.List;

Expand Down Expand Up @@ -344,7 +379,7 @@ void checkPermissionRajTables(AuthContext authContext, AjRajTablesRequest reques
* @param authContext the authentication context of the request
* @param request the request to authorize
* @param sourceTables the operation's source tables
* @throws io.grpc.StatusRuntimeException if the user is not authorized to invoke NaturalJoinTables
* @throws io.grpc.StatusRuntimeException if the user is not authorized to invoke MultiJoinTables
*/
void checkPermissionMultiJoinTables(AuthContext authContext, MultiJoinTablesRequest request,
List<Table> sourceTables);
Expand Down Expand Up @@ -654,8 +689,8 @@ public void checkPermissionRajTables(AuthContext authContext, AjRajTablesRequest
checkPermission(authContext, sourceTables);
}

public void checkPermissionMultiJoinTables(AuthContext authContext, MultiJoinTablesRequest request,
List<Table> sourceTables) {
public void checkPermissionMultiJoinTables(AuthContext authContext,
MultiJoinTablesRequest request, List<Table> sourceTables) {
checkPermission(authContext, sourceTables);
}

Expand Down Expand Up @@ -954,8 +989,8 @@ public void checkPermissionRajTables(AuthContext authContext, AjRajTablesRequest
}
}

public void checkPermissionMultiJoinTables(AuthContext authContext, MultiJoinTablesRequest request,
List<Table> sourceTables) {
public void checkPermissionMultiJoinTables(AuthContext authContext,
MultiJoinTablesRequest request, List<Table> sourceTables) {
if (delegate != null) {
delegate.checkPermissionMultiJoinTables(authContext, request, sourceTables);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation;
import io.deephaven.proto.backplane.grpc.BatchTableRequest.Operation.OpCase;
import io.deephaven.proto.backplane.grpc.MultiJoinInput;
import io.deephaven.proto.backplane.grpc.TableReference;

import java.util.stream.Stream;
Expand Down Expand Up @@ -100,6 +101,10 @@ public static Stream<TableReference> getSourceIds(Operation op) {
return Stream.of(op.getRangeJoin().getLeftId(), op.getRangeJoin().getRightId());
case COLUMN_STATISTICS:
return Stream.of(op.getColumnStatistics().getSourceId());
case MULTI_JOIN:
return op.getMultiJoin().getMultiJoinInputsList().isEmpty()
? op.getMultiJoin().getSourceIdsList().stream()
: op.getMultiJoin().getMultiJoinInputsList().stream().map(MultiJoinInput::getSourceId);
case OP_NOT_SET:
throw new IllegalStateException("Operation id not set");
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public MultiJoinGrpcImpl(
super(authWiring::checkPermissionMultiJoinTables,
BatchTableRequest.Operation::getMultiJoin,
MultiJoinTablesRequest::getResultId,
(MultiDependencyFunction<MultiJoinTablesRequest>) request -> request.getMultiJoinInputsCount() > 0
? request.getMultiJoinInputsList().stream().map(MultiJoinInput::getSourceId)
.collect(Collectors.toList())
: request.getSourceIdsList());
(MultiDependencyFunction<MultiJoinTablesRequest>) request -> request.getMultiJoinInputsList().isEmpty()
? request.getSourceIdsList()
: request.getMultiJoinInputsList().stream().map(MultiJoinInput::getSourceId)
.collect(Collectors.toList()));
}

@Override
Expand Down

0 comments on commit 4c0e3f3

Please sign in to comment.