1
0

Allow HoodieWrapperFileSystem to wrap other proxy file-system implementations with no getScheme implementation (#793)

This commit is contained in:
Balaji Varadarajan
2019-07-24 21:31:46 -07:00
committed by vinoth chandar
parent 0b451b3a58
commit 83dab21ae1

View File

@@ -121,13 +121,15 @@ public class HoodieWrapperFileSystem extends FileSystem {
// Remove 'hoodie-' prefix from path // Remove 'hoodie-' prefix from path
if (path.toString().startsWith(HOODIE_SCHEME_PREFIX)) { if (path.toString().startsWith(HOODIE_SCHEME_PREFIX)) {
path = new Path(path.toString().replace(HOODIE_SCHEME_PREFIX, "")); path = new Path(path.toString().replace(HOODIE_SCHEME_PREFIX, ""));
this.uri = path.toUri();
} else {
this.uri = uri;
} }
this.fileSystem = FSUtils.getFs(path.toString(), conf); this.fileSystem = FSUtils.getFs(path.toString(), conf);
// Do not need to explicitly initialize the default filesystem, its done already in the above // Do not need to explicitly initialize the default filesystem, its done already in the above
// FileSystem.get // FileSystem.get
// fileSystem.initialize(FileSystem.getDefaultUri(conf), conf); // fileSystem.initialize(FileSystem.getDefaultUri(conf), conf);
// fileSystem.setConf(conf); // fileSystem.setConf(conf);
this.uri = uri;
} }
@Override @Override
@@ -861,11 +863,11 @@ public class HoodieWrapperFileSystem extends FileSystem {
} }
public Path convertToHoodiePath(Path oldPath) { public Path convertToHoodiePath(Path oldPath) {
return convertPathWithScheme(oldPath, getHoodieScheme(fileSystem.getScheme())); return convertPathWithScheme(oldPath, getHoodieScheme(getScheme()));
} }
private Path convertToDefaultPath(Path oldPath) { private Path convertToDefaultPath(Path oldPath) {
return convertPathWithScheme(oldPath, fileSystem.getScheme()); return convertPathWithScheme(oldPath, getScheme());
} }
private Path convertToLocalPath(Path oldPath) { private Path convertToLocalPath(Path oldPath) {