(self, ev, sql_queue_func, arg)
Process a event.
        Event should be added to sql_queue or executed directly.
Process a event.
        Event should be added to sql_queue or executed directly.
Process a event . Event should be added to sql_queue or executed directly .
def _process_event(self, ev, sql_queue_func, arg):
        """Process a event.
        Event should be added to sql_queue or executed directly.
        """
        if self.conf.table_mode == 'ignore':
            return
        # get data
        data = skytools.db_urldecode(ev.data)
        if self.encoding_validator:
            data = self.encoding_validator.validate_dict(data, self.table_name)
        if len(ev.ev_type) < 2 or ev.ev_type[1] != ':':
            raise Exception('Unsupported event type: %s/extra1=%s/data=%s' % (
                            ev.ev_type, ev.ev_extra1, ev.ev_data))
        op, pkeys = ev.type.split(':', 1)
        if op not in 'IUD':
            raise Exception('Unknown event type: %s' % ev.ev_type)
        # process only operations specified
        if not op in self.conf.event_types:
            #self.log.debug('dispatch.process_event: ignored event type')
            return
        if self.pkeys is None:
            self.pkeys = self.filter_pkeys(pkeys.split(','))
        data = self.filter_data(data)
        # prepare split table when needed
        if self.conf.table_mode == 'part':
            dst, part_time = self.split_format(ev, data)
            if dst in self.ignored_tables:
                return
            if dst not in self.row_handler.table_map:
                self.check_part(dst, part_time)
                if dst in self.ignored_tables:
                    return
        else:
            dst = self.dest_table

        if dst not in self.row_handler.table_map:
            self.row_handler.add_table(dst, LOADERS[self.conf.load_mode],
                                       self.pkeys, self.conf)
        self.row_handler.process(dst, op, data)
def _process_event ( self , ev , sql_queue_func , arg ) : if self . conf . table_mode == 'ignore' : return # get data data = skytools . db_urldecode ( ev . data ) if self . encoding_validator : data = self . encoding_validator . validate_dict ( data , self . table_name ) if len ( ev . ev_type ) < 2 or ev . ev_type [ 1 ] != ':' : raise Exception ( 'Unsupported event type: %s/extra1=%s/data=%s' % ( ev . ev_type , ev . ev_extra1 , ev . ev_data ) ) op , pkeys = ev . type . split ( ':' , 1 ) if op not in 'IUD' : raise Exception ( 'Unknown event type: %s' % ev . ev_type ) # process only operations specified if not op in self . conf . event_types : #self.log.debug('dispatch.process_event: ignored event type') return if self . pkeys is None : self . pkeys = self . filter_pkeys ( pkeys . split ( ',' ) ) data = self . filter_data ( data ) # prepare split table when needed if self . conf . table_mode == 'part' : dst , part_time = self . split_format ( ev , data ) if dst in self . ignored_tables : return if dst not in self . row_handler . table_map : self . check_part ( dst , part_time ) if dst in self . ignored_tables : return else : dst = self . dest_table if dst not in self . row_handler . table_map : self . row_handler . add_table ( dst , LOADERS [ self . conf . load_mode ] , self . pkeys , self . conf ) self . row_handler . process ( dst , op , data )