提交 0f06fb97 编写于 作者: H Hongze Cheng

TD-353

上级 5fe9e586
...@@ -161,7 +161,7 @@ typedef struct { ...@@ -161,7 +161,7 @@ typedef struct {
int64_t index; int64_t index;
int numOfCacheBlocks; int numOfCacheBlocks;
SList * memPool; SList * memPool;
} STsdbCachePool; } STsdbBufferPool;
typedef struct { typedef struct {
TSKEY keyFirst; TSKEY keyFirst;
...@@ -173,7 +173,7 @@ typedef struct { ...@@ -173,7 +173,7 @@ typedef struct {
typedef struct { typedef struct {
int cacheBlockSize; int cacheBlockSize;
int totalCacheBlocks; int totalCacheBlocks;
STsdbCachePool pool; STsdbBufferPool pool;
STsdbCacheBlock *curBlock; STsdbCacheBlock *curBlock;
SCacheMem * mem; SCacheMem * mem;
SCacheMem * imem; SCacheMem * imem;
......
...@@ -35,7 +35,7 @@ STsdbCache *tsdbInitCache(int cacheBlockSize, int totalBlocks, TsdbRepoT *pRepo) ...@@ -35,7 +35,7 @@ STsdbCache *tsdbInitCache(int cacheBlockSize, int totalBlocks, TsdbRepoT *pRepo)
pCache->totalCacheBlocks = totalBlocks; pCache->totalCacheBlocks = totalBlocks;
pCache->pRepo = pRepo; pCache->pRepo = pRepo;
STsdbCachePool *pPool = &(pCache->pool); STsdbBufferPool *pPool = &(pCache->pool);
pPool->index = 0; pPool->index = 0;
pPool->memPool = tdListNew(sizeof(STsdbCacheBlock *)); pPool->memPool = tdListNew(sizeof(STsdbCacheBlock *));
if (pPool->memPool == NULL) goto _err; if (pPool->memPool == NULL) goto _err;
...@@ -106,7 +106,7 @@ static void tsdbFreeCacheMem(SCacheMem *mem) { ...@@ -106,7 +106,7 @@ static void tsdbFreeCacheMem(SCacheMem *mem) {
} }
static int tsdbAllocBlockFromPool(STsdbCache *pCache) { static int tsdbAllocBlockFromPool(STsdbCache *pCache) {
STsdbCachePool *pPool = &(pCache->pool); STsdbBufferPool *pPool = &(pCache->pool);
tsdbLockRepo(pCache->pRepo); tsdbLockRepo(pCache->pRepo);
if (listNEles(pPool->memPool) == 0) { if (listNEles(pPool->memPool) == 0) {
...@@ -170,7 +170,7 @@ int tsdbAlterCacheTotalBlocks(STsdbRepo *pRepo, int totalBlocks) { ...@@ -170,7 +170,7 @@ int tsdbAlterCacheTotalBlocks(STsdbRepo *pRepo, int totalBlocks) {
} }
static int tsdbAddCacheBlockToPool(STsdbCache *pCache) { static int tsdbAddCacheBlockToPool(STsdbCache *pCache) {
STsdbCachePool *pPool = &pCache->pool; STsdbBufferPool *pPool = &pCache->pool;
STsdbCacheBlock *pBlock = malloc(sizeof(STsdbCacheBlock) + pCache->cacheBlockSize); STsdbCacheBlock *pBlock = malloc(sizeof(STsdbCacheBlock) + pCache->cacheBlockSize);
if (pBlock == NULL) return -1; if (pBlock == NULL) return -1;
...@@ -184,7 +184,7 @@ static int tsdbAddCacheBlockToPool(STsdbCache *pCache) { ...@@ -184,7 +184,7 @@ static int tsdbAddCacheBlockToPool(STsdbCache *pCache) {
} }
static int tsdbRemoveCacheBlockFromPool(STsdbCache *pCache) { static int tsdbRemoveCacheBlockFromPool(STsdbCache *pCache) {
STsdbCachePool *pPool = &pCache->pool; STsdbBufferPool *pPool = &pCache->pool;
STsdbCacheBlock *pBlock = NULL; STsdbCacheBlock *pBlock = NULL;
ASSERT(pCache->totalCacheBlocks >= 0); ASSERT(pCache->totalCacheBlocks >= 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册