more work

This commit is contained in:
Hongze Cheng 2022-06-13 10:44:57 +00:00
parent c94ac9a1e4
commit baea84c6bf
5 changed files with 119 additions and 1778 deletions

View File

@ -35,6 +35,7 @@ typedef struct SColVal SColVal;
typedef struct STSRow2 STSRow2;
typedef struct STSRowBuilder STSRowBuilder;
typedef struct SColData SColData;
typedef struct SColDataBatch SColDataBatch;
typedef struct STagVal STagVal;
typedef struct STag STag;

View File

@ -128,7 +128,7 @@ typedef struct SDFileSetWriter SDFileSetWriter;
// SDFileSetWriter
int32_t tsdbDFileSetWriterOpen(SDFileSetWriter *pWriter, STsdb *pTsdb, SDFileSet *pSet);
int32_t tsdbDFileSetWriterClose(SDFileSetWriter *pWriter);
int32_t tsdbDFileSetWriterClose(SDFileSetWriter *pWriter, int8_t sync);
int32_t tsdbWriteBlockData(SDFileSetWriter *pWriter, SDataCols *pDataCols, SBlock *pBlock);
int32_t tsdbWriteSBlockInfo(SDFileSetWriter *pWriter, SBlockInfo *pBlockInfo, SBlockIdx *pBlockIdx);
int32_t tsdbWriteSBlockIdx(SDFileSetWriter *pWriter, SBlockIdx *pBlockIdx);
@ -145,6 +145,8 @@ int32_t tsdbLoadSBlockStatis(SDFileSetReader *pReader, SBlock *pBlock, SBlockSta
// SDelFReader
// tsdbUtil.c ==============================================================================================
int32_t tsdbKeyFid(TSKEY key, int32_t minutes, int8_t precision);
int32_t tsdbRealloc(uint8_t **ppBuf, int64_t size);
void tsdbFree(uint8_t *pBuf);
@ -282,6 +284,8 @@ struct SBlockIdxItem {
};
struct SBlockIdx {
int64_t suid;
int64_t uid;
uint32_t delimiter;
SOffset offset;
uint32_t nData;

File diff suppressed because it is too large Load Diff

View File

@ -239,6 +239,8 @@ bool tsdbTbDataIterNext(STbDataIter *pIter) {
SMemSkipListNode *pHead = pIter->pTbData->sl.pHead;
SMemSkipListNode *pTail = pIter->pTbData->sl.pTail;
if (pIter == NULL) return false;
if (pIter->backward) {
ASSERT(pIter->pNode != pTail);
@ -271,6 +273,8 @@ bool tsdbTbDataIterGet(STbDataIter *pIter, TSDBROW *pRow) {
SMemSkipListNode *pTail = pIter->pTbData->sl.pTail;
TSDBROW row = {0};
if (pIter == NULL) return false;
if (pRow == NULL) {
pRow = &row;
}

View File

@ -715,3 +715,11 @@ int32_t tGetDelFileHdr(uint8_t *p, SDelFile *pDelFile) {
return n;
}
int32_t tsdbKeyFid(TSKEY key, int32_t minutes, int8_t precision) {
if (key < 0) {
return (int)((key + 1) / tsTickPerMin[precision] / minutes - 1);
} else {
return (int)((key / tsTickPerMin[precision] / minutes));
}
}