use of alluxio.master.file.meta.MutableLockedInodePath in project alluxio by Alluxio.
the class PermissionCheckTest method getLockedInodePath.
private LockedInodePath getLockedInodePath(ArrayList<Triple<String, String, Mode>> permissions) throws Exception {
List<Inode<?>> inodes = new ArrayList<>();
inodes.add(getRootInode());
if (permissions.size() == 0) {
return new MutableLockedInodePath(new AlluxioURI("/"), inodes, null);
}
String uri = "";
for (int i = 0; i < permissions.size(); i++) {
Triple<String, String, Mode> permission = permissions.get(i);
String owner = permission.getLeft();
String group = permission.getMiddle();
Mode mode = permission.getRight();
uri += "/" + (i + 1);
if (i == permissions.size() - 1) {
Inode<?> inode = InodeFile.create(i + 1, i, (i + 1) + "", CommonUtils.getCurrentMs(), CreateFileOptions.defaults().setBlockSizeBytes(Constants.KB).setOwner(owner).setGroup(group).setMode(mode));
inodes.add(inode);
} else {
Inode<?> inode = InodeDirectory.create(i + 1, i, (i + 1) + "", CreateDirectoryOptions.defaults().setOwner(owner).setGroup(group).setMode(mode));
inodes.add(inode);
}
}
return new MutableLockedInodePath(new AlluxioURI(uri), inodes, null);
}
Aggregations