Esempio n. 1
0
    def stop(self):
        if not getattr(self, 'started', False):
            return
        logger.debug("stop env in %s", os.getpid())
        self.shuffleFetcher.stop()
        self.cacheTracker.stop()
        self.mapOutputTracker.stop()
        if self.isMaster:
            self.trackerServer.stop()
        from dpark.broadcast import stop_manager
        stop_manager()

        logger.debug("cleaning workdir ...")
        for d in self.workdir:
            shutil.rmtree(d, True)
        logger.debug("done.")

        self.started = False
Esempio n. 2
0
    def stop(self):
        if not getattr(self, 'started', False):
            return
        logger.debug("stop env in %s", os.getpid())
        self.shuffleFetcher.stop()
        self.cacheTracker.stop()
        self.mapOutputTracker.stop()
        if self.isMaster:
            self.trackerServer.stop()
        from dpark.broadcast import stop_manager
        stop_manager()

        logger.debug("cleaning workdir ...")
        for d in self.workdir:
            shutil.rmtree(d, True)
        logger.debug("done.")

        self.started = False
Esempio n. 3
0
    def shutdown(self, driver=None):
        for tid, (_, proc) in six.iteritems(self.tasks):
            terminate(tid, proc)
        self.tasks = {}
        self.result_queue.put(None)
        from dpark.broadcast import stop_manager
        stop_manager()

        # clean work files
        for fd in self._fd_for_locks:
            os.close(fd)
        for d in self.workdir:
            try:
                shutil.rmtree(d, True)
            except:
                pass

        sys.stdout = self.stdout_redirect.reset()
        sys.stderr = self.stderr_redirect.reset()
Esempio n. 4
0
    def shutdown(self, driver=None):
        for tid, (_, proc) in six.iteritems(self.tasks):
            terminate(tid, proc)
        self.tasks = {}
        self.result_queue.put(None)
        from dpark.broadcast import stop_manager
        stop_manager()

        # clean work files
        for fd in self._fd_for_locks:
            os.close(fd)
        for d in self.workdir:
            try:
                shutil.rmtree(d, True)
            except:
                pass

        if self.stdout_redirect:
            sys.stdout = self.stdout_redirect.reset()
        if self.stderr_redirect:
            sys.stderr = self.stderr_redirect.reset()
Esempio n. 5
0
    def stop(self):
        logger.debug("stop env in pid %s", os.getpid())

        if self.master_started:
            if self.trackerServer is not None:
                self.trackerServer.stop()
                self.environ.pop(self.TRACKER_ADDR, None)
            self.master_started = False

        if self.slave_started:
            self.trackerClient.stop()
            self.cacheTracker.stop()
            self.slave_started = False

        if self.slave_started or self.master_started:
            self.shuffleFetcher.stop()

        from dpark.broadcast import stop_manager
        stop_manager()

        logger.debug("cleaning workdir ...")
        self.workdir.clean_up()
        logger.debug("env stopped.")