提交 9fa0685b 编写于 作者: H hzcheng

correct some error

上级 576f7703
......@@ -4,11 +4,11 @@ PROJECT(TDengine)
ADD_SUBDIRECTORY(os)
ADD_SUBDIRECTORY(util)
ADD_SUBDIRECTORY(rpc)
ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(kit)
ADD_SUBDIRECTORY(plugins)
ADD_SUBDIRECTORY(sdb)
ADD_SUBDIRECTORY(mnode)
# ADD_SUBDIRECTORY(client)
# ADD_SUBDIRECTORY(kit)
# ADD_SUBDIRECTORY(plugins)
# ADD_SUBDIRECTORY(sdb)
# ADD_SUBDIRECTORY(mnode)
ADD_SUBDIRECTORY(vnode)
ADD_SUBDIRECTORY(dnode)
# ADD_SUBDIRECTORY(dnode)
#ADD_SUBDIRECTORY(connector/jdbc)
......@@ -10,6 +10,7 @@ TEST(TsdbTest, createTsdbRepo) {
config.tsdbId = 0;
config.maxTables = 100;
config.daysPerFile = 10;
config.keep = 3650;
config.minRowsPerFileBlock = 100;
config.maxRowsPerFileBlock = 4096;
config.maxCacheSize = 4 * 1024 * 1024;
......
......@@ -32,12 +32,6 @@ typedef enum {
} TSDB_FILE_TYPE;
extern const char *tsdbFileSuffix[];
// const char *tsdbFileSuffix[] = {
// ".head", // TSDB_FILE_TYPE_HEAD
// ".data", // TSDB_FILE_TYPE_DATA
// ".last", // TSDB_FILE_TYPE_LAST
// ".meta" // TSDB_FILE_TYPE_META
// };
typedef struct {
int64_t fileSize;
......@@ -55,6 +49,8 @@ typedef struct {
// int16_t numOfBlocks;
// } SDataBlock;
#define IS_VALID_TSDB_FILE_TYPE(type) ((type) >= TSDB_FILE_TYPE_HEAD && (type) <= TSDB_FILE_TYPE_META)
char *tsdbGetFileName(char *dirName, char *fname, TSDB_FILE_TYPE type);
#ifdef __cplusplus
......
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tsdbFile.h"
const char *tsdbFileSuffix[] = {
".head", // TSDB_FILE_TYPE_HEAD
".data", // TSDB_FILE_TYPE_DATA
".last", // TSDB_FILE_TYPE_LAST
".meta" // TSDB_FILE_TYPE_META
};
char *tsdbGetFileName(char *dirName, char *fname, TSDB_FILE_TYPE type) {
// TODO
return NULL;
if (!IS_VALID_TSDB_FILE_TYPE(type)) return NULL;
char *fileName = (char *)malloc(strlen(dirName) + strlen(fname) + strlen(tsdbFileSuffix[type]) + 5);
if (fileName == NULL) return NULL;
sprintf(fileName, "%s/%s%s", dirName, fname, tsdbFileSuffix[type]);
return fileName;
}
\ No newline at end of file
......@@ -241,7 +241,7 @@ static int32_t tsdbSetRepoEnv(STsdbRepo *pRepo) {
return -1;
}
sprintf(dirName, "%s/%s", pRepo->rootDir, dirName);
sprintf(dirName, "%s/%s", pRepo->rootDir, "tsdb");
if (mkdir(dirName, 0755) < 0) {
free(dirName);
return -1;
......
......@@ -90,7 +90,7 @@ int32_t tsdbCreateTableImpl(STsdbMeta *pMeta, STableCfg *pCfg) {
pSTable->stableUid = -1;
pSTable->numOfCols = pCfg->numOfCols;
pSTable->pSchema = tdDupSchema(pCfg->schema);
pSTable->content.pIndex = tSkipListCreate(5, 0, 10); // TODO: change here
// pSTable->content.pIndex = tSkipListCreate(5, 0, 10); // TODO: change here
tsdbAddTable(pMeta, pSTable);
} else {
if (pSTable->type != TSDB_SUPER_TABLE) return NULL;
......@@ -113,7 +113,7 @@ int32_t tsdbCreateTableImpl(STsdbMeta *pMeta, STableCfg *pCfg) {
pTable->stableUid = -1;
pTable->pSchema = tdDupSchema(pCfg->schema);
}
pTable->content.pData = tSkipListCreate(5, 0, 10); // TODO: change here
// pTable->content.pData = tSkipListCreate(5, 0, 10); // TODO: change here
tsdbAddTable(pMeta, pTable);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册