def close(self): super(HdfsAtomicWritePipe, self).close() try: remove(self.path) except HDFSCliError: pass if not all(result['result'] for result in rename(self.tmppath, self.path) or []): raise HdfsAtomicWriteError('Atomic write to {} failed'.format(self.path))
def close(self): super(HdfsAtomicWritePipe, self).close() try: remove(self.path) except HDFSCliError: pass if not all(result['result'] for result in rename(self.tmppath, self.path) or []): raise HdfsAtomicWriteError('Atomic write to {} failed'.format( self.path))
def close(self): super(HdfsAtomicWritePipe, self).close() try: if exists(self.path): remove(self.path) except Exception as ex: if isinstance(ex, HDFSCliError) or ex.args[0].contains("FileNotFoundException"): pass else: raise ex if not all(result['result'] for result in rename(self.tmppath, self.path) or []): raise HdfsAtomicWriteError('Atomic write to {} failed'.format(self.path))
def close(self): super(HdfsAtomicWriteDirPipe, self).close() try: remove(self.path) except HDFSCliError: pass # it's unlikely to fail in this way but better safe than sorry if not all(result['result'] for result in rename(self.tmppath, self.path) or []): raise HdfsAtomicWriteError('Atomic write to {} failed'.format(self.path)) if os.path.basename(self.tmppath) in map(os.path.basename, listdir(self.path)): remove(self.path) raise HdfsAtomicWriteError('Atomic write to {} failed'.format(self.path))
def close(self): super(HdfsAtomicWritePipe, self).close() try: if exists(self.path): remove(self.path) except Exception as ex: if isinstance(ex, HDFSCliError) or ex.args[0].contains( "FileNotFoundException"): pass else: raise ex if not all(result['result'] for result in rename(self.tmppath, self.path) or []): raise HdfsAtomicWriteError('Atomic write to {} failed'.format( self.path))
def close(self): super(HdfsAtomicWriteDirPipe, self).close() try: remove(self.path) except HDFSCliError: pass # it's unlikely to fail in this way but better safe than sorry if not all(result['result'] for result in rename(self.tmppath, self.path) or []): raise HdfsAtomicWriteError('Atomic write to {} failed'.format( self.path)) if os.path.basename(self.tmppath) in map(os.path.basename, listdir(self.path)): remove(self.path) raise HdfsAtomicWriteError('Atomic write to {} failed'.format( self.path))
def close(self): super(HdfsAtomicWriteDirPipe, self).close() try: if exists(self.path): remove(self.path) except Exception as ex: if isinstance(ex, HDFSCliError) or ex.args[0].contains("FileNotFoundException"): pass else: raise ex # it's unlikely to fail in this way but better safe than sorry if not all(result['result'] for result in rename(self.tmppath, self.path) or []): raise HdfsAtomicWriteError('Atomic write to {} failed'.format(self.path)) if os.path.basename(self.tmppath) in map(os.path.basename, listdir(self.path)): remove(self.path) raise HdfsAtomicWriteError('Atomic write to {} failed'.format(self.path))
def close(self): super(HdfsAtomicWriteDirPipe, self).close() try: if exists(self.path): remove(self.path) except Exception as ex: if isinstance(ex, HDFSCliError) or ex.args[0].contains( "FileNotFoundException"): pass else: raise ex # it's unlikely to fail in this way but better safe than sorry if not all(result['result'] for result in rename(self.tmppath, self.path) or []): raise HdfsAtomicWriteError('Atomic write to {} failed'.format( self.path)) if os.path.basename(self.tmppath) in map(os.path.basename, listdir(self.path)): remove(self.path) raise HdfsAtomicWriteError('Atomic write to {} failed'.format( self.path))
def close(self): super(HdfsAtomicWriteDirPipe, self).close() rename(self.tmppath, self.path)