Github user mateiz commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1460#discussion_r15072735
  
    --- Diff: python/pyspark/rdd.py ---
    @@ -168,6 +170,123 @@ def _replaceRoot(self, value):
                 self._sink(1)
     
     
    +class Merger(object):
    +    """
    +    External merger will dump the aggregated data into disks when memory 
usage is above
    +    the limit, then merge them together.
    +
    +    >>> combiner = lambda x, y:x+y
    +    >>> merger = Merger(combiner, 10)
    +    >>> N = 10000
    +    >>> merger.merge(zip(xrange(N), xrange(N)) * 10)
    +    >>> merger.spills
    +    100
    +    >>> sum(1 for k,v in merger.iteritems())
    +    10000
    +    """
    +
    +    PARTITIONS = 64
    +    BATCH = 1000
    +
    +    def __init__(self, combiner, memory_limit=256, path="/tmp/pyspark", 
serializer=None):
    --- End diff --
    
    This should actually rotate among storage directories in spark.local.dir. 
Check out how the DiskStore works in Java.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to