def test_readback(self): pipe = hdfs.HdfsAtomicWriteDirPipe(self.path) self.assertFalse(self.fs.exists(self.path)) pipe.write(b"foo\nbar") pipe.close() self.assertTrue(hdfs.exists(self.path)) dirlist = hdfs.listdir(self.path) datapath = '%s/data' % self.path returnlist = [d for d in dirlist] self.assertTrue(returnlist[0].endswith(datapath)) pipe = hdfs.HdfsReadPipe(datapath) self.assertEqual(pipe.read(), b"foo\nbar")
def version_date(self): hdfs = luigi.contrib.hdfs.hadoopcli_clients.create_hadoopcli_client() archive_dir = hdfs.listdir(self.input()[0].path) return [os.path.basename(archive_fn).strip() for archive_fn in archive_dir]