copy.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:OnlineSchemaChange 作者: facebookincubator 项目源码 文件源码
def change_rocksdb_bulk_load(self, enable=True):
        # rocksdb_bulk_load relies on data being dumping in the same sequence
        # as new pk. If we are changing pk, then we cannot ensure that
        if self._old_table.primary_key != self._new_table.primary_key:
            log.warning("Skip rocksdb_bulk_load, because we are changing PK")
            return

        v = 1 if enable else 0
        try:
            self.execute_sql(
                sql.set_session_variable('rocksdb_bulk_load'), (v,))
        except MySQLdb.OperationalError as e:
            errnum, errmsg = e.args
            # 1193: unknown variable
            if errnum == 1193:
                log.warning(
                    "Failed to set rocksdb_bulk_load: {}".format(errmsg))
            else:
                raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号