Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5b711788
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看板
提交
5b711788
编写于
5月 02, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: rollup data storage
上级
c7ca57f5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
12 deletion
+27
-12
include/common/tdatablock.h
include/common/tdatablock.h
+1
-1
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+7
-1
source/dnode/vnode/src/tsdb/tsdbFile.c
source/dnode/vnode/src/tsdb/tsdbFile.c
+2
-2
source/dnode/vnode/src/tsdb/tsdbSma.c
source/dnode/vnode/src/tsdb/tsdbSma.c
+17
-8
未找到文件。
include/common/tdatablock.h
浏览文件 @
5b711788
...
...
@@ -225,7 +225,7 @@ SSDataBlock* createOneDataBlock(const SSDataBlock* pDataBlock, bool copyData);
void
blockDebugShowData
(
const
SArray
*
dataBlocks
);
void
buildSubmitReqFromDataBlock
(
SSubmitReq
**
pReq
,
const
SArray
*
pDataBlocks
,
STSchema
*
pTSchema
,
int32_t
vgId
,
int32_t
buildSubmitReqFromDataBlock
(
SSubmitReq
**
pReq
,
const
SArray
*
pDataBlocks
,
STSchema
*
pTSchema
,
int32_t
vgId
,
tb_uid_t
uid
,
tb_uid_t
suid
);
static
FORCE_INLINE
int32_t
blockGetEncodeSize
(
const
SSDataBlock
*
pBlock
)
{
...
...
source/common/src/tdatablock.c
浏览文件 @
5b711788
...
...
@@ -1476,7 +1476,7 @@ void blockDebugShowData(const SArray* dataBlocks) {
*
* TODO: colId should be set
*/
void
buildSubmitReqFromDataBlock
(
SSubmitReq
**
pReq
,
const
SArray
*
pDataBlocks
,
STSchema
*
pTSchema
,
int32_t
vgId
,
tb_uid_t
uid
,
int32_t
buildSubmitReqFromDataBlock
(
SSubmitReq
**
pReq
,
const
SArray
*
pDataBlocks
,
STSchema
*
pTSchema
,
int32_t
vgId
,
tb_uid_t
uid
,
tb_uid_t
suid
)
{
int32_t
sz
=
taosArrayGetSize
(
pDataBlocks
);
int32_t
bufSize
=
sizeof
(
SSubmitReq
);
...
...
@@ -1489,6 +1489,10 @@ void buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SArray* pDataBlocks, S
ASSERT
(
bufSize
<
3
*
1024
*
1024
);
*
pReq
=
taosMemoryCalloc
(
1
,
bufSize
);
if
(
!
(
*
pReq
))
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
TSDB_CODE_FAILED
;
}
void
*
pDataBuf
=
*
pReq
;
int32_t
msgLen
=
sizeof
(
SSubmitReq
);
...
...
@@ -1582,4 +1586,6 @@ void buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SArray* pDataBlocks, S
blk
->
numOfRows
=
htons
(
blk
->
numOfRows
);
blk
=
(
SSubmitBlk
*
)(
blk
->
data
+
dataLen
);
}
return
TSDB_CODE_SUCCESS
;
}
source/dnode/vnode/src/tsdb/tsdbFile.c
浏览文件 @
5b711788
...
...
@@ -27,7 +27,7 @@ static const char *TSDB_FNAME_SUFFIX[] = {
"rsma"
,
// TSDB_FILE_RSMA
};
static
const
char
*
TSDB_
DIR_
NAME
[]
=
{
static
const
char
*
TSDB_
LEVEL_D
NAME
[]
=
{
"tsdb"
,
"rsma1"
,
"rsma2"
,
...
...
@@ -51,7 +51,7 @@ void tsdbInitDFile(STsdb *pRepo, SDFile *pDFile, SDiskID did, int fid, uint32_t
pDFile
->
info
.
magic
=
TSDB_FILE_INIT_MAGIC
;
pDFile
->
info
.
fver
=
tsdbGetDFSVersion
(
ftype
);
tsdbGetFilename
(
REPO_ID
(
pRepo
),
fid
,
ver
,
ftype
,
TSDB_
DIR_
NAME
[
pRepo
->
level
],
fname
);
tsdbGetFilename
(
REPO_ID
(
pRepo
),
fid
,
ver
,
ftype
,
TSDB_
LEVEL_D
NAME
[
pRepo
->
level
],
fname
);
tfsInitFile
(
REPO_TFS
(
pRepo
),
&
(
pDFile
->
f
),
did
,
fname
);
}
...
...
source/dnode/vnode/src/tsdb/tsdbSma.c
浏览文件 @
5b711788
...
...
@@ -175,7 +175,8 @@ static int32_t tsdbInsertRSmaDataImpl(STsdb *pTsdb, const char *msg);
static
FORCE_INLINE
int32_t
tsdbUidStorePut
(
STbUidStore
*
pStore
,
tb_uid_t
suid
,
tb_uid_t
*
uid
);
static
FORCE_INLINE
int32_t
tsdbUpdateTbUidListImpl
(
STsdb
*
pTsdb
,
tb_uid_t
*
suid
,
SArray
*
tbUids
);
static
FORCE_INLINE
int32_t
tsdbExecuteRSmaImpl
(
STsdb
*
pTsdb
,
const
void
*
pMsg
,
int32_t
inputType
,
qTaskInfo_t
*
taskInfo
,
STSchema
*
pTSchema
,
tb_uid_t
suid
,
tb_uid_t
uid
,
int8_t
level
);
qTaskInfo_t
*
taskInfo
,
STSchema
*
pTSchema
,
tb_uid_t
suid
,
tb_uid_t
uid
,
int8_t
level
);
// mgmt interface
static
int32_t
tsdbDropTSmaDataImpl
(
STsdb
*
pTsdb
,
int64_t
indexUid
);
...
...
@@ -1976,7 +1977,7 @@ static int32_t tsdbFetchSubmitReqSuids(SSubmitReq *pMsg, STbUidStore *pStore) {
if
(
!
pBlock
)
break
;
tsdbUidStorePut
(
pStore
,
msgIter
.
suid
,
NULL
);
pStore
->
uid
=
msgIter
.
uid
;
// TODO: remove, just for debugging
pStore
->
uid
=
msgIter
.
uid
;
// TODO: remove, just for debugging
}
if
(
terrno
!=
TSDB_CODE_SUCCESS
)
return
-
1
;
...
...
@@ -1984,8 +1985,8 @@ static int32_t tsdbFetchSubmitReqSuids(SSubmitReq *pMsg, STbUidStore *pStore) {
}
static
FORCE_INLINE
int32_t
tsdbExecuteRSmaImpl
(
STsdb
*
pTsdb
,
const
void
*
pMsg
,
int32_t
inputType
,
qTaskInfo_t
*
taskInfo
,
STSchema
*
pTSchema
,
tb_uid_t
suid
,
tb_uid_t
uid
,
int8_t
level
)
{
qTaskInfo_t
*
taskInfo
,
STSchema
*
pTSchema
,
tb_uid_t
suid
,
tb_uid_t
uid
,
int8_t
level
)
{
SArray
*
pResult
=
NULL
;
tsdbDebug
(
"vgId:%d execute rsma %"
PRIi8
" task for qTaskInfo:%p suid:%"
PRIu64
,
REPO_ID
(
pTsdb
),
level
,
taskInfo
,
suid
);
...
...
@@ -2013,10 +2014,18 @@ static FORCE_INLINE int32_t tsdbExecuteRSmaImpl(STsdb *pTsdb, const void *pMsg,
if
(
taosArrayGetSize
(
pResult
)
>
0
)
{
blockDebugShowData
(
pResult
);
STsdb
*
sinkTsdb
=
(
level
==
TSDB_RETENTION_L1
?
pTsdb
->
pVnode
->
pRSma1
:
pTsdb
->
pVnode
->
pRSma2
);
STsdb
*
sinkTsdb
=
(
level
==
TSDB_RETENTION_L1
?
pTsdb
->
pVnode
->
pRSma1
:
pTsdb
->
pVnode
->
pRSma2
);
SSubmitReq
*
pReq
=
NULL
;
buildSubmitReqFromDataBlock
(
&
pReq
,
pResult
,
pTSchema
,
TD_VID
(
pTsdb
->
pVnode
),
uid
,
suid
);
tsdbProcessSubmitReq
(
sinkTsdb
,
INT64_MAX
,
pReq
);
if
(
buildSubmitReqFromDataBlock
(
&
pReq
,
pResult
,
pTSchema
,
TD_VID
(
pTsdb
->
pVnode
),
uid
,
suid
)
!=
0
)
{
taosArrayDestroy
(
pResult
);
return
TSDB_CODE_FAILED
;
}
if
(
tsdbProcessSubmitReq
(
sinkTsdb
,
INT64_MAX
,
pReq
)
!=
0
)
{
taosArrayDestroy
(
pResult
);
taosMemoryFreeClear
(
pReq
);
return
TSDB_CODE_FAILED
;
}
taosMemoryFreeClear
(
pReq
);
}
else
{
tsdbWarn
(
"vgId:%d no rsma % "
PRIi8
" data generated since %s"
,
REPO_ID
(
pTsdb
),
level
,
tstrerror
(
terrno
));
}
...
...
@@ -2033,7 +2042,7 @@ static int32_t tsdbExecuteRSma(STsdb *pTsdb, const void *pMsg, int32_t inputType
return
TSDB_CODE_SUCCESS
;
}
ASSERT
(
uid
!=
0
);
// TODO: remove later
ASSERT
(
uid
!=
0
);
// TODO: remove later
SSmaStat
*
pStat
=
SMA_ENV_STAT
(
pEnv
);
SRSmaInfo
*
pRSmaInfo
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录