more work
This commit is contained in:
parent
967a6155e3
commit
23a0af9d12
|
@ -302,13 +302,6 @@ size_t tsdbCacheGetCapacity(SVnode *pVnode);
|
||||||
int32_t tsdbCacheLastArray2Row(SArray *pLastArray, STSRow **ppRow, STSchema *pSchema);
|
int32_t tsdbCacheLastArray2Row(SArray *pLastArray, STSRow **ppRow, STSchema *pSchema);
|
||||||
|
|
||||||
// structs =======================
|
// structs =======================
|
||||||
typedef struct {
|
|
||||||
int minFid;
|
|
||||||
int midFid;
|
|
||||||
int maxFid;
|
|
||||||
TSKEY minKey;
|
|
||||||
} SRtn;
|
|
||||||
|
|
||||||
struct STsdbFS {
|
struct STsdbFS {
|
||||||
SDelFile *pDelFile;
|
SDelFile *pDelFile;
|
||||||
SArray *aDFileSet; // SArray<SDFileSet>
|
SArray *aDFileSet; // SArray<SDFileSet>
|
||||||
|
@ -336,19 +329,14 @@ struct SMemSkipListNode {
|
||||||
SMemSkipListNode *forwards[0];
|
SMemSkipListNode *forwards[0];
|
||||||
};
|
};
|
||||||
typedef struct SMemSkipList {
|
typedef struct SMemSkipList {
|
||||||
uint32_t seed;
|
|
||||||
int64_t size;
|
int64_t size;
|
||||||
|
uint32_t seed;
|
||||||
int8_t maxLevel;
|
int8_t maxLevel;
|
||||||
int8_t level;
|
int8_t level;
|
||||||
SMemSkipListNode *pHead;
|
SMemSkipListNode *pHead;
|
||||||
SMemSkipListNode *pTail;
|
SMemSkipListNode *pTail;
|
||||||
} SMemSkipList;
|
} SMemSkipList;
|
||||||
|
|
||||||
struct SDelDataInfo {
|
|
||||||
tb_uid_t suid;
|
|
||||||
tb_uid_t uid;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct STbData {
|
struct STbData {
|
||||||
tb_uid_t suid;
|
tb_uid_t suid;
|
||||||
tb_uid_t uid;
|
tb_uid_t uid;
|
||||||
|
@ -448,6 +436,8 @@ struct SBlockL {
|
||||||
int64_t suid;
|
int64_t suid;
|
||||||
int64_t minUid;
|
int64_t minUid;
|
||||||
int64_t maxUid;
|
int64_t maxUid;
|
||||||
|
TSKEY minKey;
|
||||||
|
TSKEY maxKey;
|
||||||
int64_t minVer;
|
int64_t minVer;
|
||||||
int64_t maxVer;
|
int64_t maxVer;
|
||||||
int32_t nRow;
|
int32_t nRow;
|
||||||
|
|
|
@ -567,9 +567,13 @@ static int32_t tsdbCommitLastBlock(SCommitter *pCommitter) {
|
||||||
// info
|
// info
|
||||||
blockL.suid = pBlockData->suid;
|
blockL.suid = pBlockData->suid;
|
||||||
blockL.nRow = pBlockData->nRow;
|
blockL.nRow = pBlockData->nRow;
|
||||||
|
blockL.minKey = TSKEY_MAX;
|
||||||
|
blockL.maxKey = TSKEY_MIN;
|
||||||
blockL.minVer = VERSION_MAX;
|
blockL.minVer = VERSION_MAX;
|
||||||
blockL.maxVer = VERSION_MIN;
|
blockL.maxVer = VERSION_MIN;
|
||||||
for (int32_t iRow = 0; iRow < pBlockData->nRow; iRow++) {
|
for (int32_t iRow = 0; iRow < pBlockData->nRow; iRow++) {
|
||||||
|
blockL.minKey = TMIN(blockL.minKey, pBlockData->aTSKEY[iRow]);
|
||||||
|
blockL.maxKey = TMAX(blockL.maxKey, pBlockData->aTSKEY[iRow]);
|
||||||
blockL.minVer = TMIN(blockL.minVer, pBlockData->aVersion[iRow]);
|
blockL.minVer = TMIN(blockL.minVer, pBlockData->aVersion[iRow]);
|
||||||
blockL.maxVer = TMAX(blockL.maxVer, pBlockData->aVersion[iRow]);
|
blockL.maxVer = TMAX(blockL.maxVer, pBlockData->aVersion[iRow]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,6 +284,8 @@ int32_t tPutBlockL(uint8_t *p, void *ph) {
|
||||||
n += tPutI64(p ? p + n : p, pBlockL->suid);
|
n += tPutI64(p ? p + n : p, pBlockL->suid);
|
||||||
n += tPutI64(p ? p + n : p, pBlockL->minUid);
|
n += tPutI64(p ? p + n : p, pBlockL->minUid);
|
||||||
n += tPutI64(p ? p + n : p, pBlockL->maxUid);
|
n += tPutI64(p ? p + n : p, pBlockL->maxUid);
|
||||||
|
n += tPutI64v(p ? p + n : p, pBlockL->minKey);
|
||||||
|
n += tPutI64v(p ? p + n : p, pBlockL->maxKey);
|
||||||
n += tPutI64v(p ? p + n : p, pBlockL->minVer);
|
n += tPutI64v(p ? p + n : p, pBlockL->minVer);
|
||||||
n += tPutI64v(p ? p + n : p, pBlockL->maxVer);
|
n += tPutI64v(p ? p + n : p, pBlockL->maxVer);
|
||||||
n += tPutI32v(p ? p + n : p, pBlockL->nRow);
|
n += tPutI32v(p ? p + n : p, pBlockL->nRow);
|
||||||
|
@ -301,6 +303,8 @@ int32_t tGetBlockL(uint8_t *p, void *ph) {
|
||||||
n += tGetI64(p + n, &pBlockL->suid);
|
n += tGetI64(p + n, &pBlockL->suid);
|
||||||
n += tGetI64(p + n, &pBlockL->minUid);
|
n += tGetI64(p + n, &pBlockL->minUid);
|
||||||
n += tGetI64(p + n, &pBlockL->maxUid);
|
n += tGetI64(p + n, &pBlockL->maxUid);
|
||||||
|
n += tGetI64v(p + n, &pBlockL->minKey);
|
||||||
|
n += tGetI64v(p + n, &pBlockL->maxKey);
|
||||||
n += tGetI64v(p + n, &pBlockL->minVer);
|
n += tGetI64v(p + n, &pBlockL->minVer);
|
||||||
n += tGetI64v(p + n, &pBlockL->maxVer);
|
n += tGetI64v(p + n, &pBlockL->maxVer);
|
||||||
n += tGetI32v(p + n, &pBlockL->nRow);
|
n += tGetI32v(p + n, &pBlockL->nRow);
|
||||||
|
|
Loading…
Reference in New Issue