Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
codyshao
TDengine
提交
3ff60c3e
T
TDengine
项目概览
codyshao
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
2
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3ff60c3e
编写于
8月 04, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1037
上级
d5c57b68
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
39 addition
and
24 deletion
+39
-24
src/inc/taosmsg.h
src/inc/taosmsg.h
+2
-2
src/os/inc/osFile.h
src/os/inc/osFile.h
+12
-0
src/os/inc/osMemory.h
src/os/inc/osMemory.h
+3
-3
src/os/inc/osWindows.h
src/os/inc/osWindows.h
+3
-0
src/util/inc/tconfig.h
src/util/inc/tconfig.h
+1
-1
src/util/src/tcompression.c
src/util/src/tcompression.c
+1
-1
src/util/src/tconfig.c
src/util/src/tconfig.c
+4
-4
src/util/src/terror.c
src/util/src/terror.c
+1
-1
src/util/src/thashutil.c
src/util/src/thashutil.c
+1
-1
src/util/src/tlog.c
src/util/src/tlog.c
+1
-1
src/util/src/tsched.c
src/util/src/tsched.c
+2
-2
src/util/src/tskiplist.c
src/util/src/tskiplist.c
+4
-4
src/util/src/ttimer.c
src/util/src/ttimer.c
+2
-2
src/util/src/tutil.c
src/util/src/tutil.c
+2
-2
未找到文件。
src/inc/taosmsg.h
浏览文件 @
3ff60c3e
...
...
@@ -206,7 +206,7 @@ typedef struct SSubmitMsg {
SMsgHead
header
;
int32_t
length
;
int32_t
numOfBlocks
;
SSubmitBlk
blocks
[];
char
blocks
[];
}
SSubmitMsg
;
typedef
struct
{
...
...
@@ -680,7 +680,7 @@ typedef struct STableMetaMsg {
typedef
struct
SMultiTableMeta
{
int32_t
numOfTables
;
int32_t
contLen
;
STableMetaMsg
metas
[];
char
metas
[];
}
SMultiTableMeta
;
typedef
struct
{
...
...
src/os/inc/osFile.h
浏览文件 @
3ff60c3e
...
...
@@ -56,6 +56,18 @@ int32_t taosFileRename(char *fullPath, char *suffix, char delimiter, char **dstP
// TAOS_OS_FUNC_FILE_GETTMPFILEPATH
void
taosGetTmpfilePath
(
const
char
*
fileNamePrefix
,
char
*
dstPath
);
#ifdef TAOS_OS_FUNC_FILE_ISDIR
#define S_ISDIR(m) (((m) & 0170000) == (0040000))
#endif
#ifdef TAOS_OS_FUNC_FILE_ISREG
#define S_ISREG(m) !(S_ISDIR(m))
#endif
#ifdef TAOS_OS_FUNC_FILE_ISLNK
#define S_ISLNK(m) 0
#endif
#ifdef __cplusplus
}
#endif
...
...
src/os/inc/osMemory.h
浏览文件 @
3ff60c3e
...
...
@@ -74,9 +74,9 @@ void taosTMemset(void *ptr, int c);
#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 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
...
...
src/os/inc/osWindows.h
浏览文件 @
3ff60c3e
...
...
@@ -60,6 +60,9 @@ extern "C" {
#define TAOS_OS_FUNC_DIR
#define TAOS_OS_FUNC_FILE
#define TAOS_OS_FUNC_FILE_ISREG
#define TAOS_OS_FUNC_FILE_ISDIR
#define TAOS_OS_FUNC_FILE_ISLNK
#define TAOS_OS_FUNC_FILE_SENDIFLE
#define taosFSendFile(outfile, infile, offset, count) taosFSendFileImp(outfile, infile, offset, size)
#define taosTSendFile(dfd, sfd, offset, size) taosTSendFileImp(dfd, sfd, offset, size)
...
...
src/util/inc/tconfig.h
浏览文件 @
3ff60c3e
...
...
@@ -68,7 +68,7 @@ typedef struct {
int8_t
cfgStatus
;
int8_t
unitType
;
int8_t
valType
;
uint32_t
ptrLength
;
int32_t
ptrLength
;
}
SGlobalCfg
;
extern
SGlobalCfg
tsGlobalConfig
[];
...
...
src/util/src/tcompression.c
浏览文件 @
3ff60c3e
...
...
@@ -129,7 +129,7 @@ int tsCompressINTImp(const char *const input, const int nelements, char *const o
if
(
zigzag_value
>=
SIMPLE8B_MAX_INT64
)
goto
_copy_and_exit
;
char
tmp_bit
;
int64_t
tmp_bit
;
if
(
zigzag_value
==
0
)
{
// Take care here, __builtin_clzl give wrong anser for value 0;
tmp_bit
=
0
;
...
...
src/util/src/tconfig.c
浏览文件 @
3ff60c3e
...
...
@@ -98,7 +98,7 @@ static void taosReadInt16Config(SGlobalCfg *cfg, char *input_value) {
}
static
void
taosReadDirectoryConfig
(
SGlobalCfg
*
cfg
,
char
*
input_value
)
{
int
length
=
strlen
(
input_value
);
int
length
=
(
int
)
strlen
(
input_value
);
char
*
option
=
(
char
*
)
cfg
->
ptr
;
if
(
length
<=
0
||
length
>
cfg
->
ptrLength
)
{
uError
(
"config option:%s, input value:%s, length out of range[0, %d], use default value:%s"
,
...
...
@@ -150,7 +150,7 @@ static void taosReadIpStrConfig(SGlobalCfg *cfg, char *input_value) {
}
static
void
taosReadStringConfig
(
SGlobalCfg
*
cfg
,
char
*
input_value
)
{
int
length
=
strlen
(
input_value
);
int
length
=
(
int
)
strlen
(
input_value
);
char
*
option
=
(
char
*
)
cfg
->
ptr
;
if
(
length
<=
0
||
length
>
cfg
->
ptrLength
)
{
uError
(
"config option:%s, input value:%s, length out of range[0, %d], use default value:%s"
,
...
...
@@ -283,7 +283,7 @@ void taosReadGlobalLogCfg() {
option
=
value
=
NULL
;
olen
=
vlen
=
0
;
g
etline
(
&
line
,
&
len
,
fp
);
taosG
etline
(
&
line
,
&
len
,
fp
);
line
[
len
-
1
]
=
0
;
paGetToken
(
line
,
&
option
,
&
olen
);
...
...
@@ -329,7 +329,7 @@ bool taosReadGlobalCfg() {
option
=
value
=
NULL
;
olen
=
vlen
=
0
;
g
etline
(
&
line
,
&
len
,
fp
);
taosG
etline
(
&
line
,
&
len
,
fp
);
line
[
len
-
1
]
=
0
;
paGetToken
(
line
,
&
option
,
&
olen
);
...
...
src/util/src/terror.c
浏览文件 @
3ff60c3e
...
...
@@ -49,7 +49,7 @@ static int tsCompareTaosError(const void* a, const void* b) {
}
static
pthread_once_t
tsErrorInit
=
PTHREAD_ONCE_INIT
;
static
void
tsSortError
()
{
static
void
tsSortError
(
void
)
{
qsort
(
errors
,
sizeof
(
errors
)
/
sizeof
(
errors
[
0
]),
sizeof
(
errors
[
0
]),
tsCompareTaosError
);
}
...
...
src/util/src/thashutil.c
浏览文件 @
3ff60c3e
...
...
@@ -78,7 +78,7 @@ uint32_t taosIntHash_64(const char *key, uint32_t UNUSED_PARAM(len)) {
uint64_t
hash
=
val
>>
16U
;
hash
+=
(
val
&
0xFFFFU
);
return
hash
;
return
(
uint32_t
)
hash
;
}
_hash_fn_t
taosGetDefaultHashFunction
(
int32_t
type
)
{
...
...
src/util/src/tlog.c
浏览文件 @
3ff60c3e
...
...
@@ -65,7 +65,7 @@ typedef struct {
int32_t
tsAsyncLog
=
1
;
float
tsTotalLogDirGB
=
0
;
float
tsAvailLogDirGB
=
0
;
float
tsMinimalLogDirGB
=
0
.
1
;
float
tsMinimalLogDirGB
=
0
.
1
f
;
char
tsLogDir
[
TSDB_FILENAME_LEN
]
=
"/var/log/taos"
;
static
SLogObj
tsLogObj
=
{
.
fileNum
=
1
};
...
...
src/util/src/tsched.c
浏览文件 @
3ff60c3e
...
...
@@ -192,12 +192,12 @@ void taosCleanUpScheduler(void *param) {
pSched
->
stop
=
true
;
for
(
int
i
=
0
;
i
<
pSched
->
numOfThreads
;
++
i
)
{
if
(
pSched
->
qthread
[
i
]
)
{
if
(
taosCheckPthreadValid
(
pSched
->
qthread
[
i
])
)
{
tsem_post
(
&
pSched
->
fullSem
);
}
}
for
(
int
i
=
0
;
i
<
pSched
->
numOfThreads
;
++
i
)
{
if
(
pSched
->
qthread
[
i
]
)
{
if
(
taosCheckPthreadValid
(
pSched
->
qthread
[
i
])
)
{
pthread_join
(
pSched
->
qthread
[
i
],
NULL
);
}
}
...
...
src/util/src/tskiplist.c
浏览文件 @
3ff60c3e
...
...
@@ -19,7 +19,7 @@
#include "tutil.h"
#include "tcompare.h"
__attribute__
((
unused
))
static
FORCE_INLINE
void
recordNodeEachLevel
(
SSkipList
*
pSkipList
,
int32_t
level
)
{
// record link count in each level
UNUSED_FUNC
static
FORCE_INLINE
void
recordNodeEachLevel
(
SSkipList
*
pSkipList
,
int32_t
level
)
{
// record link count in each level
#if SKIP_LIST_RECORD_PERFORMANCE
for
(
int32_t
i
=
0
;
i
<
level
;
++
i
)
{
pSkipList
->
state
.
nLevelNodeCnt
[
i
]
++
;
...
...
@@ -27,7 +27,7 @@ __attribute__ ((unused)) static FORCE_INLINE void recordNodeEachLevel(SSkipList
#endif
}
__attribute__
((
unused
))
static
FORCE_INLINE
void
removeNodeEachLevel
(
SSkipList
*
pSkipList
,
int32_t
level
)
{
UNUSED_FUNC
static
FORCE_INLINE
void
removeNodeEachLevel
(
SSkipList
*
pSkipList
,
int32_t
level
)
{
#if SKIP_LIST_RECORD_PERFORMANCE
for
(
int32_t
i
=
0
;
i
<
level
;
++
i
)
{
pSkipList
->
state
.
nLevelNodeCnt
[
i
]
--
;
...
...
@@ -132,7 +132,7 @@ static bool initForwardBackwardPtr(SSkipList* pSkipList) {
pSkipList
->
pTail
=
(
SSkipListNode
*
)
((
char
*
)
pSkipList
->
pHead
+
SL_NODE_HEADER_SIZE
(
maxLevel
));
pSkipList
->
pTail
->
level
=
pSkipList
->
maxLevel
;
for
(
int32_t
i
=
0
;
i
<
maxLevel
;
++
i
)
{
for
(
u
int32_t
i
=
0
;
i
<
maxLevel
;
++
i
)
{
SL_GET_FORWARD_POINTER
(
pSkipList
->
pHead
,
i
)
=
pSkipList
->
pTail
;
SL_GET_BACKWARD_POINTER
(
pSkipList
->
pTail
,
i
)
=
pSkipList
->
pHead
;
}
...
...
@@ -177,7 +177,7 @@ SSkipList *tSkipListCreate(uint8_t maxLevel, uint8_t keyType, uint8_t keyLen, ui
}
}
srand
(
time
(
NULL
));
srand
(
(
uint32_t
)
time
(
NULL
));
#if SKIP_LIST_RECORD_PERFORMANCE
pSkipList
->
state
.
nTotalMemSize
+=
sizeof
(
SSkipList
);
...
...
src/util/src/ttimer.c
浏览文件 @
3ff60c3e
...
...
@@ -445,7 +445,7 @@ bool taosTmrStopA(tmr_h* timerId) {
bool
taosTmrReset
(
TAOS_TMR_CALLBACK
fp
,
int
mseconds
,
void
*
param
,
void
*
handle
,
tmr_h
*
pTmrId
)
{
tmr_ctrl_t
*
ctrl
=
(
tmr_ctrl_t
*
)
handle
;
if
(
ctrl
==
NULL
||
ctrl
->
label
[
0
]
==
0
)
{
return
NULL
;
return
false
;
}
uintptr_t
id
=
(
uintptr_t
)
*
pTmrId
;
...
...
@@ -491,7 +491,7 @@ static void taosTmrModuleInit(void) {
return
;
}
for
(
in
t
i
=
0
;
i
<
tsMaxTmrCtrl
-
1
;
++
i
)
{
for
(
uint32_
t
i
=
0
;
i
<
tsMaxTmrCtrl
-
1
;
++
i
)
{
tmr_ctrl_t
*
ctrl
=
tmrCtrls
+
i
;
ctrl
->
next
=
ctrl
+
1
;
}
...
...
src/util/src/tutil.c
浏览文件 @
3ff60c3e
...
...
@@ -273,7 +273,7 @@ char *strbetween(char *string, char *begin, char *end) {
char
*
_begin
=
strstr
(
string
,
begin
);
if
(
_begin
!=
NULL
)
{
char
*
_end
=
strstr
(
_begin
+
strlen
(
begin
),
end
);
int
size
=
_end
-
_begin
;
int
size
=
(
int
)(
_end
-
_begin
)
;
if
(
_end
!=
NULL
&&
size
>
0
)
{
result
=
(
char
*
)
calloc
(
1
,
size
);
memcpy
(
result
,
_begin
+
strlen
(
begin
),
size
-
+
strlen
(
begin
));
...
...
@@ -332,7 +332,7 @@ bool taosGetVersionNumber(char *versionStr, int *versionNubmer) {
}
int
versionNumberPos
[
5
]
=
{
0
};
int
len
=
strlen
(
versionStr
);
int
len
=
(
int
)
strlen
(
versionStr
);
int
dot
=
0
;
for
(
int
pos
=
0
;
pos
<
len
&&
dot
<
4
;
++
pos
)
{
if
(
versionStr
[
pos
]
==
'.'
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录