Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,16 @@ private URI getRepositoryUri(Configuration conf,
uri.append(":");
}
URI rootUri = rootDirectory.toUri();
uri.append(rootUri.getPath());
if (rootUri.getHost() != null) {
uri.append("?").append("hdfs:host").append("=").append(rootUri.getHost());
if (rootUri.getPort() != -1) {
uri.append("&").append("hdfs:port").append("=").append(rootUri.getPort());
}

if(rootUri.getScheme().equals("hdfs")) {
if (rootUri.getHost() != null) {
uri.append("?").append("hdfs:host").append("=").append(rootUri.getHost());
if (rootUri.getPort() != -1) {
uri.append("&").append("hdfs:port").append("=").append(rootUri.getPort());
}
}
} else{
uri.append("/").append(rootUri);
}
}
return URI.create(uri.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,17 @@ private static URI fileSystemURI(Map<String, String> match, Configuration conf)
} else {
String defaultScheme;
try {
defaultScheme = FileSystem.get(conf).getUri().getScheme();
defaultScheme = FileSystem.get(new URI(match.get("path")),conf).getUri().getScheme();
} catch (IOException e) {
throw new DatasetIOException("Cannot determine the default FS", e);
}
return new URI(defaultScheme, userInfo, "", UNSPECIFIED_PORT, "/", null, null);

if(defaultScheme.equals("s3a")||defaultScheme.equals("swift"))
{
return new URI(match.get("path"));
} else {
return new URI(defaultScheme, userInfo, "", UNSPECIFIED_PORT, "/", null, null);
}
}
} catch (URISyntaxException ex) {
throw new DatasetOperationException("Could not build FS URI", ex);
Expand Down