@Override public RecoverableFsDataOutputStream recover(ResumeRecoverable recoverable) throws IOException { if (recoverable instanceof LocalRecoverable) { return new LocalRecoverableFsDataOutputStream((LocalRecoverable) recoverable); } else { throw new IllegalArgumentException( "LocalFileSystem cannot recover recoverable for other file system: " + recoverable); } }
@Override public RecoverableFsDataOutputStream open(Path filePath) throws IOException { final File targetFile = fs.pathToFile(filePath); final File tempFile = generateStagingTempFilePath(targetFile); // try to create the parent final File parent = tempFile.getParentFile(); if (parent != null && !parent.mkdirs() && !parent.exists()) { throw new IOException("Failed to create the parent directory: " + parent); } return new LocalRecoverableFsDataOutputStream(targetFile, tempFile); }
@Override public RecoverableFsDataOutputStream recover(ResumeRecoverable recoverable) throws IOException { if (recoverable instanceof LocalRecoverable) { return new LocalRecoverableFsDataOutputStream((LocalRecoverable) recoverable); } else { throw new IllegalArgumentException( "LocalFileSystem cannot recover recoverable for other file system: " + recoverable); } }
@Override public RecoverableFsDataOutputStream open(Path filePath) throws IOException { final File targetFile = fs.pathToFile(filePath); final File tempFile = generateStagingTempFilePath(targetFile); // try to create the parent final File parent = tempFile.getParentFile(); if (parent != null && !parent.mkdirs() && !parent.exists()) { throw new IOException("Failed to create the parent directory: " + parent); } return new LocalRecoverableFsDataOutputStream(targetFile, tempFile); }