From 72f871f0cd5bfc8d7dbfb091c849246b8539e120 Mon Sep 17 00:00:00 2001 From: hzcheng Date: Fri, 20 Mar 2020 12:24:29 +0800 Subject: [PATCH] TD-34 --- src/vnode/tsdb/inc/tsdbFile.h | 1 + src/vnode/tsdb/src/tsdbFile.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vnode/tsdb/inc/tsdbFile.h b/src/vnode/tsdb/inc/tsdbFile.h index 2f38f1f452..89159a06e7 100644 --- a/src/vnode/tsdb/inc/tsdbFile.h +++ b/src/vnode/tsdb/inc/tsdbFile.h @@ -55,6 +55,7 @@ typedef struct { int32_t keep; int32_t minRowPerFBlock; int32_t maxRowsPerFBlock; + int32_t maxTables; SFileGroup fGroup[]; } STsdbFileH; diff --git a/src/vnode/tsdb/src/tsdbFile.c b/src/vnode/tsdb/src/tsdbFile.c index cce5dade4b..8a7e40cabd 100644 --- a/src/vnode/tsdb/src/tsdbFile.c +++ b/src/vnode/tsdb/src/tsdbFile.c @@ -197,6 +197,7 @@ STsdbFileH *tsdbInitFile(char *dataDir, int32_t daysPerFile, int32_t keep, int32 pTsdbFileH->keep = keep; pTsdbFileH->minRowPerFBlock = minRowsPerFBlock; pTsdbFileH->maxRowsPerFBlock = maxRowsPerFBlock; + pTsdbFileH->maxTables = maxTables; // Open the directory to read information of each file DIR *dir = opendir(dataDir); @@ -205,8 +206,9 @@ STsdbFileH *tsdbInitFile(char *dataDir, int32_t daysPerFile, int32_t keep, int32 return NULL; } + char fname[256]; + struct dirent *dp; - char fname[256]; while ((dp = readdir(dir)) != NULL) { if (strncmp(dp->d_name, ".", 1) == 0 || strncmp(dp->d_name, "..", 2) == 0) continue; if (true /* check if the file is the .head file */) { -- GitLab