use of io.pravega.common.tracing.RequestTag in project pravega by pravega.
the class ControllerServiceImpl method getSegmentsImmediatelyFollowing.
@Override
public void getSegmentsImmediatelyFollowing(SegmentId segmentId, StreamObserver<SuccessorResponse> responseObserver) {
String segment = NameUtils.getQualifiedStreamSegmentName(segmentId.getStreamInfo().getScope(), segmentId.getStreamInfo().getStream(), segmentId.getSegmentId());
RequestTag requestTag = requestTracker.initializeAndTrackRequestTag(controllerService.nextRequestId(), GET_SEGMENTS_IMMEDIATELY_FOLLOWING, segment);
log.info(requestTag.getRequestId(), "getSegmentsImmediatelyFollowing called for segment {} ", segment);
authenticateExecuteAndProcessResults(() -> this.grpcAuthHelper.checkAuthorization(authorizationResource.ofStreamInScope(segmentId.getStreamInfo().getScope(), segmentId.getStreamInfo().getStream()), AuthHandler.Permissions.READ), delegationToken -> controllerService.getSegmentsImmediatelyFollowing(segmentId, requestTag.getRequestId()).thenApply(ModelHelper::createSuccessorResponse).thenApply(response -> {
response.setDelegationToken(delegationToken);
return response.build();
}), responseObserver);
}
use of io.pravega.common.tracing.RequestTag in project pravega by pravega.
the class ControllerServiceImpl method updateSubscriberStreamCut.
@Override
public void updateSubscriberStreamCut(SubscriberStreamCut request, StreamObserver<UpdateSubscriberStatus> responseObserver) {
String scope = request.getStreamCut().getStreamInfo().getScope();
String stream = request.getStreamCut().getStreamInfo().getStream();
String subscriber = request.getSubscriber();
String readerGroupId = request.getReaderGroupId();
long generation = request.getGeneration();
StreamCut streamCut = request.getStreamCut();
RequestTag requestTag = requestTracker.initializeAndTrackRequestTag(controllerService.nextRequestId(), UPDATE_TRUNCATION_STREAM_CUT, scope, stream);
log.info(requestTag.getRequestId(), "updateSubscriberStreamCut called for stream {}/{}.", scope, stream);
authenticateExecuteAndProcessResults(() -> this.grpcAuthHelper.checkAuthorization(authorizationResource.ofStreamInScope(scope, stream), AuthHandler.Permissions.READ_UPDATE), delegationToken -> controllerService.updateSubscriberStreamCut(scope, stream, subscriber, readerGroupId, generation, ImmutableMap.copyOf(ModelHelper.encode(streamCut)), requestTag.getRequestId()), responseObserver, requestTag);
}
use of io.pravega.common.tracing.RequestTag in project pravega by pravega.
the class ControllerServiceImpl method getReaderGroupConfig.
@Override
public void getReaderGroupConfig(ReaderGroupInfo request, StreamObserver<ReaderGroupConfigResponse> responseObserver) {
String scope = request.getScope();
String rgName = request.getReaderGroup();
RequestTag requestTag = requestTracker.initializeAndTrackRequestTag(controllerService.nextRequestId(), GET_READER_GROUP_CONFIG, scope, rgName);
log.info(requestTag.getRequestId(), "getReaderGroupConfig called for Reader Group {}/{}.", scope, rgName);
authenticateExecuteAndProcessResults(() -> this.grpcAuthHelper.checkAuthorizationAndCreateToken(authorizationResource.ofReaderGroupsInScope(scope), AuthHandler.Permissions.READ), delegationToken -> controllerService.getReaderGroupConfig(scope, rgName, requestTag.getRequestId()), responseObserver, requestTag);
}
Aggregations