Search in sources :

Example 6 with GrpcCallTracker

use of alluxio.master.file.contexts.GrpcCallTracker in project alluxio by Alluxio.

the class FileSystemMasterClientServiceHandler method listStatus.

@Override
public void listStatus(ListStatusPRequest request, StreamObserver<ListStatusPResponse> responseObserver) {
    final int listStatusBatchSize = ServerConfiguration.getInt(PropertyKey.MASTER_FILE_SYSTEM_LISTSTATUS_RESULTS_PER_MESSAGE);
    // Result streamer for listStatus.
    ListStatusResultStream resultStream = new ListStatusResultStream(listStatusBatchSize, responseObserver);
    try {
        RpcUtils.callAndReturn(LOG, () -> {
            AlluxioURI pathUri = getAlluxioURI(request.getPath());
            mFileSystemMaster.listStatus(pathUri, ListStatusContext.create(request.getOptions().toBuilder()).withTracker(new GrpcCallTracker(responseObserver)), resultStream);
            // Return just something.
            return null;
        }, "ListStatus", false, "request=%s", request);
    } catch (Exception e) {
        resultStream.fail(e);
    } finally {
        resultStream.complete();
    }
}
Also used : GrpcCallTracker(alluxio.master.file.contexts.GrpcCallTracker) InvalidPathException(alluxio.exception.InvalidPathException) AlluxioURI(alluxio.AlluxioURI)

Example 7 with GrpcCallTracker

use of alluxio.master.file.contexts.GrpcCallTracker in project alluxio by Alluxio.

the class FileSystemMasterClientServiceHandler method setAcl.

@Override
public void setAcl(SetAclPRequest request, StreamObserver<SetAclPResponse> responseObserver) {
    RpcUtils.call(LOG, () -> {
        AlluxioURI pathUri = getAlluxioURI(request.getPath());
        mFileSystemMaster.setAcl(pathUri, request.getAction(), request.getEntriesList().stream().map(GrpcUtils::fromProto).collect(Collectors.toList()), SetAclContext.create(request.getOptions().toBuilder()).withTracker(new GrpcCallTracker(responseObserver)));
        return SetAclPResponse.newBuilder().build();
    }, "setAcl", "request=%s", responseObserver, request);
}
Also used : GrpcCallTracker(alluxio.master.file.contexts.GrpcCallTracker) GrpcUtils(alluxio.grpc.GrpcUtils) AlluxioURI(alluxio.AlluxioURI)

Aggregations

AlluxioURI (alluxio.AlluxioURI)7 GrpcCallTracker (alluxio.master.file.contexts.GrpcCallTracker)7 InvalidPathException (alluxio.exception.InvalidPathException)1 CreateDirectoryPOptions (alluxio.grpc.CreateDirectoryPOptions)1 GetStatusPOptions (alluxio.grpc.GetStatusPOptions)1 GrpcUtils (alluxio.grpc.GrpcUtils)1