Beispiel #1
0
 def to_string(cls, filename, offset, length):
     stream = StringIO()
     if hadoop_version_info().has_variable_isplit_encoding():
         serialize_text(filename, stream)
     else:
         serialize_old_style_filename(filename, stream)
     serialize_long(offset, stream)
     serialize_long(length, stream)
     return stream.getvalue()
Beispiel #2
0
 def to_string(cls, filename, offset, length):
     stream = StringIO()
     if hadoop_version_info().has_variable_isplit_encoding():
         serialize_text(filename, stream)
     else:
         serialize_old_style_filename(filename, stream)
     serialize_long(offset, stream)
     serialize_long(length, stream)
     return stream.getvalue()
Beispiel #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)
Beispiel #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)