Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
42675a3d
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1181
Star
22014
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,发现更多精彩内容 >>
未验证
提交
42675a3d
编写于
5月 30, 2022
作者:
wafwerar
提交者:
GitHub
5月 30, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13236 from taosdata/fix/ZhiqiangWang/TD-15848-add-sdbDump-win-compile
fix(os): add sdbDump win compile
上级
0a98735a
b2a83570
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
35 addition
and
26 deletion
+35
-26
tests/test/c/CMakeLists.txt
tests/test/c/CMakeLists.txt
+15
-17
tests/test/c/sdbDump.c
tests/test/c/sdbDump.c
+20
-9
未找到文件。
tests/test/c/CMakeLists.txt
浏览文件 @
42675a3d
...
...
@@ -23,20 +23,18 @@ target_link_libraries(
PUBLIC os
)
if
(
NOT TD_WINDOWS
)
add_executable
(
sdbDump sdbDump.c
)
target_link_libraries
(
sdbDump
PUBLIC dnode
PUBLIC mnode
PUBLIC sdb
PUBLIC os
)
target_include_directories
(
sdbDump
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/dnode/mnode"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/dnode/mnode/impl/inc"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/dnode/mnode/sdb/inc"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/dnode/mgmt/node_mgmt/inc"
)
ENDIF
()
\ No newline at end of file
add_executable
(
sdbDump sdbDump.c
)
target_link_libraries
(
sdbDump
PUBLIC dnode
PUBLIC mnode
PUBLIC sdb
PUBLIC os
)
target_include_directories
(
sdbDump
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/dnode/mnode"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/dnode/mnode/impl/inc"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/dnode/mnode/sdb/inc"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/dnode/mgmt/node_mgmt/inc"
)
\ No newline at end of file
tests/test/c/sdbDump.c
浏览文件 @
42675a3d
...
...
@@ -21,12 +21,12 @@
#include "tjson.h"
#define TMP_DNODE_DIR TD_TMP_DIR_PATH "dumpsdb"
#define TMP_MNODE_DIR TD_TMP_DIR_PATH "dumpsdb
/
mnode"
#define TMP_SDB_DATA_DIR TD_TMP_DIR_PATH "dumpsdb
/mnode/
data"
#define TMP_SDB_SYNC_DIR TD_TMP_DIR_PATH "dumpsdb
/mnode/
sync"
#define TMP_SDB_DATA_FILE TD_TMP_DIR_PATH "dumpsdb
/mnode/data/
sdb.data"
#define TMP_SDB_RAFT_CFG_FILE TD_TMP_DIR_PATH "dumpsdb
/mnode/sync/
raft_config.json"
#define TMP_SDB_RAFT_STORE_FILE TD_TMP_DIR_PATH "dumpsdb
/mnode/sync/
raft_store.json"
#define TMP_MNODE_DIR TD_TMP_DIR_PATH "dumpsdb
" TD_DIRSEP "
mnode"
#define TMP_SDB_DATA_DIR TD_TMP_DIR_PATH "dumpsdb
" TD_DIRSEP "mnode" TD_DIRSEP "
data"
#define TMP_SDB_SYNC_DIR TD_TMP_DIR_PATH "dumpsdb
" TD_DIRSEP "mnode" TD_DIRSEP "
sync"
#define TMP_SDB_DATA_FILE TD_TMP_DIR_PATH "dumpsdb
" TD_DIRSEP "mnode" TD_DIRSEP "data" TD_DIRSEP "
sdb.data"
#define TMP_SDB_RAFT_CFG_FILE TD_TMP_DIR_PATH "dumpsdb
" TD_DIRSEP "mnode" TD_DIRSEP "sync" TD_DIRSEP "
raft_config.json"
#define TMP_SDB_RAFT_STORE_FILE TD_TMP_DIR_PATH "dumpsdb
" TD_DIRSEP "mnode" TD_DIRSEP "sync" TD_DIRSEP "
raft_store.json"
void
reportStartup
(
const
char
*
name
,
const
char
*
desc
)
{}
...
...
@@ -412,13 +412,23 @@ int32_t parseArgs(int32_t argc, char *argv[]) {
char
dataFile
[
PATH_MAX
]
=
{
0
};
char
raftCfgFile
[
PATH_MAX
]
=
{
0
};
char
raftStoreFile
[
PATH_MAX
]
=
{
0
};
snprintf
(
dataFile
,
PATH_MAX
,
"%s
/mnode/data/
sdb.data"
,
tsDataDir
);
snprintf
(
raftCfgFile
,
PATH_MAX
,
"%s
/mnode/sync/
raft_config.json"
,
tsDataDir
);
snprintf
(
raftStoreFile
,
PATH_MAX
,
"%s
/mnode/sync/
raft_store.json"
,
tsDataDir
);
snprintf
(
dataFile
,
PATH_MAX
,
"%s
"
TD_DIRSEP
"mnode"
TD_DIRSEP
"data"
TD_DIRSEP
"
sdb.data"
,
tsDataDir
);
snprintf
(
raftCfgFile
,
PATH_MAX
,
"%s
"
TD_DIRSEP
"mnode"
TD_DIRSEP
"sync"
TD_DIRSEP
"
raft_config.json"
,
tsDataDir
);
snprintf
(
raftStoreFile
,
PATH_MAX
,
"%s
"
TD_DIRSEP
"mnode"
TD_DIRSEP
"sync"
TD_DIRSEP
"
raft_store.json"
,
tsDataDir
);
char
cmd
[
PATH_MAX
*
2
]
=
{
0
};
snprintf
(
cmd
,
sizeof
(
cmd
),
"rm -rf %s"
,
TMP_DNODE_DIR
);
system
(
cmd
);
#ifdef WINDOWS
taosMulMkDir
(
TMP_SDB_DATA_DIR
);
taosMulMkDir
(
TMP_SDB_SYNC_DIR
);
snprintf
(
cmd
,
sizeof
(
cmd
),
"cp %s %s 2>nul"
,
dataFile
,
TMP_SDB_DATA_FILE
);
system
(
cmd
);
snprintf
(
cmd
,
sizeof
(
cmd
),
"cp %s %s 2>nul"
,
raftCfgFile
,
TMP_SDB_RAFT_CFG_FILE
);
system
(
cmd
);
snprintf
(
cmd
,
sizeof
(
cmd
),
"cp %s %s 2>nul"
,
raftStoreFile
,
TMP_SDB_RAFT_STORE_FILE
);
system
(
cmd
);
#else
snprintf
(
cmd
,
sizeof
(
cmd
),
"mkdir -p %s"
,
TMP_SDB_DATA_DIR
);
system
(
cmd
);
snprintf
(
cmd
,
sizeof
(
cmd
),
"mkdir -p %s"
,
TMP_SDB_SYNC_DIR
);
...
...
@@ -429,6 +439,7 @@ int32_t parseArgs(int32_t argc, char *argv[]) {
system
(
cmd
);
snprintf
(
cmd
,
sizeof
(
cmd
),
"cp %s %s 2>/dev/null"
,
raftStoreFile
,
TMP_SDB_RAFT_STORE_FILE
);
system
(
cmd
);
#endif
strcpy
(
tsDataDir
,
TMP_DNODE_DIR
);
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录