Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
eda06081
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看板
提交
eda06081
编写于
5月 30, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh(stream): refactor and serialize the attributes of history tasks.
上级
d9c364d6
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
29 addition
and
11 deletion
+29
-11
include/common/tcommon.h
include/common/tcommon.h
+5
-0
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+8
-3
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+2
-2
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+0
-6
source/libs/stream/src/streamTask.c
source/libs/stream/src/streamTask.c
+14
-0
未找到文件。
include/common/tcommon.h
浏览文件 @
eda06081
...
...
@@ -54,6 +54,11 @@ typedef struct SSessionKey {
uint64_t
groupId
;
}
SSessionKey
;
typedef
struct
SVersionRange
{
uint64_t
minVer
;
uint64_t
maxVer
;
}
SVersionRange
;
static
inline
int
winKeyCmprImpl
(
const
void
*
pKey1
,
const
void
*
pKey2
)
{
SWinKey
*
pWin1
=
(
SWinKey
*
)
pKey1
;
SWinKey
*
pWin2
=
(
SWinKey
*
)
pKey2
;
...
...
include/libs/stream/tstream.h
浏览文件 @
eda06081
...
...
@@ -276,6 +276,11 @@ typedef struct SStreamStatus {
int8_t
keepTaskStatus
;
}
SStreamStatus
;
typedef
struct
SHistoryDataRange
{
SVersionRange
range
;
STimeWindow
window
;
}
SHistoryDataRange
;
struct
SStreamTask
{
SStreamId
id
;
int32_t
totalLevel
;
...
...
@@ -290,9 +295,9 @@ struct SStreamTask {
STaskExec
exec
;
int8_t
fillHistory
;
// fill history
int64_t
ekey
;
// end ts key
int64_t
endVer
;
// end version
SHistoryDataRange
dataRange
;
SStreamId
historyTaskId
;
// children info
SArray
*
childEpInfo
;
// SArray<SStreamChildEpInfo*>
int32_t
nextCheckId
;
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
eda06081
...
...
@@ -476,7 +476,7 @@ int32_t mndPersistStreamTasks(SMnode *pMnode, STrans *pTrans, SStreamObj *pStrea
}
}
// persistent stream task for
history
data
// persistent stream task for
already stored ts
data
if
(
pStream
->
conf
.
fillHistory
)
{
level
=
taosArrayGetSize
(
pStream
->
pHTasksList
);
...
...
@@ -493,7 +493,6 @@ int32_t mndPersistStreamTasks(SMnode *pMnode, STrans *pTrans, SStreamObj *pStrea
}
}
return
0
;
}
...
...
@@ -639,6 +638,7 @@ static int32_t mndPersistTaskDropReq(STrans *pTrans, SStreamTask *pTask) {
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
pReq
->
head
.
vgId
=
htonl
(
pTask
->
nodeId
);
pReq
->
taskId
=
pTask
->
id
.
taskId
;
STransAction
action
=
{
0
};
...
...
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
eda06081
...
...
@@ -64,7 +64,6 @@ typedef struct STsdbReadSnap STsdbReadSnap;
typedef
struct
SBlockInfo
SBlockInfo
;
typedef
struct
SSmaInfo
SSmaInfo
;
typedef
struct
SBlockCol
SBlockCol
;
typedef
struct
SVersionRange
SVersionRange
;
typedef
struct
SLDataIter
SLDataIter
;
typedef
struct
SDiskCol
SDiskCol
;
typedef
struct
SDiskData
SDiskData
;
...
...
@@ -376,11 +375,6 @@ struct TSDBKEY {
TSKEY
ts
;
};
struct
SVersionRange
{
uint64_t
minVer
;
uint64_t
maxVer
;
};
typedef
struct
SMemSkipListNode
SMemSkipListNode
;
struct
SMemSkipListNode
{
int8_t
level
;
...
...
source/libs/stream/src/streamTask.c
浏览文件 @
eda06081
...
...
@@ -187,6 +187,13 @@ int32_t tEncodeStreamTask(SEncoder* pEncoder, const SStreamTask* pTask) {
if
(
tEncodeI64
(
pEncoder
,
pTask
->
chkInfo
.
version
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pEncoder
,
pTask
->
fillHistory
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pTask
->
historyTaskId
.
streamId
))
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pTask
->
historyTaskId
.
taskId
))
return
-
1
;
if
(
tEncodeU64
(
pEncoder
,
pTask
->
dataRange
.
range
.
minVer
))
return
-
1
;
if
(
tEncodeU64
(
pEncoder
,
pTask
->
dataRange
.
range
.
maxVer
))
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pTask
->
dataRange
.
window
.
skey
))
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pTask
->
dataRange
.
window
.
ekey
))
return
-
1
;
int32_t
epSz
=
taosArrayGetSize
(
pTask
->
childEpInfo
);
if
(
tEncodeI32
(
pEncoder
,
epSz
)
<
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
epSz
;
i
++
)
{
...
...
@@ -240,6 +247,13 @@ int32_t tDecodeStreamTask(SDecoder* pDecoder, SStreamTask* pTask) {
if
(
tDecodeI64
(
pDecoder
,
&
pTask
->
chkInfo
.
version
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pTask
->
fillHistory
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pTask
->
historyTaskId
.
streamId
))
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
pTask
->
historyTaskId
.
taskId
))
return
-
1
;
if
(
tDecodeU64
(
pDecoder
,
&
pTask
->
dataRange
.
range
.
minVer
))
return
-
1
;
if
(
tDecodeU64
(
pDecoder
,
&
pTask
->
dataRange
.
range
.
maxVer
))
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pTask
->
dataRange
.
window
.
skey
))
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pTask
->
dataRange
.
window
.
ekey
))
return
-
1
;
int32_t
epSz
;
if
(
tDecodeI32
(
pDecoder
,
&
epSz
)
<
0
)
return
-
1
;
pTask
->
childEpInfo
=
taosArrayInit
(
epSz
,
sizeof
(
void
*
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录