Пример #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
 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
 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))
     )