Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c12fd89c
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c12fd89c
编写于
2月 17, 2020
作者:
H
hzcheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more
上级
416bbe56
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
56 addition
and
27 deletion
+56
-27
src/vnode/CMakeLists.txt
src/vnode/CMakeLists.txt
+6
-3
src/vnode/common/CMakeLists.txt
src/vnode/common/CMakeLists.txt
+8
-0
src/vnode/common/src/schema.c
src/vnode/common/src/schema.c
+1
-1
src/vnode/tsdb/CMakeLists.txt
src/vnode/tsdb/CMakeLists.txt
+9
-0
src/vnode/tsdb/inc/tsdb.h
src/vnode/tsdb/inc/tsdb.h
+9
-2
src/vnode/tsdb/inc/tsdbCache.h
src/vnode/tsdb/inc/tsdbCache.h
+8
-9
src/vnode/tsdb/inc/tsdbFile.h
src/vnode/tsdb/inc/tsdbFile.h
+3
-2
src/vnode/tsdb/inc/tsdbMeta.h
src/vnode/tsdb/inc/tsdbMeta.h
+3
-3
src/vnode/tsdb/src/tsdb.c
src/vnode/tsdb/src/tsdb.c
+5
-4
src/vnode/tsdb/src/tsdbFileStore.c
src/vnode/tsdb/src/tsdbFileStore.c
+1
-1
src/vnode/tsdb/src/tsdbMeta.c
src/vnode/tsdb/src/tsdbMeta.c
+3
-2
未找到文件。
src/vnode/CMakeLists.txt
浏览文件 @
c12fd89c
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8
)
cmake_minimum_required
(
VERSION 2.8
)
PROJECT
(
TDengine
)
ADD_SUBDIRECTORY
(
detail
)
project
(
tsdb
)
\ No newline at end of file
add_subdirectory
(
common
)
add_subdirectory
(
tsdb
)
\ No newline at end of file
src/vnode/common/CMakeLists.txt
0 → 100644
浏览文件 @
c12fd89c
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/src SOURCE_LIST
)
list
(
REMOVE_ITEM SOURCE_LIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/vnodePeer.c
)
message
(
STATUS
"Common source file
${
SOURCE_LIST
}
"
)
add_library
(
common
${
SOURCE_LIST
}
)
target_include_directories
(
common PUBLIC
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
src/vnode/common/src/schema.c
浏览文件 @
c12fd89c
...
@@ -51,7 +51,7 @@ SISchema tdConvertSchemaToInline(SSchema *pSchema) {
...
@@ -51,7 +51,7 @@ SISchema tdConvertSchemaToInline(SSchema *pSchema) {
char
*
pName
=
TD_ISCHEMA_COL_NAMES
(
pISchema
);
char
*
pName
=
TD_ISCHEMA_COL_NAMES
(
pISchema
);
for
(
int32_t
i
=
0
;
i
<
totalCols
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
totalCols
;
i
++
)
{
SColumn
*
pCol
=
TD_SCHEMA_COLUMN_AT
(
TD_ISCHEMA_SCHEMA
(
pISchema
),
i
);
SColumn
*
pCol
=
TD_SCHEMA_COLUMN_AT
(
TD_ISCHEMA_SCHEMA
(
pISchema
),
i
);
char
*
colName
=
TD_COLUMN_NAME
(
TD_SCHEMA_COLUMN_AT
(
pSchema
,
i
)
,
i
);
char
*
colName
=
TD_COLUMN_NAME
(
TD_SCHEMA_COLUMN_AT
(
pSchema
,
i
));
TD_COLUMN_NAME
(
pCol
)
=
pName
;
TD_COLUMN_NAME
(
pCol
)
=
pName
;
...
...
src/vnode/tsdb/CMakeLists.txt
浏览文件 @
c12fd89c
aux_source_directory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/src SOURCE_LIST
)
message
(
STATUS
"tsdb source files:
${
SOURCE_LIST
}
"
)
add_library
(
tsdb STATIC
${
SOURCE_LIST
}
)
target_link_libraries
(
tsdb common
)
target_include_directories
(
tsdb PUBLIC
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
\ No newline at end of file
src/vnode/tsdb/inc/tsdb.h
浏览文件 @
c12fd89c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include <stdbool.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdint.h>
#include "cache.h"
//
#include "cache.h"
#include "schema.h"
#include "schema.h"
#define TSDB_VERSION_MAJOR 1
#define TSDB_VERSION_MAJOR 1
...
@@ -69,7 +69,7 @@ typedef struct {
...
@@ -69,7 +69,7 @@ typedef struct {
SDataShardPolicy
dataShardPolicy
;
SDataShardPolicy
dataShardPolicy
;
SBlockRowsPolicy
blockRowsPolicy
;
SBlockRowsPolicy
blockRowsPolicy
;
SRetentionPolicy
retentionPlicy
;
// retention configuration
SRetentionPolicy
retentionPlicy
;
// retention configuration
SCachePool
*
cachePool
;
// the cache pool the repository to use
void
*
cachePool
;
// the cache pool the repository to use
}
STSDBCfg
;
}
STSDBCfg
;
// the TSDB repository info
// the TSDB repository info
...
@@ -220,6 +220,9 @@ typedef struct STimeWindow {
...
@@ -220,6 +220,9 @@ typedef struct STimeWindow {
int64_t
ekey
;
int64_t
ekey
;
}
STimeWindow
;
}
STimeWindow
;
typedef
struct
{
}
SColumnFilterInfo
;
// query condition to build vnode iterator
// query condition to build vnode iterator
typedef
struct
STSDBQueryCond
{
typedef
struct
STSDBQueryCond
{
STimeWindow
twindow
;
STimeWindow
twindow
;
...
@@ -252,6 +255,10 @@ typedef struct STableIDList {
...
@@ -252,6 +255,10 @@ typedef struct STableIDList {
int32_t
num
;
int32_t
num
;
}
STableIDList
;
}
STableIDList
;
typedef
struct
{
}
SFields
;
/**
/**
* Get the data block iterator, starting from position according to the query condition
* Get the data block iterator, starting from position according to the query condition
* @param pRepo the TSDB repository to query on
* @param pRepo the TSDB repository to query on
...
...
src/vnode/tsdb/inc/tsdbCache.h
浏览文件 @
c12fd89c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#include <stdint.h>
#include <stdint.h>
#include "cache.h"
//
#include "cache.h"
#define TSDB_DEFAULT_CACHE_BLOCK_SIZE 16*1024*1024
/* 16M */
#define TSDB_DEFAULT_CACHE_BLOCK_SIZE 16*1024*1024
/* 16M */
...
@@ -13,11 +13,11 @@ typedef struct {
...
@@ -13,11 +13,11 @@ typedef struct {
int32_t
numOfRows
// numOfRows
int32_t
numOfRows
// numOfRows
}
STableCacheInfo
;
}
STableCacheInfo
;
typedef
struct
{
typedef
struct
_tsdb_cache_block
{
char
*
pData
;
char
*
pData
;
STableCacheInfo
*
pTableInfo
;
STableCacheInfo
*
pTableInfo
;
SCacheB
lock
*
prev
;
struct
_tsdb_cache_b
lock
*
prev
;
SCacheB
lock
*
next
;
struct
_tsdb_cache_b
lock
*
next
;
}
STSDBCacheBlock
;
}
STSDBCacheBlock
;
// Use a doublely linked list to implement this
// Use a doublely linked list to implement this
...
@@ -28,7 +28,6 @@ typedef struct STSDBCache {
...
@@ -28,7 +28,6 @@ typedef struct STSDBCache {
void
*
current
;
void
*
current
;
}
SCacheHandle
;
}
SCacheHandle
;
// ---- Operation on STSDBCacheBlock
// ---- Operation on STSDBCacheBlock
#define TSDB_CACHE_BLOCK_DATA(pBlock) ((pBlock)->pData)
#define TSDB_CACHE_BLOCK_DATA(pBlock) ((pBlock)->pData)
#define TSDB_CACHE_AVAIL_SPACE(pBlock) ((char *)((pBlock)->pTableInfo) - ((pBlock)->pData))
#define TSDB_CACHE_AVAIL_SPACE(pBlock) ((char *)((pBlock)->pTableInfo) - ((pBlock)->pData))
...
...
src/vnode/tsdb/inc/tsdbFile.h
浏览文件 @
c12fd89c
#if !defined(_TD_TSDB_FILE_H_)
#if !defined(_TD_TSDB_FILE_H_)
#define _TD_TSDB_FILE_H_
#define _TD_TSDB_FILE_H_
#include "tstring.h"
#include <stdint.h>
// #include "tstring.h"
typedef
int32_t
file_id_t
;
typedef
int32_t
file_id_t
;
...
@@ -24,7 +25,7 @@ typedef struct {
...
@@ -24,7 +25,7 @@ typedef struct {
}
SFileInfo
;
}
SFileInfo
;
typedef
struct
{
typedef
struct
{
tstring_t
fname
;
char
*
fname
;
SFileInfo
fInfo
;
SFileInfo
fInfo
;
}
SFILE
;
}
SFILE
;
...
...
src/vnode/tsdb/inc/tsdbMeta.h
浏览文件 @
c12fd89c
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
#include <pthread.h>
#include <pthread.h>
#include "taosdef.h"
//
#include "taosdef.h"
// Initially, there are 4 tables
// Initially, there are 4 tables
#define TSDB_INIT_NUMBER_OF_SUPER_TABLE 4
#define TSDB_INIT_NUMBER_OF_SUPER_TABLE 4
...
@@ -30,7 +30,7 @@ typedef struct STable {
...
@@ -30,7 +30,7 @@ typedef struct STable {
// For TSDB_SUPER_TABLE, it is the schema including tags
// For TSDB_SUPER_TABLE, it is the schema including tags
// For TSDB_NTABLE, it is only the schema, not including tags
// For TSDB_NTABLE, it is only the schema, not including tags
// For TSDB_STABLE, it is NULL
// For TSDB_STABLE, it is NULL
S
V
Schema
*
pSchema
;
SSchema
*
pSchema
;
// Tag value for this table
// Tag value for this table
// For TSDB_SUPER_TABLE and TSDB_NTABLE, it is NULL
// For TSDB_SUPER_TABLE and TSDB_NTABLE, it is NULL
...
@@ -75,7 +75,7 @@ typedef struct {
...
@@ -75,7 +75,7 @@ typedef struct {
#define TSDB_TABLE_CACHE_DATA(pTable) ((pTable)->content.pData)
#define TSDB_TABLE_CACHE_DATA(pTable) ((pTable)->content.pData)
#define TSDB_SUPER_TABLE_INDEX(pTable) ((pTable)->content.pIndex)
#define TSDB_SUPER_TABLE_INDEX(pTable) ((pTable)->content.pIndex)
S
V
Schema
*
tsdbGetTableSchema
(
STable
*
pTable
);
SSchema
*
tsdbGetTableSchema
(
STable
*
pTable
);
// ---- Operation on SMetaHandle
// ---- Operation on SMetaHandle
#define TSDB_NUM_OF_TABLES(pHandle) ((pHandle)->numOfTables)
#define TSDB_NUM_OF_TABLES(pHandle) ((pHandle)->numOfTables)
...
...
src/vnode/tsdb/src/tsdb.c
浏览文件 @
c12fd89c
...
@@ -2,14 +2,15 @@
...
@@ -2,14 +2,15 @@
#include <stdint.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdlib.h>
#include "taosdef.h"
//
#include "taosdef.h"
// #include "disk.h"
// #include "disk.h"
#include "tsdb.h"
#include "tsdbCache.h"
#include "tsdbCache.h"
#include "tsdbMeta.h"
#include "tsdbMeta.h"
typedef
struct
STSDBRepo
{
typedef
struct
STSDBRepo
{
// TSDB configuration
// TSDB configuration
STSDB
c
fg
*
pCfg
;
STSDB
C
fg
*
pCfg
;
// The meter meta handle of this TSDB repository
// The meter meta handle of this TSDB repository
SMetaHandle
*
pMetaHandle
;
SMetaHandle
*
pMetaHandle
;
...
@@ -18,12 +19,12 @@ typedef struct STSDBRepo {
...
@@ -18,12 +19,12 @@ typedef struct STSDBRepo {
SCacheHandle
*
pCacheHandle
;
SCacheHandle
*
pCacheHandle
;
// Disk tier handle for multi-tier storage
// Disk tier handle for multi-tier storage
SDiskTier
*
pDiskTier
;
void
*
pDiskTier
;
// File Store
// File Store
void
*
pFileStore
;
void
*
pFileStore
;
pthread_mutex
t
_t
tsdbMutex
;
pthread_mutex_t
tsdbMutex
;
}
STSDBRepo
;
}
STSDBRepo
;
...
...
src/vnode/tsdb/src/tsdbFileStore.c
浏览文件 @
c12fd89c
#include "tsdbFile.h"
#include "tsdbFile.h"
char
*
tsdbGetFileName
(
char
*
dirName
,
char
*
fname
,
TSDB_FILE_TYPE
type
){
char
*
tsdbGetFileName
(
char
*
dirName
,
char
*
fname
,
TSDB_FILE_TYPE
type
){
char
*
suffix
=
tsdbFileSuffix
[
type
];
//
char *suffix = tsdbFileSuffix[type];
// TODO
// TODO
}
}
\ No newline at end of file
src/vnode/tsdb/src/tsdbMeta.c
浏览文件 @
c12fd89c
#include <stdlib.h>
#include <stdlib.h>
#include "taosdef.h"
// #include "taosdef.h"
#include "tsdb.h"
#include "tsdbMeta.h"
#include "tsdbMeta.h"
SMetaHandle
*
tsdbCreateMetaHandle
(
int32_t
numOfTables
)
{
SMetaHandle
*
tsdbCreateMetaHandle
(
int32_t
numOfTables
)
{
...
@@ -11,7 +12,7 @@ SMetaHandle *tsdbCreateMetaHandle(int32_t numOfTables) {
...
@@ -11,7 +12,7 @@ SMetaHandle *tsdbCreateMetaHandle(int32_t numOfTables) {
pMetahandle
->
numOfTables
=
0
;
pMetahandle
->
numOfTables
=
0
;
pMetahandle
->
numOfSuperTables
=
0
;
pMetahandle
->
numOfSuperTables
=
0
;
pMetahandle
->
pTables
=
calloc
(
sizeof
(
STable
*
)
*
numOfTables
);
pMetahandle
->
pTables
=
calloc
(
sizeof
(
STable
*
)
,
numOfTables
);
if
(
pMetahandle
->
pTables
==
NULL
)
{
if
(
pMetahandle
->
pTables
==
NULL
)
{
free
(
pMetahandle
);
free
(
pMetahandle
);
return
NULL
;
return
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录