Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8f61e2d6
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
8f61e2d6
编写于
5月 29, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
953a69a8
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
46 addition
and
52 deletion
+46
-52
include/libs/executor/storageapi.h
include/libs/executor/storageapi.h
+30
-37
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+3
-5
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+1
-0
source/dnode/vnode/src/meta/metaCache.c
source/dnode/vnode/src/meta/metaCache.c
+4
-2
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+0
-2
source/dnode/vnode/src/vnd/vnodeInitApi.c
source/dnode/vnode/src/vnd/vnodeInitApi.c
+4
-1
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+3
-4
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+1
-1
未找到文件。
include/libs/executor/storageapi.h
浏览文件 @
8f61e2d6
...
...
@@ -144,6 +144,7 @@ typedef struct {
// int32_t setForSnapShot(SSnapContext *ctx, int64_t uid);
// int32_t destroySnapContext(SSnapContext *ctx);
// clang-format off
/*-------------------------------------------------new api format---------------------------------------------------*/
typedef
struct
TsdReader
{
int32_t
(
*
tsdReaderOpen
)(
void
*
pVnode
,
SQueryTableDataCond
*
pCond
,
void
*
pTableList
,
int32_t
numOfTables
,
...
...
@@ -174,6 +175,8 @@ typedef struct SStoreCacheReader {
int32_t
(
*
reuseReader
)(
void
*
pReader
,
void
*
pTableIdList
,
int32_t
numOfTables
);
}
SStoreCacheReader
;
// clang-format on
/*------------------------------------------------------------------------------------------------------------------*/
/*
void tqReaderSetColIdList(STqReader *pReader, SArray *pColIdList);
...
...
@@ -240,7 +243,6 @@ int32_t metaGetTableTags(SMeta *pMeta, uint64_t suid, SArray *uidList);
const void *metaGetTableTagVal(void *tag, int16_t type, STagVal *tagVal);
int metaGetTableNameByUid(void *meta, uint64_t uid, char *tbName);
int metaGetTableSzNameByUid(void *meta, uint64_t uid, char *tbName);
int metaGetTableUidByName(void *meta, char *tbName, uint64_t *uid);
int metaGetTableTypeByName(void *meta, char *tbName, ETableType *tbType);
bool metaIsTableExist(SMeta *pMeta, tb_uid_t uid);
...
...
@@ -250,8 +252,7 @@ int32_t metaUidFilterCachePut(SMeta *pMeta, uint64_t suid, const void *pKey, in
int32_t payloadLen, double selectivityRatio);
tb_uid_t metaGetTableEntryUidByName(SMeta *pMeta, const char *name);
int32_t metaGetCachedTbGroup(SMeta* pMeta, tb_uid_t suid, const uint8_t* pKey, int32_t keyLen, SArray** pList);
int32_t metaPutTbGroupToCache(SMeta* pMeta, uint64_t suid, const void* pKey, int32_t keyLen, void* pPayload,
int32_t payloadLen);
int32_t metaPutTbGroupToCache(SMeta* pMeta, uint64_t suid, const void* pKey, int32_t keyLen, void* pPayload, int32_t payloadLen);
*/
typedef
struct
SStoreMeta
{
...
...
@@ -269,20 +270,12 @@ typedef struct SStoreMeta {
int32_t
(
*
getTableNameByUid
)(
void
*
pVnode
,
uint64_t
uid
,
char
*
tbName
);
bool
(
*
isTableExisted
)(
void
*
pVnode
,
tb_uid_t
uid
);
/**
int32_t metaGetCachedTbGroup(SMeta* pMeta, tb_uid_t suid, const uint8_t* pKey, int32_t keyLen, SArray** pList);
int32_t metaPutTbGroupToCache(SMeta* pMeta, uint64_t suid, const void* pKey, int32_t keyLen, void* pPayload,
int32_t payloadLen);
*/
int32_t
(
*
getCachedTableList
)(
void
*
pVnode
,
tb_uid_t
suid
,
const
uint8_t
*
pKey
,
int32_t
keyLen
,
SArray
*
pList1
,
bool
*
acquireRes
);
int32_t
(
*
putCachedTableList
)(
void
*
pVnode
,
uint64_t
suid
,
const
void
*
pKey
,
int32_t
keyLen
,
void
*
pPayload
,
int32_t
payloadLen
,
double
selectivityRatio
);
// int32_t (*clearCachedTableList)(void* pVnode, uint64_t suid);
int32_t
(
*
metaGetCachedTbGroup
)(
void
*
pVnode
,
tb_uid_t
suid
,
const
uint8_t
*
pKey
,
int32_t
keyLen
,
SArray
**
pList
);
int32_t
(
*
metaPutTbGroupToCache
)(
void
*
pVnode
,
uint64_t
suid
,
const
void
*
pKey
,
int32_t
keyLen
,
void
*
pPayload
,
int32_t
payloadLen
);
int32_t
(
*
getCachedTableList
)(
void
*
pVnode
,
tb_uid_t
suid
,
const
uint8_t
*
pKey
,
int32_t
keyLen
,
SArray
*
pList1
,
bool
*
acquireRes
);
int32_t
(
*
putCachedTableList
)(
void
*
pVnode
,
uint64_t
suid
,
const
void
*
pKey
,
int32_t
keyLen
,
void
*
pPayload
,
int32_t
payloadLen
,
double
selectivityRatio
);
/**
*
*/
void
*
(
*
storeGetIndexInfo
)();
void
*
(
*
getInvertIndex
)(
void
*
pVnode
);
int32_t
(
*
getChildTableList
)(
void
*
pVnode
,
int64_t
suid
,
SArray
*
list
);
// support filter and non-filter cases. [vnodeGetCtbIdList & vnodeGetCtbIdListByFilter]
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
8f61e2d6
...
...
@@ -120,13 +120,11 @@ int32_t metaGetCachedTableUidList(void *pVnode, tb_uid_t suid, const uint8_t *k
int32_t
metaUidFilterCachePut
(
void
*
pVnode
,
uint64_t
suid
,
const
void
*
pKey
,
int32_t
keyLen
,
void
*
pPayload
,
int32_t
payloadLen
,
double
selectivityRatio
);
tb_uid_t
metaGetTableEntryUidByName
(
SMeta
*
pMeta
,
const
char
*
name
);
int32_t
metaTbGroupCacheClear
(
SMeta
*
pMeta
,
uint64_t
suid
);
int32_t
metaGetCachedTbGroup
(
SMeta
*
pMeta
,
tb_uid_t
suid
,
const
uint8_t
*
pKey
,
int32_t
keyLen
,
SArray
**
pList
);
int32_t
metaPutTbGroupToCache
(
SMeta
*
pMeta
,
uint64_t
suid
,
const
void
*
pKey
,
int32_t
keyLen
,
void
*
pPayload
,
int32_t
metaGetCachedTbGroup
(
void
*
pVnode
,
tb_uid_t
suid
,
const
uint8_t
*
pKey
,
int32_t
keyLen
,
SArray
**
pList
);
int32_t
metaPutTbGroupToCache
(
void
*
pVnode
,
uint64_t
suid
,
const
void
*
pKey
,
int32_t
keyLen
,
void
*
pPayload
,
int32_t
payloadLen
);
int64_t
metaGetTbNum
(
SMeta
*
pMeta
);
int64_t
metaGetNtbNum
(
SMeta
*
pMeta
);
int32_t
metaGetStbStats
(
void
*
pVnode
,
int64_t
uid
,
int64_t
*
numOfTables
);
...
...
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
8f61e2d6
...
...
@@ -155,6 +155,7 @@ int metaGetTableEntryByName(SMetaReader* pReader, const char* name);
int
metaAlterCache
(
SMeta
*
pMeta
,
int32_t
nPage
);
int32_t
metaUidCacheClear
(
SMeta
*
pMeta
,
uint64_t
suid
);
int32_t
metaTbGroupCacheClear
(
SMeta
*
pMeta
,
uint64_t
suid
);
int
metaAddIndexToSTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVCreateStbReq
*
pReq
);
int
metaDropIndexFromSTable
(
SMeta
*
pMeta
,
int64_t
version
,
SDropIndexReq
*
pReq
);
...
...
source/dnode/vnode/src/meta/metaCache.c
浏览文件 @
8f61e2d6
...
...
@@ -704,7 +704,8 @@ int32_t metaUidCacheClear(SMeta* pMeta, uint64_t suid) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
metaGetCachedTbGroup
(
SMeta
*
pMeta
,
tb_uid_t
suid
,
const
uint8_t
*
pKey
,
int32_t
keyLen
,
SArray
**
pList
)
{
int32_t
metaGetCachedTbGroup
(
void
*
pVnode
,
tb_uid_t
suid
,
const
uint8_t
*
pKey
,
int32_t
keyLen
,
SArray
**
pList
)
{
SMeta
*
pMeta
=
((
SVnode
*
)
pVnode
)
->
pMeta
;
int32_t
vgId
=
TD_VID
(
pMeta
->
pVnode
);
// generate the composed key for LRU cache
...
...
@@ -788,9 +789,10 @@ static void freeTbGroupCachePayload(const void* key, size_t keyLen, void* value)
}
int32_t
metaPutTbGroupToCache
(
SMeta
*
pMeta
,
uint64_t
suid
,
const
void
*
pKey
,
int32_t
keyLen
,
void
*
pPayload
,
int32_t
metaPutTbGroupToCache
(
void
*
pVnode
,
uint64_t
suid
,
const
void
*
pKey
,
int32_t
keyLen
,
void
*
pPayload
,
int32_t
payloadLen
)
{
int32_t
code
=
0
;
SMeta
*
pMeta
=
((
SVnode
*
)
pVnode
)
->
pMeta
;
int32_t
vgId
=
TD_VID
(
pMeta
->
pVnode
);
if
(
payloadLen
>
tsTagFilterResCacheSize
)
{
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
8f61e2d6
...
...
@@ -700,8 +700,6 @@ int64_t metaGetTimeSeriesNum(SMeta *pMeta) {
return
pMeta
->
pVnode
->
config
.
vndStats
.
numOfTimeSeries
+
pMeta
->
pVnode
->
config
.
vndStats
.
numOfNTimeSeries
;
}
int64_t
metaGetNtbNum
(
SMeta
*
pMeta
)
{
return
pMeta
->
pVnode
->
config
.
vndStats
.
numOfNTables
;
}
typedef
struct
{
SMeta
*
pMeta
;
TBC
*
pCur
;
...
...
source/dnode/vnode/src/vnd/vnodeInitApi.c
浏览文件 @
8f61e2d6
...
...
@@ -31,10 +31,10 @@ static void initSnapshotFn(SStoreSnapshotFn* pSnapshot);
void
initStorageAPI
(
SStorageAPI
*
pAPI
)
{
initTsdbReaderAPI
(
&
pAPI
->
tsdReader
);
initMetadataAPI
(
&
pAPI
->
metaFn
);
initTqAPI
(
&
pAPI
->
tqReaderFn
);
initStateStoreAPI
(
&
pAPI
->
stateStore
);
initMetaReaderAPI
(
&
pAPI
->
metaReaderFn
);
initMetaFilterAPI
(
&
pAPI
->
metaFilter
);
initTqAPI
(
&
pAPI
->
tqReaderFn
);
initFunctionStateStore
(
&
pAPI
->
functionStore
);
initCacheFn
(
&
pAPI
->
cacheFn
);
initSnapshotFn
(
&
pAPI
->
snapshotFn
);
...
...
@@ -91,6 +91,9 @@ void initMetadataAPI(SStoreMeta* pMeta) {
pMeta
->
getCachedTableList
=
metaGetCachedTableUidList
;
pMeta
->
putCachedTableList
=
metaUidFilterCachePut
;
pMeta
->
metaGetCachedTbGroup
=
metaGetCachedTbGroup
;
pMeta
->
metaPutTbGroupToCache
=
metaPutTbGroupToCache
;
}
void
initTqAPI
(
SStoreTqReader
*
pTq
)
{
...
...
source/libs/executor/src/executil.c
浏览文件 @
8f61e2d6
...
...
@@ -494,8 +494,8 @@ int32_t getColInfoResultForGroupby(void* pVnode, SNodeList* group, STableListInf
listNode
->
pNodeList
=
group
;
genTbGroupDigest
((
SNode
*
)
listNode
,
digest
,
&
context
);
nodesFree
(
listNode
);
ASSERT
(
0
);
// pAPI->metaFn.getCachedTableList(pVnode, pTableListInfo->idInfo.suid, context.digest, tListLen(context.digest), &tableList, true
);
pAPI
->
metaFn
.
metaGetCachedTbGroup
(
pVnode
,
pTableListInfo
->
idInfo
.
suid
,
context
.
digest
,
tListLen
(
context
.
digest
),
&
tableList
);
if
(
tableList
)
{
taosArrayDestroy
(
pTableListInfo
->
pTableList
);
pTableListInfo
->
pTableList
=
tableList
;
...
...
@@ -630,10 +630,9 @@ int32_t getColInfoResultForGroupby(void* pVnode, SNodeList* group, STableListInf
info
->
groupId
=
calcGroupId
(
keyBuf
,
len
);
}
ASSERT
(
0
);
if
(
tsTagFilterCache
)
{
tableList
=
taosArrayDup
(
pTableListInfo
->
pTableList
,
NULL
);
// pAPI->metaFn.putCachedTableList
(pVnode, pTableListInfo->idInfo.suid, context.digest, tListLen(context.digest), tableList, taosArrayGetSize(tableList) * sizeof(STableKeyInfo));
pAPI
->
metaFn
.
metaPutTbGroupToCache
(
pVnode
,
pTableListInfo
->
idInfo
.
suid
,
context
.
digest
,
tListLen
(
context
.
digest
),
tableList
,
taosArrayGetSize
(
tableList
)
*
sizeof
(
STableKeyInfo
));
}
// int64_t st2 = taosGetTimestampUs();
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
8f61e2d6
...
...
@@ -3446,7 +3446,7 @@ static void buildVnodeGroupedNtbTableCount(STableCountScanOperatorInfo* pInfo, S
uint64_t
groupId
=
calcGroupId
(
fullStbName
,
strlen
(
fullStbName
));
pRes
->
info
.
id
.
groupId
=
groupId
;
int64_t
numOfTables
=
0
;
//metaGetNtbNum(pInfo->readHandle.vnode);
int64_t
numOfTables
=
0
;
pAPI
->
metaFn
.
getBasicInfo
(
pInfo
->
readHandle
.
vnode
,
NULL
,
NULL
,
NULL
,
&
numOfTables
);
if
(
numOfTables
!=
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录