Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_46246346
TDengine
提交
67d25a29
TDengine
项目概览
weixin_46246346
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
67d25a29
编写于
12月 13, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1853
上级
0eaf70c9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
31 deletion
+33
-31
cmake/define.inc
cmake/define.inc
+12
-12
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+21
-19
未找到文件。
cmake/define.inc
浏览文件 @
67d25a29
...
...
@@ -45,7 +45,7 @@ IF (TD_LINUX_64)
ADD_DEFINITIONS
(
-
D_M_X64
)
ADD_DEFINITIONS
(
-
D_TD_LINUX_64
)
MESSAGE
(
STATUS
"linux64 is defined"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -g
3 -g
dwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
ENDIF
()
...
...
@@ -53,7 +53,7 @@ IF (TD_LINUX_32)
ADD_DEFINITIONS
(
-
D_TD_LINUX_32
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"linux32 is defined"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -
g -
fsigned-char -munaligned-access -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -fsigned-char -munaligned-access -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
IF
(
TD_ARM_64
)
...
...
@@ -62,7 +62,7 @@ IF (TD_ARM_64)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"arm64 is defined"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -
g -
fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
IF
(
TD_ARM_32
)
...
...
@@ -70,21 +70,21 @@ IF (TD_ARM_32)
ADD_DEFINITIONS
(
-
D_TD_ARM_
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"arm32 is defined"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -
g -
fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types "
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types "
)
ENDIF
()
IF
(
TD_MIPS_64
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_64_
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"mips64 is defined"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -g
3 -g
dwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
IF
(
TD_MIPS_32
)
ADD_DEFINITIONS
(
-
D_TD_MIPS_32_
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"mips32 is defined"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -g
3 -g
dwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -fPIC -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
ENDIF
()
IF
(
TD_APLHINE
)
...
...
@@ -105,8 +105,8 @@ IF (TD_LINUX)
MESSAGE
(
STATUS
"set ningsi macro to true"
)
ENDIF
()
SET
(
DEBUG_FLAGS
"-O0 -DDEBUG"
)
SET
(
RELEASE_FLAGS
"-O
0
-Wno-unused-variable -Wunused-but-set-variable"
)
SET
(
DEBUG_FLAGS
"-O0 -
g3 -
DDEBUG"
)
SET
(
RELEASE_FLAGS
"-O
g
-Wno-unused-variable -Wunused-but-set-variable"
)
IF
(
$
{
COVER
}
MATCHES
"true"
)
MESSAGE
(
STATUS
"Test coverage mode, add extra flags"
)
...
...
@@ -125,9 +125,9 @@ IF (TD_DARWIN_64)
ADD_DEFINITIONS
(
-
D_REENTRANT
-
D__USE_POSIX
-
D_LIBC_REENTRANT
)
ADD_DEFINITIONS
(
-
DUSE_LIBICONV
)
MESSAGE
(
STATUS
"darwin64 is defined"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -Wno-missing-braces -fPIC -
g -
msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
DEBUG_FLAGS
"-O0 -DDEBUG"
)
SET
(
RELEASE_FLAGS
"-O
0
"
)
SET
(
COMMON_FLAGS
"-std=gnu99 -Wall -Werror -Wno-missing-braces -fPIC -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE"
)
SET
(
DEBUG_FLAGS
"-O0 -
g3 -
DDEBUG"
)
SET
(
RELEASE_FLAGS
"-O
g
"
)
ENDIF
()
IF
(
TD_WINDOWS
)
...
...
@@ -140,7 +140,7 @@ IF (TD_WINDOWS)
IF
(
NOT
TD_GODLL
)
SET
(
COMMON_FLAGS
"/nologo /WX /wd4018 /wd2220 /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-"
)
SET
(
DEBUG_FLAGS
"/Zi /W3 /GL"
)
SET
(
RELEASE_FLAGS
"/W0 /GL"
)
SET
(
RELEASE_FLAGS
"/W0 /
O3 /
GL"
)
ENDIF
()
INCLUDE_DIRECTORIES
(
$
{
TD_COMMUNITY_DIR
}
/
deps
/
pthread
)
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
67d25a29
...
...
@@ -49,12 +49,14 @@
#define CREATE_CTABLE_RETRY_TIMES 10
#define CREATE_CTABLE_RETRY_SEC 14
int64_t
tsCTableRid
=
-
1
;
static
void
*
tsChildTableSdb
;
int64_t
tsSTableRid
=
-
1
;
static
void
*
tsSuperTableSdb
;
static
int32_t
tsChildTableUpdateSize
;
static
int32_t
tsSuperTableUpdateSize
;
int64_t
tsCTableRid
=
-
1
;
static
void
*
tsChildTableSdb
;
int64_t
tsSTableRid
=
-
1
;
static
void
*
tsSuperTableSdb
;
static
SHashObj
*
tsSTableUidHash
;
static
int32_t
tsChildTableUpdateSize
;
static
int32_t
tsSuperTableUpdateSize
;
static
void
*
mnodeGetChildTable
(
char
*
tableId
);
static
void
*
mnodeGetSuperTable
(
char
*
tableId
);
static
void
*
mnodeGetSuperTableByUid
(
uint64_t
uid
);
...
...
@@ -289,6 +291,7 @@ static int32_t mnodeChildTableActionDecode(SSdbRow *pRow) {
}
static
int32_t
mnodeChildTableActionRestored
()
{
#if 0
void *pIter = NULL;
SCTableObj *pTable = NULL;
...
...
@@ -345,6 +348,7 @@ static int32_t mnodeChildTableActionRestored() {
}
mnodeCancelGetNextChildTable(pIter);
#endif
return
0
;
}
...
...
@@ -447,6 +451,7 @@ static int32_t mnodeSuperTableActionInsert(SSdbRow *pRow) {
}
mnodeDecDbRef
(
pDb
);
taosHashPut
(
tsSTableUidHash
,
&
pStable
->
uid
,
sizeof
(
int64_t
),
&
pStable
,
sizeof
(
int64_t
));
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -459,6 +464,7 @@ static int32_t mnodeSuperTableActionDelete(SSdbRow *pRow) {
}
mnodeDecDbRef
(
pDb
);
taosHashRemove
(
tsSTableUidHash
,
&
pStable
->
uid
,
sizeof
(
int64_t
));
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -570,6 +576,7 @@ static int32_t mnodeInitSuperTables() {
.
fpRestored
=
mnodeSuperTableActionRestored
};
tsSTableUidHash
=
taosHashInit
(
8
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
true
,
HASH_ENTRY_LOCK
);
tsSTableRid
=
sdbOpenTable
(
&
desc
);
tsSuperTableSdb
=
sdbGetTableByRid
(
tsSTableRid
);
if
(
tsSuperTableSdb
==
NULL
)
{
...
...
@@ -584,6 +591,9 @@ static int32_t mnodeInitSuperTables() {
static
void
mnodeCleanupSuperTables
()
{
sdbCloseTable
(
tsSTableRid
);
tsSuperTableSdb
=
NULL
;
taosHashCleanup
(
tsSTableUidHash
);
tsSTableUidHash
=
NULL
;
}
int32_t
mnodeInitTables
()
{
...
...
@@ -633,20 +643,12 @@ static void *mnodeGetSuperTable(char *tableId) {
}
static
void
*
mnodeGetSuperTableByUid
(
uint64_t
uid
)
{
SSTableObj
*
pStable
=
NULL
;
void
*
pIter
=
NULL
;
SSTableObj
*
*
ppStable
=
taosHashGet
(
tsSTableUidHash
,
&
uid
,
sizeof
(
int64_t
))
;
if
(
ppStable
==
NULL
||
*
ppStable
==
NULL
)
return
NULL
;
while
(
1
)
{
pIter
=
mnodeGetNextSuperTable
(
pIter
,
&
pStable
);
if
(
pStable
==
NULL
)
break
;
if
(
pStable
->
uid
==
uid
)
{
mnodeCancelGetNextSuperTable
(
pIter
);
return
pStable
;
}
mnodeDecTableRef
(
pStable
);
}
return
NULL
;
SSTableObj
*
pStable
=
*
ppStable
;
mnodeIncTableRef
(
pStable
);
return
pStable
;
}
void
*
mnodeGetTable
(
char
*
tableId
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录