Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
86e3c1d2
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
86e3c1d2
编写于
5月 17, 2023
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cache/stt: remove ts from merge tree loading
上级
756fefaa
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
17 deletion
+28
-17
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+14
-10
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
+14
-7
未找到文件。
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
86e3c1d2
...
...
@@ -716,9 +716,7 @@ static int32_t tsdbCacheLoadFromRocks(STsdb *pTsdb, tb_uid_t uid, SArray *pLastA
SLRUCache
*
pCache
=
pTsdb
->
lruCache
;
for
(
int
i
=
0
,
j
=
0
;
i
<
num_keys
&&
j
<
TARRAY_SIZE
(
remainCols
);
++
i
)
{
SLastCol
*
pLastCol
=
tsdbCacheDeserialize
(
values_list
[
i
]);
SIdxKey
*
idxKey
=
taosArrayGet
(
remainCols
,
j
);
int16_t
cid
=
idxKey
->
key
.
cid
;
SLastCol
noneCol
=
{.
ts
=
TSKEY_MIN
,
.
colVal
=
COL_VAL_NONE
(
cid
,
pr
->
pSchema
->
columns
[
pr
->
pSlotIds
[
i
]].
type
)};
SIdxKey
*
idxKey
=
&
((
SIdxKey
*
)
TARRAY_DATA
(
remainCols
))[
j
];
if
(
pLastCol
)
{
SLastCol
*
pTmpLastCol
=
taosMemoryCalloc
(
1
,
sizeof
(
SLastCol
));
*
pTmpLastCol
=
*
pLastCol
;
...
...
@@ -747,6 +745,7 @@ static int32_t tsdbCacheLoadFromRocks(STsdb *pTsdb, tb_uid_t uid, SArray *pLastA
++
j
;
}
}
taosMemoryFree
(
values_list
);
taosMemoryFree
(
values_list_sizes
);
...
...
@@ -759,14 +758,13 @@ static int32_t tsdbCacheLoadFromRocks(STsdb *pTsdb, tb_uid_t uid, SArray *pLastA
int32_t
tsdbCacheGetBatch
(
STsdb
*
pTsdb
,
tb_uid_t
uid
,
SArray
*
pLastArray
,
SCacheRowsReader
*
pr
,
int8_t
ltype
)
{
int32_t
code
=
0
;
SArray
*
remainCols
=
NULL
;
SLRUCache
*
pCache
=
pTsdb
->
lruCache
;
SArray
*
pCidList
=
pr
->
pCidList
;
int
num_keys
=
TARRAY_SIZE
(
pCidList
);
SArray
*
remainCols
=
NULL
;
for
(
int
i
=
0
;
i
<
num_keys
;
++
i
)
{
int16_t
cid
=
*
(
int16_t
*
)
taosArrayGet
(
pCidList
,
i
)
;
int16_t
cid
=
((
int16_t
*
)
TARRAY_DATA
(
pCidList
))[
i
]
;
SLastKey
*
key
=
&
(
SLastKey
){.
ltype
=
ltype
,
.
uid
=
uid
,
.
cid
=
cid
};
...
...
@@ -775,7 +773,7 @@ int32_t tsdbCacheGetBatch(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCache
SLastCol
*
pLastCol
=
(
SLastCol
*
)
taosLRUCacheValue
(
pCache
,
h
);
SLastCol
lastCol
=
*
pLastCol
;
reallocVarData
(
&
lastCol
.
colVal
);
//
reallocVarData(&lastCol.colVal);
taosArrayPush
(
pLastArray
,
&
lastCol
);
if
(
h
)
{
...
...
@@ -796,7 +794,7 @@ int32_t tsdbCacheGetBatch(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArray, SCache
if
(
remainCols
&&
TARRAY_SIZE
(
remainCols
)
>
0
)
{
taosThreadMutexLock
(
&
pTsdb
->
lruMutex
);
for
(
int
i
=
0
;
i
<
TARRAY_SIZE
(
remainCols
);)
{
SIdxKey
*
idxKey
=
taosArrayGet
(
remainCols
,
i
)
;
SIdxKey
*
idxKey
=
&
((
SIdxKey
*
)
TARRAY_DATA
(
remainCols
))[
i
]
;
LRUHandle
*
h
=
taosLRUCacheLookup
(
pCache
,
&
idxKey
->
key
,
ROCKS_KEY_LEN
);
if
(
h
)
{
SLastCol
*
pLastCol
=
(
SLastCol
*
)
taosLRUCacheValue
(
pCache
,
h
);
...
...
@@ -1551,9 +1549,15 @@ static int32_t getNextRowFromFSLast(void *iter, TSDBROW **ppRow, bool *pIgnoreEa
if
(
code
)
goto
_err
;
}
int
nTmpCols
=
nCols
;
bool
hasTs
=
false
;
if
(
aCols
[
0
]
==
PRIMARYKEY_TIMESTAMP_COL_ID
)
{
--
nTmpCols
;
hasTs
=
true
;
}
for
(
int
i
=
0
;
i
<
state
->
pLoadInfo
->
numOfStt
;
++
i
)
{
state
->
pLoadInfo
[
i
].
colIds
=
aCols
;
state
->
pLoadInfo
[
i
].
numOfCols
=
nCols
;
state
->
pLoadInfo
[
i
].
colIds
=
hasTs
?
aCols
+
1
:
aCols
;
state
->
pLoadInfo
[
i
].
numOfCols
=
n
Tmp
Cols
;
state
->
pLoadInfo
[
i
].
isLast
=
isLast
;
}
tMergeTreeOpen
(
&
state
->
mergeTree
,
1
,
*
state
->
pDataFReader
,
state
->
suid
,
state
->
uid
,
...
...
source/dnode/vnode/src/tsdb/tsdbCacheRead.c
浏览文件 @
86e3c1d2
...
...
@@ -306,12 +306,14 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
tsdbCacheGetBatch
(
pr
->
pTsdb
,
pKeyInfo
->
uid
,
pRow
,
pr
,
ltype
);
// tsdbCacheGet(pr->pTsdb, pKeyInfo->uid, pRow, pr, ltype);
if
(
TARRAY_SIZE
(
pRow
)
<=
0
)
{
taosArrayClearEx
(
pRow
,
freeItem
);
// taosArrayClearEx(pRow, freeItem);
taosArrayClear
(
pRow
);
continue
;
}
SLastCol
*
pColVal
=
taosArrayGet
(
pRow
,
0
);
if
(
COL_VAL_IS_NONE
(
&
pColVal
->
colVal
))
{
taosArrayClearEx
(
pRow
,
freeItem
);
// taosArrayClearEx(pRow, freeItem);
taosArrayClear
(
pRow
);
continue
;
}
...
...
@@ -368,7 +370,8 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
taosArraySet
(
pTableUidList
,
0
,
&
pKeyInfo
->
uid
);
}
taosArrayClearEx
(
pRow
,
freeItem
);
// taosArrayClearEx(pRow, freeItem);
taosArrayClear
(
pRow
);
}
if
(
hasRes
)
{
...
...
@@ -380,17 +383,20 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32
tsdbCacheGetBatch
(
pr
->
pTsdb
,
uid
,
pRow
,
pr
,
ltype
);
if
(
TARRAY_SIZE
(
pRow
)
<=
0
)
{
taosArrayClearEx
(
pRow
,
freeItem
);
// taosArrayClearEx(pRow, freeItem);
taosArrayClear
(
pRow
);
continue
;
}
SLastCol
*
pColVal
=
(
SLastCol
*
)
taosArrayGet
(
pRow
,
0
);
if
(
COL_VAL_IS_NONE
(
&
pColVal
->
colVal
))
{
taosArrayClearEx
(
pRow
,
freeItem
);
// taosArrayClearEx(pRow, freeItem);
taosArrayClear
(
pRow
);
continue
;
}
saveOneRow
(
pRow
,
pResBlock
,
pr
,
slotIds
,
dstSlotIds
,
pRes
,
pr
->
idstr
);
taosArrayClearEx
(
pRow
,
freeItem
);
// taosArrayClearEx(pRow, freeItem);
taosArrayClear
(
pRow
);
taosArrayPush
(
pTableUidList
,
&
uid
);
...
...
@@ -418,7 +424,8 @@ _end:
}
taosMemoryFree
(
pRes
);
taosArrayDestroyEx
(
pRow
,
freeItem
);
// taosArrayDestroyEx(pRow, freeItem);
taosArrayDestroy
(
pRow
);
taosArrayDestroyEx
(
pLastCols
,
freeItem
);
return
code
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录