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

more

上级 b9767722
cmake_minimum_required(VERSION 2.8)
project(tsdb)
add_subdirectory(common)
add_subdirectory(tsdb)
......
......@@ -16,18 +16,7 @@ typedef enum {
TD_DATATYPE_BINARY
} td_datatype_t;
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
};
extern const int32_t rowDataLen[];
// TODO: finish below
#define TD_DATATYPE_BOOL_NULL
......
......@@ -29,4 +29,8 @@ int32_t tdGetMaxDataRowSize(SSchema *pSchema) {
nbytes += TD_DATA_ROW_HEADER_SIZE;
return nbytes;
}
SDataRow tdSDataRowDup(SDataRow rdata) {
return NULL;
}
\ No newline at end of file
#include <stdlib.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) {
size_t colNameLen = 0;
......@@ -82,4 +94,8 @@ int32_t tdGetColumnIdxById(SSchema *pSchema, int32_t colId) {
}
}
return -1;
}
SSchema *tdDupSchema(SSchema *pSchema) {
return NULL;
}
\ No newline at end of file
......@@ -4,9 +4,19 @@
#include "tsdb.h"
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)
add_library(tsdb STATIC ${SOURCE_LIST})
target_link_libraries(tsdb common)
target_link_libraries(tsdb common tutil)
target_include_directories(tsdb
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/inc"
......
......@@ -31,12 +31,13 @@ typedef enum {
TSDB_FILE_TYPE_META // .meta file type
} TSDB_FILE_TYPE;
const char *tsdbFileSuffix[] = {
".head", // TSDB_FILE_TYPE_HEAD
".data", // TSDB_FILE_TYPE_DATA
".last", // TSDB_FILE_TYPE_LAST
".meta" // TSDB_FILE_TYPE_META
};
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册