(self, src_curs, dst_curs, ev)
handle one event
handle one event
handle one event
def process_remote_event(self, src_curs, dst_curs, ev):
        """handle one event"""

        self.log.debug("New event: id=%s / type=%s / data=%s / extra1=%s", ev.id, ev.type, ev.data, ev.extra1)

        # set current_event only if processing them one-by-one
        if self.work_state < 0:
            self.current_event = ev

        if ev.type in ('I', 'U', 'D'):
            self.handle_data_event(ev, dst_curs)
        elif ev.type[:2] in ('I:', 'U:', 'D:'):
            self.handle_data_event(ev, dst_curs)
        elif ev.type == "R":
            self.flush_sql(dst_curs)
            self.handle_truncate_event(ev, dst_curs)
        elif ev.type == 'EXECUTE':
            self.flush_sql(dst_curs)
            self.handle_execute_event(ev, dst_curs)
        elif ev.type == 'londiste.add-table':
            self.flush_sql(dst_curs)
            self.add_set_table(dst_curs, ev.data)
        elif ev.type == 'londiste.remove-table':
            self.flush_sql(dst_curs)
            self.remove_set_table(dst_curs, ev.data)
        elif ev.type == 'londiste.remove-seq':
            self.flush_sql(dst_curs)
            self.remove_set_seq(dst_curs, ev.data)
        elif ev.type == 'londiste.update-seq':
            self.flush_sql(dst_curs)
            self.update_seq(dst_curs, ev)
        else:
            CascadedWorker.process_remote_event(self, src_curs, dst_curs, ev)

        # no point keeping it around longer
        self.current_event = None
def process_remote_event ( self , src_curs , dst_curs , ev ) : self . log . debug ( "New event: id=%s / type=%s / data=%s / extra1=%s" , ev . id , ev . type , ev . data , ev . extra1 ) # set current_event only if processing them one-by-one if self . work_state < 0 : self . current_event = ev if ev . type in ( 'I' , 'U' , 'D' ) : self . handle_data_event ( ev , dst_curs ) elif ev . type [ : 2 ] in ( 'I:' , 'U:' , 'D:' ) : self . handle_data_event ( ev , dst_curs ) elif ev . type == "R" : self . flush_sql ( dst_curs ) self . handle_truncate_event ( ev , dst_curs ) elif ev . type == 'EXECUTE' : self . flush_sql ( dst_curs ) self . handle_execute_event ( ev , dst_curs ) elif ev . type == 'londiste.add-table' : self . flush_sql ( dst_curs ) self . add_set_table ( dst_curs , ev . data ) elif ev . type == 'londiste.remove-table' : self . flush_sql ( dst_curs ) self . remove_set_table ( dst_curs , ev . data ) elif ev . type == 'londiste.remove-seq' : self . flush_sql ( dst_curs ) self . remove_set_seq ( dst_curs , ev . data ) elif ev . type == 'londiste.update-seq' : self . flush_sql ( dst_curs ) self . update_seq ( dst_curs , ev ) else : CascadedWorker . process_remote_event ( self , src_curs , dst_curs , ev ) # no point keeping it around longer self . current_event = None