Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0b0bdf2f
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
0b0bdf2f
编写于
4月 27, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: tsdb
上级
3abf351a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
15 addition
and
93 deletion
+15
-93
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+0
-1
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+11
-18
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+2
-63
source/dnode/vnode/src/tsdb/tsdbFS.c
source/dnode/vnode/src/tsdb/tsdbFS.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbFile.c
source/dnode/vnode/src/tsdb/tsdbFile.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbMain.c
source/dnode/vnode/src/tsdb/tsdbMain.c
+0
-1
source/dnode/vnode/src/vnd/vnodeCfg.c
source/dnode/vnode/src/vnd/vnodeCfg.c
+0
-8
未找到文件。
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
0b0bdf2f
...
...
@@ -114,7 +114,6 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
pCfg
->
tsdbCfg
.
keep2
=
3650
;
// pCreate->daysToKeep0;
pCfg
->
tsdbCfg
.
keep0
=
3650
;
// pCreate->daysToKeep2;
pCfg
->
tsdbCfg
.
keep1
=
3650
;
// pCreate->daysToKeep0;
pCfg
->
tsdbCfg
.
lruCacheSize
=
pCreate
->
cacheBlockSize
;
pCfg
->
tsdbCfg
.
retentions
=
pCreate
->
pRetensions
;
pCfg
->
walCfg
.
vgId
=
pCreate
->
vgId
;
pCfg
->
hashBegin
=
pCreate
->
hashBegin
;
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
0b0bdf2f
...
...
@@ -133,23 +133,18 @@ int32_t tqRetrieveDataBlock(SArray **ppCols, STqReadHandle *pHandle, uint64_t *p
// need to reposition
// structs
struct
SMetaCfg
{
uint64_t
lruSize
;
};
struct
STsdbCfg
{
int8_t
precision
;
int8_t
update
;
int8_t
compression
;
int8_t
slLevel
;
int32_t
days
;
int32_t
minRows
;
int32_t
maxRows
;
int32_t
keep2
;
int32_t
keep0
;
int32_t
keep1
;
uint64_t
lruCacheSize
;
SArray
*
retentions
;
int8_t
precision
;
int8_t
update
;
int8_t
compression
;
int8_t
slLevel
;
int32_t
days
;
int32_t
minRows
;
int32_t
maxRows
;
int32_t
keep0
;
int32_t
keep1
;
int32_t
keep2
;
SArray
*
retentions
;
};
struct
SVnodeCfg
{
...
...
@@ -160,8 +155,6 @@ struct SVnodeCfg {
int32_t
szCache
;
uint64_t
szBuf
;
bool
isHeap
;
uint32_t
ttl
;
uint32_t
keep
;
int8_t
streamMode
;
bool
isWeak
;
STsdbCfg
tsdbCfg
;
...
...
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
0b0bdf2f
...
...
@@ -46,7 +46,7 @@ int tsdbLoadDataFromCache(STable *pTable, SSkipListIterator *pIter, TSKEY maxKe
// tsdbCommit ================
#if 1
#if 1
// ======================================
typedef
struct
SSmaStat
SSmaStat
;
typedef
struct
SSmaEnv
SSmaEnv
;
...
...
@@ -168,7 +168,6 @@ typedef struct {
struct
STsdb
{
char
*
path
;
SVnode
*
pVnode
;
int32_t
vgId
;
bool
repoLocked
;
TdThreadMutex
mutex
;
STsdbCfg
config
;
...
...
@@ -179,7 +178,7 @@ struct STsdb {
SSmaEnvs
smaEnvs
;
};
#define REPO_ID(r)
((r)->vgId
)
#define REPO_ID(r)
TD_VID((r)->pVnode
)
#define REPO_CFG(r) (&(r)->config)
#define REPO_FS(r) ((r)->fs)
#define REPO_META(r) ((r)->pVnode->pMeta)
...
...
@@ -891,66 +890,6 @@ static FORCE_INLINE int tsdbUnLockFS(STsdbFS *pFs) {
return
0
;
}
// tsdbSma
// #define TSDB_SMA_TEST // remove after test finished
// struct SSmaEnv {
// TdThreadRwlock lock;
// SDiskID did;
// TDBEnv dbEnv; // TODO: If it's better to put it in smaIndex level?
// char *path; // relative path
// SSmaStat *pStat;
// };
// #define SMA_ENV_LOCK(env) ((env)->lock)
// #define SMA_ENV_DID(env) ((env)->did)
// #define SMA_ENV_ENV(env) ((env)->dbEnv)
// #define SMA_ENV_PATH(env) ((env)->path)
// #define SMA_ENV_STAT(env) ((env)->pStat)
// #define SMA_ENV_STAT_ITEMS(env) ((env)->pStat->smaStatItems)
// void tsdbDestroySmaEnv(SSmaEnv *pSmaEnv);
// void *tsdbFreeSmaEnv(SSmaEnv *pSmaEnv);
// #if 0
// int32_t tsdbGetTSmaStatus(STsdb *pTsdb, STSma *param, void *result);
// int32_t tsdbRemoveTSmaData(STsdb *pTsdb, STSma *param, STimeWindow *pWin);
// #endif
// // internal func
// static FORCE_INLINE int32_t tsdbEncodeTSmaKey(int64_t groupId, TSKEY tsKey, void **pData) {
// int32_t len = 0;
// len += taosEncodeFixedI64(pData, tsKey);
// len += taosEncodeFixedI64(pData, groupId);
// return len;
// }
// static FORCE_INLINE int32_t tsdbRLockSma(SSmaEnv *pEnv) {
// int code = taosThreadRwlockRdlock(&(pEnv->lock));
// if (code != 0) {
// terrno = TAOS_SYSTEM_ERROR(code);
// return -1;
// }
// return 0;
// }
// static FORCE_INLINE int32_t tsdbWLockSma(SSmaEnv *pEnv) {
// int code = taosThreadRwlockWrlock(&(pEnv->lock));
// if (code != 0) {
// terrno = TAOS_SYSTEM_ERROR(code);
// return -1;
// }
// return 0;
// }
// static FORCE_INLINE int32_t tsdbUnLockSma(SSmaEnv *pEnv) {
// int code = taosThreadRwlockUnlock(&(pEnv->lock));
// if (code != 0) {
// terrno = TAOS_SYSTEM_ERROR(code);
// return -1;
// }
// return 0;
// }
typedef
struct
SSmaKey
SSmaKey
;
struct
SSmaKey
{
...
...
source/dnode/vnode/src/tsdb/tsdbFS.c
浏览文件 @
0b0bdf2f
...
...
@@ -644,7 +644,7 @@ static int tsdbComparFidFSet(const void *arg1, const void *arg2) {
}
static
void
tsdbGetTxnFname
(
STsdb
*
pRepo
,
TSDB_TXN_FILE_T
ftype
,
char
fname
[])
{
snprintf
(
fname
,
TSDB_FILENAME_LEN
,
"%s/vnode/vnode%d/tsdb/%s"
,
tfsGetPrimaryPath
(
REPO_TFS
(
pRepo
)),
pRepo
->
vgId
,
snprintf
(
fname
,
TSDB_FILENAME_LEN
,
"%s/vnode/vnode%d/tsdb/%s"
,
tfsGetPrimaryPath
(
REPO_TFS
(
pRepo
)),
REPO_ID
(
pRepo
)
,
tsdbTxnFname
[
ftype
]);
}
...
...
source/dnode/vnode/src/tsdb/tsdbFile.c
浏览文件 @
0b0bdf2f
...
...
@@ -310,7 +310,7 @@ void tsdbInitDFile(STsdb *pRepo, SDFile *pDFile, SDiskID did, int fid, uint32_t
pDFile
->
info
.
magic
=
TSDB_FILE_INIT_MAGIC
;
pDFile
->
info
.
fver
=
tsdbGetDFSVersion
(
ftype
);
tsdbGetFilename
(
pRepo
->
vgId
,
fid
,
ver
,
ftype
,
fname
);
tsdbGetFilename
(
REPO_ID
(
pRepo
)
,
fid
,
ver
,
ftype
,
fname
);
tfsInitFile
(
REPO_TFS
(
pRepo
),
&
(
pDFile
->
f
),
did
,
fname
);
}
...
...
source/dnode/vnode/src/tsdb/tsdbMain.c
浏览文件 @
0b0bdf2f
...
...
@@ -33,7 +33,6 @@ int tsdbOpen(SVnode *pVnode, STsdb **ppTsdb) {
sprintf
(
pTsdb
->
path
,
"%s%s%s%s%s"
,
tfsGetPrimaryPath
(
pVnode
->
pTfs
),
TD_DIRSEP
,
pVnode
->
path
,
TD_DIRSEP
,
VNODE_TSDB_DIR
);
pTsdb
->
pVnode
=
pVnode
;
pTsdb
->
vgId
=
TD_VID
(
pVnode
);
pTsdb
->
repoLocked
=
false
;
tdbMutexInit
(
&
pTsdb
->
mutex
,
NULL
);
pTsdb
->
config
=
pVnode
->
config
.
tsdbCfg
;
...
...
source/dnode/vnode/src/vnd/vnodeCfg.c
浏览文件 @
0b0bdf2f
...
...
@@ -23,8 +23,6 @@ const SVnodeCfg vnodeCfgDefault = {
.
szCache
=
256
,
.
szBuf
=
96
*
1024
*
1024
,
.
isHeap
=
false
,
.
ttl
=
0
,
.
keep
=
0
,
.
streamMode
=
0
,
.
isWeak
=
0
,
.
tsdbCfg
=
{.
precision
=
TSDB_TIME_PRECISION_MILLI
,
...
...
@@ -58,8 +56,6 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) {
if
(
tjsonAddIntegerToObject
(
pJson
,
"szCache"
,
pCfg
->
szCache
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"szBuf"
,
pCfg
->
szBuf
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"isHeap"
,
pCfg
->
isHeap
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"ttl"
,
pCfg
->
ttl
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"keep"
,
pCfg
->
keep
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"streamMode"
,
pCfg
->
streamMode
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"isWeak"
,
pCfg
->
isWeak
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"precision"
,
pCfg
->
tsdbCfg
.
precision
)
<
0
)
return
-
1
;
...
...
@@ -72,7 +68,6 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) {
if
(
tjsonAddIntegerToObject
(
pJson
,
"keep0"
,
pCfg
->
tsdbCfg
.
keep0
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"keep1"
,
pCfg
->
tsdbCfg
.
keep1
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"keep2"
,
pCfg
->
tsdbCfg
.
keep2
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"lruCacheSize"
,
pCfg
->
tsdbCfg
.
lruCacheSize
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"wal.vgId"
,
pCfg
->
walCfg
.
vgId
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"wal.fsyncPeriod"
,
pCfg
->
walCfg
.
fsyncPeriod
)
<
0
)
return
-
1
;
if
(
tjsonAddIntegerToObject
(
pJson
,
"wal.retentionPeriod"
,
pCfg
->
walCfg
.
retentionPeriod
)
<
0
)
return
-
1
;
...
...
@@ -109,8 +104,6 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) {
if
(
tjsonGetNumberValue
(
pJson
,
"szCache"
,
pCfg
->
szCache
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"szBuf"
,
pCfg
->
szBuf
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"isHeap"
,
pCfg
->
isHeap
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"ttl"
,
pCfg
->
ttl
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"keep"
,
pCfg
->
keep
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"streamMode"
,
pCfg
->
streamMode
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"isWeak"
,
pCfg
->
isWeak
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"precision"
,
pCfg
->
tsdbCfg
.
precision
)
<
0
)
return
-
1
;
...
...
@@ -123,7 +116,6 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) {
if
(
tjsonGetNumberValue
(
pJson
,
"keep0"
,
pCfg
->
tsdbCfg
.
keep0
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"keep1"
,
pCfg
->
tsdbCfg
.
keep1
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"keep2"
,
pCfg
->
tsdbCfg
.
keep2
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"lruCacheSize"
,
pCfg
->
tsdbCfg
.
lruCacheSize
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"wal.vgId"
,
pCfg
->
walCfg
.
vgId
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"wal.fsyncPeriod"
,
pCfg
->
walCfg
.
fsyncPeriod
)
<
0
)
return
-
1
;
if
(
tjsonGetNumberValue
(
pJson
,
"wal.retentionPeriod"
,
pCfg
->
walCfg
.
retentionPeriod
)
<
0
)
return
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录