Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f652f71d
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看板
提交
f652f71d
编写于
5月 11, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
factor code
上级
d473fcf6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
17 deletion
+22
-17
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+3
-1
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
+3
-0
source/libs/stream/src/streamBackendRocksdb.c
source/libs/stream/src/streamBackendRocksdb.c
+0
-1
source/libs/stream/src/streamMeta.c
source/libs/stream/src/streamMeta.c
+9
-5
source/libs/stream/test/tstreamUpdateTest.cpp
source/libs/stream/test/tstreamUpdateTest.cpp
+7
-10
未找到文件。
include/libs/stream/tstream.h
浏览文件 @
f652f71d
...
...
@@ -341,7 +341,7 @@ typedef struct SStreamMeta {
TTB
*
pTaskDb
;
TTB
*
pCheckpointDb
;
SHashObj
*
pTasks
;
SArray
*
pTaskList
;
// SArray<task_id*>
SArray
*
pTaskList
;
// SArray<task_id*>
void
*
ahandle
;
TXN
*
txn
;
FTaskExpand
*
expandFunc
;
...
...
@@ -569,6 +569,8 @@ int32_t streamAggRecoverPrepare(SStreamTask* pTask);
// int32_t streamAggChildrenRecoverFinish(SStreamTask* pTask);
int32_t
streamProcessRecoverFinishReq
(
SStreamTask
*
pTask
,
int32_t
childId
);
void
streamMetaInit
();
void
streamMetaCleanup
();
SStreamMeta
*
streamMetaOpen
(
const
char
*
path
,
void
*
ahandle
,
FTaskExpand
expandFunc
,
int32_t
vgId
);
void
streamMetaClose
(
SStreamMeta
*
streamMeta
);
...
...
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
浏览文件 @
f652f71d
...
...
@@ -18,6 +18,7 @@
#include "dmNodes.h"
#include "index.h"
#include "qworker.h"
#include "tstream.h"
static
bool
dmRequireNode
(
SDnode
*
pDnode
,
SMgmtWrapper
*
pWrapper
)
{
SMgmtInputOpt
input
=
dmBuildMgmtInputOpt
(
pWrapper
);
...
...
@@ -153,6 +154,7 @@ int32_t dmInitDnode(SDnode *pDnode) {
}
indexInit
(
tsNumOfCommitThreads
);
streamMetaInit
();
dmReportStartup
(
"dnode-transport"
,
"initialized"
);
dDebug
(
"dnode is created, ptr:%p"
,
pDnode
);
...
...
@@ -175,6 +177,7 @@ void dmCleanupDnode(SDnode *pDnode) {
dmCleanupServer
(
pDnode
);
dmClearVars
(
pDnode
);
rpcCleanup
();
streamMetaCleanup
();
indexCleanup
();
taosConvDestroy
();
dDebug
(
"dnode is closed, ptr:%p"
,
pDnode
);
...
...
source/libs/stream/src/streamBackendRocksdb.c
浏览文件 @
f652f71d
...
...
@@ -846,7 +846,6 @@ int streamStateOpenBackend(void* backend, SStreamState* pState) {
if
(
err
!=
NULL
)
{
qError
(
"failed to create cf:%s_%s, reason:%s"
,
pState
->
pTdbState
->
idstr
,
ginitDict
[
i
].
key
,
err
);
taosMemoryFreeClear
(
err
);
// return -1;
}
}
pState
->
pTdbState
->
rocksdb
=
handle
->
db
;
...
...
source/libs/stream/src/streamMeta.c
浏览文件 @
f652f71d
...
...
@@ -19,6 +19,13 @@
#include "tref.h"
#include "ttimer.h"
static
TdThreadOnce
streamMetaModuleInit
=
PTHREAD_ONCE_INIT
;
static
int32_t
streamBackendId
=
0
;
static
void
streamMetaEnvInit
()
{
streamBackendId
=
taosOpenRef
(
20
,
streamBackendCleanup
);
}
void
streamMetaInit
()
{
taosThreadOnce
(
&
streamMetaModuleInit
,
streamMetaEnvInit
);
}
void
streamMetaCleanup
()
{
taosCloseRef
(
streamBackendId
);
}
SStreamMeta
*
streamMetaOpen
(
const
char
*
path
,
void
*
ahandle
,
FTaskExpand
expandFunc
,
int32_t
vgId
)
{
int32_t
code
=
-
1
;
SStreamMeta
*
pMeta
=
taosMemoryCalloc
(
1
,
sizeof
(
SStreamMeta
));
...
...
@@ -85,8 +92,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
}
pMeta
->
streamBackend
=
streamBackendInit
(
statePath
);
pMeta
->
streamBackendId
=
taosOpenRef
(
20
,
streamBackendCleanup
);
pMeta
->
streamBackendRid
=
taosAddRef
(
pMeta
->
streamBackendId
,
pMeta
->
streamBackend
);
pMeta
->
streamBackendRid
=
taosAddRef
(
streamBackendId
,
pMeta
->
streamBackend
);
taosMemoryFree
(
statePath
);
...
...
@@ -129,9 +135,7 @@ void streamMetaClose(SStreamMeta* pMeta) {
}
taosHashCleanup
(
pMeta
->
pTasks
);
taosRemoveRef
(
pMeta
->
streamBackendId
,
pMeta
->
streamBackendRid
);
// streamBackendCleanup(pMeta->streamBackend);
taosCloseRef
(
pMeta
->
streamBackendId
);
taosRemoveRef
(
streamBackendId
,
pMeta
->
streamBackendRid
);
pMeta
->
pTaskList
=
taosArrayDestroy
(
pMeta
->
pTaskList
);
taosMemoryFree
(
pMeta
->
path
);
taosMemoryFree
(
pMeta
);
...
...
source/libs/stream/test/tstreamUpdateTest.cpp
浏览文件 @
f652f71d
#include <gtest/gtest.h>
#include "streamBackendRocksdb.h"
#include "tstream.h"
#include "tstreamUpdate.h"
#include "ttime.h"
...
...
@@ -9,21 +11,16 @@ using namespace std;
class
StreamStateEnv
:
public
::
testing
::
Test
{
protected:
virtual
void
SetUp
()
{
// initLog();
// taosRemoveDir(path);
// SIndexOpts opts;
// opts.cacheSize = 1024 * 1024 * 4;
// int ret = indexOpen(&opts, path, &index);
// assert(ret == 0);
streamMetaInit
();
backend
=
streamBackendInit
(
path
);
}
virtual
void
TearDown
()
{
streamMetaCleanup
();
// indexClose(index);
}
const
char
*
path
=
TD_TMP_DIR_PATH
"stream"
;
// SIndexOpts* opts;
// SIndex* index;
void
*
backend
;
};
bool
equalSBF
(
SScalableBf
*
left
,
SScalableBf
*
right
)
{
...
...
@@ -212,7 +209,7 @@ TEST(TD_STREAM_UPDATE_TEST, update) {
// updateInfoDestroy(pSU7);
}
// TEST()
TEST
_F
(
StreamStateEnv
,
test1
)
{}
TEST
(
StreamStateEnv
,
test1
)
{}
// int main(int argc, char *argv[]) {
// testing::InitGoogleTest(&argc, argv);
// return RUN_ALL_TESTS();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录