refact
This commit is contained in:
parent
9ea8640b24
commit
f81d102747
|
@ -206,12 +206,18 @@ struct SDFileSet {
|
||||||
SDFile files[TSDB_FILE_MAX];
|
SDFile files[TSDB_FILE_MAX];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct TSDBKEY {
|
||||||
|
int64_t version;
|
||||||
|
TSKEY ts;
|
||||||
|
};
|
||||||
|
|
||||||
struct STbData {
|
struct STbData {
|
||||||
|
tb_uid_t suid;
|
||||||
tb_uid_t uid;
|
tb_uid_t uid;
|
||||||
TSKEY keyMin;
|
TSDBKEY minKey;
|
||||||
TSKEY keyMax;
|
TSDBKEY maxKey;
|
||||||
int64_t minVer;
|
SDelOp *pHead;
|
||||||
int64_t maxVer;
|
SDelOp *pTail;
|
||||||
int64_t nrows;
|
int64_t nrows;
|
||||||
SSkipList *pData;
|
SSkipList *pData;
|
||||||
};
|
};
|
||||||
|
@ -313,11 +319,6 @@ static FORCE_INLINE TSKEY tsdbNextIterKey(SSkipListIterator *pIter) {
|
||||||
// tsdbReadImpl
|
// tsdbReadImpl
|
||||||
typedef struct SReadH SReadH;
|
typedef struct SReadH SReadH;
|
||||||
|
|
||||||
struct TSDBKEY {
|
|
||||||
int64_t version;
|
|
||||||
TSKEY ts;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint64_t suid;
|
uint64_t suid;
|
||||||
uint64_t uid;
|
uint64_t uid;
|
||||||
|
|
|
@ -305,8 +305,8 @@ int tsdbInsertTableData(STsdb *pTsdb, SSubmitMsgIter *pMsgIter, SSubmitBlk *pBlo
|
||||||
keyMax = TD_ROW_KEY(blkIter.row);
|
keyMax = TD_ROW_KEY(blkIter.row);
|
||||||
|
|
||||||
pTbData->nrows += pMsgIter->numOfRows;
|
pTbData->nrows += pMsgIter->numOfRows;
|
||||||
if (pTbData->keyMin > keyMin) pTbData->keyMin = keyMin;
|
if (pTbData->minKey.ts > keyMin) pTbData->minKey.ts = keyMin;
|
||||||
if (pTbData->keyMax < keyMax) pTbData->keyMax = keyMax;
|
if (pTbData->maxKey.ts < keyMax) pTbData->maxKey.ts = keyMax;
|
||||||
|
|
||||||
pMemTable->nRow += pMsgIter->numOfRows;
|
pMemTable->nRow += pMsgIter->numOfRows;
|
||||||
if (pMemTable->keyMin > keyMin) pMemTable->keyMin = keyMin;
|
if (pMemTable->keyMin > keyMin) pMemTable->keyMin = keyMin;
|
||||||
|
@ -326,8 +326,8 @@ static STbData *tsdbNewTbData(tb_uid_t uid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pTbData->uid = uid;
|
pTbData->uid = uid;
|
||||||
pTbData->keyMin = TSKEY_MAX;
|
pTbData->minKey.ts = TSKEY_MAX;
|
||||||
pTbData->keyMax = TSKEY_MIN;
|
pTbData->maxKey.ts = TSKEY_MIN;
|
||||||
pTbData->nrows = 0;
|
pTbData->nrows = 0;
|
||||||
#if 0
|
#if 0
|
||||||
pTbData->pData = tSkipListCreate(5, TSDB_DATA_TYPE_TIMESTAMP, sizeof(int64_t), tkeyComparFn, SL_DISCARD_DUP_KEY,
|
pTbData->pData = tSkipListCreate(5, TSDB_DATA_TYPE_TIMESTAMP, sizeof(int64_t), tkeyComparFn, SL_DISCARD_DUP_KEY,
|
||||||
|
|
|
@ -791,7 +791,7 @@ static bool initTableMemIterator(STsdbReadHandle* pHandle, STableCheckInfo* pChe
|
||||||
TSKEY key = TD_ROW_KEY(row); // first timestamp in buffer
|
TSKEY key = TD_ROW_KEY(row); // first timestamp in buffer
|
||||||
tsdbDebug("%p uid:%" PRId64 ", check data in mem from skey:%" PRId64 ", order:%d, ts range in buf:%" PRId64
|
tsdbDebug("%p uid:%" PRId64 ", check data in mem from skey:%" PRId64 ", order:%d, ts range in buf:%" PRId64
|
||||||
"-%" PRId64 ", lastKey:%" PRId64 ", numOfRows:%" PRId64 ", %s",
|
"-%" PRId64 ", lastKey:%" PRId64 ", numOfRows:%" PRId64 ", %s",
|
||||||
pHandle, pCheckInfo->tableId, key, order, (*pMem)->keyMin, (*pMem)->keyMax, pCheckInfo->lastKey,
|
pHandle, pCheckInfo->tableId, key, order, (*pMem)->minKey.ts, (*pMem)->maxKey.ts, pCheckInfo->lastKey,
|
||||||
(*pMem)->nrows, pHandle->idStr);
|
(*pMem)->nrows, pHandle->idStr);
|
||||||
|
|
||||||
if (ASCENDING_TRAVERSE(order)) {
|
if (ASCENDING_TRAVERSE(order)) {
|
||||||
|
@ -812,7 +812,7 @@ static bool initTableMemIterator(STsdbReadHandle* pHandle, STableCheckInfo* pChe
|
||||||
TSKEY key = TD_ROW_KEY(row); // first timestamp in buffer
|
TSKEY key = TD_ROW_KEY(row); // first timestamp in buffer
|
||||||
tsdbDebug("%p uid:%" PRId64 ", check data in imem from skey:%" PRId64 ", order:%d, ts range in buf:%" PRId64
|
tsdbDebug("%p uid:%" PRId64 ", check data in imem from skey:%" PRId64 ", order:%d, ts range in buf:%" PRId64
|
||||||
"-%" PRId64 ", lastKey:%" PRId64 ", numOfRows:%" PRId64 ", %s",
|
"-%" PRId64 ", lastKey:%" PRId64 ", numOfRows:%" PRId64 ", %s",
|
||||||
pHandle, pCheckInfo->tableId, key, order, (*pIMem)->keyMin, (*pIMem)->keyMax, pCheckInfo->lastKey,
|
pHandle, pCheckInfo->tableId, key, order, (*pIMem)->minKey.ts, (*pIMem)->maxKey.ts, pCheckInfo->lastKey,
|
||||||
(*pIMem)->nrows, pHandle->idStr);
|
(*pIMem)->nrows, pHandle->idStr);
|
||||||
|
|
||||||
if (ASCENDING_TRAVERSE(order)) {
|
if (ASCENDING_TRAVERSE(order)) {
|
||||||
|
|
Loading…
Reference in New Issue