Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
85da7146
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
85da7146
编写于
8月 25, 2022
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: stats normal tables' timeseries
上级
4c280dc2
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
13 addition
and
3 deletion
+13
-3
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+3
-2
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+1
-1
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+6
-0
source/dnode/vnode/src/vnd/vnodeCfg.c
source/dnode/vnode/src/vnd/vnodeCfg.c
+3
-0
未找到文件。
source/dnode/vnode/inc/vnode.h
浏览文件 @
85da7146
...
@@ -63,7 +63,7 @@ void vnodeGetInfo(SVnode *pVnode, const char **dbname, int32_t *vgId);
...
@@ -63,7 +63,7 @@ void vnodeGetInfo(SVnode *pVnode, const char **dbname, int32_t *vgId);
int32_t
vnodeProcessCreateTSma
(
SVnode
*
pVnode
,
void
*
pCont
,
uint32_t
contLen
);
int32_t
vnodeProcessCreateTSma
(
SVnode
*
pVnode
,
void
*
pCont
,
uint32_t
contLen
);
int32_t
vnodeGetAllTableList
(
SVnode
*
pVnode
,
uint64_t
uid
,
SArray
*
list
);
int32_t
vnodeGetAllTableList
(
SVnode
*
pVnode
,
uint64_t
uid
,
SArray
*
list
);
int32_t
vnodeGetCtbIdList
(
SVnode
*
pVnode
,
int64_t
suid
,
SArray
*
list
);
int32_t
vnodeGetCtbIdList
(
SVnode
*
pVnode
,
int64_t
suid
,
SArray
*
list
);
int32_t
vnodeGetStbIdList
(
SVnode
*
pVnode
,
int64_t
suid
,
SArray
*
list
);
int32_t
vnodeGetStbIdList
(
SVnode
*
pVnode
,
int64_t
suid
,
SArray
*
list
);
void
*
vnodeGetIdx
(
SVnode
*
pVnode
);
void
*
vnodeGetIdx
(
SVnode
*
pVnode
);
void
*
vnodeGetIvtIdx
(
SVnode
*
pVnode
);
void
*
vnodeGetIvtIdx
(
SVnode
*
pVnode
);
...
@@ -224,6 +224,7 @@ typedef struct {
...
@@ -224,6 +224,7 @@ typedef struct {
int64_t
numOfSTables
;
int64_t
numOfSTables
;
int64_t
numOfCTables
;
int64_t
numOfCTables
;
int64_t
numOfNTables
;
int64_t
numOfNTables
;
int64_t
numOfNTimeSeries
;
int64_t
numOfTimeSeries
;
int64_t
numOfTimeSeries
;
int64_t
pointsWritten
;
int64_t
pointsWritten
;
int64_t
totalStorage
;
int64_t
totalStorage
;
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
85da7146
...
@@ -619,7 +619,7 @@ int64_t metaGetTimeSeriesNum(SMeta *pMeta) {
...
@@ -619,7 +619,7 @@ int64_t metaGetTimeSeriesNum(SMeta *pMeta) {
vnodeGetTimeSeriesNum
(
pMeta
->
pVnode
,
&
num
);
vnodeGetTimeSeriesNum
(
pMeta
->
pVnode
,
&
num
);
pMeta
->
pVnode
->
config
.
vndStats
.
numOfTimeSeries
=
num
;
pMeta
->
pVnode
->
config
.
vndStats
.
numOfTimeSeries
=
num
;
return
pMeta
->
pVnode
->
config
.
vndStats
.
numOfTimeSeries
;
return
pMeta
->
pVnode
->
config
.
vndStats
.
numOfTimeSeries
+
pMeta
->
pVnode
->
config
.
vndStats
.
numOfNTimeSeries
;
}
}
typedef
struct
{
typedef
struct
{
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
85da7146
...
@@ -423,6 +423,7 @@ int metaCreateTable(SMeta *pMeta, int64_t version, SVCreateTbReq *pReq, STableMe
...
@@ -423,6 +423,7 @@ int metaCreateTable(SMeta *pMeta, int64_t version, SVCreateTbReq *pReq, STableMe
me
.
ntbEntry
.
ncid
=
me
.
ntbEntry
.
schemaRow
.
pSchema
[
me
.
ntbEntry
.
schemaRow
.
nCols
-
1
].
colId
+
1
;
me
.
ntbEntry
.
ncid
=
me
.
ntbEntry
.
schemaRow
.
pSchema
[
me
.
ntbEntry
.
schemaRow
.
nCols
-
1
].
colId
+
1
;
++
pMeta
->
pVnode
->
config
.
vndStats
.
numOfNTables
;
++
pMeta
->
pVnode
->
config
.
vndStats
.
numOfNTables
;
pMeta
->
pVnode
->
config
.
vndStats
.
numOfNTimeSeries
+=
me
.
ntbEntry
.
schemaRow
.
nCols
-
1
;
}
}
if
(
metaHandleEntry
(
pMeta
,
&
me
)
<
0
)
goto
_err
;
if
(
metaHandleEntry
(
pMeta
,
&
me
)
<
0
)
goto
_err
;
...
@@ -577,6 +578,7 @@ static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type) {
...
@@ -577,6 +578,7 @@ static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type) {
// drop schema.db (todo)
// drop schema.db (todo)
--
pMeta
->
pVnode
->
config
.
vndStats
.
numOfNTables
;
--
pMeta
->
pVnode
->
config
.
vndStats
.
numOfNTables
;
pMeta
->
pVnode
->
config
.
vndStats
.
numOfNTimeSeries
-=
e
.
ntbEntry
.
schemaRow
.
nCols
-
1
;
}
else
if
(
e
.
type
==
TSDB_SUPER_TABLE
)
{
}
else
if
(
e
.
type
==
TSDB_SUPER_TABLE
)
{
tdbTbDelete
(
pMeta
->
pSuidIdx
,
&
e
.
uid
,
sizeof
(
tb_uid_t
),
&
pMeta
->
txn
);
tdbTbDelete
(
pMeta
->
pSuidIdx
,
&
e
.
uid
,
sizeof
(
tb_uid_t
),
&
pMeta
->
txn
);
// drop schema.db (todo)
// drop schema.db (todo)
...
@@ -679,6 +681,8 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
...
@@ -679,6 +681,8 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
pSchema
->
pSchema
[
entry
.
ntbEntry
.
schemaRow
.
nCols
-
1
].
flags
=
pAlterTbReq
->
flags
;
pSchema
->
pSchema
[
entry
.
ntbEntry
.
schemaRow
.
nCols
-
1
].
flags
=
pAlterTbReq
->
flags
;
pSchema
->
pSchema
[
entry
.
ntbEntry
.
schemaRow
.
nCols
-
1
].
colId
=
entry
.
ntbEntry
.
ncid
++
;
pSchema
->
pSchema
[
entry
.
ntbEntry
.
schemaRow
.
nCols
-
1
].
colId
=
entry
.
ntbEntry
.
ncid
++
;
strcpy
(
pSchema
->
pSchema
[
entry
.
ntbEntry
.
schemaRow
.
nCols
-
1
].
name
,
pAlterTbReq
->
colName
);
strcpy
(
pSchema
->
pSchema
[
entry
.
ntbEntry
.
schemaRow
.
nCols
-
1
].
name
,
pAlterTbReq
->
colName
);
++
pMeta
->
pVnode
->
config
.
vndStats
.
numOfNTimeSeries
;
break
;
break
;
case
TSDB_ALTER_TABLE_DROP_COLUMN
:
case
TSDB_ALTER_TABLE_DROP_COLUMN
:
if
(
pColumn
==
NULL
)
{
if
(
pColumn
==
NULL
)
{
...
@@ -699,6 +703,8 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
...
@@ -699,6 +703,8 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
memmove
(
pColumn
,
pColumn
+
1
,
tlen
);
memmove
(
pColumn
,
pColumn
+
1
,
tlen
);
}
}
pSchema
->
nCols
--
;
pSchema
->
nCols
--
;
--
pMeta
->
pVnode
->
config
.
vndStats
.
numOfNTimeSeries
;
break
;
break
;
case
TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES
:
case
TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES
:
if
(
pColumn
==
NULL
)
{
if
(
pColumn
==
NULL
)
{
...
...
source/dnode/vnode/src/vnd/vnodeCfg.c
浏览文件 @
85da7146
...
@@ -117,6 +117,7 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) {
...
@@ -117,6 +117,7 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) {
if
(
tjsonAddIntegerToObject
(
pJson
,
"vndStats.ctables"
,
pCfg
->
vndStats
.
numOfCTables
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"vndStats.ctables"
,
pCfg
->
vndStats
.
numOfCTables
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"vndStats.ntables"
,
pCfg
->
vndStats
.
numOfNTables
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"vndStats.ntables"
,
pCfg
->
vndStats
.
numOfNTables
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"vndStats.timeseries"
,
pCfg
->
vndStats
.
numOfTimeSeries
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"vndStats.timeseries"
,
pCfg
->
vndStats
.
numOfTimeSeries
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"vndStats.ntimeseries"
,
pCfg
->
vndStats
.
numOfNTimeSeries
)
<
0
)
return
-
1
;
SJson
*
pNodeInfoArr
=
tjsonCreateArray
();
SJson
*
pNodeInfoArr
=
tjsonCreateArray
();
tjsonAddItemToObject
(
pJson
,
"syncCfg.nodeInfo"
,
pNodeInfoArr
);
tjsonAddItemToObject
(
pJson
,
"syncCfg.nodeInfo"
,
pNodeInfoArr
);
...
@@ -224,6 +225,8 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) {
...
@@ -224,6 +225,8 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) {
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"vndStats.timeseries"
,
pCfg
->
vndStats
.
numOfTimeSeries
,
code
);
tjsonGetNumberValue
(
pJson
,
"vndStats.timeseries"
,
pCfg
->
vndStats
.
numOfTimeSeries
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"vndStats.ntimeseries"
,
pCfg
->
vndStats
.
numOfNTimeSeries
,
code
);
if
(
code
<
0
)
return
-
1
;
SJson
*
pNodeInfoArr
=
tjsonGetObjectItem
(
pJson
,
"syncCfg.nodeInfo"
);
SJson
*
pNodeInfoArr
=
tjsonGetObjectItem
(
pJson
,
"syncCfg.nodeInfo"
);
int
arraySize
=
tjsonGetArraySize
(
pNodeInfoArr
);
int
arraySize
=
tjsonGetArraySize
(
pNodeInfoArr
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录