Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
b628b891
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b628b891
编写于
7月 31, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-992]
上级
9400d5b4
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
67 addition
and
56 deletion
+67
-56
src/os/inc/osFile.h
src/os/inc/osFile.h
+16
-11
src/os/inc/osMemory.h
src/os/inc/osMemory.h
+32
-23
src/os/inc/osSocket.h
src/os/inc/osSocket.h
+14
-12
src/tsdb/src/tsdbFile.c
src/tsdb/src/tsdbFile.c
+1
-1
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+0
-3
src/tsdb/src/tsdbRWHelper.c
src/tsdb/src/tsdbRWHelper.c
+1
-0
src/util/src/tkvstore.c
src/util/src/tkvstore.c
+1
-0
src/util/src/tlog.c
src/util/src/tlog.c
+0
-3
src/util/src/tnote.c
src/util/src/tnote.c
+1
-3
src/wal/src/walMain.c
src/wal/src/walMain.c
+1
-0
未找到文件。
src/os/inc/osFile.h
浏览文件 @
b628b891
...
...
@@ -30,19 +30,24 @@ int taosFSendFileImp(FILE* out_file, FILE* in_file, int64_t* offset, int32_t
#define taosTSendFile(dfd, sfd, offset, size) taosTSendFileImp(dfd, sfd, offset, size)
#define taosFSendFile(outfile, infile, offset, count) taosTSendFileImp(fileno(outfile), fileno(infile), offset, size)
#
ifndef TAOS_RANDOM_FILE_FAIL
#define taosTRead(fd, buf, count) taosTRead
Imp(fd, buf, count)
#define taosTWrite(fd, buf, count) taosTWriteImp(fd, buf, count
)
#define taosLSeek(fd, offset, whence) lseek(fd, offset, whence)
#
else
#
define taosTRead(fd, buf, count) taosTReadImp(fd, buf, count)
#define taosTWrite(fd, buf, count) taosTWrite
Imp(fd, buf, count)
#define taosLSeek(fd, offset, whence) lseek(fd, offset, whence
)
#
ifdef TAOS_RANDOM_FILE_FAIL
void
taosSetRandomFileFailFactor
(
int
factor
);
void
taosSetRandomFileFailOutput
(
const
char
*
path
);
ssize_t
taosReadFileRandomFail
(
int
fd
,
void
*
buf
,
size_t
count
,
const
char
*
file
,
uint32_t
line
);
ssize_t
taosWriteFileRandomFail
(
int
fd
,
void
*
buf
,
size_t
count
,
const
char
*
file
,
uint32_t
line
);
off_t
taosLSeekRandomFail
(
int
fd
,
off_t
offset
,
int
whence
,
const
char
*
file
,
uint32_t
line
);
#define taosTRead(fd, buf, count) taosReadFileRandomFail(fd, buf, count, __FILE__, __LINE__)
#define taosTWrite(fd, buf, count) taosWriteFileRandomFail(fd, buf, count, __FILE__, __LINE__)
#define taosLSeek(fd, offset, whence) taosLSeekRandomFail(fd, offset, whence, __FILE__, __LINE__)
#ifdef TAOS_RANDOM_FILE_FAIL_TEST
ssize_t
taosReadFileRandomFail
(
int
fd
,
void
*
buf
,
size_t
count
,
const
char
*
file
,
uint32_t
line
);
ssize_t
taosWriteFileRandomFail
(
int
fd
,
void
*
buf
,
size_t
count
,
const
char
*
file
,
uint32_t
line
);
off_t
taosLSeekRandomFail
(
int
fd
,
off_t
offset
,
int
whence
,
const
char
*
file
,
uint32_t
line
);
#undef taosTRead
#undef taosTWrite
#undef taosLSeek
#define taosTRead(fd, buf, count) taosReadFileRandomFail(fd, buf, count, __FILE__, __LINE__)
#define taosTWrite(fd, buf, count) taosWriteFileRandomFail(fd, buf, count, __FILE__, __LINE__)
#define taosLSeek(fd, offset, whence) taosLSeekRandomFail(fd, offset, whence, __FILE__, __LINE__)
#endif
#endif
// TAOS_OS_FUNC_FILE_GETTMPFILEPATH
...
...
src/os/inc/osMemory.h
浏览文件 @
b628b891
...
...
@@ -46,29 +46,38 @@ void taosTMemset(void *ptr, int c);
} \
} while (0);
#ifndef TAOS_MEM_CHECK
#define taosMalloc(size) malloc(size)
#define taosCalloc(num, size) calloc(num, size)
#define taosRealloc(ptr, size) realloc(ptr, size)
#define taosFree(ptr) free(ptr)
#define taosStrdup(str) taosStrdupImp(str)
#define taosStrndup(str, size) taosStrndupImp(str, size)
#define taosGetline(lineptr, n, stream) taosGetlineImp(lineptr, n, stream)
#else
void
*
taos_malloc
(
size_t
size
,
const
char
*
file
,
uint32_t
line
);
void
*
taos_calloc
(
size_t
num
,
size_t
size
,
const
char
*
file
,
uint32_t
line
);
void
*
taos_realloc
(
void
*
ptr
,
size_t
size
,
const
char
*
file
,
uint32_t
line
);
void
taos_free
(
void
*
ptr
,
const
char
*
file
,
uint32_t
line
);
char
*
taos_strdup
(
const
char
*
str
,
const
char
*
file
,
uint32_t
line
);
char
*
taos_strndup
(
const
char
*
str
,
size_t
size
,
const
char
*
file
,
uint32_t
line
);
ssize_t
taos_getline
(
char
**
lineptr
,
size_t
*
n
,
FILE
*
stream
,
const
char
*
file
,
uint32_t
line
);
#define taosMalloc(size) taos_malloc(size, __FILE__, __LINE__)
#define taosCalloc(num, size) taos_calloc(num, size, __FILE__, __LINE__)
#define taosRealloc(ptr, size) taos_realloc(ptr, size, __FILE__, __LINE__)
#define taosFree(ptr) taos_free(ptr, __FILE__, __LINE__)
#define taosStrdup(str) taos_strdup(str, __FILE__, __LINE__)
#define taosStrndup(str, size) taos_strndup(str, size, __FILE__, __LINE__)
#define taosGetline(lineptr, n, stream) taos_getline(lineptr, n, stream, __FILE__, __LINE__)
#define taosMalloc(size) malloc(size)
#define taosCalloc(num, size) calloc(num, size)
#define taosRealloc(ptr, size) realloc(ptr, size)
#define taosFree(ptr) free(ptr)
#define taosStrdup(str) taosStrdupImp(str)
#define taosStrndup(str, size) taosStrndupImp(str, size)
#define taosGetline(lineptr, n, stream) taosGetlineImp(lineptr, n, stream)
#ifdef TAOS_MEM_CHECK
#ifdef TAOS_MEM_CHECK_TEST
void
*
taos_malloc
(
size_t
size
,
const
char
*
file
,
uint32_t
line
);
void
*
taos_calloc
(
size_t
num
,
size_t
size
,
const
char
*
file
,
uint32_t
line
);
void
*
taos_realloc
(
void
*
ptr
,
size_t
size
,
const
char
*
file
,
uint32_t
line
);
void
taos_free
(
void
*
ptr
,
const
char
*
file
,
uint32_t
line
);
char
*
taos_strdup
(
const
char
*
str
,
const
char
*
file
,
uint32_t
line
);
char
*
taos_strndup
(
const
char
*
str
,
size_t
size
,
const
char
*
file
,
uint32_t
line
);
ssize_t
taos_getline
(
char
**
lineptr
,
size_t
*
n
,
FILE
*
stream
,
const
char
*
file
,
uint32_t
line
);
#undef taosMalloc
#undef taosCalloc
#undef taosRealloc
#undef taosFree
#undef taosStrdup
#undef taosStrndup
#undef taosGetline
#define taosMalloc(size) taos_malloc(size, __FILE__, __LINE__)
#define taosCalloc(num, size) taos_calloc(num, size, __FILE__, __LINE__)
#define taosRealloc(ptr, size) taos_realloc(ptr, size, __FILE__, __LINE__)
#define taosFree(ptr) taos_free(ptr, __FILE__, __LINE__)
#define taosStrdup(str) taos_strdup(str, __FILE__, __LINE__)
#define taosStrndup(str, size) taos_strndup(str, size, __FILE__, __LINE__)
#define taosGetline(lineptr, n, stream) taos_getline(lineptr, n, stream, __FILE__, __LINE__)
#endif
#endif
#ifdef __cplusplus
...
...
src/os/inc/osSocket.h
浏览文件 @
b628b891
...
...
@@ -35,18 +35,20 @@ extern "C" {
#define taosClose(x) taosCloseSocket(x)
#ifdef TAOS_RANDOM_NETWORK_FAIL
ssize_t
taosSendRandomFail
(
int
sockfd
,
const
void
*
buf
,
size_t
len
,
int
flags
);
ssize_t
taosSendToRandomFail
(
int
sockfd
,
const
void
*
buf
,
size_t
len
,
int
flags
,
const
struct
sockaddr
*
dest_addr
,
socklen_t
addrlen
);
ssize_t
taosReadSocketRandomFail
(
int
fd
,
void
*
buf
,
size_t
count
);
ssize_t
taosWriteSocketRandomFail
(
int
fd
,
const
void
*
buf
,
size_t
count
);
#undef taosSend
#undef taosSendto
#undef taosReadSocket
#undef taosWriteSocket
#define taosSend(sockfd, buf, len, flags) taosSendRandomFail(sockfd, buf, len, flags)
#define taosSendto(sockfd, buf, len, flags, dest_addr, addrlen) taosSendToRandomFail(sockfd, buf, len, flags, dest_addr, addrlen)
#define taosReadSocket(fd, buf, len) taosReadSocketRandomFail(fd, buf, len)
#define taosWriteSocket(fd, buf, len) taosWriteSocketRandomFail(fd, buf, len)
#ifdef TAOS_RANDOM_NETWORK_FAIL_TEST
ssize_t
taosSendRandomFail
(
int
sockfd
,
const
void
*
buf
,
size_t
len
,
int
flags
);
ssize_t
taosSendToRandomFail
(
int
sockfd
,
const
void
*
buf
,
size_t
len
,
int
flags
,
const
struct
sockaddr
*
dest_addr
,
socklen_t
addrlen
);
ssize_t
taosReadSocketRandomFail
(
int
fd
,
void
*
buf
,
size_t
count
);
ssize_t
taosWriteSocketRandomFail
(
int
fd
,
const
void
*
buf
,
size_t
count
);
#undef taosSend
#undef taosSendto
#undef taosReadSocket
#undef taosWriteSocket
#define taosSend(sockfd, buf, len, flags) taosSendRandomFail(sockfd, buf, len, flags)
#define taosSendto(sockfd, buf, len, flags, dest_addr, addrlen) taosSendToRandomFail(sockfd, buf, len, flags, dest_addr, addrlen)
#define taosReadSocket(fd, buf, len) taosReadSocketRandomFail(fd, buf, len)
#define taosWriteSocket(fd, buf, len) taosWriteSocketRandomFail(fd, buf, len)
#endif
#endif
// TAOS_OS_FUNC_SOCKET
...
...
src/tsdb/src/tsdbFile.c
浏览文件 @
b628b891
...
...
@@ -14,11 +14,11 @@
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "talgo.h"
#include "tchecksum.h"
#include "tsdbMain.h"
#include "tutil.h"
#define TAOS_RANDOM_FILE_FAIL_TEST
#ifdef TSDB_IDX
const
char
*
tsdbFileSuffix
[]
=
{
".idx"
,
".head"
,
".data"
,
".last"
,
""
,
".i"
,
".h"
,
".l"
};
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
b628b891
...
...
@@ -14,8 +14,6 @@
*/
// no test file errors here
#undef TAOS_RANDOM_FILE_FAIL
#include "tsdbMain.h"
#include "os.h"
#include "talgo.h"
...
...
@@ -25,7 +23,6 @@
#include "tsdb.h"
#include "tulog.h"
#define TSDB_CFG_FILE_NAME "config"
#define TSDB_DATA_DIR_NAME "data"
#define TSDB_META_FILE_NAME "meta"
...
...
src/tsdb/src/tsdbRWHelper.c
浏览文件 @
b628b891
...
...
@@ -20,6 +20,7 @@
#include "tcoding.h"
#include "tscompression.h"
#include "tsdbMain.h"
#define TAOS_RANDOM_FILE_FAIL_TEST
#define TSDB_GET_COMPCOL_LEN(nCols) (sizeof(SCompData) + sizeof(SCompCol) * (nCols) + sizeof(TSCKSUM))
#define TSDB_KEY_COL_OFFSET 0
...
...
src/util/src/tkvstore.c
浏览文件 @
b628b891
...
...
@@ -21,6 +21,7 @@
#include "tcoding.h"
#include "tkvstore.h"
#include "tulog.h"
#define TAOS_RANDOM_FILE_FAIL_TEST
#define TD_KVSTORE_HEADER_SIZE 512
#define TD_KVSTORE_MAJOR_VERSION 1
...
...
src/util/src/tlog.c
浏览文件 @
b628b891
...
...
@@ -14,9 +14,6 @@
*/
#define _DEFAULT_SOURCE
// no test file errors here
#undef TAOS_RANDOM_FILE_FAIL
#include "os.h"
#include "tulog.h"
#include "tlog.h"
...
...
src/util/src/tnote.c
浏览文件 @
b628b891
...
...
@@ -13,9 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// no test file errors here
#undef TAOS_RANDOM_FILE_FAIL
#include "os.h"
#include "tnote.h"
taosNoteInfo
m_HttpNote
;
...
...
src/wal/src/walMain.c
浏览文件 @
b628b891
...
...
@@ -22,6 +22,7 @@
#include "taoserror.h"
#include "twal.h"
#include "tqueue.h"
#define TAOS_RANDOM_FILE_FAIL_TEST
#define walPrefix "wal"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录