Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a9b18d20
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看板
提交
a9b18d20
编写于
5月 24, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:fix error.
上级
01f6f74f
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
26 addition
and
22 deletion
+26
-22
include/libs/executor/dataSinkMgt.h
include/libs/executor/dataSinkMgt.h
+1
-1
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+2
-2
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+6
-6
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+3
-3
source/dnode/vnode/src/vnd/vnodeInitApi.c
source/dnode/vnode/src/vnd/vnodeInitApi.c
+2
-0
source/libs/executor/inc/dataSinkInt.h
source/libs/executor/inc/dataSinkInt.h
+2
-2
source/libs/executor/inc/executorInt.h
source/libs/executor/inc/executorInt.h
+1
-1
source/libs/executor/src/dataInserter.c
source/libs/executor/src/dataInserter.c
+1
-1
source/libs/executor/src/dataSinkMgt.c
source/libs/executor/src/dataSinkMgt.c
+2
-1
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+1
-1
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+5
-4
未找到文件。
include/libs/executor/dataSinkMgt.h
浏览文件 @
a9b18d20
...
...
@@ -59,7 +59,7 @@ typedef struct SDataSinkMgtCfg {
uint32_t
maxDataBlockNumPerQuery
;
}
SDataSinkMgtCfg
;
int32_t
dsDataSinkMgtInit
(
SDataSinkMgtCfg
*
cfg
);
int32_t
dsDataSinkMgtInit
(
SDataSinkMgtCfg
*
cfg
,
SStorageAPI
*
pAPI
);
typedef
struct
SInputData
{
const
struct
SSDataBlock
*
pData
;
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
a9b18d20
...
...
@@ -118,7 +118,7 @@ const void *metaGetTableTagVal(const 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
metaGetTableUidByName
(
void
*
pVnode
,
char
*
tbName
,
uint64_t
*
uid
);
int
metaGetTableTypeByName
(
void
*
meta
,
char
*
tbName
,
ETableType
*
tbType
);
bool
metaIsTableExist
(
void
*
pVnode
,
tb_uid_t
uid
);
int32_t
metaGetCachedTableUidList
(
SMeta
*
pMeta
,
tb_uid_t
suid
,
const
uint8_t
*
key
,
int32_t
keyLen
,
SArray
*
pList
,
...
...
@@ -192,7 +192,7 @@ int32_t tsdbCacherowsReaderOpen(void *pVnode, int32_t type, void *pTableIdList,
int32_t
tsdbRetrieveCacheRows
(
void
*
pReader
,
SSDataBlock
*
pResBlock
,
const
int32_t
*
slotIds
,
const
int32_t
*
dstSlotIds
,
SArray
*
pTableUids
);
void
*
tsdbCacherowsReaderClose
(
void
*
pReader
);
int32_t
tsdbGetTableSchema
(
SVnode
*
pVnode
,
int64_t
uid
,
STSchema
**
pSchema
,
int64_t
*
suid
);
int32_t
tsdbGetTableSchema
(
void
*
pVnode
,
int64_t
uid
,
STSchema
**
pSchema
,
int64_t
*
suid
);
void
tsdbCacheSetCapacity
(
SVnode
*
pVnode
,
size_t
capacity
);
size_t
tsdbCacheGetCapacity
(
SVnode
*
pVnode
);
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
a9b18d20
...
...
@@ -139,10 +139,10 @@ tb_uid_t metaGetTableEntryUidByName(SMeta *pMeta, const char *name) {
return
uid
;
}
int
metaGetTableNameByUid
(
void
*
meta
,
uint64_t
uid
,
char
*
tbName
)
{
int
metaGetTableNameByUid
(
void
*
pVnode
,
uint64_t
uid
,
char
*
tbName
)
{
int
code
=
0
;
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
(
SMeta
*
)
m
eta
,
0
);
metaReaderInit
(
&
mr
,
(
(
SVnode
*
)
pVnode
)
->
pM
eta
,
0
);
code
=
metaReaderGetTableEntryByUid
(
&
mr
,
uid
);
if
(
code
<
0
)
{
metaReaderClear
(
&
mr
);
...
...
@@ -170,10 +170,10 @@ int metaGetTableSzNameByUid(void *meta, uint64_t uid, char *tbName) {
return
0
;
}
int
metaGetTableUidByName
(
void
*
meta
,
char
*
tbName
,
uint64_t
*
uid
)
{
int
metaGetTableUidByName
(
void
*
pVnode
,
char
*
tbName
,
uint64_t
*
uid
)
{
int
code
=
0
;
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
(
SMeta
*
)
m
eta
,
0
);
metaReaderInit
(
&
mr
,
(
(
SVnode
*
)
pVnode
)
->
pM
eta
,
0
);
SMetaReader
*
pReader
=
&
mr
;
...
...
@@ -191,10 +191,10 @@ int metaGetTableUidByName(void *meta, char *tbName, uint64_t *uid) {
return
0
;
}
int
metaGetTableTypeByName
(
void
*
meta
,
char
*
tbName
,
ETableType
*
tbType
)
{
int
metaGetTableTypeByName
(
void
*
pVnode
,
char
*
tbName
,
ETableType
*
tbType
)
{
int
code
=
0
;
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
(
SMeta
*
)
m
eta
,
0
);
metaReaderInit
(
&
mr
,
(
(
SVnode
*
)
pVnode
)
->
pM
eta
,
0
);
code
=
metaGetTableEntryByName
(
&
mr
,
tbName
);
if
(
code
==
0
)
*
tbType
=
mr
.
me
.
type
;
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
a9b18d20
...
...
@@ -5373,9 +5373,9 @@ int64_t tsdbGetNumOfRowsInMemTable(STsdbReader* pReader) {
return
rows
;
}
int32_t
tsdbGetTableSchema
(
SVnode
*
pVnode
,
int64_t
uid
,
STSchema
**
pSchema
,
int64_t
*
suid
)
{
int32_t
tsdbGetTableSchema
(
void
*
pVnode
,
int64_t
uid
,
STSchema
**
pSchema
,
int64_t
*
suid
)
{
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
pVnode
->
pMeta
,
0
);
metaReaderInit
(
&
mr
,
((
SVnode
*
)
pVnode
)
->
pMeta
,
0
);
int32_t
code
=
metaReaderGetTableEntryByUidCache
(
&
mr
,
uid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
TSDB_CODE_TDB_INVALID_TABLE_ID
;
...
...
@@ -5405,7 +5405,7 @@ int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int6
metaReaderClear
(
&
mr
);
// get the newest table schema version
code
=
metaGetTbTSchemaEx
(
pVnode
->
pMeta
,
*
suid
,
uid
,
-
1
,
pSchema
);
code
=
metaGetTbTSchemaEx
(
((
SVnode
*
)
pVnode
)
->
pMeta
,
*
suid
,
uid
,
-
1
,
pSchema
);
return
code
;
}
...
...
source/dnode/vnode/src/vnd/vnodeInitApi.c
浏览文件 @
a9b18d20
...
...
@@ -78,6 +78,8 @@ void initMetadataAPI(SStoreMeta* pMeta) {
pMeta
->
getTableUidByName
=
metaGetTableUidByName
;
pMeta
->
getTableTypeByName
=
metaGetTableTypeByName
;
pMeta
->
getTableNameByUid
=
metaGetTableNameByUid
;
pMeta
->
getTableSchema
=
tsdbGetTableSchema
;
// todo refactor
}
void
initTqAPI
(
SStoreTqReader
*
pTq
)
{
...
...
source/libs/executor/inc/dataSinkInt.h
浏览文件 @
a9b18d20
...
...
@@ -29,8 +29,8 @@ struct SDataSink;
struct
SDataSinkHandle
;
typedef
struct
SDataSinkManager
{
SDataSinkMgtCfg
cfg
;
SStorageAPI
storeFn
;
SDataSinkMgtCfg
cfg
;
SStorageAPI
*
pAPI
;
}
SDataSinkManager
;
typedef
int32_t
(
*
FPutDataBlock
)(
struct
SDataSinkHandle
*
pHandle
,
const
SInputData
*
pInput
,
bool
*
pContinue
);
...
...
source/libs/executor/inc/executorInt.h
浏览文件 @
a9b18d20
...
...
@@ -224,7 +224,7 @@ typedef struct STableScanInfo {
int8_t
assignBlockUid
;
bool
hasGroupByTag
;
bool
countOnly
;
TsdReader
readerAPI
;
//
TsdReader readerAPI;
}
STableScanInfo
;
typedef
struct
STableMergeScanInfo
{
...
...
source/libs/executor/src/dataInserter.c
浏览文件 @
a9b18d20
...
...
@@ -429,7 +429,7 @@ int32_t createDataInserter(SDataSinkManager* pManager, const SDataSinkNode* pDat
inserter
->
explain
=
pInserterNode
->
explain
;
int64_t
suid
=
0
;
int32_t
code
=
pManager
->
storeFn
.
metaFn
.
getTableSchema
(
inserter
->
pParam
->
readHandle
->
vnode
,
pInserterNode
->
tableId
,
&
inserter
->
pSchema
,
&
suid
);
int32_t
code
=
pManager
->
pAPI
->
metaFn
.
getTableSchema
(
inserter
->
pParam
->
readHandle
->
vnode
,
pInserterNode
->
tableId
,
&
inserter
->
pSchema
,
&
suid
);
if
(
code
)
{
destroyDataSinker
((
SDataSinkHandle
*
)
inserter
);
taosMemoryFree
(
inserter
);
...
...
source/libs/executor/src/dataSinkMgt.c
浏览文件 @
a9b18d20
...
...
@@ -21,8 +21,9 @@
static
SDataSinkManager
gDataSinkManager
=
{
0
};
SDataSinkStat
gDataSinkStat
=
{
0
};
int32_t
dsDataSinkMgtInit
(
SDataSinkMgtCfg
*
cfg
)
{
int32_t
dsDataSinkMgtInit
(
SDataSinkMgtCfg
*
cfg
,
SStorageAPI
*
pAPI
)
{
gDataSinkManager
.
cfg
=
*
cfg
;
gDataSinkManager
.
pAPI
=
pAPI
;
return
0
;
// to avoid compiler eror
}
...
...
source/libs/executor/src/executor.c
浏览文件 @
a9b18d20
...
...
@@ -507,7 +507,7 @@ int32_t qCreateExecTask(SReadHandle* readHandle, int32_t vgId, uint64_t taskId,
}
SDataSinkMgtCfg
cfg
=
{.
maxDataBlockNum
=
500
,
.
maxDataBlockNumPerQuery
=
50
};
code
=
dsDataSinkMgtInit
(
&
cfg
);
code
=
dsDataSinkMgtInit
(
&
cfg
,
&
(
*
pTask
)
->
storageAPI
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to dsDataSinkMgtInit, code:%s, %s"
,
tstrerror
(
code
),
(
*
pTask
)
->
id
.
str
);
goto
_error
;
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
a9b18d20
...
...
@@ -929,7 +929,7 @@ static void destroyTableScanOperatorInfo(void* param) {
STableScanInfo
*
pTableScanInfo
=
(
STableScanInfo
*
)
param
;
blockDataDestroy
(
pTableScanInfo
->
pResBlock
);
taosHashCleanup
(
pTableScanInfo
->
pIgnoreTables
);
destroyTableScanBase
(
&
pTableScanInfo
->
base
,
&
pTableScanInfo
->
readerAPI
);
destroyTableScanBase
(
&
pTableScanInfo
->
base
,
&
pTableScanInfo
->
base
.
readerAPI
);
taosMemoryFreeClear
(
param
);
}
...
...
@@ -975,7 +975,7 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode,
pInfo
->
sample
.
sampleRatio
=
pTableScanNode
->
ratio
;
pInfo
->
sample
.
seed
=
taosGetTimestampSec
();
pInfo
->
readerAPI
=
pTaskInfo
->
storageAPI
.
tsdReader
;
pInfo
->
base
.
readerAPI
=
pTaskInfo
->
storageAPI
.
tsdReader
;
initResultSizeInfo
(
&
pOperator
->
resultInfo
,
4096
);
pInfo
->
pResBlock
=
createDataBlockFromDescNode
(
pDescNode
);
// blockDataEnsureCapacity(pInfo->pResBlock, pOperator->resultInfo.capacity);
...
...
@@ -1075,7 +1075,7 @@ void resetTableScanInfo(STableScanInfo* pTableScanInfo, STimeWindow* pWin, uint6
pTableScanInfo
->
base
.
cond
.
endVersion
=
version
;
pTableScanInfo
->
scanTimes
=
0
;
pTableScanInfo
->
currentGroupId
=
-
1
;
pTableScanInfo
->
readerAPI
.
tsdReaderClose
(
pTableScanInfo
->
base
.
dataReader
);
pTableScanInfo
->
base
.
readerAPI
.
tsdReaderClose
(
pTableScanInfo
->
base
.
dataReader
);
pTableScanInfo
->
base
.
dataReader
=
NULL
;
}
...
...
@@ -1250,7 +1250,7 @@ static SSDataBlock* doRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pSDB, int32
*
pRowIndex
=
0
;
pInfo
->
updateWin
=
(
STimeWindow
){.
skey
=
INT64_MIN
,
.
ekey
=
INT64_MAX
};
STableScanInfo
*
pTableScanInfo
=
pInfo
->
pTableScanOp
->
info
;
pTableScanInfo
->
readerAPI
.
tsdReaderClose
(
pTableScanInfo
->
base
.
dataReader
);
pTableScanInfo
->
base
.
readerAPI
.
tsdReaderClose
(
pTableScanInfo
->
base
.
dataReader
);
pTableScanInfo
->
base
.
dataReader
=
NULL
;
return
NULL
;
}
...
...
@@ -3045,6 +3045,7 @@ SOperatorInfo* createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanN
goto
_error
;
}
pInfo
->
base
.
readerAPI
=
pTaskInfo
->
storageAPI
.
tsdReader
;
pInfo
->
base
.
dataBlockLoadFlag
=
FUNC_DATA_REQUIRED_DATA_LOAD
;
pInfo
->
base
.
scanFlag
=
MAIN_SCAN
;
pInfo
->
base
.
readHandle
=
*
readHandle
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录