refactor: rename variables

This commit is contained in:
shenglian zhou 2023-12-06 09:39:38 +08:00
parent 8ff3f8e25e
commit a2e7c78d27
8 changed files with 24 additions and 23 deletions

View File

@ -158,7 +158,7 @@ typedef enum {
typedef union {
struct {
int32_t fileSetId;
int32_t filesetId;
} duration;
} STsdReaderNotifyInfo;
@ -183,7 +183,7 @@ typedef struct TsdReader {
int64_t (*tsdReaderGetNumOfInMemRows)();
void (*tsdReaderNotifyClosing)();
void (*tsdSetDurationOrder)(void* pReader);
void (*tsdSetFilesetDelimited)(void* pReader);
void (*tsdSetSetNotifyCb)(void* pReader, TsdReaderNotifyCbFn notifyFn, void* param);
} TsdReader;

View File

@ -118,6 +118,7 @@ typedef struct SScanLogicNode {
bool igLastNull;
bool groupOrderScan;
bool onlyMetaCtbIdx; // for tag scan with no tbname
bool filesetDelimited; // returned blocks delimited by fileset
} SScanLogicNode;
typedef struct SJoinLogicNode {

View File

@ -171,7 +171,7 @@ void *tsdbGetIvtIdx2(SMeta *pMeta);
uint64_t tsdbGetReaderMaxVersion2(STsdbReader *pReader);
void tsdbReaderSetCloseFlag(STsdbReader *pReader);
int64_t tsdbGetLastTimestamp2(SVnode *pVnode, void *pTableList, int32_t numOfTables, const char *pIdStr);
void tsdbSetDurationOrder(STsdbReader* pReader);
void tsdbSetFilesetDelimited(STsdbReader* pReader);
void tsdbReaderSetNotifyCb(STsdbReader* pReader, TsdReaderNotifyCbFn notifyFn, void* param);
int32_t tsdbReuseCacherowsReader(void *pReader, void *pTableIdList, int32_t numOfTables);

View File

@ -423,7 +423,7 @@ static int32_t tsdbReaderCreate(SVnode* pVnode, SQueryTableDataCond* pCond, void
goto _end;
}
pReader->bDurationOrder = false;
pReader->bFilesetDelimited = false;
tsdbInitReaderLock(pReader);
tsem_init(&pReader->resumeAfterSuspend, 0, 0);
@ -2520,7 +2520,7 @@ static void prepareDurationForNextFileSet(STsdbReader* pReader) {
if (!pReader->status.bProcMemPreFileset) {
if (pReader->notifyFn) {
STsdReaderNotifyInfo info = {0};
info.duration.fileSetId = fid;
info.duration.filesetId = fid;
pReader->notifyFn(TSD_READER_NOTIFY_DURATION_START, &info, pReader->notifyParam);
}
}
@ -2570,7 +2570,7 @@ static int32_t moveToNextFile(STsdbReader* pReader, SBlockNumber* pBlockNum, SAr
}
if (pBlockNum->numOfBlocks + pBlockNum->numOfSttFiles > 0) {
if (pReader->bDurationOrder) {
if (pReader->bFilesetDelimited) {
prepareDurationForNextFileSet(pReader);
}
break;
@ -3915,7 +3915,7 @@ static int32_t doOpenReaderImpl(STsdbReader* pReader) {
SReaderStatus* pStatus = &pReader->status;
SDataBlockIter* pBlockIter = &pStatus->blockIter;
if (pReader->bDurationOrder) {
if (pReader->bFilesetDelimited) {
getMemTableTimeRange(pReader, &pReader->status.memTableMaxKey, &pReader->status.memTableMinKey);
pReader->status.bProcMemFirstFileset = true;
}
@ -4227,7 +4227,7 @@ int32_t tsdbReaderSuspend2(STsdbReader* pReader) {
tsdbUntakeReadSnap2(pReader, pReader->pReadSnap, false);
pReader->pReadSnap = NULL;
if (pReader->bDurationOrder) {
if (pReader->bFilesetDelimited) {
pReader->status.memTableMinKey = INT64_MAX;
pReader->status.memTableMaxKey = INT64_MIN;
}
@ -4342,7 +4342,7 @@ static bool tsdbReadRowsCountOnly(STsdbReader* pReader) {
return pBlock->info.rows > 0;
}
static int32_t doTsdbNextDataBlockDurationOrder(STsdbReader* pReader) {
static int32_t doTsdbNextDataBlockFilesetDelimited(STsdbReader* pReader) {
SReaderStatus* pStatus = &pReader->status;
int32_t code = TSDB_CODE_SUCCESS;
SSDataBlock* pBlock = pReader->resBlockInfo.pResBlock;
@ -4361,7 +4361,7 @@ static int32_t doTsdbNextDataBlockDurationOrder(STsdbReader* pReader) {
pStatus->bProcMemPreFileset = false;
if (pReader->notifyFn) {
STsdReaderNotifyInfo info = {0};
info.duration.fileSetId = fid;
info.duration.filesetId = fid;
pReader->notifyFn(TSD_READER_NOTIFY_DURATION_START, &info, pReader->notifyParam);
}
resetTableListIndex(pStatus);
@ -4425,10 +4425,10 @@ static int32_t doTsdbNextDataBlock2(STsdbReader* pReader, bool* hasNext) {
if (READ_MODE_COUNT_ONLY == pReader->info.readMode) {
return tsdbReadRowsCountOnly(pReader);
}
if (!pReader->bDurationOrder) {
if (!pReader->bFilesetDelimited) {
code = doTsdbNextDataBlockFilesFirst(pReader);
} else {
code = doTsdbNextDataBlockDurationOrder(pReader);
code = doTsdbNextDataBlockFilesetDelimited(pReader);
}
*hasNext = pBlock->info.rows > 0;
@ -5152,8 +5152,8 @@ void tsdbReaderSetId2(STsdbReader* pReader, const char* idstr) {
void tsdbReaderSetCloseFlag(STsdbReader* pReader) { /*pReader->code = TSDB_CODE_TSC_QUERY_CANCELLED;*/
}
void tsdbSetDurationOrder(STsdbReader* pReader) {
pReader->bDurationOrder = true;
void tsdbSetFilesetDelimited(STsdbReader* pReader) {
pReader->bFilesetDelimited = true;
}
void tsdbReaderSetNotifyCb(STsdbReader* pReader, TsdReaderNotifyCbFn notifyFn, void* param) {

View File

@ -230,7 +230,7 @@ struct STsdbReader {
SBlockInfoBuf blockInfoBuf;
EContentData step;
STsdbReader* innerReader[2];
bool bDurationOrder; // duration by duration output
bool bFilesetDelimited; // duration by duration output
TsdReaderNotifyCbFn notifyFn;
void* notifyParam;
};

View File

@ -61,7 +61,7 @@ void initTsdbReaderAPI(TsdReader* pReader) {
pReader->tsdSetQueryTableList = tsdbSetTableList2;
pReader->tsdSetReaderTaskId = (void (*)(void*, const char*))tsdbReaderSetId2;
pReader->tsdSetDurationOrder = (void (*)(void*))tsdbSetDurationOrder;
pReader->tsdSetFilesetDelimited = (void (*)(void*))tsdbSetFilesetDelimited;
pReader->tsdSetSetNotifyCb = (void (*)(void*, TsdReaderNotifyCbFn, void*))tsdbReaderSetNotifyCb;
}

View File

@ -297,7 +297,7 @@ typedef struct STableMergeScanInfo {
SHashObj* mSkipTables;
int64_t mergeLimit;
SSortExecInfo sortExecInfo;
bool bNewDuration;
bool bNewFileset;
bool bOnlyRetrieveBlock;
} STableMergeScanInfo;

View File

@ -3261,7 +3261,7 @@ static SSDataBlock* getBlockForTableMergeScan(void* param) {
}
if (!hasNext || isTaskKilled(pTaskInfo)) {
pInfo->bNewDuration = false;
pInfo->bNewFileset = false;
if (isTaskKilled(pTaskInfo)) {
qInfo("table merge scan fetch next data block found task killed. %s", GET_TASKID(pTaskInfo));
pAPI->tsdReader.tsdReaderReleaseDataBlock(reader);
@ -3269,7 +3269,7 @@ static SSDataBlock* getBlockForTableMergeScan(void* param) {
break;
}
if (pInfo->bNewDuration) {
if (pInfo->bNewFileset) {
pInfo->bOnlyRetrieveBlock = true;
return NULL;
}
@ -3345,7 +3345,7 @@ int32_t dumpQueryTableCond(const SQueryTableDataCond* src, SQueryTableDataCond*
void tableMergeScanTsdbNotifyCb(ETsdReaderNotifyType type, STsdReaderNotifyInfo* info, void* param) {
STableMergeScanInfo* pTmsInfo = param;
pTmsInfo->bNewDuration = true;
pTmsInfo->bNewFileset = true;
return;
}
@ -3355,7 +3355,7 @@ int32_t startDurationForGroupTableMergeScan(SOperatorInfo* pOperator) {
int32_t code = TSDB_CODE_SUCCESS;
int32_t numOfTable = pInfo->tableEndIndex - pInfo->tableStartIndex + 1;
pInfo->bNewDuration = false;
pInfo->bNewFileset = false;
pInfo->sortBufSize = 2048 * pInfo->bufPageSize;
int32_t numOfBufPage = pInfo->sortBufSize / pInfo->bufPageSize;
@ -3432,7 +3432,7 @@ int32_t startGroupTableMergeScan(SOperatorInfo* pOperator) {
}
if (r == 1) {
uInfo("zsl: DURATION ORDER");
pAPI->tsdReader.tsdSetDurationOrder(pInfo->base.dataReader);
pAPI->tsdReader.tsdSetFilesetDelimited(pInfo->base.dataReader);
} else {
uInfo("zsl: NO DURATION");
}
@ -3541,7 +3541,7 @@ SSDataBlock* doTableMergeScan(SOperatorInfo* pOperator) {
pOperator->resultInfo.totalRows += pBlock->info.rows;
return pBlock;
} else {
if (pInfo->bNewDuration) {
if (pInfo->bNewFileset) {
stopDurationForGroupTableMergeScan(pOperator);
startDurationForGroupTableMergeScan(pOperator);