Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
知世而放
oceanbase
提交
fbabe9d0
O
oceanbase
项目概览
知世而放
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fbabe9d0
编写于
9月 19, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
9月 19, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] [RECYCLE_SCHEMA_HISTORY] Support recycling object privilege history
上级
46a5748a
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
498 addition
and
105 deletion
+498
-105
src/rootserver/ob_schema_history_recycler.cpp
src/rootserver/ob_schema_history_recycler.cpp
+380
-73
src/rootserver/ob_schema_history_recycler.h
src/rootserver/ob_schema_history_recycler.h
+118
-32
未找到文件。
src/rootserver/ob_schema_history_recycler.cpp
浏览文件 @
fbabe9d0
此差异已折叠。
点击以展开。
src/rootserver/ob_schema_history_recycler.h
浏览文件 @
fbabe9d0
...
...
@@ -116,38 +116,6 @@ public:
};
};
struct
ObSystemVariableSchemaKey
{
public:
ObSystemVariableSchemaKey
();
~
ObSystemVariableSchemaKey
();
bool
operator
==
(
const
ObSystemVariableSchemaKey
&
other
)
const
;
bool
operator
!=
(
const
ObSystemVariableSchemaKey
&
other
)
const
;
bool
operator
<
(
const
ObSystemVariableSchemaKey
&
other
)
const
;
ObSystemVariableSchemaKey
&
operator
=
(
const
ObSystemVariableSchemaKey
&
other
);
int
assign
(
const
ObSystemVariableSchemaKey
&
other
);
void
reset
();
bool
is_valid
()
const
;
uint64_t
hash
()
const
;
TO_STRING_KV
(
K_
(
zone
),
K_
(
name
));
public:
common
::
ObString
zone_
;
common
::
ObString
name_
;
};
struct
ObSystemVariableCompressSchemaInfo
{
public:
ObSystemVariableCompressSchemaInfo
()
:
key_
(),
max_schema_version_
(
common
::
OB_INVALID_VERSION
)
{}
~
ObSystemVariableCompressSchemaInfo
()
{}
TO_STRING_KV
(
K_
(
key
),
K_
(
max_schema_version
));
public:
ObSystemVariableSchemaKey
key_
;
int64_t
max_schema_version_
;
};
struct
ObRecycleSchemaValue
{
public:
ObRecycleSchemaValue
();
...
...
@@ -313,6 +281,7 @@ private:
DISALLOW_COPY_AND_ASSIGN
(
ObRecycleSchemaExecutor
);
};
// RECYCLE ONLY
class
ObSecondRecycleSchemaExecutor
:
public
ObIRecycleSchemaExecutor
{
public:
ObSecondRecycleSchemaExecutor
()
=
delete
;
...
...
@@ -345,6 +314,7 @@ private:
DISALLOW_COPY_AND_ASSIGN
(
ObSecondRecycleSchemaExecutor
);
};
// RECYCLE ONLY
class
ObThirdRecycleSchemaExecutor
:
public
ObIRecycleSchemaExecutor
{
public:
ObThirdRecycleSchemaExecutor
()
=
delete
;
...
...
@@ -378,6 +348,44 @@ private:
DISALLOW_COPY_AND_ASSIGN
(
ObThirdRecycleSchemaExecutor
);
};
/*
* ##############################
* # system variable #
* ##############################
*/
struct
ObSystemVariableSchemaKey
{
public:
ObSystemVariableSchemaKey
();
~
ObSystemVariableSchemaKey
();
bool
operator
==
(
const
ObSystemVariableSchemaKey
&
other
)
const
;
bool
operator
!=
(
const
ObSystemVariableSchemaKey
&
other
)
const
;
bool
operator
<
(
const
ObSystemVariableSchemaKey
&
other
)
const
;
ObSystemVariableSchemaKey
&
operator
=
(
const
ObSystemVariableSchemaKey
&
other
);
int
assign
(
const
ObSystemVariableSchemaKey
&
other
);
void
reset
();
bool
is_valid
()
const
;
uint64_t
hash
()
const
;
TO_STRING_KV
(
K_
(
zone
),
K_
(
name
));
public:
common
::
ObString
zone_
;
common
::
ObString
name_
;
};
struct
ObSystemVariableCompressSchemaInfo
{
public:
ObSystemVariableCompressSchemaInfo
()
:
key_
(),
max_schema_version_
(
common
::
OB_INVALID_VERSION
)
{}
~
ObSystemVariableCompressSchemaInfo
()
{}
TO_STRING_KV
(
K_
(
key
),
K_
(
max_schema_version
));
public:
ObSystemVariableSchemaKey
key_
;
int64_t
max_schema_version_
;
};
// COMPRESS ONLY
class
ObSystemVariableRecycleSchemaExecutor
:
public
ObIRecycleSchemaExecutor
{
public:
ObSystemVariableRecycleSchemaExecutor
()
=
delete
;
...
...
@@ -408,6 +416,84 @@ private:
common
::
ObArenaAllocator
allocator_
;
DISALLOW_COPY_AND_ASSIGN
(
ObSystemVariableRecycleSchemaExecutor
);
};
/*
* #######################################
* # tenant object priviledge #
* #######################################
*/
struct
ObObjectPrivSchemaKey
{
public:
ObObjectPrivSchemaKey
();
~
ObObjectPrivSchemaKey
();
bool
operator
==
(
const
ObObjectPrivSchemaKey
&
other
)
const
;
bool
operator
!=
(
const
ObObjectPrivSchemaKey
&
other
)
const
;
bool
operator
<
(
const
ObObjectPrivSchemaKey
&
other
)
const
;
ObObjectPrivSchemaKey
&
operator
=
(
const
ObObjectPrivSchemaKey
&
other
);
int
assign
(
const
ObObjectPrivSchemaKey
&
other
);
void
reset
();
bool
is_valid
()
const
;
uint64_t
hash
()
const
;
TO_STRING_KV
(
K_
(
obj_id
),
K_
(
obj_type
),
K_
(
col_id
),
K_
(
grantor_id
),
K_
(
grantee_id
),
K_
(
priv_id
));
public:
int64_t
obj_id_
;
int64_t
obj_type_
;
int64_t
col_id_
;
int64_t
grantor_id_
;
int64_t
grantee_id_
;
int64_t
priv_id_
;
};
struct
ObObjectPrivCompressSchemaInfo
{
public:
ObObjectPrivCompressSchemaInfo
()
:
key_
(),
max_schema_version_
(
common
::
OB_INVALID_VERSION
)
{}
~
ObObjectPrivCompressSchemaInfo
()
{}
TO_STRING_KV
(
K_
(
key
),
K_
(
max_schema_version
));
public:
ObObjectPrivSchemaKey
key_
;
int64_t
max_schema_version_
;
};
// RECYCLE AND COMPRESS
class
ObObjectPrivRecycleSchemaExecutor
:
public
ObIRecycleSchemaExecutor
{
public:
ObObjectPrivRecycleSchemaExecutor
()
=
delete
;
ObObjectPrivRecycleSchemaExecutor
(
const
uint64_t
tenant_id
,
const
int64_t
schema_version
,
const
char
*
table_name
,
common
::
ObMySQLProxy
*
sql_proxy
,
ObSchemaHistoryRecycler
*
recycler
);
virtual
~
ObObjectPrivRecycleSchemaExecutor
();
private:
virtual
bool
is_valid
()
const
;
virtual
int
fill_schema_history_map
();
virtual
int
recycle_schema_history
();
virtual
int
compress_schema_history
();
virtual
int
gen_fill_schema_history_sql
(
int64_t
start_idx
,
common
::
ObSqlString
&
sql
);
virtual
int
retrieve_schema_history
(
common
::
sqlclient
::
ObMySQLResult
&
result
,
ObObjectPrivSchemaKey
&
key
,
ObRecycleSchemaValue
&
value
);
virtual
int
fill_schema_history_key
(
const
ObObjectPrivSchemaKey
&
cur_key
,
ObObjectPrivSchemaKey
&
key
);
virtual
int
fill_schema_history
(
const
ObObjectPrivSchemaKey
&
key
,
const
ObRecycleSchemaValue
&
value
);
virtual
int
gen_batch_recycle_schema_history_sql
(
const
common
::
ObIArray
<
ObObjectPrivSchemaKey
>
&
dropped_schema_keys
,
common
::
ObSqlString
&
sql
);
virtual
int
batch_recycle_schema_history
(
const
common
::
ObIArray
<
ObObjectPrivSchemaKey
>
&
dropped_schema_keys
);
virtual
int
gen_batch_compress_schema_history_sql
(
const
ObIArray
<
ObObjectPrivCompressSchemaInfo
>
&
compress_schema_infos
,
common
::
ObSqlString
&
sql
);
virtual
int
batch_compress_schema_history
(
const
common
::
ObIArray
<
ObObjectPrivCompressSchemaInfo
>
&
compress_schema_infos
);
private:
common
::
hash
::
ObHashMap
<
ObObjectPrivSchemaKey
,
ObRecycleSchemaValue
,
common
::
hash
::
NoPthreadDefendMode
>
schema_history_map_
;
DISALLOW_COPY_AND_ASSIGN
(
ObObjectPrivRecycleSchemaExecutor
);
};
}
// end namespace rootserver
}
// end namespace oceanbase
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录