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();
}
}
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);
}
Aggregations