TD-34
This commit is contained in:
parent
1575d9f70b
commit
1b601eee75
|
@ -712,7 +712,7 @@ static int32_t tdInsertRowToTable(STsdbRepo *pRepo, SDataRow row, STable *pTable
|
||||||
tSkipListRandNodeInfo(pTable->mem->pData, &level, &headSize);
|
tSkipListRandNodeInfo(pTable->mem->pData, &level, &headSize);
|
||||||
|
|
||||||
TSKEY key = dataRowKey(row);
|
TSKEY key = dataRowKey(row);
|
||||||
printf("insert:%lld, size:%d\n", key, pTable->mem->numOfPoints);
|
// printf("insert:%lld, size:%d\n", key, pTable->mem->numOfPoints);
|
||||||
|
|
||||||
// Copy row into the memory
|
// Copy row into the memory
|
||||||
SSkipListNode *pNode = tsdbAllocFromCache(pRepo->tsdbCache, headSize + dataRowLen(row), key);
|
SSkipListNode *pNode = tsdbAllocFromCache(pRepo->tsdbCache, headSize + dataRowLen(row), key);
|
||||||
|
|
|
@ -79,7 +79,7 @@ TEST(TsdbTest, createRepo) {
|
||||||
|
|
||||||
// // 3. Loop to write some simple data
|
// // 3. Loop to write some simple data
|
||||||
int nRows = 10000000;
|
int nRows = 10000000;
|
||||||
int rowsPerSubmit = 100;
|
int rowsPerSubmit = 10;
|
||||||
int64_t start_time = 1584081000000;
|
int64_t start_time = 1584081000000;
|
||||||
|
|
||||||
SSubmitMsg *pMsg = (SSubmitMsg *)malloc(sizeof(SSubmitMsg) + sizeof(SSubmitBlk) + tdMaxRowBytesFromSchema(schema) * rowsPerSubmit);
|
SSubmitMsg *pMsg = (SSubmitMsg *)malloc(sizeof(SSubmitMsg) + sizeof(SSubmitBlk) + tdMaxRowBytesFromSchema(schema) * rowsPerSubmit);
|
||||||
|
@ -108,7 +108,18 @@ TEST(TsdbTest, createRepo) {
|
||||||
}
|
}
|
||||||
pBlock->len += dataRowLen(row);
|
pBlock->len += dataRowLen(row);
|
||||||
}
|
}
|
||||||
|
pBlock->len = htonl(pBlock->len);
|
||||||
|
pBlock->numOfRows = htonl(pBlock->numOfRows);
|
||||||
|
pBlock->uid = htobe64(pBlock->uid);
|
||||||
|
pBlock->tid = htonl(pBlock->tid);
|
||||||
|
|
||||||
|
pBlock->sversion = htonl(pBlock->sversion);
|
||||||
|
pBlock->padding = htonl(pBlock->padding);
|
||||||
|
|
||||||
pMsg->length = pMsg->length + sizeof(SSubmitBlk) + pBlock->len;
|
pMsg->length = pMsg->length + sizeof(SSubmitBlk) + pBlock->len;
|
||||||
|
pMsg->length = htonl(pMsg->length);
|
||||||
|
pMsg->numOfBlocks = htonl(pMsg->numOfBlocks);
|
||||||
|
pMsg->compressed = htonl(pMsg->numOfBlocks);
|
||||||
|
|
||||||
tsdbInsertData(pRepo, pMsg);
|
tsdbInsertData(pRepo, pMsg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue