@Test public void getattr() throws Exception { FileInfo info = new FileInfo(); info.setLength(4 * Constants.KB + 1); info.setLastModificationTimeMs(1000); String userName = System.getProperty("user.name"); info.setOwner(userName); info.setGroup(AlluxioFuseUtils.getGroupName(userName)); info.setFolder(true); info.setMode(123); info.setCompleted(true); URIStatus status = new URIStatus(info); when(mFileSystem.getStatus(any(AlluxioURI.class))).thenReturn(status); FileStat stat = new FileStat(Runtime.getSystemRuntime()); assertEquals(0, mFuseFs.getattr("/foo", stat)); assertEquals(status.getLength(), stat.st_size.longValue()); assertEquals(9, stat.st_blocks.intValue()); assertEquals(status.getLastModificationTimeMs() / 1000, stat.st_ctim.tv_sec.get()); assertEquals((status.getLastModificationTimeMs() % 1000) * 1000, stat.st_ctim.tv_nsec.longValue()); assertEquals(status.getLastModificationTimeMs() / 1000, stat.st_mtim.tv_sec.get()); assertEquals((status.getLastModificationTimeMs() % 1000) * 1000, stat.st_mtim.tv_nsec.longValue()); assertEquals(AlluxioFuseUtils.getUid(System.getProperty("user.name")), stat.st_uid.get()); assertEquals(AlluxioFuseUtils.getGid(System.getProperty("user.name")), stat.st_gid.get()); assertEquals(123 | FileStat.S_IFDIR, stat.st_mode.intValue()); }
@Override public int getattr(String path, FileStat stat) { return AlluxioFuseUtils.call( LOG, () -> getattrInternal(path, stat), "getattr", "path=%s", path); }
AlluxioFuseFileSystem extends FuseStubFS { @Override public int getattr(String path, FileStat stat) { return AlluxioFuseUtils.call( LOG, () -> getattrInternal(path, stat), "getattr", "path=%s", path); } }
AlluxioFuseFileSystem extends FuseStubFS { @Override public int getattr(String path, FileStat stat) { return AlluxioFuseUtils.call( LOG, () -> getattrInternal(path, stat), "getattr", "path=%s", path); } AlluxioFuseFileSystem(FileSystem fs, AlluxioFuseOptions opts, AlluxioConfiguration conf); }
AlluxioFuseFileSystem extends FuseStubFS { @Override public int getattr(String path, FileStat stat) { return AlluxioFuseUtils.call( LOG, () -> getattrInternal(path, stat), "getattr", "path=%s", path); } AlluxioFuseFileSystem(FileSystem fs, AlluxioFuseOptions opts, AlluxioConfiguration conf); @Override int chmod(String path, @mode_t long mode); @Override int chown(String path, @uid_t long uid, @gid_t long gid); @Override int create(String path, @mode_t long mode, FuseFileInfo fi); @Override int flush(String path, FuseFileInfo fi); @Override int getattr(String path, FileStat stat); @Override String getFSName(); @Override int mkdir(String path, @mode_t long mode); @Override int open(String path, FuseFileInfo fi); @Override int read(String path, Pointer buf, @size_t long size, @off_t long offset,
      FuseFileInfo fi); @Override int readdir(String path, Pointer buff, FuseFillDir filter,
      @off_t long offset, FuseFileInfo fi); @Override int release(String path, FuseFileInfo fi); @Override int rename(String oldPath, String newPath); @Override int rmdir(String path); @Override int statfs(String path, Statvfs stbuf); @Override int truncate(String path, long size); @Override int unlink(String path); @Override int utimens(String path, Timespec[] timespec); @Override int write(String path, Pointer buf, @size_t long size, @off_t long offset,
                   FuseFileInfo fi); }
AlluxioFuseFileSystem extends FuseStubFS { @Override public int getattr(String path, FileStat stat) { return AlluxioFuseUtils.call( LOG, () -> getattrInternal(path, stat), "getattr", "path=%s", path); } AlluxioFuseFileSystem(FileSystem fs, AlluxioFuseOptions opts, AlluxioConfiguration conf); @Override int chmod(String path, @mode_t long mode); @Override int chown(String path, @uid_t long uid, @gid_t long gid); @Override int create(String path, @mode_t long mode, FuseFileInfo fi); @Override int flush(String path, FuseFileInfo fi); @Override int getattr(String path, FileStat stat); @Override String getFSName(); @Override int mkdir(String path, @mode_t long mode); @Override int open(String path, FuseFileInfo fi); @Override int read(String path, Pointer buf, @size_t long size, @off_t long offset,
      FuseFileInfo fi); @Override int readdir(String path, Pointer buff, FuseFillDir filter,
      @off_t long offset, FuseFileInfo fi); @Override int release(String path, FuseFileInfo fi); @Override int rename(String oldPath, String newPath); @Override int rmdir(String path); @Override int statfs(String path, Statvfs stbuf); @Override int truncate(String path, long size); @Override int unlink(String path); @Override int utimens(String path, Timespec[] timespec); @Override int write(String path, Pointer buf, @size_t long size, @off_t long offset,
                   FuseFileInfo fi); @VisibleForTesting
  static final int UNKNOWN_INODES; @VisibleForTesting
  static final int MAX_NAME_LENGTH; @VisibleForTesting
  static final long ID_NOT_SET_VALUE; @VisibleForTesting
  static final long ID_NOT_SET_VALUE_UNSIGNED; }