use of io.pravega.shared.controller.tracing.RPCTracingTags.IS_SEGMENT_OPEN in project pravega by pravega.
the class ControllerServiceImpl method isSegmentValid.
@Override
public void isSegmentValid(SegmentId request, StreamObserver<SegmentValidityResponse> responseObserver) {
RequestTag requestTag = requestTracker.initializeAndTrackRequestTag(controllerService.nextRequestId(), IS_SEGMENT_OPEN, request.getStreamInfo().getScope(), request.getStreamInfo().getStream(), Long.toString(request.getSegmentId()));
log.info(requestTag.getRequestId(), "isSegmentValid called for segment {}/{}/{}.", request.getStreamInfo().getScope(), request.getStreamInfo().getStream(), request.getSegmentId());
authenticateExecuteAndProcessResults(() -> this.grpcAuthHelper.checkAuthorization(authorizationResource.ofStreamInScope(request.getStreamInfo().getScope(), request.getStreamInfo().getStream()), AuthHandler.Permissions.READ), delegationToken -> controllerService.isSegmentValid(request.getStreamInfo().getScope(), request.getStreamInfo().getStream(), request.getSegmentId(), requestTag.getRequestId()).thenApply(bRes -> SegmentValidityResponse.newBuilder().setResponse(bRes).build()), responseObserver);
}
Aggregations