(self, row)
Update object with info from db.
Update object with info from db.
Update object with info from db .
def loaded_state(self, row):
        """Update object with info from db."""

        self.log.debug("loaded_state: %s: %s / %s",
                       self.name, row['merge_state'], row['custom_snapshot'])
        self.change_snapshot(row['custom_snapshot'], 0)
        self.state = self.parse_state(row['merge_state'])
        self.changed = 0
        if row['table_attrs']:
            self.table_attrs = skytools.db_urldecode(row['table_attrs'])
        else:
            self.table_attrs = {}
        self.copy_role = row['copy_role']
        self.dropped_ddl = row['dropped_ddl']
        if row['merge_state'] == "?":
            self.changed = 1

        self.copy_pos = int(row.get('copy_pos','0'))
        self.max_parallel_copy = int(self.table_attrs.get('max_parallel_copy',
                                                        self.max_parallel_copy))

        if 'dest_table' in row and row['dest_table']:
            self.dest_table = row['dest_table']
        else:
            self.dest_table = self.name

        hstr = self.table_attrs.get('handlers', '') # compat
        hstr = self.table_attrs.get('handler', hstr)
        self.plugin = build_handler(self.name, hstr, self.dest_table)
def loaded_state ( self , row ) : self . log . debug ( "loaded_state: %s: %s / %s" , self . name , row [ 'merge_state' ] , row [ 'custom_snapshot' ] ) self . change_snapshot ( row [ 'custom_snapshot' ] , 0 ) self . state = self . parse_state ( row [ 'merge_state' ] ) self . changed = 0 if row [ 'table_attrs' ] : self . table_attrs = skytools . db_urldecode ( row [ 'table_attrs' ] ) else : self . table_attrs = { } self . copy_role = row [ 'copy_role' ] self . dropped_ddl = row [ 'dropped_ddl' ] if row [ 'merge_state' ] == "?" : self . changed = 1 self . copy_pos = int ( row . get ( 'copy_pos' , '0' ) ) self . max_parallel_copy = int ( self . table_attrs . get ( 'max_parallel_copy' , self . max_parallel_copy ) ) if 'dest_table' in row and row [ 'dest_table' ] : self . dest_table = row [ 'dest_table' ] else : self . dest_table = self . name hstr = self . table_attrs . get ( 'handlers' , '' ) # compat hstr = self . table_attrs . get ( 'handler' , hstr ) self . plugin = build_handler ( self . name , hstr , self . dest_table )