From 0f5cd844fe63b7dd9a3e0a920f9a26a25b9f5d1a Mon Sep 17 00:00:00 2001 From: Nick Pentreath Date: Thu, 19 Dec 2013 11:06:37 +0200 Subject: [PATCH] Remove unused pair UTF8 class. Add comments to msgpack deserializer --- python/pyspark/serializers.py | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/python/pyspark/serializers.py b/python/pyspark/serializers.py index fad9b55ffcef6..0a1eccb06c354 100644 --- a/python/pyspark/serializers.py +++ b/python/pyspark/serializers.py @@ -261,6 +261,7 @@ class MarshalSerializer(FramedSerializer): dumps = marshal.dumps loads = marshal.loads + class MUTF8Deserializer(Serializer): """ Deserializes streams written by Java's DataOutputStream.writeUTF(). @@ -280,29 +281,9 @@ def load_stream(self, stream): return -class PairMUTF8Deserializer(Serializer): - """ - Deserializes streams of tuples written by Java's DataOutputStream.writeUTF(). - """ - def loads(self, stream): - l1 = struct.unpack('>H', stream.read(2))[0] - a = stream.read(l1).decode('utf8') - l2 = struct.unpack('>H', stream.read(2))[0] - b = stream.read(l2).decode('utf8') - return (a, b) - - def load_stream(self, stream): - while True: - try: - yield self.loads(stream) - except struct.error: - return - except EOFError: - return - class MsgPackDeserializer(FramedSerializer): """ - + Deserializes streams written by Java MsgPack """ def loads(self, obj): return msgpack.loads(obj, use_list=0) @@ -311,7 +292,6 @@ def dumps(self, obj): return msgpack.dumps(obj) - def read_long(stream): length = stream.read(8) if length == "":