Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Davies Liu committed Apr 6, 2015
1 parent 9e2df24 commit c6a2f8d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/pyspark/shuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ def mergeValues(self, iterator):
else:
batch *= 1.5

if get_used_memory() >= limit:
self._spill()

def _partition(self, key):
""" Return the partition for key """
return hash((key, self._seed)) % self.partitions
Expand Down Expand Up @@ -310,6 +313,9 @@ def mergeCombiners(self, iterator, limit=None):
else:
batch *= 1.5

if get_used_memory() >= limit:
self._spill()

def _spill(self):
"""
dump already partitioned data into disks.
Expand Down

0 comments on commit c6a2f8d

Please sign in to comment.