more work
This commit is contained in:
parent
f80db38c59
commit
288904e901
|
@ -151,6 +151,8 @@ int32_t tPutBlockIdx(uint8_t *p, void *ph);
|
|||
int32_t tGetBlockIdx(uint8_t *p, void *ph);
|
||||
|
||||
// SBlock
|
||||
int32_t tPutBlock(uint8_t *p, void *ph);
|
||||
int32_t tGetBlock(uint8_t *p, void *ph);
|
||||
int32_t tBlockCmprFn(const void *p1, const void *p2);
|
||||
|
||||
// SDelIdx
|
||||
|
|
|
@ -355,6 +355,7 @@ static int32_t tsdbCommitTableData(SCommitter *pCommitter, STbData *pTbData, SBl
|
|||
int32_t iBlock;
|
||||
int32_t nBlock;
|
||||
SBlock *pBlock;
|
||||
SBlock block;
|
||||
|
||||
// check
|
||||
if (pTbData) {
|
||||
|
@ -389,6 +390,25 @@ static int32_t tsdbCommitTableData(SCommitter *pCommitter, STbData *pTbData, SBl
|
|||
blockIdx.size = -1;
|
||||
|
||||
// impl (todo)
|
||||
iBlock = 0;
|
||||
nBlock = pCommitter->oBlock.nItem;
|
||||
do {
|
||||
pRow = tsdbTbDataIterGet(pIter);
|
||||
if (iBlock < nBlock) {
|
||||
pBlock = █
|
||||
code = tMapDataGetItemByIdx(&pCommitter->oBlock, iBlock, pBlock, tGetBlock);
|
||||
if (code) goto _err;
|
||||
} else {
|
||||
pBlock == NULL;
|
||||
}
|
||||
|
||||
if ((pRow == NULL || pRow->pTSRow->ts > pCommitter->maxKey) && pBlock == NULL) break;
|
||||
|
||||
code = tsdbMergeData(pCommitter, pIter, pBlock);
|
||||
if (code) goto _err;
|
||||
|
||||
if (iBlock < nBlock) iBlock++;
|
||||
} while (true);
|
||||
|
||||
// end
|
||||
code = tsdbWriteBlock(pCommitter->pWriter, &pCommitter->nBlock, NULL, &blockIdx);
|
||||
|
|
|
@ -273,6 +273,9 @@ bool tsdbTbDataIterNext(STbDataIter *pIter) {
|
|||
}
|
||||
|
||||
TSDBROW *tsdbTbDataIterGet(STbDataIter *pIter) {
|
||||
// we add here for commit usage
|
||||
if (pIter == NULL) return NULL;
|
||||
|
||||
if (pIter->pRow) {
|
||||
goto _exit;
|
||||
}
|
||||
|
|
|
@ -281,6 +281,20 @@ int32_t tGetBlockIdx(uint8_t *p, void *ph) {
|
|||
}
|
||||
|
||||
// SBlock ======================================================
|
||||
int32_t tPutBlock(uint8_t *p, void *ph) {
|
||||
int32_t n = 0;
|
||||
ASSERT(0);
|
||||
// TODO
|
||||
return n;
|
||||
}
|
||||
|
||||
int32_t tGetBlock(uint8_t *p, void *ph) {
|
||||
int32_t n = 0;
|
||||
ASSERT(0);
|
||||
// TODO
|
||||
return n;
|
||||
}
|
||||
|
||||
int32_t tBlockCmprFn(const void *p1, const void *p2) {
|
||||
int32_t c;
|
||||
SBlock *pBlock1 = (SBlock *)p1;
|
||||
|
|
Loading…
Reference in New Issue