Skip to content

Commit

Permalink
fixing wholetextfileinput to it has the same setMinPartitions functio…
Browse files Browse the repository at this point in the history
…n as in BinaryData files
  • Loading branch information
kmader committed Oct 30, 2014
1 parent 359a096 commit 3c49a30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ private[spark] class WholeTextFileInputFormat extends CombineFileInputFormat[Str
}

/**
* Allow minPartitions set by end-user in order to keep compatibility with old Hadoop API.
* Allow minPartitions set by end-user in order to keep compatibility with old Hadoop API,
* which is set through setMaxSplitSize
*/
def setMaxSplitSize(context: JobContext, minPartitions: Int) {
def setMinPartitions(context: JobContext, minPartitions: Int) {
val files = listStatus(context)
val totalLen = files.map { file =>
if (file.isDir) 0L else file.getLen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private[spark] class WholeTextFileRDD(
case _ =>
}
val jobContext = newJobContext(conf, jobId)
inputFormat.setMaxSplitSize(jobContext, minPartitions)
inputFormat.setMinPartitions(jobContext, minPartitions)
val rawSplits = inputFormat.getSplits(jobContext).toArray
val result = new Array[Partition](rawSplits.size)
for (i <- 0 until rawSplits.size) {
Expand Down

0 comments on commit 3c49a30

Please sign in to comment.