Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a049e310
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
提交
a049e310
编写于
7月 12, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/enh/triggerCheckPoint2' into enh/triggerCheckPoint2
上级
6f2fc4fa
6298f17c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
69 addition
and
36 deletion
+69
-36
include/libs/executor/executor.h
include/libs/executor/executor.h
+0
-3
source/libs/executor/inc/querytask.h
source/libs/executor/inc/querytask.h
+0
-2
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+0
-6
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+0
-14
source/libs/stream/inc/streamBackendRocksdb.h
source/libs/stream/inc/streamBackendRocksdb.h
+1
-0
source/libs/stream/src/streamBackendRocksdb.c
source/libs/stream/src/streamBackendRocksdb.c
+60
-8
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+0
-2
source/libs/stream/src/streamMeta.c
source/libs/stream/src/streamMeta.c
+8
-1
未找到文件。
include/libs/executor/executor.h
浏览文件 @
a049e310
...
@@ -99,9 +99,6 @@ void qSetTaskId(qTaskInfo_t tinfo, uint64_t taskId, uint64_t queryId);
...
@@ -99,9 +99,6 @@ void qSetTaskId(qTaskInfo_t tinfo, uint64_t taskId, uint64_t queryId);
int32_t
qSetStreamOpOpen
(
qTaskInfo_t
tinfo
);
int32_t
qSetStreamOpOpen
(
qTaskInfo_t
tinfo
);
// todo refactor
void
qGetCheckpointVersion
(
qTaskInfo_t
tinfo
,
int64_t
*
dataVer
,
int64_t
*
ckId
);
/**
/**
* Set multiple input data blocks for the stream scan.
* Set multiple input data blocks for the stream scan.
* @param tinfo
* @param tinfo
...
...
source/libs/executor/inc/querytask.h
浏览文件 @
a049e310
...
@@ -69,8 +69,6 @@ typedef struct {
...
@@ -69,8 +69,6 @@ typedef struct {
SVersionRange
fillHistoryVer
;
SVersionRange
fillHistoryVer
;
STimeWindow
fillHistoryWindow
;
STimeWindow
fillHistoryWindow
;
SStreamState
*
pState
;
SStreamState
*
pState
;
int64_t
dataVersion
;
int64_t
checkPointId
;
}
SStreamTaskInfo
;
}
SStreamTaskInfo
;
struct
SExecTaskInfo
{
struct
SExecTaskInfo
{
...
...
source/libs/executor/src/executor.c
浏览文件 @
a049e310
...
@@ -223,12 +223,6 @@ int32_t qSetStreamOpOpen(qTaskInfo_t tinfo) {
...
@@ -223,12 +223,6 @@ int32_t qSetStreamOpOpen(qTaskInfo_t tinfo) {
return
code
;
return
code
;
}
}
void
qGetCheckpointVersion
(
qTaskInfo_t
tinfo
,
int64_t
*
dataVer
,
int64_t
*
ckId
)
{
SExecTaskInfo
*
pTaskInfo
=
tinfo
;
*
dataVer
=
pTaskInfo
->
streamInfo
.
dataVersion
;
*
ckId
=
pTaskInfo
->
streamInfo
.
checkPointId
;
}
int32_t
qSetMultiStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
pBlocks
,
size_t
numOfBlocks
,
int32_t
type
)
{
int32_t
qSetMultiStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
pBlocks
,
size_t
numOfBlocks
,
int32_t
type
)
{
if
(
tinfo
==
NULL
)
{
if
(
tinfo
==
NULL
)
{
return
TSDB_CODE_APP_ERROR
;
return
TSDB_CODE_APP_ERROR
;
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
a049e310
...
@@ -2318,11 +2318,6 @@ static int32_t getNextQualifiedFinalWindow(SInterval* pInterval, STimeWindow* pN
...
@@ -2318,11 +2318,6 @@ static int32_t getNextQualifiedFinalWindow(SInterval* pInterval, STimeWindow* pN
return
startPos
;
return
startPos
;
}
}
static
void
setStreamDataVersion
(
SExecTaskInfo
*
pTaskInfo
,
int64_t
version
,
int64_t
ckId
)
{
pTaskInfo
->
streamInfo
.
dataVersion
=
version
;
pTaskInfo
->
streamInfo
.
checkPointId
=
ckId
;
}
static
void
doStreamIntervalAggImpl
(
SOperatorInfo
*
pOperatorInfo
,
SSDataBlock
*
pSDataBlock
,
uint64_t
groupId
,
static
void
doStreamIntervalAggImpl
(
SOperatorInfo
*
pOperatorInfo
,
SSDataBlock
*
pSDataBlock
,
uint64_t
groupId
,
SSHashObj
*
pUpdatedMap
)
{
SSHashObj
*
pUpdatedMap
)
{
SStreamIntervalOperatorInfo
*
pInfo
=
(
SStreamIntervalOperatorInfo
*
)
pOperatorInfo
->
info
;
SStreamIntervalOperatorInfo
*
pInfo
=
(
SStreamIntervalOperatorInfo
*
)
pOperatorInfo
->
info
;
...
@@ -2823,7 +2818,6 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
...
@@ -2823,7 +2818,6 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
}
else
if
(
pBlock
->
info
.
type
==
STREAM_CHECKPOINT
)
{
}
else
if
(
pBlock
->
info
.
type
==
STREAM_CHECKPOINT
)
{
doStreamIntervalSaveCheckpoint
(
pOperator
);
doStreamIntervalSaveCheckpoint
(
pOperator
);
pAPI
->
stateStore
.
streamStateCommit
(
pInfo
->
pState
);
pAPI
->
stateStore
.
streamStateCommit
(
pInfo
->
pState
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
,
pInfo
->
pState
->
checkPointId
);
copyDataBlock
(
pInfo
->
pCheckpointRes
,
pBlock
);
copyDataBlock
(
pInfo
->
pCheckpointRes
,
pBlock
);
pOperator
->
status
=
OP_RES_TO_RETURN
;
pOperator
->
status
=
OP_RES_TO_RETURN
;
qDebug
(
"===stream===return data:%s. recv datablock num:%"
PRIu64
,
qDebug
(
"===stream===return data:%s. recv datablock num:%"
PRIu64
,
...
@@ -3086,7 +3080,6 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream,
...
@@ -3086,7 +3080,6 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream,
if
(
res
==
TSDB_CODE_SUCCESS
)
{
if
(
res
==
TSDB_CODE_SUCCESS
)
{
doStreamIntervalDecodeOpState
(
buff
,
pOperator
);
doStreamIntervalDecodeOpState
(
buff
,
pOperator
);
taosMemoryFree
(
buff
);
taosMemoryFree
(
buff
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
,
pInfo
->
pState
->
checkPointId
);
}
}
return
pOperator
;
return
pOperator
;
...
@@ -3953,7 +3946,6 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) {
...
@@ -3953,7 +3946,6 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) {
}
else
if
(
pBlock
->
info
.
type
==
STREAM_CHECKPOINT
)
{
}
else
if
(
pBlock
->
info
.
type
==
STREAM_CHECKPOINT
)
{
doStreamSessionSaveCheckpoint
(
pOperator
);
doStreamSessionSaveCheckpoint
(
pOperator
);
pAggSup
->
stateStore
.
streamStateCommit
(
pAggSup
->
pState
);
pAggSup
->
stateStore
.
streamStateCommit
(
pAggSup
->
pState
);
setStreamDataVersion
(
pOperator
->
pTaskInfo
,
pInfo
->
dataVersion
,
pAggSup
->
pState
->
checkPointId
);
copyDataBlock
(
pInfo
->
pCheckpointRes
,
pBlock
);
copyDataBlock
(
pInfo
->
pCheckpointRes
,
pBlock
);
continue
;
continue
;
}
else
{
}
else
{
...
@@ -4154,7 +4146,6 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh
...
@@ -4154,7 +4146,6 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh
if
(
res
==
TSDB_CODE_SUCCESS
)
{
if
(
res
==
TSDB_CODE_SUCCESS
)
{
doStreamSessionDecodeOpState
(
buff
,
pOperator
);
doStreamSessionDecodeOpState
(
buff
,
pOperator
);
taosMemoryFree
(
buff
);
taosMemoryFree
(
buff
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
,
pInfo
->
streamAggSup
.
pState
->
checkPointId
);
}
}
setOperatorInfo
(
pOperator
,
"StreamSessionWindowAggOperator"
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION
,
true
,
setOperatorInfo
(
pOperator
,
"StreamSessionWindowAggOperator"
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION
,
true
,
...
@@ -4256,7 +4247,6 @@ static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) {
...
@@ -4256,7 +4247,6 @@ static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) {
}
else
if
(
pBlock
->
info
.
type
==
STREAM_CHECKPOINT
)
{
}
else
if
(
pBlock
->
info
.
type
==
STREAM_CHECKPOINT
)
{
doStreamSessionSaveCheckpoint
(
pOperator
);
doStreamSessionSaveCheckpoint
(
pOperator
);
pAggSup
->
stateStore
.
streamStateCommit
(
pAggSup
->
pState
);
pAggSup
->
stateStore
.
streamStateCommit
(
pAggSup
->
pState
);
setStreamDataVersion
(
pOperator
->
pTaskInfo
,
pInfo
->
dataVersion
,
pAggSup
->
pState
->
checkPointId
);
pOperator
->
status
=
OP_RES_TO_RETURN
;
pOperator
->
status
=
OP_RES_TO_RETURN
;
continue
;
continue
;
}
else
{
}
else
{
...
@@ -4681,7 +4671,6 @@ static SSDataBlock* doStreamStateAgg(SOperatorInfo* pOperator) {
...
@@ -4681,7 +4671,6 @@ static SSDataBlock* doStreamStateAgg(SOperatorInfo* pOperator) {
}
else
if
(
pBlock
->
info
.
type
==
STREAM_CHECKPOINT
)
{
}
else
if
(
pBlock
->
info
.
type
==
STREAM_CHECKPOINT
)
{
doStreamSessionSaveCheckpoint
(
pOperator
);
doStreamSessionSaveCheckpoint
(
pOperator
);
pInfo
->
streamAggSup
.
stateStore
.
streamStateCommit
(
pInfo
->
streamAggSup
.
pState
);
pInfo
->
streamAggSup
.
stateStore
.
streamStateCommit
(
pInfo
->
streamAggSup
.
pState
);
setStreamDataVersion
(
pOperator
->
pTaskInfo
,
pInfo
->
dataVersion
,
pInfo
->
streamAggSup
.
pState
->
checkPointId
);
copyDataBlock
(
pInfo
->
pCheckpointRes
,
pBlock
);
copyDataBlock
(
pInfo
->
pCheckpointRes
,
pBlock
);
continue
;
continue
;
}
else
{
}
else
{
...
@@ -4878,7 +4867,6 @@ SOperatorInfo* createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhys
...
@@ -4878,7 +4867,6 @@ SOperatorInfo* createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhys
if
(
res
==
TSDB_CODE_SUCCESS
)
{
if
(
res
==
TSDB_CODE_SUCCESS
)
{
doStreamStateDecodeOpState
(
buff
,
pOperator
);
doStreamStateDecodeOpState
(
buff
,
pOperator
);
taosMemoryFree
(
buff
);
taosMemoryFree
(
buff
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
,
pInfo
->
streamAggSup
.
pState
->
checkPointId
);
}
}
setOperatorInfo
(
pOperator
,
"StreamStateAggOperator"
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE
,
true
,
OP_NOT_OPENED
,
setOperatorInfo
(
pOperator
,
"StreamStateAggOperator"
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE
,
true
,
OP_NOT_OPENED
,
...
@@ -5548,7 +5536,6 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
...
@@ -5548,7 +5536,6 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
}
else
if
(
pBlock
->
info
.
type
==
STREAM_CHECKPOINT
)
{
}
else
if
(
pBlock
->
info
.
type
==
STREAM_CHECKPOINT
)
{
doStreamIntervalSaveCheckpoint
(
pOperator
);
doStreamIntervalSaveCheckpoint
(
pOperator
);
pAPI
->
stateStore
.
streamStateCommit
(
pInfo
->
pState
);
pAPI
->
stateStore
.
streamStateCommit
(
pInfo
->
pState
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
,
pInfo
->
pState
->
checkPointId
);
pInfo
->
reCkBlock
=
true
;
pInfo
->
reCkBlock
=
true
;
copyDataBlock
(
pInfo
->
pCheckpointRes
,
pBlock
);
copyDataBlock
(
pInfo
->
pCheckpointRes
,
pBlock
);
qDebug
(
"===stream===return data:single interval. recv datablock num:%"
PRIu64
,
pInfo
->
numOfDatapack
);
qDebug
(
"===stream===return data:single interval. recv datablock num:%"
PRIu64
,
pInfo
->
numOfDatapack
);
...
@@ -5735,7 +5722,6 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys
...
@@ -5735,7 +5722,6 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SPhys
if
(
res
==
TSDB_CODE_SUCCESS
)
{
if
(
res
==
TSDB_CODE_SUCCESS
)
{
doStreamIntervalDecodeOpState
(
buff
,
pOperator
);
doStreamIntervalDecodeOpState
(
buff
,
pOperator
);
taosMemoryFree
(
buff
);
taosMemoryFree
(
buff
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
,
pInfo
->
pState
->
checkPointId
);
}
}
initIntervalDownStream
(
downstream
,
pPhyNode
->
type
,
pInfo
);
initIntervalDownStream
(
downstream
,
pPhyNode
->
type
,
pInfo
);
...
...
source/libs/stream/inc/streamBackendRocksdb.h
浏览文件 @
a049e310
...
@@ -47,6 +47,7 @@ typedef struct {
...
@@ -47,6 +47,7 @@ typedef struct {
void
*
streamBackendInit
(
const
char
*
path
);
void
*
streamBackendInit
(
const
char
*
path
);
void
streamBackendCleanup
(
void
*
arg
);
void
streamBackendCleanup
(
void
*
arg
);
void
streamBackendHandleCleanup
(
void
*
arg
);
void
streamBackendHandleCleanup
(
void
*
arg
);
int32_t
streamBackendLoadCheckpointInfo
(
void
*
pMeta
);
int32_t
streamBackendDoCheckpoint
(
void
*
pMeta
,
uint64_t
checkpointId
);
int32_t
streamBackendDoCheckpoint
(
void
*
pMeta
,
uint64_t
checkpointId
);
SListNode
*
streamBackendAddCompare
(
void
*
backend
,
void
*
arg
);
SListNode
*
streamBackendAddCompare
(
void
*
backend
,
void
*
arg
);
void
streamBackendDelCompare
(
void
*
backend
,
void
*
arg
);
void
streamBackendDelCompare
(
void
*
backend
,
void
*
arg
);
...
...
source/libs/stream/src/streamBackendRocksdb.c
浏览文件 @
a049e310
...
@@ -393,7 +393,7 @@ int32_t delObsoleteCheckpoint(void* arg, const char* path) {
...
@@ -393,7 +393,7 @@ int32_t delObsoleteCheckpoint(void* arg, const char* path) {
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
checkpointDel
);
i
++
)
{
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
checkpointDel
);
i
++
)
{
int64_t
id
=
*
(
int64_t
*
)
taosArrayGet
(
checkpointDel
,
i
);
int64_t
id
=
*
(
int64_t
*
)
taosArrayGet
(
checkpointDel
,
i
);
char
tbuf
[
256
]
=
{
0
};
char
tbuf
[
256
]
=
{
0
};
sprintf
(
tbuf
,
"%s/checkpoint
_
%"
PRId64
""
,
path
,
id
);
sprintf
(
tbuf
,
"%s/checkpoint
-
%"
PRId64
""
,
path
,
id
);
if
(
taosIsDir
(
tbuf
))
{
if
(
taosIsDir
(
tbuf
))
{
taosRemoveDir
(
tbuf
);
taosRemoveDir
(
tbuf
);
}
}
...
@@ -402,11 +402,63 @@ int32_t delObsoleteCheckpoint(void* arg, const char* path) {
...
@@ -402,11 +402,63 @@ int32_t delObsoleteCheckpoint(void* arg, const char* path) {
return
0
;
return
0
;
}
}
static
int32_t
compareCheckpoint
(
const
void
*
a
,
const
void
*
b
)
{
int64_t
x
=
*
(
int64_t
*
)
a
;
int64_t
y
=
*
(
int64_t
*
)
b
;
return
x
<
y
?
-
1
:
1
;
}
int32_t
streamBackendLoadCheckpointInfo
(
void
*
arg
)
{
SStreamMeta
*
pMeta
=
arg
;
int32_t
code
=
0
;
int32_t
len
=
strlen
(
pMeta
->
path
)
+
30
;
char
*
checkpointPath
=
taosMemoryCalloc
(
1
,
len
);
sprintf
(
checkpointPath
,
"%s/%s"
,
pMeta
->
path
,
"checkpoints"
);
if
(
!
taosDirExist
(
checkpointPath
))
{
return
0
;
// no checkpoint, nothing to load
}
TdDirPtr
pDir
=
taosOpenDir
(
checkpointPath
);
if
(
pDir
==
NULL
)
return
0
;
TdDirEntryPtr
de
=
NULL
;
SArray
*
suffix
=
taosArrayInit
(
4
,
sizeof
(
int64_t
));
while
((
de
=
taosReadDir
(
pDir
))
!=
NULL
)
{
if
(
strcmp
(
taosGetDirEntryName
(
de
),
"."
)
==
0
||
strcmp
(
taosGetDirEntryName
(
de
),
".."
)
==
0
)
continue
;
if
(
taosDirEntryIsDir
(
de
))
{
char
checkpointPrefix
[
32
]
=
{
0
};
int64_t
checkpointId
=
0
;
int
ret
=
sscanf
(
taosGetDirEntryName
(
de
),
"checkpoint-%"
PRId64
""
,
&
checkpointId
);
if
(
ret
==
1
)
{
taosArrayPush
(
suffix
,
&
checkpointId
);
}
}
else
{
continue
;
}
}
taosArraySort
(
suffix
,
compareCheckpoint
);
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
suffix
);
i
++
)
{
int64_t
id
=
*
(
int64_t
*
)
taosArrayGet
(
suffix
,
i
);
taosArrayPush
(
pMeta
->
checkpointSaved
,
&
id
);
}
taosArrayDestroy
(
suffix
);
taosCloseDir
(
&
pDir
);
taosMemoryFree
(
checkpointPath
);
return
0
;
}
int32_t
streamBackendDoCheckpoint
(
void
*
arg
,
uint64_t
checkpointId
)
{
int32_t
streamBackendDoCheckpoint
(
void
*
arg
,
uint64_t
checkpointId
)
{
SStreamMeta
*
pMeta
=
arg
;
SStreamMeta
*
pMeta
=
arg
;
int64_t
backendRid
=
pMeta
->
streamBackendRid
;
int64_t
backendRid
=
pMeta
->
streamBackendRid
;
int64_t
st
=
taosGetTimestampMs
();
int64_t
st
=
taosGetTimestampMs
();
int32_t
code
=
-
1
;
int32_t
code
=
-
1
;
char
path
[
256
]
=
{
0
};
char
path
[
256
]
=
{
0
};
sprintf
(
path
,
"%s/%s"
,
pMeta
->
path
,
"checkpoints"
);
sprintf
(
path
,
"%s/%s"
,
pMeta
->
path
,
"checkpoints"
);
...
@@ -417,7 +469,7 @@ int32_t streamBackendDoCheckpoint(void* arg, uint64_t checkpointId) {
...
@@ -417,7 +469,7 @@ int32_t streamBackendDoCheckpoint(void* arg, uint64_t checkpointId) {
}
}
char
checkpointDir
[
256
]
=
{
0
};
char
checkpointDir
[
256
]
=
{
0
};
snprintf
(
checkpointDir
,
tListLen
(
checkpointDir
),
"%s/checkpoint_%"
PRIu
64
,
path
,
checkpointId
);
snprintf
(
checkpointDir
,
tListLen
(
checkpointDir
),
"%s/checkpoint-%"
PRId
64
,
path
,
checkpointId
);
SBackendWrapper
*
pHandle
=
taosAcquireRef
(
streamBackendId
,
backendRid
);
SBackendWrapper
*
pHandle
=
taosAcquireRef
(
streamBackendId
,
backendRid
);
if
(
pHandle
==
NULL
)
{
if
(
pHandle
==
NULL
)
{
...
@@ -1203,8 +1255,8 @@ bool streamStateIterSeekAndValid(rocksdb_iterator_t* iter, char* buf, size_t len
...
@@ -1203,8 +1255,8 @@ bool streamStateIterSeekAndValid(rocksdb_iterator_t* iter, char* buf, size_t len
}
}
return
true
;
return
true
;
}
}
rocksdb_iterator_t
*
streamStateIterCreate
(
SStreamState
*
pState
,
const
char
*
pChkptFileName
,
rocksdb_snapshot_t
**
snapshot
,
rocksdb_iterator_t
*
streamStateIterCreate
(
SStreamState
*
pState
,
const
char
*
pChkptFileName
,
rocksdb_readoptions_t
**
readOpt
)
{
rocksdb_
snapshot_t
**
snapshot
,
rocksdb_
readoptions_t
**
readOpt
)
{
int
idx
=
streamStateGetCfIdx
(
pState
,
pChkptFileName
);
int
idx
=
streamStateGetCfIdx
(
pState
,
pChkptFileName
);
SBackendCfWrapper
*
wrapper
=
pState
->
pTdbState
->
pBackendCfWrapper
;
SBackendCfWrapper
*
wrapper
=
pState
->
pTdbState
->
pBackendCfWrapper
;
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
a049e310
...
@@ -18,8 +18,6 @@
...
@@ -18,8 +18,6 @@
// maximum allowed processed block batches. One block may include several submit blocks
// maximum allowed processed block batches. One block may include several submit blocks
#define MAX_STREAM_RESULT_DUMP_THRESHOLD 100
#define MAX_STREAM_RESULT_DUMP_THRESHOLD 100
static
int32_t
updateCheckPointInfo
(
SStreamTask
*
pTask
,
int64_t
checkpointId
);
bool
streamTaskShouldStop
(
const
SStreamStatus
*
pStatus
)
{
bool
streamTaskShouldStop
(
const
SStreamStatus
*
pStatus
)
{
int32_t
status
=
atomic_load_8
((
int8_t
*
)
&
pStatus
->
taskStatus
);
int32_t
status
=
atomic_load_8
((
int8_t
*
)
&
pStatus
->
taskStatus
);
return
(
status
==
TASK_STATUS__STOP
)
||
(
status
==
TASK_STATUS__DROPPING
);
return
(
status
==
TASK_STATUS__STOP
)
||
(
status
==
TASK_STATUS__DROPPING
);
...
...
source/libs/stream/src/streamMeta.c
浏览文件 @
a049e310
...
@@ -100,6 +100,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
...
@@ -100,6 +100,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
if
(
pMeta
->
streamBackend
==
NULL
)
{
if
(
pMeta
->
streamBackend
==
NULL
)
{
goto
_err
;
goto
_err
;
}
}
pMeta
->
streamBackendRid
=
taosAddRef
(
streamBackendId
,
pMeta
->
streamBackend
);
pMeta
->
streamBackendRid
=
taosAddRef
(
streamBackendId
,
pMeta
->
streamBackend
);
pMeta
->
pTaskBackendUnique
=
pMeta
->
pTaskBackendUnique
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_ENTRY_LOCK
);
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_ENTRY_LOCK
);
...
@@ -108,6 +109,12 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
...
@@ -108,6 +109,12 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
pMeta
->
checkpointCap
=
4
;
pMeta
->
checkpointCap
=
4
;
taosInitRWLatch
(
&
pMeta
->
checkpointDirLock
);
taosInitRWLatch
(
&
pMeta
->
checkpointDirLock
);
code
=
streamBackendLoadCheckpointInfo
(
pMeta
);
if
(
code
!=
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
code
);
goto
_err
;
}
taosMemoryFree
(
streamPath
);
taosMemoryFree
(
streamPath
);
taosInitRWLatch
(
&
pMeta
->
lock
);
taosInitRWLatch
(
&
pMeta
->
lock
);
...
@@ -310,7 +317,7 @@ void streamMetaRemoveTask(SStreamMeta* pMeta, int32_t taskId) {
...
@@ -310,7 +317,7 @@ void streamMetaRemoveTask(SStreamMeta* pMeta, int32_t taskId) {
qDebug
(
"s-task:0x%x set task status:%s"
,
taskId
,
streamGetTaskStatusStr
(
TASK_STATUS__DROPPING
));
qDebug
(
"s-task:0x%x set task status:%s"
,
taskId
,
streamGetTaskStatusStr
(
TASK_STATUS__DROPPING
));
while
(
1
)
{
while
(
1
)
{
taosRLockLatch
(
&
pMeta
->
lock
);
taosRLockLatch
(
&
pMeta
->
lock
);
ppTask
=
(
SStreamTask
**
)
taosHashGet
(
pMeta
->
pTasks
,
&
taskId
,
sizeof
(
int32_t
));
ppTask
=
(
SStreamTask
**
)
taosHashGet
(
pMeta
->
pTasks
,
&
taskId
,
sizeof
(
int32_t
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录