(self, dst_db, ev_list, date_str)
Actual event processing.
Actual event processing.
Actual event processing .
def dispatch(self, dst_db, ev_list, date_str):
        """Actual event processing."""

        # get tables and sql
        tables = {}
        sql_list = []
        for ev in ev_list:
            if date_str:
                tbl = "%s_%s" % (ev.extra1, date_str)
            else:
                tbl = ev.extra1

            sql = self.make_sql(tbl, ev)
            sql_list.append(sql)

            if not tbl in tables:
                tables[tbl] = self.get_table_info(ev, tbl)

        # create tables if needed
        self.check_tables(dst_db, tables)

        # insert into data tables
        curs = dst_db.cursor()
        block = []
        for sql in sql_list:
            self.log.debug(sql)
            block.append(sql)
            if len(block) > 100:
                curs.execute("\n".join(block))
                block = []
        if len(block) > 0:
            curs.execute("\n".join(block))
def dispatch ( self , dst_db , ev_list , date_str ) : # get tables and sql tables = { } sql_list = [ ] for ev in ev_list : if date_str : tbl = "%s_%s" % ( ev . extra1 , date_str ) else : tbl = ev . extra1 sql = self . make_sql ( tbl , ev ) sql_list . append ( sql ) if not tbl in tables : tables [ tbl ] = self . get_table_info ( ev , tbl ) # create tables if needed self . check_tables ( dst_db , tables ) # insert into data tables curs = dst_db . cursor ( ) block = [ ] for sql in sql_list : self . log . debug ( sql ) block . append ( sql ) if len ( block ) > 100 : curs . execute ( "\n" . join ( block ) ) block = [ ] if len ( block ) > 0 : curs . execute ( "\n" . join ( block ) )