Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
minor
  • Loading branch information
brkyvz committed Nov 11, 2015
commit c250d2e15e9435e8c7e9ac9c4927057e4c6cf9f7
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,10 @@ private[streaming] object FileBasedWriteAheadLog {
threadpool: ThreadPoolExecutor,
source: Seq[I],
handler: I => Iterator[O]): Iterator[O] = {
val taskSupport = new ThreadPoolTaskSupport(threadpool)
source.grouped(threadpool.getCorePoolSize).flatMap { element =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, my bad. grouped creates groups of n, not n groups. We want n groups.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm, i see you have implemented it differently than what we discussed. Seems to work. In fact this is more evenly load balanced i think. Just change element to group.

val parallelCollection = element.par
parallelCollection.tasksupport = new ThreadPoolTaskSupport(threadpool)
parallelCollection.tasksupport = taskSupport
parallelCollection.map(handler)
}.flatten
}
Expand Down