Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6b49352a
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6b49352a
编写于
6月 02, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
4fd2fb06
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
22 addition
and
24 deletion
+22
-24
include/libs/scheduler/scheduler.h
include/libs/scheduler/scheduler.h
+1
-1
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+1
-1
source/client/src/clientMain.c
source/client/src/clientMain.c
+1
-1
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+4
-3
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+2
-2
source/libs/scheduler/src/schJob.c
source/libs/scheduler/src/schJob.c
+4
-5
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+9
-11
未找到文件。
include/libs/scheduler/scheduler.h
浏览文件 @
6b49352a
...
...
@@ -100,7 +100,7 @@ int32_t schedulerExecJob(void *transport, SArray *nodeList, SQueryPlan *pDag, in
*/
int32_t
schedulerFetchRows
(
int64_t
job
,
void
**
data
);
int32_t
schedulerAsyncFetchRows
(
int64_t
job
,
schedulerFetchCallback
fp
,
void
*
param
);
void
schedulerAsyncFetchRows
(
int64_t
job
,
schedulerFetchCallback
fp
,
void
*
param
);
int32_t
schedulerGetTasksStatus
(
int64_t
job
,
SArray
*
pSub
);
...
...
source/client/src/clientImpl.c
浏览文件 @
6b49352a
...
...
@@ -1086,7 +1086,7 @@ void* doAsyncFetchRow(SRequestObj* pRequest, bool setupOneRowPtr, bool convertUc
tsem_wait
(
&
pParam
->
sem
);
}
if
(
setupOneRowPtr
)
{
if
(
pRequest
->
code
==
TSDB_CODE_SUCCESS
&&
setupOneRowPtr
)
{
doSetOneRowPtr
(
pResultInfo
);
pResultInfo
->
current
+=
1
;
}
...
...
source/client/src/clientMain.c
浏览文件 @
6b49352a
...
...
@@ -793,7 +793,7 @@ void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
}
}
pRequest
->
code
=
schedulerAsyncFetchRows
(
pRequest
->
body
.
queryJob
,
fetchCallback
,
pRequest
);
schedulerAsyncFetchRows
(
pRequest
->
body
.
queryJob
,
fetchCallback
,
pRequest
);
}
TAOS_SUB
*
taos_subscribe
(
TAOS
*
taos
,
int
restart
,
const
char
*
topic
,
const
char
*
sql
,
TAOS_SUBSCRIBE_CALLBACK
fp
,
...
...
source/client/test/clientTests.cpp
浏览文件 @
6b49352a
...
...
@@ -474,7 +474,7 @@ TEST(testCase, create_multiple_tables) {
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create table t_2 using st1 tags(1)"
);
pRes
=
taos_query
(
pConn
,
"create table
if not exists
t_2 using st1 tags(1)"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create multiple tables, reason:%s
\n
"
,
taos_errstr
(
pRes
));
taos_free_result
(
pRes
);
...
...
@@ -482,7 +482,7 @@ TEST(testCase, create_multiple_tables) {
}
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create table t_3 using st1 tags(2)"
);
pRes
=
taos_query
(
pConn
,
"create table
if not exists
t_3 using st1 tags(2)"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create multiple tables, reason:%s
\n
"
,
taos_errstr
(
pRes
));
taos_free_result
(
pRes
);
...
...
@@ -590,6 +590,7 @@ TEST(testCase, generated_request_id_test) {
taosHashCleanup
(
phash
);
}
TEST
(
testCase
,
insert_test
)
{
TAOS
*
pConn
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
ASSERT_NE
(
pConn
,
nullptr
);
...
...
@@ -645,7 +646,7 @@ TEST(testCase, projection_query_tables) {
}
taos_free_result
(
pRes
);
for
(
int32_t
i
=
0
;
i
<
1000
0
;
i
+=
20
)
{
for
(
int32_t
i
=
0
;
i
<
1000
;
i
+=
20
)
{
char
sql
[
1024
]
=
{
0
};
sprintf
(
sql
,
"insert into tu values(now+%da, %d)(now+%da, %d)(now+%da, %d)(now+%da, %d)"
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
6b49352a
...
...
@@ -1034,10 +1034,10 @@ int32_t catalogAsyncGetAllMeta(SCatalog* pCtg, void *pTrans, const SEpSet* pMgmt
CTG_ERR_JRET
(
ctgLaunchJob
(
pJob
));
*
jobId
=
pJob
->
refId
;
// NOTE: here the assignment of jobId is invalid, may over-write the true scheduler created query job.
// *jobId = pJob->refId;
_return:
if
(
pJob
)
{
taosReleaseRef
(
gCtgMgmt
.
jobPool
,
pJob
->
refId
);
...
...
source/libs/scheduler/src/schJob.c
浏览文件 @
6b49352a
...
...
@@ -21,9 +21,9 @@
#include "tref.h"
#include "trpc.h"
FORCE_INLINE
SSchJob
*
schAcquireJob
(
int64_t
refId
)
{
qDebug
(
"acquire job:0x%"
PRIx64
,
refId
);
return
(
SSchJob
*
)
taosAcquireRef
(
schMgmt
.
jobRef
,
refId
);
}
FORCE_INLINE
SSchJob
*
schAcquireJob
(
int64_t
refId
)
{
qDebug
(
"acquire job
Id
:0x%"
PRIx64
,
refId
);
return
(
SSchJob
*
)
taosAcquireRef
(
schMgmt
.
jobRef
,
refId
);
}
FORCE_INLINE
int32_t
schReleaseJob
(
int64_t
refId
)
{
qDebug
(
"release job:0x%"
PRIx64
,
refId
);
return
taosReleaseRef
(
schMgmt
.
jobRef
,
refId
);
}
FORCE_INLINE
int32_t
schReleaseJob
(
int64_t
refId
)
{
qDebug
(
"release job
Id
:0x%"
PRIx64
,
refId
);
return
taosReleaseRef
(
schMgmt
.
jobRef
,
refId
);
}
int32_t
schInitTask
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
SSubplan
*
pPlan
,
SSchLevel
*
pLevel
)
{
pTask
->
plan
=
pPlan
;
...
...
@@ -1365,8 +1365,6 @@ void schFreeJobImpl(void *job) {
int32_t
schExecJobImpl
(
void
*
pTrans
,
SArray
*
pNodeList
,
SQueryPlan
*
pDag
,
int64_t
*
job
,
const
char
*
sql
,
SSchResInfo
*
pRes
,
int64_t
startTs
,
bool
sync
)
{
qDebug
(
"QID:0x%"
PRIx64
" job started"
,
pDag
->
queryId
);
if
(
pNodeList
==
NULL
||
taosArrayGetSize
(
pNodeList
)
<=
0
)
{
qDebug
(
"QID:0x%"
PRIx64
" input exec nodeList is empty"
,
pDag
->
queryId
);
}
...
...
@@ -1375,6 +1373,7 @@ int32_t schExecJobImpl(void *pTrans, SArray *pNodeList, SQueryPlan *pDag, int64_
SSchJob
*
pJob
=
NULL
;
SCH_ERR_RET
(
schInitJob
(
&
pJob
,
pDag
,
pTrans
,
pNodeList
,
sql
,
pRes
,
startTs
,
sync
));
qDebug
(
"QID:0x%"
PRIx64
" jobId:0x%"
PRIx64
" started"
,
pDag
->
queryId
,
pJob
->
refId
);
*
job
=
pJob
->
refId
;
SCH_ERR_JRET
(
schLaunchJob
(
pJob
));
...
...
@@ -1386,7 +1385,7 @@ int32_t schExecJobImpl(void *pTrans, SArray *pNodeList, SQueryPlan *pDag, int64_
pJob
->
userCb
=
SCH_EXEC_CB
;
}
SCH_JOB_DLOG
(
"job exec done, job status:%s
"
,
SCH_GET_JOB_STATUS_STR
(
pJob
)
);
SCH_JOB_DLOG
(
"job exec done, job status:%s
, jobId:0x%"
PRIx64
,
SCH_GET_JOB_STATUS_STR
(
pJob
),
pJob
->
refId
);
_return:
...
...
source/libs/scheduler/src/scheduler.c
浏览文件 @
6b49352a
...
...
@@ -102,7 +102,7 @@ int32_t schedulerFetchRows(int64_t job, void **pData) {
int32_t
code
=
0
;
SSchJob
*
pJob
=
schAcquireJob
(
job
);
if
(
NULL
==
pJob
)
{
qError
(
"acquire job from jobRef list failed, may be dropped,
refId:
%"
PRIx64
,
job
);
qError
(
"acquire job from jobRef list failed, may be dropped,
jobId:0x
%"
PRIx64
,
job
);
SCH_ERR_RET
(
TSDB_CODE_SCH_STATUS_ERROR
);
}
...
...
@@ -115,28 +115,26 @@ int32_t schedulerFetchRows(int64_t job, void **pData) {
SCH_RET
(
code
);
}
int32_t
schedulerAsyncFetchRows
(
int64_t
job
,
schedulerFetchCallback
fp
,
void
*
param
)
{
void
schedulerAsyncFetchRows
(
int64_t
job
,
schedulerFetchCallback
fp
,
void
*
param
)
{
if
(
NULL
==
fp
||
NULL
==
param
)
{
SCH_ERR_RET
(
TSDB_CODE_QRY_INVALID_INPUT
);
fp
(
NULL
,
param
,
TSDB_CODE_QRY_INVALID_INPUT
);
return
;
}
int32_t
code
=
0
;
SSchJob
*
pJob
=
schAcquireJob
(
job
);
if
(
NULL
==
pJob
)
{
qError
(
"acquire job from jobRef list failed, may be dropped,
refId:
%"
PRIx64
,
job
);
qError
(
"acquire job from jobRef list failed, may be dropped,
jobId:0x
%"
PRIx64
,
job
);
fp
(
NULL
,
param
,
TSDB_CODE_SCH_STATUS_ERROR
);
return
TSDB_CODE_SCH_STATUS_ERROR
;
return
;
}
pJob
->
attr
.
syncSchedule
=
false
;
pJob
->
userRes
.
fetchFp
=
fp
;
pJob
->
userRes
.
userParam
=
param
;
code
=
schAsyncFetchRows
(
pJob
);
/*code = */
schAsyncFetchRows
(
pJob
);
schReleaseJob
(
job
);
SCH_RET
(
code
);
}
int32_t
schedulerGetTasksStatus
(
int64_t
job
,
SArray
*
pSub
)
{
...
...
@@ -173,7 +171,7 @@ _return:
int32_t
scheduleCancelJob
(
int64_t
job
)
{
SSchJob
*
pJob
=
schAcquireJob
(
job
);
if
(
NULL
==
pJob
)
{
qError
(
"acquire job from jobRef list failed, may be dropped,
refId:
%"
PRIx64
,
job
);
qError
(
"acquire job from jobRef list failed, may be dropped,
jobId:0x
%"
PRIx64
,
job
);
SCH_ERR_RET
(
TSDB_CODE_SCH_STATUS_ERROR
);
}
...
...
@@ -187,7 +185,7 @@ int32_t scheduleCancelJob(int64_t job) {
void
schedulerFreeJob
(
int64_t
job
)
{
SSchJob
*
pJob
=
schAcquireJob
(
job
);
if
(
NULL
==
pJob
)
{
q
Debug
(
"acquire job from jobRef list failed, may be dropped, refId:
%"
PRIx64
,
job
);
q
Error
(
"acquire job from jobRef list failed, may be dropped, jobId:0x
%"
PRIx64
,
job
);
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录