Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
69b7348e
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看板
未验证
提交
69b7348e
编写于
10月 12, 2022
作者:
H
Hongze Cheng
提交者:
GitHub
10月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17316 from taosdata/feat/tdlite
refact: adjust some code for further dev
上级
a596b548
746da9fd
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
64 addition
and
37 deletion
+64
-37
CMakeLists.txt
CMakeLists.txt
+4
-4
source/dnode/vnode/src/meta/metaOpen.c
source/dnode/vnode/src/meta/metaOpen.c
+11
-3
source/dnode/vnode/src/tsdb/tsdbFS.c
source/dnode/vnode/src/tsdb/tsdbFS.c
+7
-2
source/dnode/vnode/src/tsdb/tsdbOpen.c
source/dnode/vnode/src/tsdb/tsdbOpen.c
+5
-2
source/dnode/vnode/src/vnd/vnodeCommit.c
source/dnode/vnode/src/vnd/vnodeCommit.c
+5
-1
source/dnode/vnode/src/vnd/vnodeOpen.c
source/dnode/vnode/src/vnd/vnodeOpen.c
+4
-6
source/libs/CMakeLists.txt
source/libs/CMakeLists.txt
+11
-10
source/libs/function/CMakeLists.txt
source/libs/function/CMakeLists.txt
+8
-1
source/libs/qcom/CMakeLists.txt
source/libs/qcom/CMakeLists.txt
+1
-1
source/libs/scalar/CMakeLists.txt
source/libs/scalar/CMakeLists.txt
+8
-2
source/libs/transport/CMakeLists.txt
source/libs/transport/CMakeLists.txt
+0
-5
未找到文件。
CMakeLists.txt
浏览文件 @
69b7348e
...
...
@@ -17,11 +17,12 @@ include(${TD_SUPPORT_DIR}/cmake.platform)
include
(
${
TD_SUPPORT_DIR
}
/cmake.define
)
include
(
${
TD_SUPPORT_DIR
}
/cmake.options
)
include
(
${
TD_SUPPORT_DIR
}
/cmake.version
)
include
(
${
TD_SUPPORT_DIR
}
/cmake.install
)
# contrib
add_subdirectory
(
contrib
)
set_property
(
GLOBAL PROPERTY GLOBAL_DEPENDS_NO_CYCLES OFF
)
# api
add_library
(
api INTERFACE
)
target_include_directories
(
api INTERFACE
"include/client"
)
...
...
@@ -36,8 +37,7 @@ add_subdirectory(source)
add_subdirectory
(
tools
)
add_subdirectory
(
utils
)
add_subdirectory
(
examples/c
)
include
(
${
TD_SUPPORT_DIR
}
/cmake.install
)
# docs
add_subdirectory
(
docs/doxgen
)
# tests (TODO)
add_subdirectory
(
docs/doxgen
)
\ No newline at end of file
source/dnode/vnode/src/meta/metaOpen.c
浏览文件 @
69b7348e
...
...
@@ -35,7 +35,11 @@ int metaOpen(SVnode *pVnode, SMeta **ppMeta) {
*
ppMeta
=
NULL
;
// create handle
slen
=
strlen
(
tfsGetPrimaryPath
(
pVnode
->
pTfs
))
+
strlen
(
pVnode
->
path
)
+
strlen
(
VNODE_META_DIR
)
+
3
;
if
(
pVnode
->
pTfs
)
{
slen
=
strlen
(
tfsGetPrimaryPath
(
pVnode
->
pTfs
))
+
strlen
(
pVnode
->
path
)
+
strlen
(
VNODE_META_DIR
)
+
3
;
}
else
{
slen
=
strlen
(
pVnode
->
path
)
+
strlen
(
VNODE_META_DIR
)
+
2
;
}
if
((
pMeta
=
taosMemoryCalloc
(
1
,
sizeof
(
*
pMeta
)
+
slen
))
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
...
...
@@ -43,8 +47,12 @@ int metaOpen(SVnode *pVnode, SMeta **ppMeta) {
metaInitLock
(
pMeta
);
pMeta
->
path
=
(
char
*
)
&
pMeta
[
1
];
sprintf
(
pMeta
->
path
,
"%s%s%s%s%s"
,
tfsGetPrimaryPath
(
pVnode
->
pTfs
),
TD_DIRSEP
,
pVnode
->
path
,
TD_DIRSEP
,
VNODE_META_DIR
);
if
(
pVnode
->
pTfs
)
{
sprintf
(
pMeta
->
path
,
"%s%s%s%s%s"
,
tfsGetPrimaryPath
(
pVnode
->
pTfs
),
TD_DIRSEP
,
pVnode
->
path
,
TD_DIRSEP
,
VNODE_META_DIR
);
}
else
{
sprintf
(
pMeta
->
path
,
"%s%s%s"
,
pVnode
->
path
,
TD_DIRSEP
,
VNODE_META_DIR
);
}
taosRealPath
(
pMeta
->
path
,
NULL
,
slen
);
pMeta
->
pVnode
=
pVnode
;
...
...
source/dnode/vnode/src/tsdb/tsdbFS.c
浏览文件 @
69b7348e
...
...
@@ -417,6 +417,7 @@ _err:
// EXPOSED APIS ====================================================================================
int32_t
tsdbFSOpen
(
STsdb
*
pTsdb
)
{
int32_t
code
=
0
;
SVnode
*
pVnode
=
pTsdb
->
pVnode
;
// open handle
pTsdb
->
fs
.
pDelFile
=
NULL
;
...
...
@@ -429,8 +430,12 @@ int32_t tsdbFSOpen(STsdb *pTsdb) {
// load fs or keep empty
char
fname
[
TSDB_FILENAME_LEN
];
snprintf
(
fname
,
TSDB_FILENAME_LEN
-
1
,
"%s%s%s%sCURRENT"
,
tfsGetPrimaryPath
(
pTsdb
->
pVnode
->
pTfs
),
TD_DIRSEP
,
pTsdb
->
path
,
TD_DIRSEP
);
if
(
pVnode
->
pTfs
)
{
snprintf
(
fname
,
TSDB_FILENAME_LEN
-
1
,
"%s%s%s%sCURRENT"
,
tfsGetPrimaryPath
(
pTsdb
->
pVnode
->
pTfs
),
TD_DIRSEP
,
pTsdb
->
path
,
TD_DIRSEP
);
}
else
{
snprintf
(
fname
,
TSDB_FILENAME_LEN
-
1
,
"%s%sCURRENT"
,
pTsdb
->
path
,
TD_DIRSEP
);
}
if
(
!
taosCheckExistFile
(
fname
))
{
// empty one
...
...
source/dnode/vnode/src/tsdb/tsdbOpen.c
浏览文件 @
69b7348e
...
...
@@ -57,10 +57,13 @@ int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb, const char *dir, STsdbKeepCfg *pKee
}
else
{
memcpy
(
&
pTsdb
->
keepCfg
,
pKeepCfg
,
sizeof
(
STsdbKeepCfg
));
}
// pTsdb->fs = tsdbNewFS(REPO_KEEP_CFG(pTsdb));
// create dir
tfsMkdir
(
pVnode
->
pTfs
,
pTsdb
->
path
);
if
(
pVnode
->
pTfs
)
{
tfsMkdir
(
pVnode
->
pTfs
,
pTsdb
->
path
);
}
else
{
taosMkDir
(
pTsdb
->
path
);
}
// open tsdb
if
(
tsdbFSOpen
(
pTsdb
)
<
0
)
{
...
...
source/dnode/vnode/src/vnd/vnodeCommit.c
浏览文件 @
69b7348e
...
...
@@ -227,7 +227,11 @@ int vnodeCommit(SVnode *pVnode) {
info
.
state
.
committed
=
pVnode
->
state
.
applied
;
info
.
state
.
commitTerm
=
pVnode
->
state
.
applyTerm
;
info
.
state
.
commitID
=
pVnode
->
state
.
commitID
;
snprintf
(
dir
,
TSDB_FILENAME_LEN
,
"%s%s%s"
,
tfsGetPrimaryPath
(
pVnode
->
pTfs
),
TD_DIRSEP
,
pVnode
->
path
);
if
(
pVnode
->
pTfs
)
{
snprintf
(
dir
,
TSDB_FILENAME_LEN
,
"%s%s%s"
,
tfsGetPrimaryPath
(
pVnode
->
pTfs
),
TD_DIRSEP
,
pVnode
->
path
);
}
else
{
snprintf
(
dir
,
TSDB_FILENAME_LEN
,
"%s"
,
pVnode
->
path
);
}
if
(
vnodeSaveInfo
(
dir
,
&
info
)
<
0
)
{
ASSERT
(
0
);
return
-
1
;
...
...
source/dnode/vnode/src/vnd/vnodeOpen.c
浏览文件 @
69b7348e
...
...
@@ -138,12 +138,6 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) {
sprintf
(
tdir
,
"%s%s%s"
,
dir
,
TD_DIRSEP
,
VNODE_WAL_DIR
);
taosRealPath
(
tdir
,
NULL
,
sizeof
(
tdir
));
// for test tsdb snapshot
#if 0
pVnode->config.walCfg.segSize = 200;
pVnode->config.walCfg.retentionSize = 2000;
#endif
pVnode
->
pWal
=
walOpen
(
tdir
,
&
(
pVnode
->
config
.
walCfg
));
if
(
pVnode
->
pWal
==
NULL
)
{
vError
(
"vgId:%d, failed to open vnode wal since %s"
,
TD_VID
(
pVnode
),
tstrerror
(
terrno
));
...
...
@@ -159,12 +153,14 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) {
goto
_err
;
}
#if !VNODE_AS_LIB
// open query
if
(
vnodeQueryOpen
(
pVnode
))
{
vError
(
"vgId:%d, failed to open vnode query since %s"
,
TD_VID
(
pVnode
),
tstrerror
(
terrno
));
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_err
;
}
#endif
// vnode begin
if
(
vnodeBegin
(
pVnode
)
<
0
)
{
...
...
@@ -173,11 +169,13 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) {
goto
_err
;
}
#if !VNODE_AS_LIB
// open sync
if
(
vnodeSyncOpen
(
pVnode
,
dir
))
{
vError
(
"vgId:%d, failed to open sync since %s"
,
TD_VID
(
pVnode
),
tstrerror
(
terrno
));
goto
_err
;
}
#endif
return
pVnode
;
...
...
source/libs/CMakeLists.txt
浏览文件 @
69b7348e
add_subdirectory
(
tdb
)
add_subdirectory
(
cache
)
add_subdirectory
(
transport
)
add_subdirectory
(
wal
)
add_subdirectory
(
monitor
)
add_subdirectory
(
tfs
)
add_subdirectory
(
sync
)
add_subdirectory
(
tdb
)
add_subdirectory
(
qcom
)
add_subdirectory
(
nodes
)
add_subdirectory
(
catalog
)
add_subdirectory
(
scalar
)
add_subdirectory
(
function
)
add_subdirectory
(
index
)
add_subdirectory
(
wal
)
add_subdirectory
(
parser
)
add_subdirectory
(
scheduler
)
add_subdirectory
(
cache
)
add_subdirectory
(
catalog
)
add_subdirectory
(
executor
)
add_subdirectory
(
stream
)
add_subdirectory
(
planner
)
add_subdirectory
(
function
)
add_subdirectory
(
qcom
)
add_subdirectory
(
qworker
)
add_subdirectory
(
tfs
)
add_subdirectory
(
monitor
)
add_subdirectory
(
nodes
)
add_subdirectory
(
scalar
)
add_subdirectory
(
command
)
\ No newline at end of file
source/libs/function/CMakeLists.txt
浏览文件 @
69b7348e
...
...
@@ -14,7 +14,14 @@ target_include_directories(
target_link_libraries
(
function
PRIVATE os util common nodes scalar qcom transport stream
PRIVATE os
PRIVATE util
PRIVATE common
PRIVATE nodes
PRIVATE qcom
PRIVATE scalar
PRIVATE transport
PRIVATE stream
PUBLIC uv_a
)
...
...
source/libs/qcom/CMakeLists.txt
浏览文件 @
69b7348e
...
...
@@ -8,7 +8,7 @@ target_include_directories(
target_link_libraries
(
qcom
PRIVATE os util transport
nodes
PRIVATE os util transport
)
if
(
${
BUILD_TEST
}
)
...
...
source/libs/scalar/CMakeLists.txt
浏览文件 @
69b7348e
...
...
@@ -8,8 +8,14 @@ target_include_directories(
)
target_link_libraries
(
scalar
PRIVATE os util common nodes function qcom vnode
)
PRIVATE os
PRIVATE util
PRIVATE common
PRIVATE nodes
PRIVATE function
PRIVATE qcom
PRIVATE vnode
)
if
(
${
BUILD_TEST
}
)
ADD_SUBDIRECTORY
(
test
)
...
...
source/libs/transport/CMakeLists.txt
浏览文件 @
69b7348e
...
...
@@ -16,11 +16,6 @@ target_link_libraries(
)
if
(
${
BUILD_WITH_UV_TRANS
}
)
if
(
${
BUILD_WITH_UV
}
)
target_include_directories
(
transport
PUBLIC
"
${
TD_SOURCE_DIR
}
/contrib/libuv/include"
)
target_link_libraries
(
transport
PUBLIC uv_a
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录