Search in sources :

Example 1 with FileNameCachingPath

use of org.apache.hudi.hadoop.FileNameCachingPath in project hudi by apache.

the class HoodieWrapperFileSystem method convertPathWithScheme.

public static Path convertPathWithScheme(Path oldPath, String newScheme) {
    URI oldURI = oldPath.toUri();
    URI newURI;
    try {
        newURI = new URI(newScheme, oldURI.getUserInfo(), oldURI.getHost(), oldURI.getPort(), oldURI.getPath(), oldURI.getQuery(), oldURI.getFragment());
        return new FileNameCachingPath(newURI);
    } catch (URISyntaxException e) {
        // TODO - Better Exception handling
        throw new RuntimeException(e);
    }
}
Also used : FileNameCachingPath(org.apache.hudi.hadoop.FileNameCachingPath) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI)

Aggregations

URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 FileNameCachingPath (org.apache.hudi.hadoop.FileNameCachingPath)1