@Override public void copyFromLocalFile(boolean delSrc, boolean overwrite, Path[] srcs, Path dst) throws IOException { fileSystem .copyFromLocalFile(delSrc, overwrite, convertDefaults(srcs), convertToDefaultPath(dst)); }
public Path convertToHoodiePath(Path oldPath) { return convertPathWithScheme(oldPath, getHoodieScheme(fileSystem.getScheme())); }
@Override public Path makeQualified(Path path) { return convertToHoodiePath(fileSystem.makeQualified(convertToDefaultPath(path))); }
@Override public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { final Path translatedPath = convertToDefaultPath(f); return wrapOutputStream(f, fileSystem .create(translatedPath, permission, overwrite, bufferSize, replication, blockSize, progress)); }
private Path[] convertDefaults(Path[] psrcs) { Path[] psrcsNew = new Path[psrcs.length]; for (int i = 0; i < psrcs.length; i++) { psrcsNew[i] = convertToDefaultPath(psrcs[i]); } return psrcsNew; }
@Override public Path getWorkingDirectory() { return convertToHoodiePath(fileSystem.getWorkingDirectory()); }
@Override public FileStatus[] listStatus(Path[] files) throws IOException { return fileSystem.listStatus(convertDefaults(files)); }
public static Configuration registerFileSystem(Path file, Configuration conf) { Configuration returnConf = new Configuration(conf); String scheme = FSUtils.getFs(file.toString(), conf).getScheme(); returnConf.set("fs." + HoodieWrapperFileSystem.getHoodieScheme(scheme) + ".impl", HoodieWrapperFileSystem.class.getName()); return returnConf; }
private Path convertToDefaultPath(Path oldPath) { return convertPathWithScheme(oldPath, fileSystem.getScheme()); }
public boolean canWrite() { return fs.getBytesWritten(file) < maxFileSize; }
@Override public boolean rename(Path src, Path dst) throws IOException { return fileSystem.rename(convertToDefaultPath(src), convertToDefaultPath(dst)); }
@Override public FSDataOutputStream create(Path f) throws IOException { return wrapOutputStream(f, fileSystem.create(convertToDefaultPath(f))); }
@Override public Path getWorkingDirectory() { return convertToHoodiePath(fileSystem.getWorkingDirectory()); }
@Override public FileStatus[] listStatus(Path[] files, PathFilter filter) throws IOException { return fileSystem.listStatus(convertDefaults(files), filter); }
public static Configuration registerFileSystem(Path file, Configuration conf) { Configuration returnConf = new Configuration(conf); String scheme = FSUtils.getFs(file.toString(), conf).getScheme(); returnConf.set("fs." + HoodieWrapperFileSystem.getHoodieScheme(scheme) + ".impl", HoodieWrapperFileSystem.class.getName()); return returnConf; }
private Path convertToDefaultPath(Path oldPath) { return convertPathWithScheme(oldPath, fileSystem.getScheme()); }
public boolean canWrite() { return fs.getBytesWritten(file) < maxFileSize; }
@Override public FSDataOutputStream create(Path f, boolean overwrite, int bufferSize, Progressable progress) throws IOException { return fileSystem.create(convertToDefaultPath(f), overwrite, bufferSize, progress); }
@Override public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException { return convertToHoodiePath(fileSystem .startLocalOutput(convertToDefaultPath(fsOutputFile), convertToDefaultPath(tmpLocalFile))); }
@Override public FSDataOutputStream create(Path f, boolean overwrite) throws IOException { return wrapOutputStream(f, fileSystem.create(convertToDefaultPath(f), overwrite)); }