Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
15cceb5a
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
15cceb5a
编写于
4月 11, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactors.
上级
74da3c05
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
38 addition
and
36 deletion
+38
-36
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+18
-16
source/dnode/snode/src/snode.c
source/dnode/snode/src/snode.c
+1
-1
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+3
-3
source/dnode/vnode/src/tq/tqUtil.c
source/dnode/vnode/src/tq/tqUtil.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+8
-8
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+3
-3
source/libs/stream/src/streamTask.c
source/libs/stream/src/streamTask.c
+4
-4
未找到文件。
include/libs/stream/tstream.h
浏览文件 @
15cceb5a
...
...
@@ -287,6 +287,11 @@ typedef struct SStreamId {
const
char
*
idStr
;
}
SStreamId
;
typedef
struct
SCheckpointInfo
{
int64_t
id
;
int64_t
version
;
// offset in WAL
}
SCheckpointInfo
;
struct
SStreamTask
{
SStreamId
id
;
int32_t
totalLevel
;
...
...
@@ -298,8 +303,8 @@ struct SStreamTask {
int32_t
selfChildId
;
int32_t
nodeId
;
SEpSet
epSet
;
int64_t
recoverSnapVer
;
int64_t
startVer
;
SCheckpointInfo
chkInfo
;
STaskExec
exec
;
// fill history
int8_t
fillHistory
;
...
...
@@ -309,9 +314,6 @@ struct SStreamTask {
int32_t
nextCheckId
;
SArray
*
checkpointInfo
;
// SArray<SStreamCheckpointInfo>
// exec
STaskExec
exec
;
// output
union
{
STaskDispatcherFixedEp
fixedEpDispatcher
;
...
...
@@ -587,7 +589,7 @@ void streamMetaClose(SStreamMeta* streamMeta);
int32_t
streamMetaSaveTask
(
SStreamMeta
*
pMeta
,
SStreamTask
*
pTask
);
int32_t
streamMetaAddTask
(
SStreamMeta
*
pMeta
,
int64_t
ver
,
SStreamTask
*
pTask
);
int32_t
streamMetaAddSerializedTask
(
SStreamMeta
*
pMeta
,
int64_t
star
tVer
,
char
*
msg
,
int32_t
msgLen
);
int32_t
streamMetaAddSerializedTask
(
SStreamMeta
*
pMeta
,
int64_t
checkpoin
tVer
,
char
*
msg
,
int32_t
msgLen
);
// SStreamTask* streamMetaGetTask(SStreamMeta* pMeta, int32_t taskId);
SStreamTask
*
streamMetaAcquireTask
(
SStreamMeta
*
pMeta
,
int32_t
taskId
);
...
...
source/dnode/snode/src/snode.c
浏览文件 @
15cceb5a
...
...
@@ -76,7 +76,7 @@ int32_t sndExpandTask(SSnode *pSnode, SStreamTask *pTask, int64_t ver) {
pTask
->
inputStatus
=
TASK_INPUT_STATUS__NORMAL
;
pTask
->
outputStatus
=
TASK_OUTPUT_STATUS__NORMAL
;
pTask
->
pMsgCb
=
&
pSnode
->
msgCb
;
pTask
->
startVer
=
ver
;
pTask
->
chkInfo
.
version
=
ver
;
pTask
->
pState
=
streamStateOpen
(
pSnode
->
path
,
pTask
,
false
,
-
1
,
-
1
);
if
(
pTask
->
pState
==
NULL
)
{
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
15cceb5a
...
...
@@ -906,7 +906,7 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) {
pTask
->
inputStatus
=
TASK_INPUT_STATUS__NORMAL
;
pTask
->
outputStatus
=
TASK_OUTPUT_STATUS__NORMAL
;
pTask
->
pMsgCb
=
&
pTq
->
pVnode
->
msgCb
;
pTask
->
startVer
=
ver
;
pTask
->
chkInfo
.
version
=
ver
;
pTask
->
pMeta
=
pTq
->
pStreamMeta
;
// expand executor
...
...
@@ -981,7 +981,7 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) {
streamSetupTrigger
(
pTask
);
tqInfo
(
"vgId:%d expand stream task, s-task:%s, ver:%"
PRId64
" child id:%d, level:%d"
,
vgId
,
pTask
->
id
.
idStr
,
pTask
->
startVer
,
pTask
->
selfChildId
,
pTask
->
taskLevel
);
pTask
->
chkInfo
.
version
,
pTask
->
selfChildId
,
pTask
->
taskLevel
);
return
0
;
}
...
...
@@ -1124,7 +1124,7 @@ int32_t tqProcessTaskRecover1Req(STQ* pTq, SRpcMsg* pMsg) {
}
// check param
int64_t
fillVer1
=
pTask
->
startVer
;
int64_t
fillVer1
=
pTask
->
chkInfo
.
version
;
if
(
fillVer1
<=
0
)
{
streamMetaReleaseTask
(
pTq
->
pStreamMeta
,
pTask
);
return
-
1
;
...
...
source/dnode/vnode/src/tq/tqUtil.c
浏览文件 @
15cceb5a
...
...
@@ -96,7 +96,7 @@ void initOffsetForAllRestoreTasks(STQ* pTq) {
STqOffset
*
pOffset
=
tqOffsetRead
(
pTq
->
pOffsetStore
,
key
);
if
(
pOffset
==
NULL
)
{
doSaveTaskOffset
(
pTq
->
pOffsetStore
,
key
,
pTask
->
startVer
);
doSaveTaskOffset
(
pTq
->
pOffsetStore
,
key
,
pTask
->
chkInfo
.
version
);
}
}
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
15cceb5a
...
...
@@ -2088,7 +2088,7 @@ static int32_t doMergeFileBlockAndLastBlock(SLastBlockReader* pLastBlockReader,
pBlockScanInfo
->
lastKey
=
tsLastBlock
;
return
TSDB_CODE_SUCCESS
;
}
else
{
int32_t
code
=
tsdbRowMergerInit
(
&
merge
,
NULL
,
&
fRow
,
pReader
->
pSchema
);
code
=
tsdbRowMergerInit
(
&
merge
,
NULL
,
&
fRow
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
@@ -2112,7 +2112,7 @@ static int32_t doMergeFileBlockAndLastBlock(SLastBlockReader* pLastBlockReader,
}
}
}
else
{
// not merge block data
int32_t
code
=
tsdbRowMergerInit
(
&
merge
,
NULL
,
&
fRow
,
pReader
->
pSchema
);
code
=
tsdbRowMergerInit
(
&
merge
,
NULL
,
&
fRow
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
@@ -2352,7 +2352,7 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
tsdbRowMergerAdd
(
&
merge
,
piRow
,
piSchema
);
}
else
{
init
=
true
;
STSchema
*
pSchema
=
doGetSchemaForTSRow
(
TSDBROW_SVERSION
(
piRow
),
pReader
,
pBlockScanInfo
->
uid
);
pSchema
=
doGetSchemaForTSRow
(
TSDBROW_SVERSION
(
piRow
),
pReader
,
pBlockScanInfo
->
uid
);
code
=
tsdbRowMergerInit
(
&
merge
,
pSchema
,
piRow
,
piSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
...
...
@@ -2575,7 +2575,7 @@ int32_t mergeRowsInFileBlocks(SBlockData* pBlockData, STableBlockScanInfo* pBloc
SRow
*
pTSRow
=
NULL
;
SRowMerger
merge
=
{
0
};
int32_t
code
=
tsdbRowMergerInit
(
&
merge
,
NULL
,
&
fRow
,
pReader
->
pSchema
);
code
=
tsdbRowMergerInit
(
&
merge
,
NULL
,
&
fRow
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
@@ -3243,7 +3243,7 @@ static int32_t readRowsCountFromFiles(STsdbReader* pReader) {
while
(
1
)
{
bool
hasNext
=
false
;
int32_t
code
=
filesetIteratorNext
(
&
pReader
->
status
.
fileIter
,
pReader
,
&
hasNext
);
code
=
filesetIteratorNext
(
&
pReader
->
status
.
fileIter
,
pReader
,
&
hasNext
);
if
(
code
)
{
return
code
;
}
...
...
@@ -3515,8 +3515,8 @@ SVersionRange getQueryVerRange(SVnode* pVnode, SQueryTableDataCond* pCond, int8_
int64_t
startVer
=
(
pCond
->
startVersion
==
-
1
)
?
0
:
pCond
->
startVersion
;
int64_t
endVer
=
0
;
if
(
pCond
->
endVersion
==
-
1
)
{
// user not specified end version, set current maximum version of vnode as the endVersion
if
(
pCond
->
endVersion
==
-
1
)
{
// user not specified end version, set current maximum version of vnode as the endVersion
endVer
=
pVnode
->
state
.
applied
;
}
else
{
endVer
=
(
pCond
->
endVersion
>
pVnode
->
state
.
applied
)
?
pVnode
->
state
.
applied
:
pCond
->
endVersion
;
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
15cceb5a
...
...
@@ -288,9 +288,9 @@ int32_t streamExecForAll(SStreamTask* pTask) {
int64_t
ckId
=
0
;
int64_t
dataVer
=
0
;
qGetCheckpointVersion
(
pTask
->
exec
.
pExecutor
,
&
dataVer
,
&
ckId
);
if
(
dataVer
>
pTask
->
startVer
)
{
// save it since the checkpoint is updated
qDebug
(
"s-task:%s exec end, checkpoint ver from %"
PRId64
" to %"
PRId64
,
pTask
->
id
.
idStr
,
pTask
->
startVer
,
dataVer
);
pTask
->
startVer
=
dataVer
;
if
(
dataVer
>
pTask
->
chkInfo
.
version
)
{
// save it since the checkpoint is updated
qDebug
(
"s-task:%s exec end, checkpoint ver from %"
PRId64
" to %"
PRId64
,
pTask
->
id
.
idStr
,
pTask
->
chkInfo
.
version
,
dataVer
);
pTask
->
chkInfo
=
(
SCheckpointInfo
)
{.
version
=
dataVer
,
.
id
=
ckId
}
;
streamMetaSaveTask
(
pTask
->
pMeta
,
pTask
);
if
(
streamMetaCommit
(
pTask
->
pMeta
)
<
0
)
{
...
...
source/libs/stream/src/streamTask.c
浏览文件 @
15cceb5a
...
...
@@ -70,8 +70,8 @@ int32_t tEncodeSStreamTask(SEncoder* pEncoder, const SStreamTask* pTask) {
if
(
tEncodeI32
(
pEncoder
,
pTask
->
nodeId
)
<
0
)
return
-
1
;
if
(
tEncodeSEpSet
(
pEncoder
,
&
pTask
->
epSet
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pTask
->
recoverSnapVer
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pTask
->
startVer
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pTask
->
chkInfo
.
id
)
<
0
)
return
-
1
;
if
(
tEncodeI64
(
pEncoder
,
pTask
->
chkInfo
.
version
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pEncoder
,
pTask
->
fillHistory
)
<
0
)
return
-
1
;
int32_t
epSz
=
taosArrayGetSize
(
pTask
->
childEpInfo
);
...
...
@@ -123,8 +123,8 @@ int32_t tDecodeSStreamTask(SDecoder* pDecoder, SStreamTask* pTask) {
if
(
tDecodeI32
(
pDecoder
,
&
pTask
->
nodeId
)
<
0
)
return
-
1
;
if
(
tDecodeSEpSet
(
pDecoder
,
&
pTask
->
epSet
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pTask
->
recoverSnapVer
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pTask
->
startVer
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pTask
->
chkInfo
.
id
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
pDecoder
,
&
pTask
->
chkInfo
.
version
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pTask
->
fillHistory
)
<
0
)
return
-
1
;
int32_t
epSz
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录