Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8146c0e0
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看板
提交
8146c0e0
编写于
12月 16, 2021
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify scheduler api
上级
62590e53
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
63 addition
and
26 deletion
+63
-26
include/libs/scheduler/scheduler.h
include/libs/scheduler/scheduler.h
+6
-24
source/libs/scheduler/inc/schedulerInt.h
source/libs/scheduler/inc/schedulerInt.h
+15
-1
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+42
-1
未找到文件。
include/libs/scheduler/scheduler.h
浏览文件 @
8146c0e0
...
...
@@ -20,6 +20,8 @@
extern
"C"
{
#endif
#include "planner.h"
typedef
struct
SQueryProfileSummary
{
int64_t
startTs
;
// Object created and added into the message queue
int64_t
endTs
;
// the timestamp when the task is completed
...
...
@@ -43,43 +45,23 @@ typedef struct SQueryProfileSummary {
uint64_t
resultSize
;
// generated result size in Kb.
}
SQueryProfileSummary
;
typedef
struct
SQueryTask
{
uint64_t
queryId
;
// query id
uint64_t
taskId
;
// task id
char
*
pSubplan
;
// operator tree
uint64_t
status
;
// task status
SQueryProfileSummary
summary
;
// task execution summary
void
*
pOutputHandle
;
// result buffer handle, to temporarily keep the output result for next stage
}
SQueryTask
;
typedef
struct
SQueryJob
{
SArray
**
pSubtasks
;
// todo
}
SQueryJob
;
/**
* Process the query job, generated according to the query physical plan.
* This is a synchronized API, and is also thread-safety.
* @param pJob
* @return
*/
int32_t
qProcessQueryJob
(
struct
SQueryJob
*
pJob
);
int32_t
scheduleQueryJob
(
SQueryDag
*
pDag
,
void
**
pJob
);
int32_t
scheduleFetchRows
(
void
*
pJob
,
void
*
data
);
/**
* The SSqlObj should not be here????
* @param pSql
* @param pVgroupId
* @param pRetVgroupId
* @return
*/
//SArray* qGetInvolvedVgroupIdList(struct SSqlObj* pSql, SArray* pVgroupId, SArray* pRetVgroupId);
/**
* Cancel query job
* @param pJob
* @return
*/
int32_t
qKillQueryJob
(
struct
SQueryJob
*
pJob
);
int32_t
scheduleCancelJob
(
void
*
pJob
);
#ifdef __cplusplus
}
...
...
source/libs/scheduler/inc/schedulerInt.h
浏览文件 @
8146c0e0
...
...
@@ -31,8 +31,22 @@ typedef struct SQuery {
int32_t
currentLevel
;
}
SQuery
;
typedef
struct
SQueryTask
{
uint64_t
queryId
;
// query id
uint64_t
taskId
;
// task id
char
*
pSubplan
;
// operator tree
uint64_t
status
;
// task status
SQueryProfileSummary
summary
;
// task execution summary
void
*
pOutputHandle
;
// result buffer handle, to temporarily keep the output result for next stage
}
SQueryTask
;
typedef
struct
SQueryJob
{
SArray
**
pSubtasks
;
// todo
}
SQueryJob
;
#ifdef __cplusplus
}
#endif
#endif
/*_TD_SCHEDULER_INT_H_*/
\ No newline at end of file
#endif
/*_TD_SCHEDULER_INT_H_*/
source/libs/scheduler/src/scheduler.c
浏览文件 @
8146c0e0
...
...
@@ -13,4 +13,45 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "schedulerInt.h"
\ No newline at end of file
#include "schedulerInt.h"
#include "taosmsg.h"
int32_t
schBuildAndSendRequest
(
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
__taos_async_fn_t
fp
)
{
/*
SRequestObj *pRequest = createRequest(pTscObj, fp, param, TSDB_SQL_CONNECT);
if (pRequest == NULL) {
return TSDB_CODE_TSC_OUT_OF_MEMORY;
}
SRequestMsgBody body = {0};
buildConnectMsg(pRequest, &body);
int64_t transporterId = 0;
sendMsgToServer(pTscObj->pTransporter, &pTscObj->pAppInfo->mgmtEp.epSet, &body, &transporterId);
tsem_wait(&pRequest->body.rspSem);
destroyConnectMsg(&body);
if (pRequest->code != TSDB_CODE_SUCCESS) {
const char *errorMsg = (pRequest->code == TSDB_CODE_RPC_FQDN_ERROR) ? taos_errstr(pRequest) : tstrerror(terrno);
printf("failed to connect to server, reason: %s\n\n", errorMsg);
destroyRequest(pRequest);
taos_close(pTscObj);
pTscObj = NULL;
} else {
tscDebug("0x%"PRIx64" connection is opening, connId:%d, dnodeConn:%p", pTscObj->id, pTscObj->connId, pTscObj->pTransporter);
destroyRequest(pRequest);
}
*/
}
int32_t
scheduleQueryJob
(
SQueryDag
*
pDag
,
void
**
pJob
);
int32_t
scheduleFetchRows
(
void
*
pJob
,
void
*
data
);
int32_t
scheduleCancelJob
(
void
*
pJob
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录