コード例 #1
0
 def test_copy_to_local_command_generator(self):
     hdfs_client.copy_to_local(
         path="/tmp/test",
         localdst="~/dir",
         executor=lambda command, *args: self.assertEqual(
             build_command(command, *args),
             "hadoop fs -copyToLocal /tmp/test ~/dir"))
コード例 #2
0
ファイル: test_hdfs_client.py プロジェクト: epam/Merlin
 def test_copy_to_local_command_generator(self):
     hdfs_client.copy_to_local(
         path="/tmp/test",
         localdst="~/dir",
         executor=lambda command, *args: self.assertEqual(
             build_command(command, *args), "hadoop fs -copyToLocal /tmp/test ~/dir"
         ),
     )
コード例 #3
0
 def copy_to_local(self, local_path):
     """
     Copies file from HDFS to the local file system
     :param local_path: path to file on local file system
     :type local_path: str
     """
     self._assert_exists_()
     fs.copy_to_local(path=self.path, localdst=local_path).if_failed_raise(
         CommandException(
             "Cannot copy '{path}' to local".format(path=self.path)))
コード例 #4
0
ファイル: hdfs.py プロジェクト: epam/Merlin
 def copy_to_local(self, local_path):
     """
     Copies file from HDFS to the local file system
     :param local_path: path to file on local file system
     :type local_path: str
     """
     self._assert_exists_()
     fs.copy_to_local(path=self.path, localdst=local_path).if_failed_raise(
         CommandException("Cannot copy '{path}' to local".format(path=self.path))
     )