add mock code
This commit is contained in:
parent
2dc928be5f
commit
bd7a2adc5f
|
@ -36,6 +36,10 @@ typedef struct SReadHandle {
|
|||
void* vnode;
|
||||
void* mnd;
|
||||
SMsgCb* pMsgCb;
|
||||
|
||||
/* XXXXXXXXXXXXXXXXXXXX */
|
||||
int32_t deleteQuery;
|
||||
/* XXXXXXXXXXXXXXXXXXXX */
|
||||
// int8_t initTsdbReader;
|
||||
} SReadHandle;
|
||||
|
||||
|
|
|
@ -151,6 +151,10 @@ typedef struct SExecTaskInfo {
|
|||
jmp_buf env; // jump to this position when error happens.
|
||||
EOPTR_EXEC_MODEL execModel; // operator execution model [batch model|stream model]
|
||||
struct SOperatorInfo* pRoot;
|
||||
|
||||
/* XXXXXXXXXXXXXXXXXXXX */
|
||||
SReadHandle* pHandle;
|
||||
/* XXXXXXXXXXXXXXXXXXXX */
|
||||
} SExecTaskInfo;
|
||||
|
||||
enum {
|
||||
|
|
|
@ -139,7 +139,26 @@ int32_t qExecTask(qTaskInfo_t tinfo, SSDataBlock** pRes, uint64_t* useconds) {
|
|||
qDebug("%s execTask is launched", GET_TASKID(pTaskInfo));
|
||||
|
||||
int64_t st = taosGetTimestampUs();
|
||||
/* XXXXXXXXXXXXXXXXXXXX */
|
||||
if (pTaskInfo->pHandle->deleteQuery) {
|
||||
static int32_t first = 1;
|
||||
if (first) {
|
||||
*pRes = createDataBlock();
|
||||
int64_t rows = 33;
|
||||
SColumnInfoData infoData = createColumnInfoData(TSDB_DATA_TYPE_BIGINT, 8, 1);
|
||||
blockDataAppendColInfo(*pRes, &infoData);
|
||||
SColumnInfoData* pCol1 = taosArrayGet((*pRes)->pDataBlock, 0);
|
||||
colDataAppend(pCol1, 0, (char*)&rows, false);
|
||||
first = 0;
|
||||
} else {
|
||||
*pRes = NULL;
|
||||
}
|
||||
} else {
|
||||
/* XXXXXXXXXXXXXXXXXXXX */
|
||||
*pRes = pTaskInfo->pRoot->fpSet.getNextFn(pTaskInfo->pRoot);
|
||||
/* XXXXXXXXXXXXXXXXXXXX */
|
||||
}
|
||||
/* XXXXXXXXXXXXXXXXXXXX */
|
||||
uint64_t el = (taosGetTimestampUs() - st);
|
||||
|
||||
pTaskInfo->cost.elapsedTime += el;
|
||||
|
|
|
@ -4638,6 +4638,10 @@ int32_t createExecTaskInfoImpl(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SRead
|
|||
(*pTaskInfo)->pRoot =
|
||||
createOperatorTree(pPlan->pNode, *pTaskInfo, pHandle, queryId, taskId, &(*pTaskInfo)->tableqinfoList, pPlan->user);
|
||||
|
||||
|
||||
/* XXXXXXXXXXXXXXXXXXXX */
|
||||
(*pTaskInfo)->pHandle = pHandle;
|
||||
/* XXXXXXXXXXXXXXXXXXXX */
|
||||
if (NULL == (*pTaskInfo)->pRoot) {
|
||||
code = (*pTaskInfo)->code;
|
||||
goto _complete;
|
||||
|
|
|
@ -936,6 +936,11 @@ int32_t qwProcessDelete(QW_FPARAMS_DEF, SQWMsg *qwMsg, SDeleteRes *pRes) {
|
|||
|
||||
ctx.plan = plan;
|
||||
|
||||
/* XXXXXXXXXXXXXXXXXXXX */
|
||||
SReadHandle *phandle = (SReadHandle*)qwMsg->node;
|
||||
phandle->deleteQuery = 1;
|
||||
/* XXXXXXXXXXXXXXXXXXXX */
|
||||
|
||||
code = qCreateExecTask(qwMsg->node, mgmt->nodeId, tId, plan, &pTaskInfo, &sinkHandle, NULL, OPTR_EXEC_MODEL_BATCH);
|
||||
if (code) {
|
||||
QW_TASK_ELOG("qCreateExecTask failed, code:%x - %s", code, tstrerror(code));
|
||||
|
|
Loading…
Reference in New Issue