Search in sources :

Example 1 with GrpcCallTracker

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

the class FileSystemMasterClientServiceHandler method remove.

@Override
public void remove(DeletePRequest request, StreamObserver<DeletePResponse> responseObserver) {
    RpcUtils.call(LOG, () -> {
        AlluxioURI pathUri = getAlluxioURI(request.getPath());
        mFileSystemMaster.delete(pathUri, DeleteContext.create(request.getOptions().toBuilder()).withTracker(new GrpcCallTracker(responseObserver)));
        return DeletePResponse.newBuilder().build();
    }, "Remove", "request=%s", responseObserver, request);
}
Also used : GrpcCallTracker(alluxio.master.file.contexts.GrpcCallTracker) AlluxioURI(alluxio.AlluxioURI)

Example 2 with GrpcCallTracker

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

the class FileSystemMasterClientServiceHandler method createDirectory.

@Override
public void createDirectory(CreateDirectoryPRequest request, StreamObserver<CreateDirectoryPResponse> responseObserver) {
    CreateDirectoryPOptions options = request.getOptions();
    RpcUtils.call(LOG, () -> {
        AlluxioURI pathUri = getAlluxioURI(request.getPath());
        mFileSystemMaster.createDirectory(pathUri, CreateDirectoryContext.create(options.toBuilder()).withTracker(new GrpcCallTracker(responseObserver)));
        return CreateDirectoryPResponse.newBuilder().build();
    }, "CreateDirectory", "request=%s", responseObserver, request);
}
Also used : CreateDirectoryPOptions(alluxio.grpc.CreateDirectoryPOptions) GrpcCallTracker(alluxio.master.file.contexts.GrpcCallTracker) AlluxioURI(alluxio.AlluxioURI)

Example 3 with GrpcCallTracker

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

the class FileSystemMasterClientServiceHandler method getStatus.

@Override
public void getStatus(GetStatusPRequest request, StreamObserver<GetStatusPResponse> responseObserver) {
    GetStatusPOptions options = request.getOptions();
    RpcUtils.call(LOG, () -> {
        AlluxioURI pathUri = getAlluxioURI(request.getPath());
        return GetStatusPResponse.newBuilder().setFileInfo(GrpcUtils.toProto(mFileSystemMaster.getFileInfo(pathUri, GetStatusContext.create(options.toBuilder()).withTracker(new GrpcCallTracker(responseObserver))))).build();
    }, "GetStatus", true, "request=%s", responseObserver, request);
}
Also used : GrpcCallTracker(alluxio.master.file.contexts.GrpcCallTracker) GetStatusPOptions(alluxio.grpc.GetStatusPOptions) AlluxioURI(alluxio.AlluxioURI)

Example 4 with GrpcCallTracker

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

the class FileSystemMasterClientServiceHandler method rename.

@Override
public void rename(RenamePRequest request, StreamObserver<RenamePResponse> responseObserver) {
    RpcUtils.call(LOG, () -> {
        AlluxioURI srcPathUri = getAlluxioURI(request.getPath());
        AlluxioURI dstPathUri = getAlluxioURI(request.getDstPath());
        mFileSystemMaster.rename(srcPathUri, dstPathUri, RenameContext.create(request.getOptions().toBuilder()).withTracker(new GrpcCallTracker(responseObserver)));
        return RenamePResponse.newBuilder().build();
    }, "Rename", "request=%s", responseObserver, request);
}
Also used : GrpcCallTracker(alluxio.master.file.contexts.GrpcCallTracker) AlluxioURI(alluxio.AlluxioURI)

Example 5 with GrpcCallTracker

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

the class FileSystemMasterClientServiceHandler method setAttribute.

@Override
public void setAttribute(SetAttributePRequest request, StreamObserver<SetAttributePResponse> responseObserver) {
    RpcUtils.call(LOG, () -> {
        AlluxioURI pathUri = getAlluxioURI(request.getPath());
        mFileSystemMaster.setAttribute(pathUri, SetAttributeContext.create(request.getOptions().toBuilder()).withTracker(new GrpcCallTracker(responseObserver)));
        return SetAttributePResponse.newBuilder().build();
    }, "SetAttribute", "request=%s", responseObserver, request);
}
Also used : GrpcCallTracker(alluxio.master.file.contexts.GrpcCallTracker) 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