(self, tbl_stat)
Run parallel worker for copy.
Run parallel worker for copy.
Run parallel worker for copy .
def launch_copy(self, tbl_stat):
        """Run parallel worker for copy."""
        self.log.info("Launching copy process")
        script = sys.argv[0]
        conf = self.cf.filename
        cmd = [script, conf, 'copy', tbl_stat.name, '-d']

        # pass same verbosity options as main script got
        if self.options.quiet:
            cmd.append('-q')
        if self.options.verbose:
            cmd += ['-v'] * self.options.verbose

        # let existing copy finish and clean its pidfile,
        # otherwise new copy will exit immediately.
        # FIXME: should not happen on per-table pidfile ???
        copy_pidfile = "%s.copy.%s" % (self.pidfile, tbl_stat.name)
        while skytools.signal_pidfile(copy_pidfile, 0):
            self.log.warning("Waiting for existing copy to exit")
            time.sleep(2)

        # launch and wait for daemonization result
        self.log.debug("Launch args: %r", cmd)
        res = os.spawnvp(os.P_WAIT, script, cmd)
        self.log.debug("Launch result: %r", res)
        if res != 0:
            self.log.error("Failed to launch copy process, result=%d", res)
def launch_copy ( self , tbl_stat ) : self . log . info ( "Launching copy process" ) script = sys . argv [ 0 ] conf = self . cf . filename cmd = [ script , conf , 'copy' , tbl_stat . name , '-d' ] # pass same verbosity options as main script got if self . options . quiet : cmd . append ( '-q' ) if self . options . verbose : cmd += [ '-v' ] * self . options . verbose # let existing copy finish and clean its pidfile, # otherwise new copy will exit immediately. # FIXME: should not happen on per-table pidfile ??? copy_pidfile = "%s.copy.%s" % ( self . pidfile , tbl_stat . name ) while skytools . signal_pidfile ( copy_pidfile , 0 ) : self . log . warning ( "Waiting for existing copy to exit" ) time . sleep ( 2 ) # launch and wait for daemonization result self . log . debug ( "Launch args: %r" , cmd ) res = os . spawnvp ( os . P_WAIT , script , cmd ) self . log . debug ( "Launch result: %r" , res ) if res != 0 : self . log . error ( "Failed to launch copy process, result=%d" , res )