TD-353
This commit is contained in:
parent
28fd0574db
commit
d5c20d7b53
|
@ -292,6 +292,9 @@ int tsdbOpenBufPool(STsdbRepo* pRepo);
|
||||||
SListNode* tsdbAllocBufBlockFromPool(STsdbRepo* pRepo);
|
SListNode* tsdbAllocBufBlockFromPool(STsdbRepo* pRepo);
|
||||||
|
|
||||||
// ------------------ tsdbMemTable.c
|
// ------------------ tsdbMemTable.c
|
||||||
|
int tsdbInsertRowToMem(STsdbRepo* pRepo, SDataRow row, STable* pTable);
|
||||||
|
int tsdbRefMemTable(STsdbRepo* pRepo, SMemTable* pMemTable);
|
||||||
|
int tsdbUnRefMemTable(STsdbRepo* pRepo, SMemTable* pMemTable);
|
||||||
|
|
||||||
// ------------------ tsdbFile.c
|
// ------------------ tsdbFile.c
|
||||||
#define TSDB_KEY_FILEID(key, daysPerFile, precision) ((key) / tsMsPerDay[(precision)] / (daysPerFile))
|
#define TSDB_KEY_FILEID(key, daysPerFile, precision) ((key) / tsMsPerDay[(precision)] / (daysPerFile))
|
||||||
|
|
|
@ -18,6 +18,16 @@
|
||||||
|
|
||||||
#define TSDB_DATA_SKIPLIST_LEVEL 5
|
#define TSDB_DATA_SKIPLIST_LEVEL 5
|
||||||
|
|
||||||
|
static FORCE_INLINE STsdbBufBlock *tsdbGetCurrBufBlock(STsdbRepo *pRepo);
|
||||||
|
|
||||||
|
static void * tsdbAllocBytes(STsdbRepo *pRepo, int bytes);
|
||||||
|
static void tsdbFreeBytes(STsdbRepo *pRepo, void *ptr, int bytes);
|
||||||
|
static SMemTable * tsdbNewMemTable(STsdbCfg *pCfg);
|
||||||
|
static void tsdbFreeMemTable(SMemTable *pMemTable);
|
||||||
|
static STableData *tsdbNewTableData(STsdbCfg *pCfg, STable *pTable);
|
||||||
|
static void tsdbFreeTableData(STableData *pTableData);
|
||||||
|
static char * tsdbGetTsTupleKey(const void *data);
|
||||||
|
|
||||||
// ---------------- INTERNAL FUNCTIONS ----------------
|
// ---------------- INTERNAL FUNCTIONS ----------------
|
||||||
int tsdbInsertRowToMem(STsdbRepo *pRepo, SDataRow row, STable *pTable) {
|
int tsdbInsertRowToMem(STsdbRepo *pRepo, SDataRow row, STable *pTable) {
|
||||||
STsdbCfg * pCfg = &pRepo->config;
|
STsdbCfg * pCfg = &pRepo->config;
|
||||||
|
@ -104,7 +114,6 @@ int tsdbUnRefMemTable(STsdbRepo *pRepo, SMemTable *pMemTable) {
|
||||||
STsdbBufPool *pBufPool = pRepo->pPool;
|
STsdbBufPool *pBufPool = pRepo->pPool;
|
||||||
|
|
||||||
SListNode *pNode = NULL;
|
SListNode *pNode = NULL;
|
||||||
// TODO: check the correctness of this code part
|
|
||||||
if (tsdbLockRepo(pRepo) < 0) return -1;
|
if (tsdbLockRepo(pRepo) < 0) return -1;
|
||||||
while ((pNode = tdListPopHead(pMemTable->bufBlockList)) != NULL) {
|
while ((pNode = tdListPopHead(pMemTable->bufBlockList)) != NULL) {
|
||||||
tdListAppendNode(pBufPool->bufBlockList, pNode);
|
tdListAppendNode(pBufPool->bufBlockList, pNode);
|
||||||
|
|
Loading…
Reference in New Issue