/** * @param context the {@link FileSystemContext} to use in this client * @return a {@link BaseFileSystem} */ public static BaseFileSystem create(FileSystemContext context) { return new BaseFileSystem(context); }
/** * Constructs a new {@link MoveDefinition}. */ public MoveDefinition() { mFsContext = FileSystemContext.create(ServerConfiguration.global()); mFileSystem = BaseFileSystem.create(mFsContext); }
@Override public void createDirectory(AlluxioURI path) throws FileAlreadyExistsException, InvalidPathException, IOException, AlluxioException { createDirectory(path, CreateDirectoryPOptions.getDefaultInstance()); }
@Override public FileInStream openFile(AlluxioURI path, OpenFilePOptions options) throws FileDoesNotExistException, IOException, AlluxioException { checkUri(path); URIStatus status = getStatus(path); if (status.isFolder()) { throw new FileDoesNotExistException( ExceptionMessage.CANNOT_READ_DIRECTORY.getMessage(status.getName())); } InStreamOptions inStreamOptions = new InStreamOptions(status, options, mFsContext.getConf()); return new FileInStream(status, inStreamOptions, mFsContext); }
@Override public FileOutStream createFile(AlluxioURI path) throws FileAlreadyExistsException, InvalidPathException, IOException, AlluxioException { return createFile(path, CreateFilePOptions.getDefaultInstance()); }
@Override public URIStatus getStatus(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException { return getStatus(path, GetStatusPOptions.getDefaultInstance()); }
@Override public FileOutStream createFile(AlluxioURI path, CreateFilePOptions options) throws FileAlreadyExistsException, InvalidPathException, IOException, AlluxioException { checkUri(path); FileSystemMasterClient masterClient = mFsContext.acquireMasterClient(); URIStatus status; return new FileOutStream(path, outStreamOptions, mFsContext); } catch (Exception e) { delete(path); throw e;
@Override public void free(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException { free(path, FreePOptions.getDefaultInstance()); }
@Override public List<URIStatus> listStatus(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException { return listStatus(path, ListStatusPOptions.getDefaultInstance()); }
@Override public void delete(AlluxioURI path) throws DirectoryNotEmptyException, FileDoesNotExistException, IOException, AlluxioException { delete(path, DeletePOptions.getDefaultInstance()); }
/** * {@inheritDoc} * * @deprecated since version 1.1 and will be removed in version 2.0 */ @Deprecated @Override public void loadMetadata(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException { loadMetadata(path, LoadMetadataPOptions.getDefaultInstance()); }
@Override public boolean exists(AlluxioURI path) throws InvalidPathException, IOException, AlluxioException { return exists(path, ExistsPOptions.getDefaultInstance()); }
@Override public FileOutStream createFile(AlluxioURI path) throws FileAlreadyExistsException, InvalidPathException, IOException, AlluxioException { return createFile(path, CreateFileOptions.defaults()); }
@Override public URIStatus getStatus(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException { return getStatus(path, GetStatusOptions.defaults()); }
@Override public void free(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException { free(path, FreeOptions.defaults()); }
@Override public List<URIStatus> listStatus(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException { return listStatus(path, ListStatusOptions.defaults()); }
@Override public void delete(AlluxioURI path) throws DirectoryNotEmptyException, FileDoesNotExistException, IOException, AlluxioException { delete(path, DeleteOptions.defaults()); }
@Override public void loadMetadata(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException { loadMetadata(path, LoadMetadataOptions.defaults()); }
@Override public boolean exists(AlluxioURI path) throws InvalidPathException, IOException, AlluxioException { return exists(path, ExistsOptions.defaults()); }
/** * Constructs a new {@link LoadDefinition}. */ public LoadDefinition() { mFsContext = FileSystemContext.create(ServerConfiguration.global()); mFileSystem = BaseFileSystem.create(mFsContext); }