提交 724a3710 编写于 作者: H Hongze Cheng

more

上级 3fdb868a
......@@ -67,6 +67,13 @@ static FORCE_INLINE SMemRow tsdbNextIterRow(SSkipListIterator *pIter) {
return (SMemRow)SL_GET_NODE_DATA(node);
}
static FORCE_INLINE TSKEY tsdbNextIterKey(SSkipListIterator *pIter) {
SMemRow row = tsdbNextIterRow(pIter);
if (row == NULL) return TSDB_DATA_TIMESTAMP_NULL;
return memRowKey(row);
}
#ifdef __cplusplus
}
#endif
......
......@@ -138,10 +138,10 @@ int tsdbCommit(STsdb *pRepo) {
break;
}
}
#if 0
// Loop to commit to each file
fid = tsdbNextCommitFid(&(commith));
#if 0
while (true) {
// Loop over both on disk and memory
if (pSet == NULL && fid == TSDB_IVLD_FID) break;
......@@ -281,28 +281,28 @@ static void tsdbSeekCommitIter(SCommitH *pCommith, TSKEY key) {
}
}
// static int tsdbNextCommitFid(SCommitH *pCommith) {
// STsdb * pRepo = TSDB_COMMIT_REPO(pCommith);
// STsdbCfg *pCfg = REPO_CFG(pRepo);
// int fid = TSDB_IVLD_FID;
// for (int i = 0; i < pCommith->niters; i++) {
// SCommitIter *pIter = pCommith->iters + i;
// if (pIter->pTable == NULL || pIter->pIter == NULL) continue;
// TSKEY nextKey = tsdbNextIterKey(pIter->pIter);
// if (nextKey == TSDB_DATA_TIMESTAMP_NULL) {
// continue;
// } else {
// int tfid = (int)(TSDB_KEY_FID(nextKey, pCfg->daysPerFile, pCfg->precision));
// if (fid == TSDB_IVLD_FID || fid > tfid) {
// fid = tfid;
// }
// }
// }
static int tsdbNextCommitFid(SCommitH *pCommith) {
STsdb * pRepo = TSDB_COMMIT_REPO(pCommith);
STsdbCfg *pCfg = REPO_CFG(pRepo);
int fid = TSDB_IVLD_FID;
// return fid;
// }
for (int i = 0; i < pCommith->niters; i++) {
SCommitIter *pIter = pCommith->iters + i;
// if (pIter->pTable == NULL || pIter->pIter == NULL) continue;
TSKEY nextKey = tsdbNextIterKey(pIter->pIter);
if (nextKey == TSDB_DATA_TIMESTAMP_NULL) {
continue;
} else {
int tfid = (int)(TSDB_KEY_FID(nextKey, pCfg->daysPerFile, pCfg->precision));
if (fid == TSDB_IVLD_FID || fid > tfid) {
fid = tfid;
}
}
}
return fid;
}
static void tsdbDestroyCommitH(SCommitH *pCommith) {
pCommith->pDataCols = tdFreeDataCols(pCommith->pDataCols);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册