Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fbc4d649
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
fbc4d649
编写于
6月 01, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
d4f4ac1d
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
204 addition
and
152 deletion
+204
-152
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+1
-0
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h
+5
-5
source/dnode/vnode/src/tsdb/dev/inc/tsdbUtil.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbUtil.h
+11
-11
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
+170
-119
source/dnode/vnode/src/tsdb/dev/tsdbUtil.c
source/dnode/vnode/src/tsdb/dev/tsdbUtil.c
+16
-16
source/dnode/vnode/src/tsdb/tsdbUtil.c
source/dnode/vnode/src/tsdb/tsdbUtil.c
+1
-1
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
fbc4d649
...
...
@@ -165,6 +165,7 @@ void tBlockDataDestroy(SBlockData *pBlockData);
int32_t
tBlockDataInit
(
SBlockData
*
pBlockData
,
TABLEID
*
pId
,
STSchema
*
pTSchema
,
int16_t
*
aCid
,
int32_t
nCid
);
void
tBlockDataReset
(
SBlockData
*
pBlockData
);
int32_t
tBlockDataAppendRow
(
SBlockData
*
pBlockData
,
TSDBROW
*
pRow
,
STSchema
*
pTSchema
,
int64_t
uid
);
int32_t
tBlockDataUpdateRow
(
SBlockData
*
pBlockData
,
TSDBROW
*
pRow
,
STSchema
*
pTSchema
);
int32_t
tBlockDataTryUpsertRow
(
SBlockData
*
pBlockData
,
TSDBROW
*
pRow
,
int64_t
uid
);
int32_t
tBlockDataUpsertRow
(
SBlockData
*
pBlockData
,
TSDBROW
*
pRow
,
STSchema
*
pTSchema
,
int64_t
uid
);
void
tBlockDataClear
(
SBlockData
*
pBlockData
);
...
...
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h
浏览文件 @
fbc4d649
...
...
@@ -24,8 +24,8 @@ extern "C" {
#endif
typedef
TARRAY2
(
SSttBlk
)
TSttBlkArray
;
typedef
TARRAY2
(
SStatisBlk
)
TStatisBlkArray
;
typedef
TARRAY2
(
SDelBlk
)
TDelBlkArray
;
typedef
TARRAY2
(
STbStatisBlk
)
TStatisBlkArray
;
// SSttFileReader ==========================================
typedef
struct
SSttFileReader
SSttFileReader
;
...
...
@@ -41,20 +41,20 @@ int32_t tsdbSttFileReaderGetSegReader(SSttFileReader *reader, const TSttSegReade
// SSttSegReader
int32_t
tsdbSttFileReadSttBlk
(
SSttSegReader
*
reader
,
const
TSttBlkArray
**
sttBlkArray
);
int32_t
tsdbSttFileReadDelBlk
(
SSttSegReader
*
reader
,
const
TDelBlkArray
**
delBlkArray
);
int32_t
tsdbSttFileReadStatisBlk
(
SSttSegReader
*
reader
,
const
TStatisBlkArray
**
statisBlkArray
);
int32_t
tsdbSttFileReadDelBlk
(
SSttSegReader
*
reader
,
const
TDelBlkArray
**
delBlkArray
);
int32_t
tsdbSttFileReadSttBlock
(
SSttSegReader
*
reader
,
const
SSttBlk
*
sttBlk
,
SBlockData
*
bData
);
int32_t
tsdbSttFileReadDelBlock
(
SSttSegReader
*
reader
,
const
SDelBlk
*
delBlk
,
SDelBlock
*
dData
);
int32_t
tsdbSttFileReadStatisBlock
(
SSttSegReader
*
reader
,
const
S
Tb
StatisBlk
*
statisBlk
,
STbStatisBlock
*
sData
);
int32_t
tsdbSttFileReadStatisBlock
(
SSttSegReader
*
reader
,
const
SStatisBlk
*
statisBlk
,
STbStatisBlock
*
sData
);
struct
SSttFileReaderConfig
{
STsdb
*
tsdb
;
int32_t
szPage
;
STFile
file
[
1
];
SSkmInfo
*
skmTb
;
SSkmInfo
*
skmRow
;
uint8_t
**
aBuf
;
int32_t
szPage
;
STFile
file
[
1
];
};
// SSttFileWriter ==========================================
...
...
source/dnode/vnode/src/tsdb/dev/inc/tsdbUtil.h
浏览文件 @
fbc4d649
...
...
@@ -37,7 +37,7 @@ typedef union {
}
SDelRecord
;
typedef
union
{
TARRAY2
(
int64_t
)
aData
[
DEL_RECORD_NUM_ELEM
];
TARRAY2
(
int64_t
)
dataArr
[
DEL_RECORD_NUM_ELEM
];
struct
{
TARRAY2
(
int64_t
)
suid
[
1
];
TARRAY2
(
int64_t
)
uid
[
1
];
...
...
@@ -74,9 +74,9 @@ typedef union {
int64_t
suid
;
int64_t
uid
;
int64_t
firstKey
;
int64_t
firstVer
;
int64_t
first
Key
Ver
;
int64_t
lastKey
;
int64_t
lastVer
;
int64_t
last
Key
Ver
;
int64_t
minVer
;
int64_t
maxVer
;
int64_t
count
;
...
...
@@ -84,29 +84,29 @@ typedef union {
}
STbStatisRecord
;
typedef
union
{
TARRAY2
(
int64_t
)
aData
[
STATIS_RECORD_NUM_ELEM
];
TARRAY2
(
int64_t
)
dataArr
[
STATIS_RECORD_NUM_ELEM
];
struct
{
TARRAY2
(
int64_t
)
suid
[
1
];
TARRAY2
(
int64_t
)
uid
[
1
];
TARRAY2
(
int64_t
)
firstKey
[
1
];
TARRAY2
(
int64_t
)
firstVer
[
1
];
TARRAY2
(
int64_t
)
first
Key
Ver
[
1
];
TARRAY2
(
int64_t
)
lastKey
[
1
];
TARRAY2
(
int64_t
)
lastVer
[
1
];
TARRAY2
(
int64_t
)
last
Key
Ver
[
1
];
TARRAY2
(
int64_t
)
minVer
[
1
];
TARRAY2
(
int64_t
)
maxVer
[
1
];
TARRAY2
(
int64_t
)
aC
ount
[
1
];
TARRAY2
(
int64_t
)
c
ount
[
1
];
};
}
STbStatisBlock
;
typedef
struct
S
Tb
StatisBlk
{
typedef
struct
SStatisBlk
{
int32_t
numRec
;
int32_t
size
[
STATIS_RECORD_NUM_ELEM
];
TABLEID
minTid
;
TABLEID
maxTid
;
TABLEID
minT
b
id
;
TABLEID
maxT
b
id
;
int64_t
minVer
;
int64_t
maxVer
;
SFDataPtr
dp
[
1
];
}
S
Tb
StatisBlk
;
}
SStatisBlk
;
#define STATIS_BLOCK_SIZE(db) TARRAY2_SIZE((db)->suid)
...
...
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
浏览文件 @
fbc4d649
此差异已折叠。
点击以展开。
source/dnode/vnode/src/tsdb/dev/tsdbUtil.c
浏览文件 @
fbc4d649
...
...
@@ -17,29 +17,29 @@
// SDelBlock ----------
int32_t
tDelBlockInit
(
SDelBlock
*
delBlock
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
delBlock
->
aData
);
++
i
)
{
TARRAY2_INIT
(
&
delBlock
->
aData
[
i
]);
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
delBlock
->
dataArr
);
++
i
)
{
TARRAY2_INIT
(
&
delBlock
->
dataArr
[
i
]);
}
return
0
;
}
int32_t
tDelBlockFree
(
SDelBlock
*
delBlock
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
delBlock
->
aData
);
++
i
)
{
TARRAY2_FREE
(
&
delBlock
->
aData
[
i
]);
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
delBlock
->
dataArr
);
++
i
)
{
TARRAY2_FREE
(
&
delBlock
->
dataArr
[
i
]);
}
return
0
;
}
int32_t
tDelBlockClear
(
SDelBlock
*
delBlock
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
delBlock
->
aData
);
++
i
)
{
TARRAY2_CLEAR
(
&
delBlock
->
aData
[
i
],
NULL
);
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
delBlock
->
dataArr
);
++
i
)
{
TARRAY2_CLEAR
(
&
delBlock
->
dataArr
[
i
],
NULL
);
}
return
0
;
}
int32_t
tDelBlockPut
(
SDelBlock
*
delBlock
,
const
SDelRecord
*
delRecord
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
delBlock
->
aData
);
++
i
)
{
int32_t
code
=
TARRAY2_APPEND
(
&
delBlock
->
aData
[
i
],
delRecord
->
aData
[
i
]);
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
delBlock
->
dataArr
);
++
i
)
{
int32_t
code
=
TARRAY2_APPEND
(
&
delBlock
->
dataArr
[
i
],
delRecord
->
aData
[
i
]);
if
(
code
)
return
code
;
}
return
0
;
...
...
@@ -57,29 +57,29 @@ int32_t tDelBlockDecode(const void *buf, SDelBlock *delBlock) {
// STbStatisBlock ----------
int32_t
tStatisBlockInit
(
STbStatisBlock
*
statisBlock
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
aData
);
++
i
)
{
TARRAY2_INIT
(
&
statisBlock
->
aData
[
i
]);
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
dataArr
);
++
i
)
{
TARRAY2_INIT
(
&
statisBlock
->
dataArr
[
i
]);
}
return
0
;
}
int32_t
tStatisBlockFree
(
STbStatisBlock
*
statisBlock
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
aData
);
++
i
)
{
TARRAY2_FREE
(
&
statisBlock
->
aData
[
i
]);
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
dataArr
);
++
i
)
{
TARRAY2_FREE
(
&
statisBlock
->
dataArr
[
i
]);
}
return
0
;
}
int32_t
tStatisBlockClear
(
STbStatisBlock
*
statisBlock
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
aData
);
++
i
)
{
TARRAY2_CLEAR
(
&
statisBlock
->
aData
[
i
],
NULL
);
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
dataArr
);
++
i
)
{
TARRAY2_CLEAR
(
&
statisBlock
->
dataArr
[
i
],
NULL
);
}
return
0
;
}
int32_t
tStatisBlockPut
(
STbStatisBlock
*
statisBlock
,
const
STbStatisRecord
*
statisRecord
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
aData
);
++
i
)
{
int32_t
code
=
TARRAY2_APPEND
(
&
statisBlock
->
aData
[
i
],
statisRecord
->
aData
[
i
]);
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
dataArr
);
++
i
)
{
int32_t
code
=
TARRAY2_APPEND
(
&
statisBlock
->
dataArr
[
i
],
statisRecord
->
aData
[
i
]);
if
(
code
)
return
code
;
}
return
0
;
...
...
source/dnode/vnode/src/tsdb/tsdbUtil.c
浏览文件 @
fbc4d649
...
...
@@ -1237,7 +1237,7 @@ int32_t tBlockDataAppendRow(SBlockData *pBlockData, TSDBROW *pRow, STSchema *pTS
_exit:
return
code
;
}
static
int32_t
tBlockDataUpdateRow
(
SBlockData
*
pBlockData
,
TSDBROW
*
pRow
,
STSchema
*
pTSchema
)
{
int32_t
tBlockDataUpdateRow
(
SBlockData
*
pBlockData
,
TSDBROW
*
pRow
,
STSchema
*
pTSchema
)
{
int32_t
code
=
0
;
// version
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录