@Test public void setAttributeSyncMetadataInterval() throws Exception { AlluxioURI file = new AlluxioURI("/file"); SetAttributePOptions opt = FileSystemOptions.setAttributeClientDefaults(mFileContext.getPathConf(file)); mFileSystem.setAttribute(file); verify(mFileSystemMasterClient).setAttribute(file, opt); }
@Override public void setAttribute(AlluxioURI path, SetAttributePOptions options) throws FileDoesNotExistException, IOException, AlluxioException { checkUri(path); SetAttributePOptions mergedOptions = FileSystemOptions.setAttributeClientDefaults(mFsContext.getPathConf(path)) .toBuilder().mergeFrom(options).build(); rpc(client -> { client.setAttribute(path, mergedOptions); LOG.debug("Set attributes for {}, options: {}", path.getPath(), options); return null; }); }
BaseFileSystem implements FileSystem { @Override public void setAttribute(AlluxioURI path, SetAttributePOptions options) throws FileDoesNotExistException, IOException, AlluxioException { checkUri(path); SetAttributePOptions mergedOptions = FileSystemOptions.setAttributeClientDefaults(mFsContext.getPathConf(path)) .toBuilder().mergeFrom(options).build(); rpc(client -> { client.setAttribute(path, mergedOptions); LOG.debug("Set attributes for {}, options: {}", path.getPath(), options); return null; }); } }
BaseFileSystem implements FileSystem { @Override public void setAttribute(AlluxioURI path, SetAttributePOptions options) throws FileDoesNotExistException, IOException, AlluxioException { checkUri(path); SetAttributePOptions mergedOptions = FileSystemOptions.setAttributeClientDefaults(mFsContext.getPathConf(path)) .toBuilder().mergeFrom(options).build(); rpc(client -> { client.setAttribute(path, mergedOptions); LOG.debug("Set attributes for {}, options: {}", path.getPath(), options); return null; }); } BaseFileSystem(FileSystemContext fsContext); }
BaseFileSystem implements FileSystem { @Override public void setAttribute(AlluxioURI path, SetAttributePOptions options) throws FileDoesNotExistException, IOException, AlluxioException { checkUri(path); SetAttributePOptions mergedOptions = FileSystemOptions.setAttributeClientDefaults(mFsContext.getPathConf(path)) .toBuilder().mergeFrom(options).build(); rpc(client -> { client.setAttribute(path, mergedOptions); LOG.debug("Set attributes for {}, options: {}", path.getPath(), options); return null; }); } BaseFileSystem(FileSystemContext fsContext); @Override synchronized void close(); @Override boolean isClosed(); @Override void createDirectory(AlluxioURI path, CreateDirectoryPOptions options); @Override FileOutStream createFile(AlluxioURI path, CreateFilePOptions options); @Override void delete(AlluxioURI path, DeletePOptions options); @Override boolean exists(AlluxioURI path, final ExistsPOptions options); @Override void free(AlluxioURI path, final FreePOptions options); @Override List<BlockLocationInfo> getBlockLocations(AlluxioURI path); @Override AlluxioConfiguration getConf(); @Override URIStatus getStatus(AlluxioURI path, final GetStatusPOptions options); @Override List<URIStatus> listStatus(AlluxioURI path, final ListStatusPOptions options); @Override void mount(AlluxioURI alluxioPath, AlluxioURI ufsPath, final MountPOptions options); @Override void updateMount(AlluxioURI alluxioPath, final MountPOptions options); @Override Map<String, MountPointInfo> getMountTable(); @Override List<SyncPointInfo> getSyncPathList(); @Override void persist(final AlluxioURI path, final ScheduleAsyncPersistencePOptions options); @Override FileInStream openFile(AlluxioURI path, OpenFilePOptions options); @Override FileInStream openFile(URIStatus status, OpenFilePOptions options); @Override void rename(AlluxioURI src, AlluxioURI dst, RenamePOptions options); @Override AlluxioURI reverseResolve(AlluxioURI ufsUri); @Override void setAcl(AlluxioURI path, SetAclAction action, List<AclEntry> entries,
      SetAclPOptions options); @Override void setAttribute(AlluxioURI path, SetAttributePOptions options); @Override void startSync(AlluxioURI path); @Override void stopSync(AlluxioURI path); @Override void unmount(AlluxioURI path, UnmountPOptions options); }
BaseFileSystem implements FileSystem { @Override public void setAttribute(AlluxioURI path, SetAttributePOptions options) throws FileDoesNotExistException, IOException, AlluxioException { checkUri(path); SetAttributePOptions mergedOptions = FileSystemOptions.setAttributeClientDefaults(mFsContext.getPathConf(path)) .toBuilder().mergeFrom(options).build(); rpc(client -> { client.setAttribute(path, mergedOptions); LOG.debug("Set attributes for {}, options: {}", path.getPath(), options); return null; }); } BaseFileSystem(FileSystemContext fsContext); @Override synchronized void close(); @Override boolean isClosed(); @Override void createDirectory(AlluxioURI path, CreateDirectoryPOptions options); @Override FileOutStream createFile(AlluxioURI path, CreateFilePOptions options); @Override void delete(AlluxioURI path, DeletePOptions options); @Override boolean exists(AlluxioURI path, final ExistsPOptions options); @Override void free(AlluxioURI path, final FreePOptions options); @Override List<BlockLocationInfo> getBlockLocations(AlluxioURI path); @Override AlluxioConfiguration getConf(); @Override URIStatus getStatus(AlluxioURI path, final GetStatusPOptions options); @Override List<URIStatus> listStatus(AlluxioURI path, final ListStatusPOptions options); @Override void mount(AlluxioURI alluxioPath, AlluxioURI ufsPath, final MountPOptions options); @Override void updateMount(AlluxioURI alluxioPath, final MountPOptions options); @Override Map<String, MountPointInfo> getMountTable(); @Override List<SyncPointInfo> getSyncPathList(); @Override void persist(final AlluxioURI path, final ScheduleAsyncPersistencePOptions options); @Override FileInStream openFile(AlluxioURI path, OpenFilePOptions options); @Override FileInStream openFile(URIStatus status, OpenFilePOptions options); @Override void rename(AlluxioURI src, AlluxioURI dst, RenamePOptions options); @Override AlluxioURI reverseResolve(AlluxioURI ufsUri); @Override void setAcl(AlluxioURI path, SetAclAction action, List<AclEntry> entries,
      SetAclPOptions options); @Override void setAttribute(AlluxioURI path, SetAttributePOptions options); @Override void startSync(AlluxioURI path); @Override void stopSync(AlluxioURI path); @Override void unmount(AlluxioURI path, UnmountPOptions options);  }