use of io.pravega.common.tracing.RequestTag 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);
}
use of io.pravega.common.tracing.RequestTag in project pravega by pravega.
the class ControllerServiceImpl method checkTransactionState.
@Override
public void checkTransactionState(TxnRequest request, StreamObserver<TxnState> responseObserver) {
final UUID txnId = ModelHelper.encode(request.getTxnId());
RequestTag requestTag = requestTracker.initializeAndTrackRequestTag(controllerService.nextRequestId(), CHECK_TRANSACTION_STATE, request.getStreamInfo().getScope(), request.getStreamInfo().getStream(), txnId.toString());
log.info(requestTag.getRequestId(), "checkTransactionState called for stream {}/{}, txnId={}.", request.getStreamInfo().getScope(), request.getStreamInfo().getStream(), txnId);
authenticateExecuteAndProcessResults(() -> this.grpcAuthHelper.checkAuthorization(authorizationResource.ofStreamInScope(request.getStreamInfo().getScope(), request.getStreamInfo().getStream()), AuthHandler.Permissions.READ), delegationToken -> controllerService.checkTransactionStatus(request.getStreamInfo().getScope(), request.getStreamInfo().getStream(), txnId, requestTag.getRequestId()), responseObserver, requestTag);
}
use of io.pravega.common.tracing.RequestTag in project pravega by pravega.
the class ControllerServiceImpl method createKeyValueTable.
@Override
public void createKeyValueTable(KeyValueTableConfig request, StreamObserver<CreateKeyValueTableStatus> responseObserver) {
String scope = request.getScope();
String kvt = request.getKvtName();
RequestTag requestTag = requestTracker.initializeAndTrackRequestTag(controllerService.nextRequestId(), CREATE_KEY_VALUE_TABLE, scope, kvt);
log.info(requestTag.getRequestId(), "createKeyValueTable called for KVTable {}/{}.", scope, kvt);
authenticateExecuteAndProcessResults(() -> this.grpcAuthHelper.checkAuthorizationAndCreateToken(authorizationResource.ofKeyValueTablesInScope(scope), AuthHandler.Permissions.READ_UPDATE), delegationToken -> controllerService.createKeyValueTable(scope, kvt, ModelHelper.encode(request), System.currentTimeMillis(), requestTag.getRequestId()), responseObserver, requestTag);
}
use of io.pravega.common.tracing.RequestTag in project pravega by pravega.
the class ControllerServiceImpl method removeWriter.
@Override
public void removeWriter(Controller.RemoveWriterRequest request, StreamObserver<Controller.RemoveWriterResponse> responseObserver) {
StreamInfo streamInfo = request.getStream();
RequestTag requestTag = requestTracker.initializeAndTrackRequestTag(controllerService.nextRequestId(), REMOVE_WRITER, streamInfo.getScope(), streamInfo.getStream(), request.getWriter());
log.info(requestTag.getRequestId(), "writerShutdown called for stream {}/{}, writer={}", streamInfo.getScope(), streamInfo.getStream(), request.getWriter());
authenticateExecuteAndProcessResults(() -> this.grpcAuthHelper.checkAuthorization(authorizationResource.ofStreamInScope(streamInfo.getScope(), streamInfo.getStream()), AuthHandler.Permissions.READ_UPDATE), delegationToken -> controllerService.removeWriter(streamInfo.getScope(), streamInfo.getStream(), request.getWriter(), requestTag.getRequestId()), responseObserver, requestTag);
}
use of io.pravega.common.tracing.RequestTag in project pravega by pravega.
the class ControllerServiceImpl method deleteKeyValueTable.
@Override
public void deleteKeyValueTable(KeyValueTableInfo request, StreamObserver<DeleteKVTableStatus> responseObserver) {
RequestTag requestTag = requestTracker.initializeAndTrackRequestTag(controllerService.nextRequestId(), DELETE_KEY_VALUE_TABLE, request.getScope(), request.getKvtName());
log.info(requestTag.getRequestId(), "deleteKeyValueTable called for KVTable {}/{}.", request.getScope(), request.getKvtName());
authenticateExecuteAndProcessResults(() -> this.grpcAuthHelper.checkAuthorization(authorizationResource.ofKeyValueTableInScope(request.getScope(), request.getKvtName()), AuthHandler.Permissions.READ_UPDATE), delegationToken -> controllerService.deleteKeyValueTable(request.getScope(), request.getKvtName(), requestTag.getRequestId()), responseObserver, requestTag);
}
Aggregations