Example #1
0
File: pipes.py Project: wtj/pydoop
 def __init__(self, data):
     stream = StringIO(data)
     if hadoop_version_info().has_variable_isplit_encoding():
         self.filename = deserialize_text(stream)
     else:
         self.filename = deserialize_old_style_filename(stream)
     self.offset = deserialize_long(stream)
     self.length = deserialize_long(stream)
Example #2
0
 def __init__(self, data):
     stream = StringIO(data)
     if hadoop_version_info().has_variable_isplit_encoding():
         self.filename = deserialize_text(stream)
     else:
         self.filename = deserialize_old_style_filename(stream)
     self.offset = deserialize_long(stream)
     self.length = deserialize_long(stream)
Example #3
0
 def test_serialize_old_style_filename(self):
     fn = 'some_filename.file'
     srl.serialize_old_style_filename(fn, self.stream)
     self.stream.seek(0)
     new_fn = srl.deserialize_old_style_filename(self.stream)
     self.assertEqual(fn, new_fn)
Example #4
0
 def test_serialize_old_style_filename(self):
     fn = 'some_filename.file'
     srl.serialize_old_style_filename(fn, self.stream)
     self.stream.seek(0)
     new_fn = srl.deserialize_old_style_filename(self.stream)
     self.assertEqual(fn, new_fn)