提交 532d4a26 编写于 作者: H hzcheng

more

上级 b9767722
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
project(tsdb)
add_subdirectory(common) add_subdirectory(common)
add_subdirectory(tsdb) add_subdirectory(tsdb)
......
...@@ -16,18 +16,7 @@ typedef enum { ...@@ -16,18 +16,7 @@ typedef enum {
TD_DATATYPE_BINARY TD_DATATYPE_BINARY
} td_datatype_t; } td_datatype_t;
const int32_t rowDataLen[] = { extern const int32_t rowDataLen[];
sizeof(int8_t), // TD_DATATYPE_BOOL,
sizeof(int8_t), // TD_DATATYPE_TINYINT,
sizeof(int16_t), // TD_DATATYPE_SMALLINT,
sizeof(int32_t), // TD_DATATYPE_INT,
sizeof(int64_t), // TD_DATATYPE_BIGINT,
sizeof(float), // TD_DATATYPE_FLOAT,
sizeof(double), // TD_DATATYPE_DOUBLE,
sizeof(int32_t), // TD_DATATYPE_VARCHAR,
sizeof(int32_t), // TD_DATATYPE_NCHAR,
sizeof(int32_t) // TD_DATATYPE_BINARY
};
// TODO: finish below // TODO: finish below
#define TD_DATATYPE_BOOL_NULL #define TD_DATATYPE_BOOL_NULL
......
...@@ -29,4 +29,8 @@ int32_t tdGetMaxDataRowSize(SSchema *pSchema) { ...@@ -29,4 +29,8 @@ int32_t tdGetMaxDataRowSize(SSchema *pSchema) {
nbytes += TD_DATA_ROW_HEADER_SIZE; nbytes += TD_DATA_ROW_HEADER_SIZE;
return nbytes; return nbytes;
}
SDataRow tdSDataRowDup(SDataRow rdata) {
return NULL;
} }
\ No newline at end of file
#include <stdlib.h> #include <stdlib.h>
#include "schema.h" #include "schema.h"
const int32_t rowDataLen[] = {
sizeof(int8_t), // TD_DATATYPE_BOOL,
sizeof(int8_t), // TD_DATATYPE_TINYINT,
sizeof(int16_t), // TD_DATATYPE_SMALLINT,
sizeof(int32_t), // TD_DATATYPE_INT,
sizeof(int64_t), // TD_DATATYPE_BIGINT,
sizeof(float), // TD_DATATYPE_FLOAT,
sizeof(double), // TD_DATATYPE_DOUBLE,
sizeof(int32_t), // TD_DATATYPE_VARCHAR,
sizeof(int32_t), // TD_DATATYPE_NCHAR,
sizeof(int32_t) // TD_DATATYPE_BINARY
};
static size_t tdGetEstimatedISchemaLen(SSchema *pSchema) { static size_t tdGetEstimatedISchemaLen(SSchema *pSchema) {
size_t colNameLen = 0; size_t colNameLen = 0;
...@@ -82,4 +94,8 @@ int32_t tdGetColumnIdxById(SSchema *pSchema, int32_t colId) { ...@@ -82,4 +94,8 @@ int32_t tdGetColumnIdxById(SSchema *pSchema, int32_t colId) {
} }
} }
return -1; return -1;
}
SSchema *tdDupSchema(SSchema *pSchema) {
return NULL;
} }
\ No newline at end of file
...@@ -4,9 +4,19 @@ ...@@ -4,9 +4,19 @@
#include "tsdb.h" #include "tsdb.h"
TEST(TsdbTest, createTsdbRepo) { TEST(TsdbTest, createTsdbRepo) {
STsdbCfg *pCfg = (STsdbCfg *)malloc(sizeof(STsdbCfg)); STsdbCfg config;
free(pCfg); config.precision = TSDB_PRECISION_MILLI;
config.tsdbId = 0;
config.maxTables = 100;
config.daysPerFile = 10;
config.minRowsPerFileBlock = 100;
config.maxRowsPerFileBlock = 4096;
config.maxCacheSize = 4 * 1024 * 1024;
ASSERT_EQ(1, 2/2); tsdb_repo_t *pRepo = tsdbCreateRepo("/root/mnt/test/vnode0", &config, NULL);
ASSERT_NE(pRepo, nullptr);
tsdbCloseRepo(pRepo);
} }
\ No newline at end of file
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCE_LIST) aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src SOURCE_LIST)
add_library(tsdb STATIC ${SOURCE_LIST}) add_library(tsdb STATIC ${SOURCE_LIST})
target_link_libraries(tsdb common) target_link_libraries(tsdb common tutil)
target_include_directories(tsdb target_include_directories(tsdb
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/inc" PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/inc"
......
...@@ -31,12 +31,13 @@ typedef enum { ...@@ -31,12 +31,13 @@ typedef enum {
TSDB_FILE_TYPE_META // .meta file type TSDB_FILE_TYPE_META // .meta file type
} TSDB_FILE_TYPE; } TSDB_FILE_TYPE;
const char *tsdbFileSuffix[] = { extern const char *tsdbFileSuffix[];
".head", // TSDB_FILE_TYPE_HEAD // const char *tsdbFileSuffix[] = {
".data", // TSDB_FILE_TYPE_DATA // ".head", // TSDB_FILE_TYPE_HEAD
".last", // TSDB_FILE_TYPE_LAST // ".data", // TSDB_FILE_TYPE_DATA
".meta" // TSDB_FILE_TYPE_META // ".last", // TSDB_FILE_TYPE_LAST
}; // ".meta" // TSDB_FILE_TYPE_META
// };
typedef struct { typedef struct {
int64_t fileSize; int64_t fileSize;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册