Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
buyaopa
TDengine
提交
42fc4236
T
TDengine
项目概览
buyaopa
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
42fc4236
编写于
3月 02, 2020
作者:
H
hzcheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more
上级
a6166565
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
31 addition
and
33 deletion
+31
-33
src/vnode/tsdb/inc/tsdb.h
src/vnode/tsdb/inc/tsdb.h
+21
-23
src/vnode/tsdb/src/tsdbMain.c
src/vnode/tsdb/src/tsdbMain.c
+10
-10
未找到文件。
src/vnode/tsdb/inc/tsdb.h
浏览文件 @
42fc4236
...
@@ -17,7 +17,7 @@ typedef void tsdb_repo_t; // use void to hide implementation details from outsi
...
@@ -17,7 +17,7 @@ typedef void tsdb_repo_t; // use void to hide implementation details from outsi
typedef
struct
{
typedef
struct
{
int64_t
uid
;
// the unique table ID
int64_t
uid
;
// the unique table ID
int32_t
tableI
d
;
// the table ID in the repository.
int32_t
ti
d
;
// the table ID in the repository.
}
STableId
;
}
STableId
;
// Submit message for this TSDB
// Submit message for this TSDB
...
@@ -52,8 +52,6 @@ typedef struct {
...
@@ -52,8 +52,6 @@ typedef struct {
// Rows in file block policy
// Rows in file block policy
typedef
struct
{
typedef
struct
{
// TODO: Need a more fancy description
// TODO: Need a more fancy description
int32_t
minRowsPerFileBlock
;
int32_t
maxRowsPerFileBlock
;
}
SBlockRowsPolicy
;
}
SBlockRowsPolicy
;
// the TSDB repository configuration
// the TSDB repository configuration
...
@@ -61,9 +59,10 @@ typedef struct {
...
@@ -61,9 +59,10 @@ typedef struct {
char
*
rootDir
;
// TSDB repository root directory, TODO: need to adjust here
char
*
rootDir
;
// TSDB repository root directory, TODO: need to adjust here
int32_t
tsdbId
;
int32_t
tsdbId
;
int32_t
maxTables
;
// maximum number of tables this repository can have
int32_t
maxTables
;
// maximum number of tables this repository can have
SDataShardPolicy
dataShardPolicy
;
int32_t
daysPerFile
;
// day per file sharding policy
SBlockRowsPolicy
blockRowsPolicy
;
int32_t
minRowsPerFileBlock
;
// minimum rows per file block
SRetentionPolicy
retentionPlicy
;
// retention configuration
int32_t
maxRowsPerFileBlock
;
// maximum rows per file block
int32_t
keep
;
// Day of data to keep
void
*
cachePool
;
// the cache pool the repository to use
void
*
cachePool
;
// the cache pool the repository to use
}
STsdbCfg
;
}
STsdbCfg
;
...
@@ -79,8 +78,7 @@ typedef struct STSDBRepoInfo {
...
@@ -79,8 +78,7 @@ typedef struct STSDBRepoInfo {
// the meter configuration
// the meter configuration
typedef
struct
{
typedef
struct
{
char
*
tableName
;
char
*
tableName
;
int64_t
uid
;
// uid given by upper layer
STableId
tableId
;
int32_t
tableId
;
// table ID allocated from upper layer
char
*
stableName
;
// if not NULL, the table is created from a super table, need to make sure the super
char
*
stableName
;
// if not NULL, the table is created from a super table, need to make sure the super
// table exists in this TSDB.
// table exists in this TSDB.
...
@@ -245,7 +243,6 @@ typedef struct STableIDList {
...
@@ -245,7 +243,6 @@ typedef struct STableIDList {
}
STableIDList
;
}
STableIDList
;
typedef
struct
{
typedef
struct
{
}
SFields
;
}
SFields
;
/**
/**
...
@@ -269,7 +266,8 @@ tsdb_query_handle_t *tsdbQueryFromTableID(tsdb_repo_t *pRepo, STSDBQueryCond *pC
...
@@ -269,7 +266,8 @@ tsdb_query_handle_t *tsdbQueryFromTableID(tsdb_repo_t *pRepo, STSDBQueryCond *pC
* @param pTagFilterStr tag filter info
* @param pTagFilterStr tag filter info
* @return
* @return
*/
*/
tsdb_query_handle_t
*
tsdbQueryFromTagConds
(
tsdb_repo_t
*
pRepo
,
STSDBQueryCond
*
pCond
,
int16_t
stableId
,
const
char
*
pTagFilterStr
);
tsdb_query_handle_t
*
tsdbQueryFromTagConds
(
tsdb_repo_t
*
pRepo
,
STSDBQueryCond
*
pCond
,
int16_t
stableId
,
const
char
*
pTagFilterStr
);
/**
/**
* Reset to the start(end) position of current query, from which the iterator starts.
* Reset to the start(end) position of current query, from which the iterator starts.
...
...
src/vnode/tsdb/src/tsdbMain.c
浏览文件 @
42fc4236
...
@@ -39,7 +39,7 @@ typedef struct _tsdb_repo {
...
@@ -39,7 +39,7 @@ typedef struct _tsdb_repo {
int8_t
state
;
int8_t
state
;
}
ST
SDB
Repo
;
}
ST
sdb
Repo
;
#define TSDB_GET_TABLE_BY_ID(pRepo, sid) (((STSDBRepo *)pRepo)->pTableList)[sid]
#define TSDB_GET_TABLE_BY_ID(pRepo, sid) (((STSDBRepo *)pRepo)->pTableList)[sid]
#define TSDB_GET_TABLE_BY_NAME(pRepo, name)
#define TSDB_GET_TABLE_BY_NAME(pRepo, name)
...
@@ -57,11 +57,11 @@ static int32_t tsdbCheckCfg(STsdbCfg *pCfg) {
...
@@ -57,11 +57,11 @@ static int32_t tsdbCheckCfg(STsdbCfg *pCfg) {
return
0
;
return
0
;
}
}
static
int32_t
tsdbCreateFiles
(
ST
SDB
Repo
*
pRepo
)
{
static
int32_t
tsdbCreateFiles
(
ST
sdb
Repo
*
pRepo
)
{
// TODO
// TODO
}
}
static
int32_t
tsdbClearFiles
(
ST
SDB
Repo
*
pRepo
)
{
static
int32_t
tsdbClearFiles
(
ST
sdb
Repo
*
pRepo
)
{
// TODO
// TODO
}
}
...
@@ -72,7 +72,7 @@ tsdb_repo_t *tsdbCreateRepo(STsdbCfg *pCfg) {
...
@@ -72,7 +72,7 @@ tsdb_repo_t *tsdbCreateRepo(STsdbCfg *pCfg) {
return
NULL
;
return
NULL
;
}
}
ST
SDBRepo
*
pRepo
=
(
STSDBRepo
*
)
malloc
(
sizeof
(
STSDB
Repo
));
ST
sdbRepo
*
pRepo
=
(
STsdbRepo
*
)
malloc
(
sizeof
(
STsdb
Repo
));
if
(
pRepo
==
NULL
)
{
if
(
pRepo
==
NULL
)
{
// TODO: deal with error
// TODO: deal with error
return
NULL
;
return
NULL
;
...
@@ -112,7 +112,7 @@ tsdb_repo_t *tsdbCreateRepo(STsdbCfg *pCfg) {
...
@@ -112,7 +112,7 @@ tsdb_repo_t *tsdbCreateRepo(STsdbCfg *pCfg) {
}
}
int32_t
tsdbDropRepo
(
tsdb_repo_t
*
repo
)
{
int32_t
tsdbDropRepo
(
tsdb_repo_t
*
repo
)
{
ST
SDBRepo
*
pRepo
=
(
STSDB
Repo
*
)
repo
;
ST
sdbRepo
*
pRepo
=
(
STsdb
Repo
*
)
repo
;
pRepo
->
state
=
TSDB_REPO_STATE_CLOSED
;
pRepo
->
state
=
TSDB_REPO_STATE_CLOSED
;
...
@@ -133,7 +133,7 @@ tsdb_repo_t *tsdbOpenRepo(char *tsdbDir) {
...
@@ -133,7 +133,7 @@ tsdb_repo_t *tsdbOpenRepo(char *tsdbDir) {
return
NULL
;
return
NULL
;
}
}
ST
SDBRepo
*
pRepo
=
(
STSDBRepo
*
)
malloc
(
sizeof
(
STSDB
Repo
));
ST
sdbRepo
*
pRepo
=
(
STsdbRepo
*
)
malloc
(
sizeof
(
STsdb
Repo
));
if
(
pRepo
==
NULL
)
{
if
(
pRepo
==
NULL
)
{
return
NULL
;
return
NULL
;
}
}
...
@@ -156,12 +156,12 @@ tsdb_repo_t *tsdbOpenRepo(char *tsdbDir) {
...
@@ -156,12 +156,12 @@ tsdb_repo_t *tsdbOpenRepo(char *tsdbDir) {
return
(
tsdb_repo_t
*
)
pRepo
;
return
(
tsdb_repo_t
*
)
pRepo
;
}
}
static
int32_t
tsdbFlushCache
(
ST
SDB
Repo
*
pRepo
)
{
static
int32_t
tsdbFlushCache
(
ST
sdb
Repo
*
pRepo
)
{
// TODO
// TODO
}
}
int32_t
tsdbCloseRepo
(
tsdb_repo_t
*
repo
)
{
int32_t
tsdbCloseRepo
(
tsdb_repo_t
*
repo
)
{
ST
SDBRepo
*
pRepo
=
(
STSDB
Repo
*
)
repo
;
ST
sdbRepo
*
pRepo
=
(
STsdb
Repo
*
)
repo
;
tsdbFlushCache
(
pRepo
);
tsdbFlushCache
(
pRepo
);
...
@@ -175,7 +175,7 @@ int32_t tsdbCloseRepo(tsdb_repo_t *repo) {
...
@@ -175,7 +175,7 @@ int32_t tsdbCloseRepo(tsdb_repo_t *repo) {
}
}
int32_t
tsdbConfigRepo
(
tsdb_repo_t
*
repo
,
STsdbCfg
*
pCfg
)
{
int32_t
tsdbConfigRepo
(
tsdb_repo_t
*
repo
,
STsdbCfg
*
pCfg
)
{
ST
SDBRepo
*
pRepo
=
(
STSDB
Repo
*
)
repo
;
ST
sdbRepo
*
pRepo
=
(
STsdb
Repo
*
)
repo
;
pRepo
->
pCfg
=
pCfg
;
pRepo
->
pCfg
=
pCfg
;
// TODO
// TODO
...
@@ -187,7 +187,7 @@ STSDBRepoInfo *tsdbGetStatus(tsdb_repo_t *pRepo) {
...
@@ -187,7 +187,7 @@ STSDBRepoInfo *tsdbGetStatus(tsdb_repo_t *pRepo) {
}
}
int32_t
tsdbCreateTable
(
tsdb_repo_t
*
repo
,
STableCfg
*
pCfg
)
{
int32_t
tsdbCreateTable
(
tsdb_repo_t
*
repo
,
STableCfg
*
pCfg
)
{
ST
SDBRepo
*
pRepo
=
(
STSDB
Repo
*
)
repo
;
ST
sdbRepo
*
pRepo
=
(
STsdb
Repo
*
)
repo
;
return
tsdbCreateTableImpl
(
pRepo
->
tsdbMeta
,
pCfg
);
return
tsdbCreateTableImpl
(
pRepo
->
tsdbMeta
,
pCfg
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录