Beispiel #1
0
 def hdfs_folder_exists(self, folder):
     path = Path(folder)
     fs = path.getFileSystem(Configuration())
     try:
         status = fs.getFileStatus(path)
         # TODO: there could be problems if it exists but is a simple file
         return status.isDir()
     except:
         return False
Beispiel #2
0
 def hdfs_folder_exists(self, folder):
     path = Path(folder)
     fs = path.getFileSystem(Configuration())
     try:
         status = fs.getFileStatus(path)
         # TODO: there could be problems if it exists but is a simple file
         return status.isDir()
     except:
         return False
Beispiel #3
0
 def copyContentFromLocalFile(self, content, dest_path, overwrite = True):
     file_path = Path(dest_path)
     fs = file_path.getFileSystem(self.configuration)
     if overwrite and fs.exists(file_path):
         fs.delete(file_path, True)
     self.createInputFile(fs, dest_path, content)
Beispiel #4
0
 def copyContentFromLocalFile(self, content, dest_path, overwrite=True):
     file_path = Path(dest_path)
     fs = file_path.getFileSystem(self.configuration)
     if overwrite and fs.exists(file_path):
         fs.delete(file_path, True)
     self.createInputFile(fs, dest_path, content)