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

more

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