Skip to content

Commit

Permalink
add repr for FlattedValuesSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Davies Liu committed Apr 7, 2015
1 parent c6a2f8d commit d2f053b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion python/pyspark/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ def _batched(self, iterator):
def load_stream(self, stream):
return self.serializer.load_stream(stream)

def __repr__(self):
return "FlattedValuesSerializer(%d)" % self.batchSize


class AutoBatchedSerializer(BatchedSerializer):
"""
Expand Down Expand Up @@ -271,7 +274,7 @@ def __eq__(self, other):
return (isinstance(other, AutoBatchedSerializer) and
other.serializer == self.serializer and other.bestSize == self.bestSize)

def __str__(self):
def __repr__(self):
return "AutoBatchedSerializer(%s)" % str(self.serializer)


Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/shuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def mergeCombiners(self, iterator, limit=None):
else:
batch *= 1.5

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

def _spill(self):
Expand Down

0 comments on commit d2f053b

Please sign in to comment.