Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c7158f78
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c7158f78
编写于
8月 19, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adjust more
上级
f59bc9c0
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
41 addition
and
21 deletion
+41
-21
source/dnode/vnode/src/inc/meta.h
source/dnode/vnode/src/inc/meta.h
+0
-1
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+3
-1
source/dnode/vnode/src/tsdb/tsdbFile.c
source/dnode/vnode/src/tsdb/tsdbFile.c
+13
-2
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
+25
-17
未找到文件。
source/dnode/vnode/src/inc/meta.h
浏览文件 @
c7158f78
...
@@ -66,7 +66,6 @@ int32_t metaCacheOpen(SMeta* pMeta);
...
@@ -66,7 +66,6 @@ int32_t metaCacheOpen(SMeta* pMeta);
void
metaCacheClose
(
SMeta
*
pMeta
);
void
metaCacheClose
(
SMeta
*
pMeta
);
int32_t
metaCacheUpsert
(
SMeta
*
pMeta
,
SMetaInfo
*
pInfo
);
int32_t
metaCacheUpsert
(
SMeta
*
pMeta
,
SMetaInfo
*
pInfo
);
int32_t
metaCacheDrop
(
SMeta
*
pMeta
,
int64_t
uid
);
int32_t
metaCacheDrop
(
SMeta
*
pMeta
,
int64_t
uid
);
int32_t
metaCacheGet
(
SMeta
*
pMeta
,
int64_t
uid
,
SMetaInfo
*
pInfo
);
struct
SMeta
{
struct
SMeta
{
TdThreadRwlock
lock
;
TdThreadRwlock
lock
;
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
c7158f78
...
@@ -1051,6 +1051,8 @@ int32_t metaGetTableTags(SMeta *pMeta, uint64_t suid, SArray *uidList, SHashObj
...
@@ -1051,6 +1051,8 @@ int32_t metaGetTableTags(SMeta *pMeta, uint64_t suid, SArray *uidList, SHashObj
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
int32_t
metaCacheGet
(
SMeta
*
pMeta
,
int64_t
uid
,
SMetaInfo
*
pInfo
);
int32_t
metaGetInfo
(
SMeta
*
pMeta
,
int64_t
uid
,
SMetaInfo
*
pInfo
)
{
int32_t
metaGetInfo
(
SMeta
*
pMeta
,
int64_t
uid
,
SMetaInfo
*
pInfo
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
void
*
pData
=
NULL
;
void
*
pData
=
NULL
;
...
...
source/dnode/vnode/src/tsdb/tsdbFile.c
浏览文件 @
c7158f78
...
@@ -188,11 +188,16 @@ int32_t tPutDFileSet(uint8_t *p, SDFileSet *pSet) {
...
@@ -188,11 +188,16 @@ int32_t tPutDFileSet(uint8_t *p, SDFileSet *pSet) {
n
+=
tPutI32v
(
p
?
p
+
n
:
p
,
pSet
->
diskId
.
level
);
n
+=
tPutI32v
(
p
?
p
+
n
:
p
,
pSet
->
diskId
.
level
);
n
+=
tPutI32v
(
p
?
p
+
n
:
p
,
pSet
->
diskId
.
id
);
n
+=
tPutI32v
(
p
?
p
+
n
:
p
,
pSet
->
diskId
.
id
);
n
+=
tPutI32v
(
p
?
p
+
n
:
p
,
pSet
->
fid
);
n
+=
tPutI32v
(
p
?
p
+
n
:
p
,
pSet
->
fid
);
// data
n
+=
tPutHeadFile
(
p
?
p
+
n
:
p
,
pSet
->
pHeadF
);
n
+=
tPutHeadFile
(
p
?
p
+
n
:
p
,
pSet
->
pHeadF
);
n
+=
tPutDataFile
(
p
?
p
+
n
:
p
,
pSet
->
pDataF
);
n
+=
tPutDataFile
(
p
?
p
+
n
:
p
,
pSet
->
pDataF
);
n
+=
tPutLastFile
(
p
?
p
+
n
:
p
,
pSet
->
pLastF
);
n
+=
tPutSmaFile
(
p
?
p
+
n
:
p
,
pSet
->
pSmaF
);
n
+=
tPutSmaFile
(
p
?
p
+
n
:
p
,
pSet
->
pSmaF
);
// last
n
+=
tPutU8
(
p
?
p
+
n
:
p
,
1
);
// for future compatibility
n
+=
tPutLastFile
(
p
?
p
+
n
:
p
,
pSet
->
pLastF
);
return
n
;
return
n
;
}
}
...
@@ -202,11 +207,17 @@ int32_t tGetDFileSet(uint8_t *p, SDFileSet *pSet) {
...
@@ -202,11 +207,17 @@ int32_t tGetDFileSet(uint8_t *p, SDFileSet *pSet) {
n
+=
tGetI32v
(
p
+
n
,
&
pSet
->
diskId
.
level
);
n
+=
tGetI32v
(
p
+
n
,
&
pSet
->
diskId
.
level
);
n
+=
tGetI32v
(
p
+
n
,
&
pSet
->
diskId
.
id
);
n
+=
tGetI32v
(
p
+
n
,
&
pSet
->
diskId
.
id
);
n
+=
tGetI32v
(
p
+
n
,
&
pSet
->
fid
);
n
+=
tGetI32v
(
p
+
n
,
&
pSet
->
fid
);
// data
n
+=
tGetHeadFile
(
p
+
n
,
pSet
->
pHeadF
);
n
+=
tGetHeadFile
(
p
+
n
,
pSet
->
pHeadF
);
n
+=
tGetDataFile
(
p
+
n
,
pSet
->
pDataF
);
n
+=
tGetDataFile
(
p
+
n
,
pSet
->
pDataF
);
n
+=
tGetLastFile
(
p
+
n
,
pSet
->
pLastF
);
n
+=
tGetSmaFile
(
p
+
n
,
pSet
->
pSmaF
);
n
+=
tGetSmaFile
(
p
+
n
,
pSet
->
pSmaF
);
// last
uint8_t
nLast
;
n
+=
tGetU8
(
p
+
n
,
&
nLast
);
n
+=
tGetLastFile
(
p
+
n
,
pSet
->
pLastF
);
return
n
;
return
n
;
}
}
...
...
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
浏览文件 @
c7158f78
...
@@ -30,8 +30,6 @@ struct STsdbSnapReader {
...
@@ -30,8 +30,6 @@ struct STsdbSnapReader {
SArray
*
aBlockL
;
// SArray<SBlockL>
SArray
*
aBlockL
;
// SArray<SBlockL>
SBlockIdx
*
pBlockIdx
;
SBlockIdx
*
pBlockIdx
;
SBlockL
*
pBlockL
;
SBlockL
*
pBlockL
;
SBlock
*
pBlock
;
SBlock
block
;
int32_t
iBlockIdx
;
int32_t
iBlockIdx
;
int32_t
iBlockL
;
int32_t
iBlockL
;
...
@@ -78,9 +76,6 @@ static int32_t tsdbSnapReadData(STsdbSnapReader* pReader, uint8_t** ppData) {
...
@@ -78,9 +76,6 @@ static int32_t tsdbSnapReadData(STsdbSnapReader* pReader, uint8_t** ppData) {
if
(
code
)
goto
_err
;
if
(
code
)
goto
_err
;
pReader
->
iBlock
=
0
;
pReader
->
iBlock
=
0
;
if
(
pReader
->
iBlock
<
pReader
->
mBlock
.
nItem
)
{
tMapDataGetItemByIdx
(
&
pReader
->
mBlock
,
pReader
->
iBlock
,
&
pReader
->
block
,
tGetBlock
);
}
}
else
{
}
else
{
pReader
->
pBlockIdx
=
NULL
;
pReader
->
pBlockIdx
=
NULL
;
}
}
...
@@ -97,18 +92,16 @@ static int32_t tsdbSnapReadData(STsdbSnapReader* pReader, uint8_t** ppData) {
...
@@ -97,18 +92,16 @@ static int32_t tsdbSnapReadData(STsdbSnapReader* pReader, uint8_t** ppData) {
while
(
true
)
{
while
(
true
)
{
if
(
pReader
->
pBlockIdx
&&
pReader
->
pBlockL
)
{
if
(
pReader
->
pBlockIdx
&&
pReader
->
pBlockL
)
{
TABLEID
minId
=
{.
suid
=
pReader
->
pBlockL
->
suid
,
.
uid
=
pReader
->
pBlockL
->
minUid
};
TABLEID
id
=
{.
suid
=
pReader
->
pBlockL
->
suid
,
.
uid
=
pReader
->
pBlockL
->
minUid
};
TABLEID
maxId
=
{.
suid
=
pReader
->
pBlockL
->
suid
,
.
uid
=
pReader
->
pBlockL
->
maxUid
};
// if (tTABLEIDCmprFn(pReader->pBlockIdx, &minId) < 0) {
if
(
tTABLEIDCmprFn
(
pReader
->
pBlockIdx
,
&
minId
)
<
0
)
{
// // TODO
// TODO
// } else if (tTABLEIDCmprFn(pReader->pBlockIdx, &maxId) < 0) {
}
else
if
(
tTABLEIDCmprFn
(
pReader
->
pBlockIdx
,
&
maxId
)
<
0
)
{
// // TODO
// TODO
// } else {
}
else
{
// // TODO
// TODO
// }
}
}
else
if
(
pReader
->
pBlockIdx
)
{
}
else
if
(
pReader
->
pBlockIdx
)
{
// may have problem (todo)
while
(
pReader
->
iBlock
<
pReader
->
mBlock
.
nItem
)
{
while
(
pReader
->
iBlock
<
pReader
->
mBlock
.
nItem
)
{
SBlock
block
;
SBlock
block
;
tMapDataGetItemByIdx
(
&
pReader
->
mBlock
,
pReader
->
iBlock
,
&
block
,
tGetBlock
);
tMapDataGetItemByIdx
(
&
pReader
->
mBlock
,
pReader
->
iBlock
,
&
block
,
tGetBlock
);
...
@@ -119,9 +112,24 @@ static int32_t tsdbSnapReadData(STsdbSnapReader* pReader, uint8_t** ppData) {
...
@@ -119,9 +112,24 @@ static int32_t tsdbSnapReadData(STsdbSnapReader* pReader, uint8_t** ppData) {
// next
// next
pReader
->
iBlock
++
;
pReader
->
iBlock
++
;
if
(
*
ppData
)
break
;
}
if
(
*
ppData
)
goto
_exit
;
if
(
pReader
->
iBlock
>=
pReader
->
mBlock
.
nItem
)
{
pReader
->
iBlockIdx
++
;
if
(
pReader
->
iBlockIdx
<
taosArrayGetSize
(
pReader
->
aBlockIdx
))
{
pReader
->
pBlockIdx
=
(
SBlockIdx
*
)
taosArrayGet
(
pReader
->
aBlockIdx
,
pReader
->
iBlockIdx
);
code
=
tsdbReadBlock
(
pReader
->
pDataFReader
,
pReader
->
pBlockIdx
,
&
pReader
->
mBlock
);
if
(
code
)
goto
_err
;
pReader
->
iBlock
=
0
;
}
else
{
pReader
->
pBlockIdx
=
NULL
;
}
}
}
if
(
*
ppData
)
goto
_exit
;
}
else
if
(
pReader
->
pBlockL
)
{
}
else
if
(
pReader
->
pBlockL
)
{
while
(
pReader
->
pBlockL
)
{
while
(
pReader
->
pBlockL
)
{
if
(
pReader
->
pBlockL
->
minVer
<=
pReader
->
ever
&&
pReader
->
pBlockL
->
maxVer
>=
pReader
->
sver
)
{
if
(
pReader
->
pBlockL
->
minVer
<=
pReader
->
ever
&&
pReader
->
pBlockL
->
maxVer
>=
pReader
->
sver
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录