Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
43edc037
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
43edc037
编写于
10月 29, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1847 Modify the file names of wal module
上级
18eb9e23
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
104 addition
and
28 deletion
+104
-28
src/inc/twal.h
src/inc/twal.h
+12
-15
src/wal/inc/walInt.h
src/wal/inc/walInt.h
+41
-0
src/wal/inc/walMgmt.h
src/wal/inc/walMgmt.h
+27
-0
src/wal/src/walMgmt.c
src/wal/src/walMgmt.c
+21
-0
src/wal/src/walWrite.c
src/wal/src/walWrite.c
+3
-13
未找到文件。
src/inc/twal.h
浏览文件 @
43edc037
...
...
@@ -22,22 +22,22 @@ extern "C" {
#define TAOS_WAL_NOLOG 0
#define TAOS_WAL_WRITE 1
#define TAOS_WAL_FSYNC 2
typedef
struct
{
int8_t
msgType
;
int8_t
reserved
[
3
];
int32_t
len
;
uint64_t
version
;
uint32_t
signature
;
uint32_t
cksum
;
char
cont
[];
int8_t
msgType
;
int8_t
reserved
[
3
];
int32_t
len
;
uint64_t
version
;
uint32_t
signature
;
uint32_t
cksum
;
char
cont
[];
}
SWalHead
;
typedef
struct
{
int8_t
walLevel
;
// wal level
int32_t
fsyncPeriod
;
// millisecond
int8_t
wals
;
// number of WAL files;
int8_t
keep
;
// keep the wal file when closed
int8_t
walLevel
;
// wal level
int32_t
fsyncPeriod
;
// millisecond
int8_t
wals
;
// number of WAL files;
int8_t
keep
;
// keep the wal file when closed
}
SWalCfg
;
typedef
void
*
twalh
;
// WAL HANDLE
...
...
@@ -53,9 +53,6 @@ int walRestore(twalh, void *pVnode, FWalWrite writeFp);
int
walGetWalFile
(
twalh
,
char
*
name
,
uint32_t
*
index
);
int64_t
walGetVersion
(
twalh
);
extern
int
wDebugFlag
;
#ifdef __cplusplus
}
#endif
...
...
src/wal/inc/walInt.h
0 → 100644
浏览文件 @
43edc037
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_WAL_INT_H
#define TDENGINE_WAL_INT_H
#ifdef __cplusplus
extern
"C"
{
#endif
#include "tlog.h"
extern
int32_t
wDebugFlag
;
#define wFatal(...) { if (wDebugFlag & DEBUG_FATAL) { taosPrintLog("WAL FATAL ", 255, __VA_ARGS__); }}
#define wError(...) { if (wDebugFlag & DEBUG_ERROR) { taosPrintLog("WAL ERROR ", 255, __VA_ARGS__); }}
#define wWarn(...) { if (wDebugFlag & DEBUG_WARN) { taosPrintLog("WAL WARN ", 255, __VA_ARGS__); }}
#define wInfo(...) { if (wDebugFlag & DEBUG_INFO) { taosPrintLog("WAL ", 255, __VA_ARGS__); }}
#define wDebug(...) { if (wDebugFlag & DEBUG_DEBUG) { taosPrintLog("WAL ", wDebugFlag, __VA_ARGS__); }}
#define wTrace(...) { if (wDebugFlag & DEBUG_TRACE) { taosPrintLog("WAL ", wDebugFlag, __VA_ARGS__); }}
#define walPrefix "wal"
#define walSignature (uint32_t)(0xFAFBFDFE)
#ifdef __cplusplus
}
#endif
#endif
src/wal/inc/walMgmt.h
0 → 100644
浏览文件 @
43edc037
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_WAL_MGMT_H
#define TDENGINE_WAL_MGMT_H
#ifdef __cplusplus
extern
"C"
{
#endif
#ifdef __cplusplus
}
#endif
#endif
src/wal/src/walMgmt.c
0 → 100644
浏览文件 @
43edc037
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "taoserror.h"
#include "twal.h"
#include "walInt.h"
#include "walMgmt.h"
\ No newline at end of file
src/wal/src/wal
Main
.c
→
src/wal/src/wal
Write
.c
浏览文件 @
43edc037
...
...
@@ -14,11 +14,10 @@
*/
#define _DEFAULT_SOURCE
#define TAOS_RANDOM_FILE_FAIL_TEST
#include "os.h"
#include "tlog.h"
#include "twal.h"
#include "walInt.h"
#include "walMgmt.h"
#include "tchecksum.h"
#include "tutil.h"
#include "ttimer.h"
...
...
@@ -26,14 +25,6 @@
#include "twal.h"
#include "tqueue.h"
#define walPrefix "wal"
#define wFatal(...) { if (wDebugFlag & DEBUG_FATAL) { taosPrintLog("WAL FATAL ", 255, __VA_ARGS__); }}
#define wError(...) { if (wDebugFlag & DEBUG_ERROR) { taosPrintLog("WAL ERROR ", 255, __VA_ARGS__); }}
#define wWarn(...) { if (wDebugFlag & DEBUG_WARN) { taosPrintLog("WAL WARN ", 255, __VA_ARGS__); }}
#define wInfo(...) { if (wDebugFlag & DEBUG_INFO) { taosPrintLog("WAL ", 255, __VA_ARGS__); }}
#define wDebug(...) { if (wDebugFlag & DEBUG_DEBUG) { taosPrintLog("WAL ", wDebugFlag, __VA_ARGS__); }}
#define wTrace(...) { if (wDebugFlag & DEBUG_TRACE) { taosPrintLog("WAL ", wDebugFlag, __VA_ARGS__); }}
typedef
struct
{
uint64_t
version
;
...
...
@@ -54,7 +45,6 @@ typedef struct {
static
void
*
walTmrCtrl
=
NULL
;
static
int
tsWalNum
=
0
;
static
pthread_once_t
walModuleInit
=
PTHREAD_ONCE_INIT
;
static
uint32_t
walSignature
=
0xFAFBFDFE
;
static
int
walHandleExistingFiles
(
const
char
*
path
);
static
int
walRestoreWalFile
(
SWal
*
pWal
,
void
*
pVnode
,
FWalWrite
writeFp
);
static
int
walRemoveWalFiles
(
const
char
*
path
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录