Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2d328c89
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2d328c89
编写于
4月 21, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor
上级
1ec6fa12
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
21 deletion
+22
-21
source/dnode/vnode/src/inc/tsdbSma.h
source/dnode/vnode/src/inc/tsdbSma.h
+1
-0
source/dnode/vnode/src/tsdb/tsdbSma.c
source/dnode/vnode/src/tsdb/tsdbSma.c
+21
-20
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+0
-1
未找到文件。
source/dnode/vnode/src/inc/tsdbSma.h
浏览文件 @
2d328c89
...
...
@@ -25,6 +25,7 @@ extern "C" {
#endif
int32_t
tsdbRegisterRSma
(
STsdb
*
pTsdb
,
SMeta
*
pMeta
,
SVCreateTbReq
*
pReq
);
int32_t
tsdbTriggerRSma
(
STsdb
*
pTsdb
,
SMeta
*
pMeta
,
SSubmitReq
*
pMsg
);
#ifdef __cplusplus
}
...
...
source/dnode/vnode/src/tsdb/tsdbSma.c
浏览文件 @
2d328c89
...
...
@@ -109,12 +109,12 @@ struct SSmaStat {
T_REF_DECLARE
()
};
#define S
S
MA_STAT_ITEMS(s) ((s)->smaStatItems)
#define S
S
MA_STAT_INFO_HASH(s) ((s)->rsmaInfoHash)
#define SMA_STAT_ITEMS(s) ((s)->smaStatItems)
#define SMA_STAT_INFO_HASH(s) ((s)->rsmaInfoHash)
#define RSMA_MAX_LEVEL 2
#define RSMA_TASK_INFO_HASH_SLOT 8
struct
SRSmaInfo
{
struct
SRSmaInfo
{
void
*
taskInfo
[
RSMA_MAX_LEVEL
];
// qTaskInfo_t
};
...
...
@@ -471,18 +471,18 @@ static int32_t tsdbInitSmaStat(SSmaStat **pSmaStat, int8_t smaType) {
}
if
(
smaType
==
TSDB_SMA_TYPE_ROLLUP
)
{
S
S
MA_STAT_INFO_HASH
(
*
pSmaStat
)
=
taosHashInit
(
SMA_STAT_INFO_HASH
(
*
pSmaStat
)
=
taosHashInit
(
RSMA_TASK_INFO_HASH_SLOT
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
true
,
HASH_ENTRY_LOCK
);
if
(
S
S
MA_STAT_INFO_HASH
(
*
pSmaStat
)
==
NULL
)
{
if
(
SMA_STAT_INFO_HASH
(
*
pSmaStat
)
==
NULL
)
{
taosMemoryFreeClear
(
*
pSmaStat
);
return
TSDB_CODE_FAILED
;
}
}
else
if
(
smaType
==
TSDB_SMA_TYPE_TIME_RANGE
)
{
S
S
MA_STAT_ITEMS
(
*
pSmaStat
)
=
SMA_STAT_ITEMS
(
*
pSmaStat
)
=
taosHashInit
(
SMA_STATE_HASH_SLOT
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
true
,
HASH_ENTRY_LOCK
);
if
(
S
S
MA_STAT_ITEMS
(
*
pSmaStat
)
==
NULL
)
{
if
(
SMA_STAT_ITEMS
(
*
pSmaStat
)
==
NULL
)
{
taosMemoryFreeClear
(
*
pSmaStat
);
return
TSDB_CODE_FAILED
;
}
...
...
@@ -528,21 +528,21 @@ int32_t tsdbDestroySmaState(SSmaStat *pSmaStat, int8_t smaType) {
if
(
pSmaStat
)
{
// TODO: use taosHashSetFreeFp when taosHashSetFreeFp is ready.
if
(
smaType
==
TSDB_SMA_TYPE_TIME_RANGE
)
{
void
*
item
=
taosHashIterate
(
S
S
MA_STAT_ITEMS
(
pSmaStat
),
NULL
);
void
*
item
=
taosHashIterate
(
SMA_STAT_ITEMS
(
pSmaStat
),
NULL
);
while
(
item
!=
NULL
)
{
SSmaStatItem
*
pItem
=
*
(
SSmaStatItem
**
)
item
;
tsdbFreeSmaStatItem
(
pItem
);
item
=
taosHashIterate
(
S
S
MA_STAT_ITEMS
(
pSmaStat
),
item
);
item
=
taosHashIterate
(
SMA_STAT_ITEMS
(
pSmaStat
),
item
);
}
taosHashCleanup
(
S
S
MA_STAT_ITEMS
(
pSmaStat
));
taosHashCleanup
(
SMA_STAT_ITEMS
(
pSmaStat
));
}
else
if
(
smaType
==
TSDB_SMA_TYPE_ROLLUP
)
{
void
*
infoHash
=
taosHashIterate
(
S
S
MA_STAT_INFO_HASH
(
pSmaStat
),
NULL
);
void
*
infoHash
=
taosHashIterate
(
SMA_STAT_INFO_HASH
(
pSmaStat
),
NULL
);
while
(
infoHash
!=
NULL
)
{
SRSmaInfo
*
pInfoHash
=
*
(
SRSmaInfo
**
)
infoHash
;
tsdbFreeRSmaInfo
(
pInfoHash
);
infoHash
=
taosHashIterate
(
S
S
MA_STAT_INFO_HASH
(
pSmaStat
),
infoHash
);
infoHash
=
taosHashIterate
(
SMA_STAT_INFO_HASH
(
pSmaStat
),
infoHash
);
}
taosHashCleanup
(
S
S
MA_STAT_INFO_HASH
(
pSmaStat
));
taosHashCleanup
(
SMA_STAT_INFO_HASH
(
pSmaStat
));
}
else
{
ASSERT
(
0
);
}
...
...
@@ -1687,7 +1687,7 @@ int32_t tsdbDropTSma(STsdb *pTsdb, char *pMsg) {
}
/**
* @brief
Only applicable to stable
.
* @brief
Check and init qTaskInfo_t, only applicable to stable with SRSmaParam
.
*
* @param pTsdb
* @param pMeta
...
...
@@ -1724,15 +1724,15 @@ int32_t tsdbRegisterRSma(STsdb *pTsdb, SMeta *pMeta, SVCreateTbReq *pReq) {
pRSmaInfo
=
tsdbFreeRSmaInfo
(
pRSmaInfo
);
}
STqReadHandle
*
pReadHandle
=
tqInitSubmitMsgScanner
(
pMeta
);
if
(
pR
eadHandle
==
NULL
)
{
pRSmaInfo
=
(
SRSmaInfo
*
)
taosMemoryCalloc
(
1
,
sizeof
(
SRSmaInfo
)
);
if
(
pR
SmaInfo
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_FAILED
;
}
pRSmaInfo
=
(
SRSmaInfo
*
)
taosMemoryCalloc
(
1
,
sizeof
(
SRSmaInfo
)
);
if
(
pR
SmaInfo
==
NULL
)
{
taosMemoryFree
(
pR
eadHandle
);
STqReadHandle
*
pReadHandle
=
tqInitSubmitMsgScanner
(
pMeta
);
if
(
pR
eadHandle
==
NULL
)
{
taosMemoryFree
(
pR
SmaInfo
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_FAILED
;
}
...
...
@@ -1760,7 +1760,8 @@ int32_t tsdbRegisterRSma(STsdb *pTsdb, SMeta *pMeta, SVCreateTbReq *pReq) {
}
}
if
(
taosHashPut
(
SSMA_STAT_INFO_HASH
(
pStat
),
&
pReq
->
stbCfg
.
suid
,
sizeof
(
tb_uid_t
),
&
pRSmaInfo
,
sizeof
(
pRSmaInfo
))
!=
0
)
{
if
(
taosHashPut
(
SMA_STAT_INFO_HASH
(
pStat
),
&
pReq
->
stbCfg
.
suid
,
sizeof
(
tb_uid_t
),
&
pRSmaInfo
,
sizeof
(
pRSmaInfo
))
!=
0
)
{
return
TSDB_CODE_FAILED
;
}
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
2d328c89
...
...
@@ -215,7 +215,6 @@ static int vnodeProcessCreateStbReq(SVnode *pVnode, void *pReq) {
return
-
1
;
}
// deploy Rollup SMA
tsdbRegisterRSma
(
pVnode
->
pTsdb
,
pVnode
->
pMeta
,
&
vCreateTbReq
);
taosMemoryFree
(
vCreateTbReq
.
stbCfg
.
pSchema
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录