Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a38fcf4e
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a38fcf4e
编写于
5月 25, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
catalog async test
上级
e2638b18
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
123 addition
and
0 deletion
+123
-0
source/libs/catalog/src/ctgDbg.c
source/libs/catalog/src/ctgDbg.c
+123
-0
未找到文件。
source/libs/catalog/src/ctgDbg.c
浏览文件 @
a38fcf4e
...
...
@@ -21,6 +21,129 @@
extern
SCatalogMgmt
gCtgMgmt
;
SCtgDebug
gCTGDebug
=
{
0
};
void
ctgdUserCallback
(
SMetaData
*
pResult
,
void
*
param
,
int32_t
code
)
{
ASSERT
(
*
(
int32_t
*
)
param
==
1
);
taosMemoryFree
(
param
);
ctgDebug
(
"async call result: %s"
,
tstrerror
(
code
));
if
(
NULL
==
pResult
)
{
ctgDebug
(
"empty meta result"
);
return
;
}
int32_t
num
=
0
;
if
(
pResult
->
pTableMeta
&&
taosArrayGetSize
(
pResult
->
pTableMeta
)
>
0
)
{
num
=
taosArrayGetSize
(
pResult
->
pTableMeta
);
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
STableMeta
*
p
=
taosArrayGet
(
pResult
->
pTableMeta
,
i
);
STableComInfo
*
c
=
&
p
->
tableInfo
;
if
(
TSDB_CHILD_TABLE
==
p
->
tableType
)
{
ctgDebug
(
"table meta: type:%d, vgId:%d, uid:%"
PRIx64
",suid:%"
PRIx64
,
p
->
tableType
,
p
->
vgId
,
p
->
uid
,
p
->
suid
);
return
;
}
else
{
ctgDebug
(
"table meta: type:%d, vgId:%d, uid:%"
PRIx64
",suid:%"
PRIx64
",sv:%d, tv:%d, tagNum:%d, precision:%d, colNum:%d, rowSize:%d"
,
p
->
tableType
,
p
->
vgId
,
p
->
uid
,
p
->
suid
,
p
->
sversion
,
p
->
tversion
,
c
->
numOfTags
,
c
->
precision
,
c
->
numOfColumns
,
c
->
rowSize
);
}
int32_t
colNum
=
c
->
numOfColumns
+
c
->
numOfTags
;
for
(
int32_t
j
=
0
;
j
<
colNum
;
++
j
)
{
SSchema
*
s
=
&
p
->
schema
[
j
];
ctgDebug
(
"[%d] name:%s, type:%d, colId:%d, bytes:%d"
,
j
,
s
->
name
,
s
->
type
,
s
->
colId
,
s
->
bytes
);
}
}
}
else
{
ctgDebug
(
"empty table meta"
);
}
if
(
pResult
->
pDbVgroup
&&
taosArrayGetSize
(
pResult
->
pDbVgroup
)
>
0
)
{
num
=
taosArrayGetSize
(
pResult
->
pDbVgroup
);
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
SArray
*
pDb
=
*
(
SArray
**
)
taosArrayGet
(
pResult
->
pDbVgroup
,
i
);
int32_t
vgNum
=
taosArrayGetSize
(
pDb
);
for
(
int32_t
j
=
0
;
j
<
vgNum
;
++
j
)
{
SVgroupInfo
*
pInfo
=
taosArrayGet
(
pDb
,
j
);
ctgDebug
(
param
,
...);
}
}
}
else
{
ctgDebug
(
"empty db vgroup"
);
}
}
int32_t
ctgdLaunchAsyncCall
(
SCatalog
*
pCtg
,
void
*
pTrans
,
const
SEpSet
*
pMgmtEps
,
uint64_t
reqId
)
{
int32_t
code
=
0
;
SCatalogReq
req
=
{
0
};
req
.
pTableMeta
=
taosArrayInit
(
2
,
sizeof
(
SName
));
req
.
pDbVgroup
=
taosArrayInit
(
2
,
TSDB_DB_FNAME_LEN
);
req
.
pTableHash
=
taosArrayInit
(
2
,
sizeof
(
SName
));
req
.
pUdf
=
taosArrayInit
(
2
,
TSDB_FUNC_NAME_LEN
);
req
.
pDbCfg
=
taosArrayInit
(
2
,
TSDB_DB_FNAME_LEN
);
req
.
pIndex
=
NULL
;
//taosArrayInit(2, TSDB_INDEX_FNAME_LEN);
req
.
pUser
=
taosArrayInit
(
2
,
sizeof
(
SUserAuthInfo
));
req
.
qNodeRequired
=
true
;
SName
name
=
{
0
};
char
dbFName
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
char
funcName
[
TSDB_FUNC_NAME_LEN
]
=
{
0
};
SUserAuthInfo
user
=
{
0
};
tNameFromString
(
&
name
,
"1.db1.tb1"
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
taosArrayPush
(
req
.
pTableMeta
,
&
name
);
taosArrayPush
(
req
.
pTableHash
,
&
name
);
tNameFromString
(
&
name
,
"1.db1.st1"
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
taosArrayPush
(
req
.
pTableMeta
,
&
name
);
taosArrayPush
(
req
.
pTableHash
,
&
name
);
strcpy
(
dbFName
,
"1.db1"
);
taosArrayPush
(
req
.
pDbVgroup
,
dbFName
);
taosArrayPush
(
req
.
pDbCfg
,
dbFName
);
strcpy
(
dbFName
,
"1.db2"
);
taosArrayPush
(
req
.
pDbVgroup
,
dbFName
);
taosArrayPush
(
req
.
pDbCfg
,
dbFName
);
strcpy
(
funcName
,
"udf1"
);
taosArrayPush
(
req
.
pUdf
,
funcName
);
strcpy
(
funcName
,
"udf2"
);
taosArrayPush
(
req
.
pUdf
,
funcName
);
strcpy
(
user
.
user
,
"root"
);
strcpy
(
user
.
dbFName
,
"1.db1"
);
user
.
type
=
AUTH_TYPE_READ
;
taosArrayPush
(
req
.
pUser
,
&
user
);
user
.
type
=
AUTH_TYPE_WRITE
;
taosArrayPush
(
req
.
pUser
,
&
user
);
user
.
type
=
AUTH_TYPE_OTHER
;
taosArrayPush
(
req
.
pUser
,
&
user
);
strcpy
(
user
.
user
,
"user1"
);
strcpy
(
user
.
dbFName
,
"1.db2"
);
user
.
type
=
AUTH_TYPE_READ
;
taosArrayPush
(
req
.
pUser
,
&
user
);
user
.
type
=
AUTH_TYPE_WRITE
;
taosArrayPush
(
req
.
pUser
,
&
user
);
user
.
type
=
AUTH_TYPE_OTHER
;
taosArrayPush
(
req
.
pUser
,
&
user
);
int32_t
*
param
=
taosMemoryCalloc
(
1
,
sizeof
(
int32_t
));
*
param
=
1
;
int64_t
jobId
=
0
;
CTG_ERR_JRET
(
catalogAsyncGetAllMeta
(
pCtg
,
pTrans
,
pMgmtEps
,
reqId
,
&
req
,
ctgdUserCallback
,
param
,
&
jobId
));
_return:
taosArrayDestroy
(
req
.
pTableMeta
);
taosArrayDestroy
(
req
.
pDbVgroup
);
taosArrayDestroy
(
req
.
pTableHash
);
taosArrayDestroy
(
req
.
pUdf
);
taosArrayDestroy
(
req
.
pDbCfg
);
taosArrayDestroy
(
req
.
pUser
);
CTG_RET
(
code
);
}
int32_t
ctgdEnableDebug
(
char
*
option
)
{
if
(
0
==
strcasecmp
(
option
,
"lock"
))
{
gCTGDebug
.
lockEnable
=
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录