use of alluxio.grpc.CheckAccessPOptions in project alluxio by Alluxio.
the class AbstractFileSystem method access.
@Override
public void access(Path path, FsAction mode) throws IOException {
LOG.debug("access({}, {})", path, mode);
AlluxioURI uri = getAlluxioPath(path);
CheckAccessPOptions options = CheckAccessPOptions.newBuilder().setBits(Mode.Bits.fromShort((short) mode.ordinal()).toProto()).build();
try {
mFileSystem.checkAccess(uri, options);
} catch (AlluxioException e) {
throw new IOException(e);
}
}
use of alluxio.grpc.CheckAccessPOptions in project alluxio by Alluxio.
the class BaseFileSystem method checkAccess.
@Override
public void checkAccess(AlluxioURI path, CheckAccessPOptions options) throws InvalidPathException, IOException, AlluxioException {
checkUri(path);
rpc(client -> {
CheckAccessPOptions mergedOptions = FileSystemOptions.checkAccessDefaults(mFsContext.getPathConf(path)).toBuilder().mergeFrom(options).build();
client.checkAccess(path, mergedOptions);
LOG.debug("Checked access {}, options: {}", path.getPath(), mergedOptions);
return null;
});
}
use of alluxio.grpc.CheckAccessPOptions in project alluxio by Alluxio.
the class CheckAccessContext method mergeFrom.
/**
* Merges and embeds the given {@link CheckAccessPOptions} with the corresponding master
* options.
*
* @param optionsBuilder Builder for proto {@link CheckAccessPOptions} to merge with defaults
* @return the instance of {@link CheckAccessContext} with default values for master
*/
public static CheckAccessContext mergeFrom(CheckAccessPOptions.Builder optionsBuilder) {
CheckAccessPOptions masterOptions = FileSystemOptions.checkAccessDefaults(ServerConfiguration.global());
CheckAccessPOptions.Builder mergedOptionsBuilder = masterOptions.toBuilder().mergeFrom(optionsBuilder.build());
return create(mergedOptionsBuilder);
}
Aggregations