Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d06bcb22
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看板
提交
d06bcb22
编写于
10月 26, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: fix typo and do some internal refactor.
上级
6acdfdd9
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
11 addition
and
124 deletion
+11
-124
include/libs/executor/executor.h
include/libs/executor/executor.h
+0
-7
include/util/tarray.h
include/util/tarray.h
+1
-18
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
+2
-2
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+6
-4
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+0
-17
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+1
-3
source/util/src/tarray.c
source/util/src/tarray.c
+0
-72
未找到文件。
include/libs/executor/executor.h
浏览文件 @
d06bcb22
...
...
@@ -133,13 +133,6 @@ int32_t qGetQueryTableSchemaVersion(qTaskInfo_t tinfo, char* dbName, char* table
int32_t
qExecTaskOpt
(
qTaskInfo_t
tinfo
,
SArray
*
pResList
,
uint64_t
*
useconds
,
bool
*
hasMore
,
SLocalFetch
*
pLocal
);
int32_t
qExecTask
(
qTaskInfo_t
tinfo
,
SSDataBlock
**
pBlock
,
uint64_t
*
useconds
);
/**
* kill the ongoing query and free the query handle and corresponding resources automatically
* @param tinfo qhandle
* @return
*/
int32_t
qKillTask
(
qTaskInfo_t
tinfo
);
/**
* kill the ongoing query asynchronously
* @param tinfo qhandle
...
...
include/util/tarray.h
浏览文件 @
d06bcb22
...
...
@@ -38,7 +38,6 @@ extern "C" {
#define TARRAY_MIN_SIZE 8
#define TARRAY_GET_ELEM(array, index) ((void*)((char*)((array)->pData) + (index) * (array)->elemSize))
#define TARRAY_ELEM_IDX(array, ele) (POINTER_DISTANCE(ele, (array)->pData) / (array)->elemSize)
#define TARRAY_GET_START(array) ((array)->pData)
typedef
struct
SArray
{
size_t
size
;
...
...
@@ -71,14 +70,6 @@ int32_t taosArrayEnsureCap(SArray* pArray, size_t tsize);
*/
void
*
taosArrayAddBatch
(
SArray
*
pArray
,
const
void
*
pData
,
int32_t
nEles
);
/**
*
* @param pArray
* @param pData position array list
* @param numOfElems the number of removed position
*/
void
taosArrayRemoveBatch
(
SArray
*
pArray
,
const
int32_t
*
pData
,
int32_t
numOfElems
);
/**
*
* @param pArray
...
...
@@ -266,13 +257,6 @@ void* taosArraySearch(const SArray* pArray, const void* key, __compar_fn_t compa
*/
int32_t
taosArraySearchIdx
(
const
SArray
*
pArray
,
const
void
*
key
,
__compar_fn_t
comparFn
,
int32_t
flags
);
/**
* search the array
* @param pArray
* @param key
*/
char
*
taosArraySearchString
(
const
SArray
*
pArray
,
const
char
*
key
,
__compar_fn_t
comparFn
,
int32_t
flags
);
/**
* sort the pointer data in the array
* @param pArray
...
...
@@ -286,8 +270,6 @@ void taosArraySortPWithExt(SArray* pArray, __ext_compar_fn_t fn, const void* par
int32_t
taosEncodeArray
(
void
**
buf
,
const
SArray
*
pArray
,
FEncode
encode
);
void
*
taosDecodeArray
(
const
void
*
buf
,
SArray
**
pArray
,
FDecode
decode
,
int32_t
dataSz
);
char
*
taosShowStrArray
(
const
SArray
*
pArray
);
/**
* swap array
* @param a
...
...
@@ -295,6 +277,7 @@ char* taosShowStrArray(const SArray* pArray);
* @return
*/
void
taosArraySwap
(
SArray
*
a
,
SArray
*
b
);
#ifdef __cplusplus
}
#endif
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
d06bcb22
...
...
@@ -1506,7 +1506,7 @@ static int32_t tsdbCommitTableData(SCommitter *pCommitter, TABLEID id) {
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
#else
if
(
pCommitter
->
dWriter
.
bData
.
nRow
>=
pCommitter
->
maxRow
)
{
if
(
pCommitter
->
dWriter
.
bData
l
.
nRow
>=
pCommitter
->
maxRow
)
{
code
=
tsdbWriteSttBlock
(
pCommitter
->
dWriter
.
pWriter
,
&
pCommitter
->
dWriter
.
bDatal
,
pCommitter
->
dWriter
.
aSttBlk
,
pCommitter
->
cmprAlg
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
...
...
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
浏览文件 @
d06bcb22
...
...
@@ -152,8 +152,8 @@ static SBlockData *loadLastBlock(SLDataIter *pIter, const char *idStr) {
pInfo
->
loadBlocks
+=
1
;
tsdbDebug
(
"read last block, total load:%d, trigger by uid:%"
PRIu64
", last file index:%d, last block index:%d, entry:%d, %p, elapsed time:%.2f ms, %s"
,
pInfo
->
loadBlocks
,
pIter
->
uid
,
pIter
->
iStt
,
pIter
->
iSttBlk
,
pInfo
->
currentLoadBlockIndex
,
pBlock
,
el
,
", last file index:%d, last block index:%d, entry:%d,
rows:%d,
%p, elapsed time:%.2f ms, %s"
,
pInfo
->
loadBlocks
,
pIter
->
uid
,
pIter
->
iStt
,
pIter
->
iSttBlk
,
pInfo
->
currentLoadBlockIndex
,
pBlock
->
nRow
,
pBlock
,
el
,
idStr
);
pInfo
->
blockIndex
[
pInfo
->
currentLoadBlockIndex
]
=
pIter
->
iSttBlk
;
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
d06bcb22
...
...
@@ -2139,12 +2139,13 @@ static int64_t getCurrentKeyInLastBlock(SLastBlockReader* pLastBlockReader) {
}
static
bool
hasDataInLastBlock
(
SLastBlockReader
*
pLastBlockReader
)
{
return
pLastBlockReader
->
mergeTree
.
pIter
!=
NULL
;
}
bool
hasDataInFileBlock
(
const
SBlockData
*
pBlockData
,
const
SFileBlockDumpInfo
*
pDumpInfo
)
{
if
(
pBlockData
->
nRow
>
0
)
{
ASSERT
(
pBlockData
->
nRow
==
pDumpInfo
->
totalRows
);
bool
hasDataInFileBlock
(
const
SBlockData
*
pBlockData
,
const
SFileBlockDumpInfo
*
pDumpInfo
)
{
if
(
pBlockData
->
nRow
>
0
)
{
ASSERT
(
pBlockData
->
nRow
==
pDumpInfo
->
totalRows
);
}
return
pBlockData
->
nRow
>
0
&&
(
!
pDumpInfo
->
allDumped
);
return
pBlockData
->
nRow
>
0
&&
(
!
pDumpInfo
->
allDumped
);
}
int32_t
mergeRowsInFileBlocks
(
SBlockData
*
pBlockData
,
STableBlockScanInfo
*
pBlockScanInfo
,
int64_t
key
,
...
...
@@ -2619,6 +2620,7 @@ static int32_t doBuildDataBlock(STsdbReader* pReader) {
ASSERT
(
tsLast
>=
pBlock
->
maxKey
.
ts
);
tBlockDataReset
(
&
pReader
->
status
.
fileBlockData
);
tsdbDebug
(
"load data in last block firstly, due to desc scan data, %s"
,
pReader
->
idStr
);
code
=
buildComposedDataBlock
(
pReader
);
}
else
{
// whole block is required, return it directly
SDataBlockInfo
*
pInfo
=
&
pReader
->
pResBlock
->
info
;
...
...
source/libs/executor/src/executor.c
浏览文件 @
d06bcb22
...
...
@@ -564,23 +564,6 @@ int32_t qExecTask(qTaskInfo_t tinfo, SSDataBlock** pRes, uint64_t* useconds) {
return
pTaskInfo
->
code
;
}
int32_t
qKillTask
(
qTaskInfo_t
qinfo
)
{
SExecTaskInfo
*
pTaskInfo
=
(
SExecTaskInfo
*
)
qinfo
;
if
(
pTaskInfo
==
NULL
)
{
return
TSDB_CODE_QRY_INVALID_QHANDLE
;
}
qAsyncKillTask
(
qinfo
);
// Wait for the query executing thread being stopped/
// Once the query is stopped, the owner of qHandle will be cleared immediately.
while
(
pTaskInfo
->
owner
!=
0
)
{
taosMsleep
(
100
);
}
return
TSDB_CODE_SUCCESS
;
}
int32_t
qAsyncKillTask
(
qTaskInfo_t
qinfo
)
{
SExecTaskInfo
*
pTaskInfo
=
(
SExecTaskInfo
*
)
qinfo
;
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
d06bcb22
...
...
@@ -3640,9 +3640,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
return
pOperator
;
}
int32_t
num
=
0
;
size_t
size
=
LIST_LENGTH
(
pPhyNode
->
pChildren
);
size_t
size
=
LIST_LENGTH
(
pPhyNode
->
pChildren
);
SOperatorInfo
**
ops
=
taosMemoryCalloc
(
size
,
POINTER_BYTES
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SPhysiNode
*
pChildNode
=
(
SPhysiNode
*
)
nodesListGetNode
(
pPhyNode
->
pChildren
,
i
);
...
...
source/util/src/tarray.c
浏览文件 @
d06bcb22
...
...
@@ -91,48 +91,6 @@ void* taosArrayAddBatch(SArray* pArray, const void* pData, int32_t nEles) {
return
dst
;
}
void
taosArrayRemoveBatch
(
SArray
*
pArray
,
const
int32_t
*
pData
,
int32_t
numOfElems
)
{
assert
(
pArray
!=
NULL
&&
pData
!=
NULL
);
if
(
numOfElems
<=
0
)
{
return
;
}
size_t
size
=
taosArrayGetSize
(
pArray
);
if
(
numOfElems
>=
size
)
{
taosArrayClear
(
pArray
);
return
;
}
int32_t
i
=
pData
[
0
]
+
1
,
j
=
0
;
while
(
i
<
size
)
{
if
(
j
==
numOfElems
-
1
)
{
break
;
}
char
*
p
=
TARRAY_GET_ELEM
(
pArray
,
i
);
if
(
i
>
pData
[
j
]
&&
i
<
pData
[
j
+
1
])
{
char
*
dst
=
TARRAY_GET_ELEM
(
pArray
,
i
-
(
j
+
1
));
memmove
(
dst
,
p
,
pArray
->
elemSize
);
}
else
if
(
i
==
pData
[
j
+
1
])
{
j
+=
1
;
}
i
+=
1
;
}
assert
(
i
==
pData
[
numOfElems
-
1
]
+
1
&&
i
<=
size
);
int32_t
srcIndex
=
pData
[
numOfElems
-
1
]
+
1
;
int32_t
dstIndex
=
pData
[
numOfElems
-
1
]
-
numOfElems
+
1
;
if
(
pArray
->
size
-
srcIndex
>
0
)
{
char
*
dst
=
TARRAY_GET_ELEM
(
pArray
,
dstIndex
);
char
*
src
=
TARRAY_GET_ELEM
(
pArray
,
srcIndex
);
memmove
(
dst
,
src
,
pArray
->
elemSize
*
(
pArray
->
size
-
srcIndex
));
}
pArray
->
size
-=
numOfElems
;
}
void
taosArrayRemoveDuplicate
(
SArray
*
pArray
,
__compar_fn_t
comparFn
,
void
(
*
fp
)(
void
*
))
{
assert
(
pArray
);
...
...
@@ -435,17 +393,6 @@ void taosArraySortString(SArray* pArray, __compar_fn_t comparFn) {
taosSort
(
pArray
->
pData
,
pArray
->
size
,
pArray
->
elemSize
,
comparFn
);
}
char
*
taosArraySearchString
(
const
SArray
*
pArray
,
const
char
*
key
,
__compar_fn_t
comparFn
,
int32_t
flags
)
{
assert
(
pArray
!=
NULL
);
assert
(
key
!=
NULL
);
void
*
p
=
taosbsearch
(
&
key
,
pArray
->
pData
,
pArray
->
size
,
pArray
->
elemSize
,
comparFn
,
flags
);
if
(
p
==
NULL
)
{
return
NULL
;
}
return
*
(
char
**
)
p
;
}
static
int32_t
taosArrayPartition
(
SArray
*
pArray
,
int32_t
i
,
int32_t
j
,
__ext_compar_fn_t
fn
,
const
void
*
userData
)
{
void
*
key
=
taosArrayGetP
(
pArray
,
i
);
while
(
i
<
j
)
{
...
...
@@ -543,26 +490,7 @@ void* taosDecodeArray(const void* buf, SArray** pArray, FDecode decode, int32_t
void
taosArraySortPWithExt
(
SArray
*
pArray
,
__ext_compar_fn_t
fn
,
const
void
*
param
)
{
taosArrayGetSize
(
pArray
)
>
8
?
taosArrayQuickSort
(
pArray
,
fn
,
param
)
:
taosArrayInsertSort
(
pArray
,
fn
,
param
);
}
// TODO(yihaoDeng) add order array<type>
//
char
*
taosShowStrArray
(
const
SArray
*
pArray
)
{
int32_t
sz
=
pArray
->
size
;
int32_t
tlen
=
0
;
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
tlen
+=
strlen
(
taosArrayGetP
(
pArray
,
i
))
+
1
;
}
char
*
res
=
taosMemoryCalloc
(
1
,
tlen
);
char
*
buf
=
res
;
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
char
*
str
=
taosArrayGetP
(
pArray
,
i
);
int32_t
len
=
strlen
(
str
);
memcpy
(
buf
,
str
,
len
);
buf
+=
len
;
if
(
i
!=
sz
-
1
)
*
buf
=
','
;
}
return
res
;
}
void
taosArraySwap
(
SArray
*
a
,
SArray
*
b
)
{
if
(
a
==
NULL
||
b
==
NULL
)
return
;
size_t
t
=
a
->
size
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录