예제 #1
0
파일: format.py 프로젝트: rohithreddy/luigi
 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))
예제 #2
0
 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))
예제 #3
0
파일: format.py 프로젝트: PeteW/luigi
 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))
예제 #4
0
    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))
예제 #5
0
파일: format.py 프로젝트: zorrodong/luigi
 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))
예제 #6
0
    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))
예제 #7
0
파일: format.py 프로젝트: rohithreddy/luigi
    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))
예제 #8
0
파일: format.py 프로젝트: zorrodong/luigi
    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))
예제 #9
0
파일: format.py 프로젝트: 01-/luigi
 def close(self):
     super(HdfsAtomicWriteDirPipe, self).close()
     rename(self.tmppath, self.path)
예제 #10
0
 def close(self):
     super(HdfsAtomicWriteDirPipe, self).close()
     rename(self.tmppath, self.path)