diff --git a/src/dnode/CMakeLists.txt b/src/dnode/CMakeLists.txt index ef7d6e29811e5f685d15e62b66f6108521a95561..af840718497c3634cbe3d1284d08883c9abb6da6 100644 --- a/src/dnode/CMakeLists.txt +++ b/src/dnode/CMakeLists.txt @@ -10,7 +10,7 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) AUX_SOURCE_DIRECTORY(src SRC) ADD_EXECUTABLE(taosd ${SRC}) - TARGET_LINK_LIBRARIES(taosd mnode sdb taos_static monitor http) + TARGET_LINK_LIBRARIES(taosd mnode sdb taos_static monitor http tsdb) #IF (TD_CLUSTER) # TARGET_LINK_LIBRARIES(taosd dcluster) diff --git a/src/vnode/common/inc/dataformat.h b/src/vnode/common/inc/dataformat.h index 9e72ed5d6bb98a544cad61a2ec886ab22c873978..9399d38023f2a8cff6ba5b840575d9ed40d8b7c5 100644 --- a/src/vnode/common/inc/dataformat.h +++ b/src/vnode/common/inc/dataformat.h @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ #if !defined(_TD_DATA_FORMAT_H_) #define _TD_DATA_FORMAT_H_ @@ -5,6 +19,9 @@ #include "schema.h" +#ifdef __cplusplus +extern "C" { +#endif // ----------------- Data row structure /* A data row, the format of it is like below: @@ -71,4 +88,8 @@ SDataRow tdSDataRowDup(SDataRow rdata); */ int32_t tdGetMaxDataRowSize(SSchema *pSchema); +#ifdef __cplusplus +} +#endif + #endif // _TD_DATA_FORMAT_H_ diff --git a/src/vnode/tsdb/inc/tsdb.h b/src/vnode/tsdb/inc/tsdb.h index bf27d127d3f2d4217b436a9c0aae8c904845362f..655448ed16f0685f7209f8c69a4498ad227930d4 100644 --- a/src/vnode/tsdb/inc/tsdb.h +++ b/src/vnode/tsdb/inc/tsdb.h @@ -1,6 +1,17 @@ -/************************************** - * FOR OUTSIDE USAGE - **************************************/ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ #if !defined(_TD_TSDB_H_) #define _TD_TSDB_H_ @@ -11,6 +22,10 @@ #include "dataformat.h" #include "schema.h" +#ifdef __cplusplus +extern "C" { +#endif + #define TSDB_VERSION_MAJOR 1 #define TSDB_VERSION_MINOR 0 @@ -324,4 +339,8 @@ STableIDList *tsdbGetTableList(tsdb_query_handle_t *pQueryHandle); */ STableIDList *tsdbQueryTableList(int16_t stableId, const char *pTagCond); +#ifdef __cplusplus +} +#endif + #endif // _TD_TSDB_H_ \ No newline at end of file diff --git a/src/vnode/tsdb/inc/tsdbCache.h b/src/vnode/tsdb/inc/tsdbCache.h index 6521b0fd9f7fe6ea730f87ddf38e0bd00a191fcb..31d8221723f377fc0fec456bdd65164e035ba067 100644 --- a/src/vnode/tsdb/inc/tsdbCache.h +++ b/src/vnode/tsdb/inc/tsdbCache.h @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ #if !defined(_TD_TSDBCACHE_H_) #define _TD_TSDBCACHE_H_ @@ -5,6 +19,10 @@ // #include "cache.h" +#ifdef __cplusplus +extern "C" { +#endif + #define TSDB_DEFAULT_CACHE_BLOCK_SIZE 16*1024*1024 /* 16M */ typedef struct { @@ -38,4 +56,8 @@ typedef struct STSDBCache { SCacheHandle *tsdbCreateCache(int32_t numOfBlocks); int32_t tsdbFreeCache(SCacheHandle *pHandle); +#ifdef __cplusplus +} +#endif + #endif // _TD_TSDBCACHE_H_ diff --git a/src/vnode/tsdb/inc/tsdbFile.h b/src/vnode/tsdb/inc/tsdbFile.h index 8ea0a8b0f72ec393879966a9c13361799bb29c72..2dda32380560c477b5d24034d3629ad23b609d5c 100644 --- a/src/vnode/tsdb/inc/tsdbFile.h +++ b/src/vnode/tsdb/inc/tsdbFile.h @@ -1,9 +1,27 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ #if !defined(_TD_TSDB_FILE_H_) #define _TD_TSDB_FILE_H_ #include // #include "tstring.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef int32_t file_id_t; typedef enum { @@ -38,4 +56,8 @@ typedef struct { char *tsdbGetFileName(char *dirName, char *fname, TSDB_FILE_TYPE type); +#ifdef __cplusplus +} +#endif + #endif // _TD_TSDB_FILE_H_ diff --git a/src/vnode/tsdb/inc/tsdbMeta.h b/src/vnode/tsdb/inc/tsdbMeta.h index 21c75212caf71a5f6f3a74d0a4641fa29f87fbd7..99930e94540aee37bd49e6b6b3cddc43df66863b 100644 --- a/src/vnode/tsdb/inc/tsdbMeta.h +++ b/src/vnode/tsdb/inc/tsdbMeta.h @@ -1,11 +1,28 @@ -/************************************ - * For internal usage - ************************************/ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#if !defined(_TSDB_META_H_) +#define _TSDB_META_H_ #include #include "dataformat.h" +#ifdef __cplusplus +extern "C" { +#endif + // #include "taosdef.h" // Initially, there are 4 tables @@ -58,10 +75,10 @@ typedef struct STable { } STable; typedef struct { - int32_t maxTables; - STable ** tables; // array of normal tables - STable * stables; // linked list of super tables - void * tableMap; // hash map of uid ==> STable * + int32_t maxTables; + STable **tables; // array of normal tables + STable * stables; // linked list of super tables + void * tableMap; // hash map of uid ==> STable * } STsdbMeta; // ---- Operation on STable @@ -92,4 +109,10 @@ STsdbMeta *tsdbOpenMetaHandle(char *tsdbDir); int32_t tsdbCreateTableImpl(STsdbMeta *pHandle, STableCfg *pCfg); -int32_t tsdbInsertDataImpl(STsdbMeta *pMeta, STableId tableId, char *pData); \ No newline at end of file +int32_t tsdbInsertDataImpl(STsdbMeta *pMeta, STableId tableId, char *pData); + +#ifdef __cplusplus +} +#endif + +#endif // _TSDB_META_H_ \ No newline at end of file