spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tdas <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-11419][STREAMING] Parallel recovery for...
Date Thu, 12 Nov 2015 00:45:10 GMT
Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9373#discussion_r44608862
  
    --- Diff: streaming/src/main/scala/org/apache/spark/streaming/util/FileBasedWriteAheadLog.scala
---
    @@ -251,4 +261,23 @@ private[streaming] object FileBasedWriteAheadLog {
           }
         }.sortBy { _.startTime }
       }
    +
    +  /**
    +   * This creates an iterator from a parallel collection, by keeping at most `n` objects
in memory
    +   * at any given time, where `n` is the size of the thread pool. This is crucial for
use cases
    +   * where we create `FileBasedWriteAheadLogReader`s during parallel recovery. We don't
want to
    +   * open up `k` streams altogether where `k` is the size of the Seq that we want to
parallelize.
    +   */
    +  def seqToParIterator[I, O](
    +      tpool: ThreadPoolExecutor,
    +      source: Seq[I],
    +      handler: I => Iterator[O]): Iterator[O] = {
    +    val taskSupport = new ThreadPoolTaskSupport(tpool)
    +    val groupSize = math.max(math.max(tpool.getCorePoolSize, tpool.getPoolSize), 8)
    --- End diff --
    
    Its not safe for the rest of the system to allow infinite number of thread. I think there
should be limits. The limit can be a sparkconf that will not be exposed publicly.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message