提交 baea84c6 编写于 作者: H Hongze Cheng

more work

上级 c94ac9a1
...@@ -35,6 +35,7 @@ typedef struct SColVal SColVal; ...@@ -35,6 +35,7 @@ typedef struct SColVal SColVal;
typedef struct STSRow2 STSRow2; typedef struct STSRow2 STSRow2;
typedef struct STSRowBuilder STSRowBuilder; typedef struct STSRowBuilder STSRowBuilder;
typedef struct SColData SColData; typedef struct SColData SColData;
typedef struct SColDataBatch SColDataBatch;
typedef struct STagVal STagVal; typedef struct STagVal STagVal;
typedef struct STag STag; typedef struct STag STag;
......
...@@ -128,7 +128,7 @@ typedef struct SDFileSetWriter SDFileSetWriter; ...@@ -128,7 +128,7 @@ typedef struct SDFileSetWriter SDFileSetWriter;
// SDFileSetWriter // SDFileSetWriter
int32_t tsdbDFileSetWriterOpen(SDFileSetWriter *pWriter, STsdb *pTsdb, SDFileSet *pSet); 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 tsdbWriteBlockData(SDFileSetWriter *pWriter, SDataCols *pDataCols, SBlock *pBlock);
int32_t tsdbWriteSBlockInfo(SDFileSetWriter *pWriter, SBlockInfo *pBlockInfo, SBlockIdx *pBlockIdx); int32_t tsdbWriteSBlockInfo(SDFileSetWriter *pWriter, SBlockInfo *pBlockInfo, SBlockIdx *pBlockIdx);
int32_t tsdbWriteSBlockIdx(SDFileSetWriter *pWriter, SBlockIdx *pBlockIdx); int32_t tsdbWriteSBlockIdx(SDFileSetWriter *pWriter, SBlockIdx *pBlockIdx);
...@@ -145,6 +145,8 @@ int32_t tsdbLoadSBlockStatis(SDFileSetReader *pReader, SBlock *pBlock, SBlockSta ...@@ -145,6 +145,8 @@ int32_t tsdbLoadSBlockStatis(SDFileSetReader *pReader, SBlock *pBlock, SBlockSta
// SDelFReader // SDelFReader
// tsdbUtil.c ============================================================================================== // tsdbUtil.c ==============================================================================================
int32_t tsdbKeyFid(TSKEY key, int32_t minutes, int8_t precision);
int32_t tsdbRealloc(uint8_t **ppBuf, int64_t size); int32_t tsdbRealloc(uint8_t **ppBuf, int64_t size);
void tsdbFree(uint8_t *pBuf); void tsdbFree(uint8_t *pBuf);
...@@ -282,6 +284,8 @@ struct SBlockIdxItem { ...@@ -282,6 +284,8 @@ struct SBlockIdxItem {
}; };
struct SBlockIdx { struct SBlockIdx {
int64_t suid;
int64_t uid;
uint32_t delimiter; uint32_t delimiter;
SOffset offset; SOffset offset;
uint32_t nData; uint32_t nData;
......
...@@ -239,6 +239,8 @@ bool tsdbTbDataIterNext(STbDataIter *pIter) { ...@@ -239,6 +239,8 @@ bool tsdbTbDataIterNext(STbDataIter *pIter) {
SMemSkipListNode *pHead = pIter->pTbData->sl.pHead; SMemSkipListNode *pHead = pIter->pTbData->sl.pHead;
SMemSkipListNode *pTail = pIter->pTbData->sl.pTail; SMemSkipListNode *pTail = pIter->pTbData->sl.pTail;
if (pIter == NULL) return false;
if (pIter->backward) { if (pIter->backward) {
ASSERT(pIter->pNode != pTail); ASSERT(pIter->pNode != pTail);
...@@ -271,6 +273,8 @@ bool tsdbTbDataIterGet(STbDataIter *pIter, TSDBROW *pRow) { ...@@ -271,6 +273,8 @@ bool tsdbTbDataIterGet(STbDataIter *pIter, TSDBROW *pRow) {
SMemSkipListNode *pTail = pIter->pTbData->sl.pTail; SMemSkipListNode *pTail = pIter->pTbData->sl.pTail;
TSDBROW row = {0}; TSDBROW row = {0};
if (pIter == NULL) return false;
if (pRow == NULL) { if (pRow == NULL) {
pRow = &row; pRow = &row;
} }
......
...@@ -715,3 +715,11 @@ int32_t tGetDelFileHdr(uint8_t *p, SDelFile *pDelFile) { ...@@ -715,3 +715,11 @@ int32_t tGetDelFileHdr(uint8_t *p, SDelFile *pDelFile) {
return n; 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));
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册