Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
f948a51f
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看板
提交
f948a51f
编写于
6月 19, 2020
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-353
上级
0d3d2a90
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
6 deletion
+23
-6
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+21
-4
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+2
-2
未找到文件。
src/tsdb/src/tsdbMain.c
浏览文件 @
f948a51f
...
...
@@ -62,7 +62,7 @@ static int tsdbRestoreInfo(STsdbRepo *pRepo);
static
int
tsdbInitSubmitBlkIter
(
SSubmitBlk
*
pBlock
,
SSubmitBlkIter
*
pIter
);
static
void
tsdbAlterCompression
(
STsdbRepo
*
pRepo
,
int8_t
compression
);
static
int
tsdbAlterKeep
(
STsdbRepo
*
pRepo
,
int32_t
keep
);
static
void
tsdbAlterMaxTables
(
STsdbRepo
*
pRepo
,
int32_t
maxTables
);
static
int
tsdbAlterMaxTables
(
STsdbRepo
*
pRepo
,
int32_t
maxTables
);
static
int
tsdbAlterCacheTotalBlocks
(
STsdbRepo
*
pRepo
,
int
totalBlocks
);
static
int
keyFGroupCompFunc
(
const
void
*
key
,
const
void
*
fgroup
);
static
int
tsdbEncodeCfg
(
void
**
buf
,
STsdbCfg
*
pCfg
);
...
...
@@ -303,7 +303,10 @@ int32_t tsdbConfigRepo(TSDB_REPO_T *repo, STsdbCfg *pCfg) {
configChanged
=
true
;
}
if
(
pRCfg
->
maxTables
!=
pCfg
->
maxTables
)
{
tsdbAlterMaxTables
(
pRepo
,
pCfg
->
maxTables
);
if
(
tsdbAlterMaxTables
(
pRepo
,
pCfg
->
maxTables
)
<
0
)
{
tsdbError
(
"vgId:%d failed to configure repo when alter maxTables since %s"
,
REPO_ID
(
pRepo
),
tstrerror
(
terrno
));
return
-
1
;
}
configChanged
=
true
;
}
...
...
@@ -885,11 +888,12 @@ static int tsdbAlterKeep(STsdbRepo *pRepo, int32_t keep) {
return
0
;
}
static
void
tsdbAlterMaxTables
(
STsdbRepo
*
pRepo
,
int32_t
maxTables
)
{
static
int
tsdbAlterMaxTables
(
STsdbRepo
*
pRepo
,
int32_t
maxTables
)
{
// TODO
int
oldMaxTables
=
pRepo
->
config
.
maxTables
;
if
(
oldMaxTables
<
pRepo
->
config
.
maxTables
)
{
// TODO
terrno
=
TSDB_CODE_TDB_INVALID_ACTION
;
return
-
1
;
}
STsdbMeta
*
pMeta
=
pRepo
->
tsdbMeta
;
...
...
@@ -898,7 +902,20 @@ static void tsdbAlterMaxTables(STsdbRepo *pRepo, int32_t maxTables) {
memset
(
&
pMeta
->
tables
[
oldMaxTables
],
0
,
sizeof
(
STable
*
)
*
(
maxTables
-
oldMaxTables
));
pRepo
->
config
.
maxTables
=
maxTables
;
if
(
pRepo
->
mem
)
{
pRepo
->
mem
->
tData
=
realloc
(
pRepo
->
mem
->
tData
,
maxTables
*
sizeof
(
STableData
*
));
memset
(
POINTER_SHIFT
(
pRepo
->
mem
->
tData
,
sizeof
(
STableData
*
)
*
oldMaxTables
),
0
,
sizeof
(
STableData
*
)
*
(
maxTables
-
oldMaxTables
));
}
if
(
pRepo
->
imem
)
{
pRepo
->
imem
->
tData
=
realloc
(
pRepo
->
imem
->
tData
,
maxTables
*
sizeof
(
STableData
*
));
memset
(
POINTER_SHIFT
(
pRepo
->
imem
->
tData
,
sizeof
(
STableData
*
)
*
oldMaxTables
),
0
,
sizeof
(
STableData
*
)
*
(
maxTables
-
oldMaxTables
));
}
tsdbTrace
(
"vgId:%d, tsdb maxTables is changed from %d to %d!"
,
pRepo
->
config
.
tsdbId
,
oldMaxTables
,
maxTables
);
return
0
;
}
static
int
keyFGroupCompFunc
(
const
void
*
key
,
const
void
*
fgroup
)
{
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
f948a51f
...
...
@@ -259,12 +259,12 @@ static bool initTableMemIterator(STsdbQueryHandle* pHandle, STableCheckInfo* pCh
assert
(
pCheckInfo
->
iter
==
NULL
&&
pCheckInfo
->
iiter
==
NULL
);
if
(
pCheckInfo
->
mem
)
{
if
(
pCheckInfo
->
mem
&&
pCheckInfo
->
mem
->
tData
[
pCheckInfo
->
tableId
.
tid
]
!=
NULL
)
{
pCheckInfo
->
iter
=
tSkipListCreateIterFromVal
(
pCheckInfo
->
mem
->
tData
[
pCheckInfo
->
tableId
.
tid
]
->
pData
,
(
const
char
*
)
&
pCheckInfo
->
lastKey
,
TSDB_DATA_TYPE_TIMESTAMP
,
order
);
}
if
(
pCheckInfo
->
imem
)
{
if
(
pCheckInfo
->
imem
&&
pCheckInfo
->
imem
->
tData
[
pCheckInfo
->
tableId
.
tid
]
!=
NULL
)
{
pCheckInfo
->
iiter
=
tSkipListCreateIterFromVal
(
pCheckInfo
->
imem
->
tData
[
pCheckInfo
->
tableId
.
tid
]
->
pData
,
(
const
char
*
)
&
pCheckInfo
->
lastKey
,
TSDB_DATA_TYPE_TIMESTAMP
,
order
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录