(self, curs)
Store changed table state in database.
Store changed table state in database.
Store changed table state in database .
def save_table_state(self, curs):
        """Store changed table state in database."""

        for t in self.table_list:
            # backwards compat: move plugin-only dest_table to table_info
            if t.dest_table != t.plugin.dest_table:
                self.log.info("Overwriting .dest_table from plugin: tbl=%s  dst=%s",
                              t.name, t.plugin.dest_table)
                q = "update londiste.table_info set dest_table = %s"\
                    " where queue_name = %s and table_name = %s"
                curs.execute(q, [t.plugin.dest_table, self.set_name, t.name])

            if not t.changed:
                continue
            merge_state = t.render_state()
            self.log.info("storing state of %s: copy:%d new_state:%s",
                            t.name, self.copy_thread, merge_state)
            q = "select londiste.local_set_table_state(%s, %s, %s, %s)"
            curs.execute(q, [self.set_name,
                             t.name, t.str_snapshot, merge_state])
            t.changed = 0
def save_table_state ( self , curs ) : for t in self . table_list : # backwards compat: move plugin-only dest_table to table_info if t . dest_table != t . plugin . dest_table : self . log . info ( "Overwriting .dest_table from plugin: tbl=%s  dst=%s" , t . name , t . plugin . dest_table ) q = "update londiste.table_info set dest_table = %s" " where queue_name = %s and table_name = %s" curs . execute ( q , [ t . plugin . dest_table , self . set_name , t . name ] ) if not t . changed : continue merge_state = t . render_state ( ) self . log . info ( "storing state of %s: copy:%d new_state:%s" , t . name , self . copy_thread , merge_state ) q = "select londiste.local_set_table_state(%s, %s, %s, %s)" curs . execute ( q , [ self . set_name , t . name , t . str_snapshot , merge_state ] ) t . changed = 0