Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e24ce211
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看板
提交
e24ce211
编写于
5月 26, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: set function ptr.
上级
1e22d875
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
33 addition
and
21 deletion
+33
-21
include/libs/executor/storageapi.h
include/libs/executor/storageapi.h
+7
-7
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+2
-2
source/dnode/vnode/src/meta/metaSnapshot.c
source/dnode/vnode/src/meta/metaSnapshot.c
+3
-3
source/dnode/vnode/src/tq/tqMeta.c
source/dnode/vnode/src/tq/tqMeta.c
+2
-0
source/dnode/vnode/src/vnd/vnodeInitApi.c
source/dnode/vnode/src/vnd/vnodeInitApi.c
+9
-1
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+1
-1
source/libs/executor/src/operator.c
source/libs/executor/src/operator.c
+4
-3
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+5
-4
未找到文件。
include/libs/executor/storageapi.h
浏览文件 @
e24ce211
...
...
@@ -196,8 +196,8 @@ typedef struct {
// int32_t tqReaderSeek(STqReader *pReader, int64_t ver, const char *id);
// bool tqNextBlockInWal(STqReader* pReader, const char* idstr);
// bool tqNextBlockImpl(STqReader *pReader, const char* idstr);
// int32_t get
MetafromSnapS
hot(SSnapContext *ctx, void **pBuf, int32_t *contLen, int16_t *type, int64_t *uid);
// SMetaTableInfo get
UidfromSnapS
hot(SSnapContext *ctx);
// int32_t get
TableInfoFromSnaps
hot(SSnapContext *ctx, void **pBuf, int32_t *contLen, int16_t *type, int64_t *uid);
// SMetaTableInfo get
MetaTableInfoFromSnaps
hot(SSnapContext *ctx);
// int32_t setForSnapShot(SSnapContext *ctx, int64_t uid);
// int32_t destroySnapContext(SSnapContext *ctx);
...
...
@@ -310,15 +310,15 @@ typedef struct SStoreTqReader {
typedef
struct
SStoreSnapshotFn
{
/*
int32_t get
MetafromSnapS
hot(SSnapContext *ctx, void **pBuf, int32_t *contLen, int16_t *type, int64_t *uid);
SMetaTableInfo get
UidfromSnapS
hot(SSnapContext *ctx);
int32_t get
TableInfoFromSnaps
hot(SSnapContext *ctx, void **pBuf, int32_t *contLen, int16_t *type, int64_t *uid);
SMetaTableInfo get
MetaTableInfoFromSnaps
hot(SSnapContext *ctx);
int32_t setForSnapShot(SSnapContext *ctx, int64_t uid);
int32_t destroySnapContext(SSnapContext *ctx);
*/
int32_t
(
*
createSnapshot
)();
void
(
*
destroySnapshot
)();
SMetaTableInfo
(
*
getTableInfoFromSnapshot
)();
int32_t
(
*
get
Meta
InfoFromSnapshot
)();
int32_t
(
*
destroySnapshot
)();
SMetaTableInfo
(
*
get
Meta
TableInfoFromSnapshot
)();
int32_t
(
*
get
Table
InfoFromSnapshot
)();
}
SStoreSnapshotFn
;
/**
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
e24ce211
...
...
@@ -282,8 +282,8 @@ int32_t vnodeSnapWrite(SVSnapWriter *pWriter, uint8_t *pData, uint32_t nData);
int32_t
buildSnapContext
(
SVnode
*
pVnode
,
int64_t
snapVersion
,
int64_t
suid
,
int8_t
subType
,
bool
withMeta
,
SSnapContext
**
ctxRet
);
int32_t
get
MetafromSnapS
hot
(
SSnapContext
*
ctx
,
void
**
pBuf
,
int32_t
*
contLen
,
int16_t
*
type
,
int64_t
*
uid
);
SMetaTableInfo
get
UidfromSnapS
hot
(
SSnapContext
*
ctx
);
int32_t
get
TableInfoFromSnaps
hot
(
SSnapContext
*
ctx
,
void
**
pBuf
,
int32_t
*
contLen
,
int16_t
*
type
,
int64_t
*
uid
);
SMetaTableInfo
get
MetaTableInfoFromSnaps
hot
(
SSnapContext
*
ctx
);
int32_t
setForSnapShot
(
SSnapContext
*
ctx
,
int64_t
uid
);
int32_t
destroySnapContext
(
SSnapContext
*
ctx
);
...
...
source/dnode/vnode/src/meta/metaSnapshot.c
浏览文件 @
e24ce211
...
...
@@ -466,7 +466,7 @@ int32_t setForSnapShot(SSnapContext* ctx, int64_t uid) {
return
c
;
}
int32_t
get
MetafromSnapS
hot
(
SSnapContext
*
ctx
,
void
**
pBuf
,
int32_t
*
contLen
,
int16_t
*
type
,
int64_t
*
uid
)
{
int32_t
get
TableInfoFromSnaps
hot
(
SSnapContext
*
ctx
,
void
**
pBuf
,
int32_t
*
contLen
,
int16_t
*
type
,
int64_t
*
uid
)
{
int32_t
ret
=
0
;
void
*
pKey
=
NULL
;
void
*
pVal
=
NULL
;
...
...
@@ -598,7 +598,7 @@ int32_t getMetafromSnapShot(SSnapContext* ctx, void** pBuf, int32_t* contLen, in
return
ret
;
}
SMetaTableInfo
get
UidfromSnapS
hot
(
SSnapContext
*
ctx
)
{
SMetaTableInfo
get
MetaTableInfoFromSnaps
hot
(
SSnapContext
*
ctx
)
{
SMetaTableInfo
result
=
{
0
};
void
*
pKey
=
NULL
;
void
*
pVal
=
NULL
;
...
...
@@ -619,7 +619,7 @@ SMetaTableInfo getUidfromSnapShot(SSnapContext* ctx) {
int32_t
ret
=
MoveToPosition
(
ctx
,
idInfo
->
version
,
*
uidTmp
);
if
(
ret
!=
0
)
{
metaDebug
(
"tmqsnap get
UidfromSnapS
hot not exist uid:%"
PRIi64
" version:%"
PRIi64
,
*
uidTmp
,
idInfo
->
version
);
metaDebug
(
"tmqsnap get
MetaTableInfoFromSnaps
hot not exist uid:%"
PRIi64
" version:%"
PRIi64
,
*
uidTmp
,
idInfo
->
version
);
continue
;
}
tdbTbcGet
((
TBC
*
)
ctx
->
pCur
,
(
const
void
**
)
&
pKey
,
&
kLen
,
(
const
void
**
)
&
pVal
,
&
vLen
);
...
...
source/dnode/vnode/src/tq/tqMeta.c
浏览文件 @
e24ce211
...
...
@@ -304,6 +304,8 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
.
version
=
handle
.
snapshotVer
};
initStorageAPI
(
&
reader
.
api
);
if
(
handle
.
execHandle
.
subType
==
TOPIC_SUB_TYPE__COLUMN
)
{
handle
.
execHandle
.
task
=
qCreateQueueExecTaskInfo
(
handle
.
execHandle
.
execCol
.
qmsg
,
&
reader
,
vgId
,
&
handle
.
execHandle
.
numOfCols
,
0
);
...
...
source/dnode/vnode/src/vnd/vnodeInitApi.c
浏览文件 @
e24ce211
...
...
@@ -26,6 +26,7 @@ static void initMetaReaderAPI(SStoreMetaReader* pMetaReader);
static
void
initMetaFilterAPI
(
SMetaDataFilterAPI
*
pFilter
);
static
void
initFunctionStateStore
(
SFunctionStateStore
*
pStore
);
static
void
initCacheFn
(
SStoreCacheReader
*
pCache
);
static
void
initSnapshotFn
(
SStoreSnapshotFn
*
pSnapshot
);
void
initStorageAPI
(
SStorageAPI
*
pAPI
)
{
initTsdbReaderAPI
(
&
pAPI
->
tsdReader
);
...
...
@@ -36,6 +37,7 @@ void initStorageAPI(SStorageAPI* pAPI) {
initMetaFilterAPI
(
&
pAPI
->
metaFilter
);
initFunctionStateStore
(
&
pAPI
->
functionStore
);
initCacheFn
(
&
pAPI
->
cacheFn
);
initSnapshotFn
(
&
pAPI
->
snapshotFn
);
}
void
initTsdbReaderAPI
(
TsdReader
*
pReader
)
{
...
...
@@ -69,7 +71,6 @@ void initMetadataAPI(SStoreMeta* pMeta) {
pMeta
->
getBasicInfo
=
vnodeGetInfo
;
pMeta
->
getNumOfChildTables
=
metaGetStbStats
;
// pMeta->getNumOfRowsInMem = tsdbGetNumOfRowsInMemTable;
pMeta
->
getChildTableList
=
vnodeGetCtbIdList
;
...
...
@@ -224,4 +225,11 @@ void initCacheFn(SStoreCacheReader* pCache) {
pCache
->
closeReader
=
tsdbCacherowsReaderClose
;
pCache
->
retrieveRows
=
tsdbRetrieveCacheRows
;
pCache
->
reuseReader
=
tsdbReuseCacherowsReader
;
}
void
initSnapshotFn
(
SStoreSnapshotFn
*
pSnapshot
)
{
pSnapshot
->
createSnapshot
=
setForSnapShot
;
pSnapshot
->
destroySnapshot
=
destroySnapContext
;
pSnapshot
->
getMetaTableInfoFromSnapshot
=
getMetaTableInfoFromSnapshot
;
pSnapshot
->
getTableInfoFromSnapshot
=
getTableInfoFromSnapshot
;
}
\ No newline at end of file
source/libs/executor/src/executor.c
浏览文件 @
e24ce211
...
...
@@ -1190,7 +1190,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
return
-
1
;
}
SMetaTableInfo
mtInfo
=
pTaskInfo
->
storageAPI
.
snapshotFn
.
getTableInfoFromSnapshot
(
sContext
);
SMetaTableInfo
mtInfo
=
pTaskInfo
->
storageAPI
.
snapshotFn
.
get
Meta
TableInfoFromSnapshot
(
sContext
);
pTaskInfo
->
storageAPI
.
tsdReader
.
tsdReaderClose
(
pInfo
->
dataReader
);
pInfo
->
dataReader
=
NULL
;
...
...
source/libs/executor/src/operator.c
浏览文件 @
e24ce211
...
...
@@ -380,17 +380,18 @@ SOperatorInfo* createOperator(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo, SR
STableListInfo
*
pTableListInfo
=
tableListCreate
();
if
(
pBlockNode
->
tableType
==
TSDB_SUPER_TABLE
)
{
SArray
*
pList
=
taosArrayInit
(
4
,
sizeof
(
STableKeyInfo
));
SArray
*
pList
=
taosArrayInit
(
4
,
sizeof
(
uint64_t
));
int32_t
code
=
pTaskInfo
->
storageAPI
.
metaFn
.
getChildTableList
(
pHandle
->
vnode
,
pBlockNode
->
uid
,
pList
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pTaskInfo
->
code
=
code
;
taosArrayDestroy
(
pList
);
return
NULL
;
}
size_t
num
=
taosArrayGetSize
(
pList
);
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
STableKeyInfo
*
p
=
taosArrayGet
(
pList
,
i
);
tableListAddTableInfo
(
pTableListInfo
,
p
->
u
id
,
0
);
uint64_t
*
id
=
taosArrayGet
(
pList
,
i
);
tableListAddTableInfo
(
pTableListInfo
,
*
id
,
0
);
}
taosArrayDestroy
(
pList
);
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
e24ce211
...
...
@@ -2185,7 +2185,7 @@ static SSDataBlock* doRawScan(SOperatorInfo* pOperator) {
return
pBlock
;
}
SMetaTableInfo
mtInfo
=
pAPI
->
snapshotFn
.
getTableInfoFromSnapshot
(
pInfo
->
sContext
);
SMetaTableInfo
mtInfo
=
pAPI
->
snapshotFn
.
get
Meta
TableInfoFromSnapshot
(
pInfo
->
sContext
);
STqOffsetVal
offset
=
{
0
};
if
(
mtInfo
.
uid
==
0
)
{
// read snapshot done, change to get data from wal
qDebug
(
"tmqsnap read snapshot done, change to get data from wal"
);
...
...
@@ -2203,8 +2203,8 @@ static SSDataBlock* doRawScan(SOperatorInfo* pOperator) {
int32_t
dataLen
=
0
;
int16_t
type
=
0
;
int64_t
uid
=
0
;
if
(
pAPI
->
snapshotFn
.
get
Meta
InfoFromSnapshot
(
sContext
,
&
data
,
&
dataLen
,
&
type
,
&
uid
)
<
0
)
{
qError
(
"tmqsnap get
MetafromSnapS
hot error"
);
if
(
pAPI
->
snapshotFn
.
get
Table
InfoFromSnapshot
(
sContext
,
&
data
,
&
dataLen
,
&
type
,
&
uid
)
<
0
)
{
qError
(
"tmqsnap get
TableInfoFromSnaps
hot error"
);
taosMemoryFreeClear
(
data
);
return
NULL
;
}
...
...
@@ -2253,6 +2253,7 @@ SOperatorInfo* createRawScanOperatorInfo(SReadHandle* pHandle, SExecTaskInfo* pT
pInfo
->
pTableListInfo
=
tableListCreate
();
pInfo
->
vnode
=
pHandle
->
vnode
;
pInfo
->
pAPI
=
&
pTaskInfo
->
storageAPI
;
pInfo
->
sContext
=
pHandle
->
sContext
;
setOperatorInfo
(
pOperator
,
"RawScanOperator"
,
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
,
false
,
OP_NOT_OPENED
,
pInfo
,
...
...
@@ -3470,7 +3471,7 @@ static void buildVnodeGroupedStbTableCount(STableCountScanOperatorInfo* pInfo, S
int64_t
ctbNum
=
0
;
int32_t
code
=
pAPI
->
metaFn
.
getNumOfChildTables
(
pInfo
->
readHandle
.
vnode
,
stbUid
,
&
ctbNum
);
fillTableCountScanDataBlock
(
pSupp
,
dbName
,
stbName
,
ctbNum
,
pRes
);
fillTableCountScanDataBlock
(
pSupp
,
dbName
,
varDataVal
(
stbName
)
,
ctbNum
,
pRes
);
}
static
void
destoryTableCountScanOperator
(
void
*
param
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录