Skip to content

Commit

Permalink
[ADAM-1984] Support file systems that don't set the scheme.
Browse files Browse the repository at this point in the history
Resolves #1984.
  • Loading branch information
Frank Austin Nothaft authored and heuermh committed Apr 24, 2018
1 parent 75b51e7 commit 429680e
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ private[adam] object FileMerger extends Logging {
*/
val BUFFER_SIZE_CONF = "org.bdgenomics.adam.rdd.FileMerger.bufferSize"

private def isHdfs(fs: FileSystem): Boolean = {
try {
fs.getScheme == "hdfs"
} catch {
case _: Throwable => false
}
}

/**
* Merges together sharded files, while preserving partition ordering.
*
Expand Down Expand Up @@ -75,7 +83,7 @@ private[adam] object FileMerger extends Logging {
disableFastConcat: Boolean = false) {

// if our file system is an hdfs mount, we can use the parallel merger
if (!disableFastConcat && (fs.getScheme == "hdfs")) {
if (!disableFastConcat && isHdfs(fs)) {
ParallelFileMerger.mergeFiles(sc,
outputPath,
tailPath,
Expand Down

0 comments on commit 429680e

Please sign in to comment.