use of io.pravega.client.control.impl.ModelHelper 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);
}
Aggregations