Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6dcdafa4
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看板
提交
6dcdafa4
编写于
12月 01, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
bd56fd2e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
16 deletion
+15
-16
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+2
-2
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+6
-6
source/dnode/vnode/src/tsdb/tsdbMemTable.c
source/dnode/vnode/src/tsdb/tsdbMemTable.c
+7
-8
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
6dcdafa4
...
...
@@ -745,8 +745,8 @@ typedef struct {
int32_t
tsdbOpenCache
(
STsdb
*
pTsdb
);
void
tsdbCloseCache
(
STsdb
*
pTsdb
);
int32_t
tsdbCacheInsertLast
(
SLRUCache
*
pCache
,
tb_uid_t
uid
,
SRow
*
row
,
STsdb
*
pTsdb
);
int32_t
tsdbCacheInsertLastrow
(
SLRUCache
*
pCache
,
STsdb
*
pTsdb
,
tb_uid_t
uid
,
SRow
*
row
,
bool
dup
);
int32_t
tsdbCacheInsertLast
(
SLRUCache
*
pCache
,
tb_uid_t
uid
,
TSDBROW
*
row
,
STsdb
*
pTsdb
);
int32_t
tsdbCacheInsertLastrow
(
SLRUCache
*
pCache
,
STsdb
*
pTsdb
,
tb_uid_t
uid
,
TSDBROW
*
row
,
bool
dup
);
int32_t
tsdbCacheGetLastH
(
SLRUCache
*
pCache
,
tb_uid_t
uid
,
SCacheRowsReader
*
pr
,
LRUHandle
**
h
);
int32_t
tsdbCacheGetLastrowH
(
SLRUCache
*
pCache
,
tb_uid_t
uid
,
SCacheRowsReader
*
pr
,
LRUHandle
**
h
);
int32_t
tsdbCacheRelease
(
SLRUCache
*
pCache
,
LRUHandle
*
h
);
...
...
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
6dcdafa4
...
...
@@ -190,7 +190,7 @@ int32_t tsdbCacheDelete(SLRUCache *pCache, tb_uid_t uid, TSKEY eKey) {
return
code
;
}
int32_t
tsdbCacheInsertLastrow
(
SLRUCache
*
pCache
,
STsdb
*
pTsdb
,
tb_uid_t
uid
,
SRow
*
row
,
bool
dup
)
{
int32_t
tsdbCacheInsertLastrow
(
SLRUCache
*
pCache
,
STsdb
*
pTsdb
,
tb_uid_t
uid
,
TSDBROW
*
row
,
bool
dup
)
{
int32_t
code
=
0
;
STSRow
*
cacheRow
=
NULL
;
char
key
[
32
]
=
{
0
};
...
...
@@ -201,7 +201,7 @@ int32_t tsdbCacheInsertLastrow(SLRUCache *pCache, STsdb *pTsdb, tb_uid_t uid, SR
LRUHandle
*
h
=
taosLRUCacheLookup
(
pCache
,
key
,
keyLen
);
if
(
h
)
{
STSchema
*
pTSchema
=
metaGetTbTSchema
(
pTsdb
->
pVnode
->
pMeta
,
uid
,
-
1
,
1
);
TSKEY
keyTs
=
row
->
ts
;
TSKEY
keyTs
=
TSDBROW_TS
(
row
)
;
bool
invalidate
=
false
;
SArray
*
pLast
=
(
SArray
*
)
taosLRUCacheValue
(
pCache
,
h
);
...
...
@@ -222,7 +222,7 @@ int32_t tsdbCacheInsertLastrow(SLRUCache *pCache, STsdb *pTsdb, tb_uid_t uid, SR
SColVal
*
tColVal
=
&
tTsVal1
->
colVal
;
SColVal
colVal
=
{
0
};
t
RowGet
(
row
,
pTSchema
,
iCol
,
&
colVal
);
t
sdbRowGetColVal
(
row
,
pTSchema
,
iCol
,
&
colVal
);
if
(
!
COL_VAL_IS_NONE
(
&
colVal
))
{
if
(
keyTs
==
tTsVal1
->
ts
&&
!
COL_VAL_IS_NONE
(
tColVal
))
{
invalidate
=
true
;
...
...
@@ -316,7 +316,7 @@ int32_t tsdbCacheInsertLastrow(SLRUCache *pCache, STsdb *pTsdb, tb_uid_t uid, SR
return
code
;
}
int32_t
tsdbCacheInsertLast
(
SLRUCache
*
pCache
,
tb_uid_t
uid
,
SRow
*
row
,
STsdb
*
pTsdb
)
{
int32_t
tsdbCacheInsertLast
(
SLRUCache
*
pCache
,
tb_uid_t
uid
,
TSDBROW
*
row
,
STsdb
*
pTsdb
)
{
int32_t
code
=
0
;
STSRow
*
cacheRow
=
NULL
;
char
key
[
32
]
=
{
0
};
...
...
@@ -327,7 +327,7 @@ int32_t tsdbCacheInsertLast(SLRUCache *pCache, tb_uid_t uid, SRow *row, STsdb *p
LRUHandle
*
h
=
taosLRUCacheLookup
(
pCache
,
key
,
keyLen
);
if
(
h
)
{
STSchema
*
pTSchema
=
metaGetTbTSchema
(
pTsdb
->
pVnode
->
pMeta
,
uid
,
-
1
,
1
);
TSKEY
keyTs
=
row
->
ts
;
TSKEY
keyTs
=
TSDBROW_TS
(
row
)
;
bool
invalidate
=
false
;
SArray
*
pLast
=
(
SArray
*
)
taosLRUCacheValue
(
pCache
,
h
);
...
...
@@ -348,7 +348,7 @@ int32_t tsdbCacheInsertLast(SLRUCache *pCache, tb_uid_t uid, SRow *row, STsdb *p
SColVal
*
tColVal
=
&
tTsVal1
->
colVal
;
SColVal
colVal
=
{
0
};
t
RowGet
(
row
,
pTSchema
,
iCol
,
&
colVal
);
t
sdbRowGetColVal
(
row
,
pTSchema
,
iCol
,
&
colVal
);
if
(
!
COL_VAL_IS_VALUE
(
&
colVal
))
{
if
(
keyTs
==
tTsVal1
->
ts
&&
COL_VAL_IS_VALUE
(
tColVal
))
{
invalidate
=
true
;
...
...
source/dnode/vnode/src/tsdb/tsdbMemTable.c
浏览文件 @
6dcdafa4
...
...
@@ -647,12 +647,12 @@ static int32_t tsdbInsertColDataToTable(SMemTable *pMemTable, STbData *pTbData,
pTbData
->
maxKey
=
key
.
ts
;
if
(
TSDB_CACHE_LAST_ROW
(
pMemTable
->
pTsdb
->
pVnode
->
config
))
{
// tsdbCacheInsertLastrow(pMemTable->pTsdb->lruCache, pMemTable->pTsdb, pTbData->uid, pLast
Row, true);
tsdbCacheInsertLastrow
(
pMemTable
->
pTsdb
->
lruCache
,
pMemTable
->
pTsdb
,
pTbData
->
uid
,
&
l
Row
,
true
);
}
}
if
(
TSDB_CACHE_LAST
(
pMemTable
->
pTsdb
->
pVnode
->
config
))
{
// tsdbCacheInsertLast(pMemTable->pTsdb->lruCache, pTbData->uid, pLast
Row, pMemTable->pTsdb);
tsdbCacheInsertLast
(
pMemTable
->
pTsdb
->
lruCache
,
pTbData
->
uid
,
&
l
Row
,
pMemTable
->
pTsdb
);
}
// SMemTable
...
...
@@ -676,7 +676,7 @@ static int32_t tsdbInsertRowDataToTable(SMemTable *pMemTable, STbData *pTbData,
SMemSkipListNode
*
pos
[
SL_MAX_LEVEL
];
TSDBROW
tRow
=
{.
type
=
TSDBROW_ROW_FMT
,
.
version
=
version
};
int32_t
iRow
=
0
;
SRow
*
pLastRow
=
NULL
;
TSDBROW
lRow
;
// backward put first data
tRow
.
pTSRow
=
aRow
[
iRow
++
];
...
...
@@ -684,11 +684,10 @@ static int32_t tsdbInsertRowDataToTable(SMemTable *pMemTable, STbData *pTbData,
tbDataMovePosTo
(
pTbData
,
pos
,
&
key
,
SL_MOVE_BACKWARD
);
code
=
tbDataDoPut
(
pMemTable
,
pTbData
,
pos
,
&
tRow
,
0
);
if
(
code
)
goto
_exit
;
lRow
=
tRow
;
pTbData
->
minKey
=
TMIN
(
pTbData
->
minKey
,
key
.
ts
);
pLastRow
=
tRow
.
pTSRow
;
// forward put rest data
if
(
iRow
<
nRow
)
{
for
(
int8_t
iLevel
=
pos
[
0
]
->
level
;
iLevel
<
pTbData
->
sl
.
maxLevel
;
iLevel
++
)
{
...
...
@@ -706,7 +705,7 @@ static int32_t tsdbInsertRowDataToTable(SMemTable *pMemTable, STbData *pTbData,
code
=
tbDataDoPut
(
pMemTable
,
pTbData
,
pos
,
&
tRow
,
1
);
if
(
code
)
goto
_exit
;
pLastRow
=
tRow
.
pTS
Row
;
lRow
=
t
Row
;
iRow
++
;
}
...
...
@@ -716,12 +715,12 @@ static int32_t tsdbInsertRowDataToTable(SMemTable *pMemTable, STbData *pTbData,
pTbData
->
maxKey
=
key
.
ts
;
if
(
TSDB_CACHE_LAST_ROW
(
pMemTable
->
pTsdb
->
pVnode
->
config
))
{
tsdbCacheInsertLastrow
(
pMemTable
->
pTsdb
->
lruCache
,
pMemTable
->
pTsdb
,
pTbData
->
uid
,
pLast
Row
,
true
);
tsdbCacheInsertLastrow
(
pMemTable
->
pTsdb
->
lruCache
,
pMemTable
->
pTsdb
,
pTbData
->
uid
,
&
l
Row
,
true
);
}
}
if
(
TSDB_CACHE_LAST
(
pMemTable
->
pTsdb
->
pVnode
->
config
))
{
tsdbCacheInsertLast
(
pMemTable
->
pTsdb
->
lruCache
,
pTbData
->
uid
,
pLast
Row
,
pMemTable
->
pTsdb
);
tsdbCacheInsertLast
(
pMemTable
->
pTsdb
->
lruCache
,
pTbData
->
uid
,
&
l
Row
,
pMemTable
->
pTsdb
);
}
// SMemTable
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录