Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7dd5b4ad
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7dd5b4ad
编写于
1月 07, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make more comile
上级
50776325
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
399 addition
and
383 deletion
+399
-383
source/dnode/vnode/tsdb/CMakeLists.txt
source/dnode/vnode/tsdb/CMakeLists.txt
+1
-1
source/dnode/vnode/tsdb/inc/tsdbCommit.h
source/dnode/vnode/tsdb/inc/tsdbCommit.h
+10
-1
source/dnode/vnode/tsdb/inc/tsdbDef.h
source/dnode/vnode/tsdb/inc/tsdbDef.h
+3
-3
source/dnode/vnode/tsdb/src/tsdbCommit.c
source/dnode/vnode/tsdb/src/tsdbCommit.c
+17
-17
source/dnode/vnode/tsdb/src/tsdbFS.c
source/dnode/vnode/tsdb/src/tsdbFS.c
+367
-360
source/dnode/vnode/tsdb/src/tsdbMemTable.c
source/dnode/vnode/tsdb/src/tsdbMemTable.c
+1
-1
未找到文件。
source/dnode/vnode/tsdb/CMakeLists.txt
浏览文件 @
7dd5b4ad
...
...
@@ -12,7 +12,7 @@ else(0)
"src/tsdbWrite.c"
"src/tsdbReadImpl.c"
"src/tsdbFile.c"
#
"src/tsdbFS.c"
"src/tsdbFS.c"
)
endif
(
0
)
...
...
source/dnode/vnode/tsdb/inc/tsdbCommit.h
浏览文件 @
7dd5b4ad
...
...
@@ -29,10 +29,19 @@ typedef struct {
int64_t
size
;
}
SKVRecord
;
void
tsdbGetRtnSnap
(
STsdb
*
pRepo
,
SRtn
*
pRtn
);
static
FORCE_INLINE
int
TSDB_KEY_FID
(
TSKEY
key
,
int32_t
days
,
int8_t
precision
)
{
if
(
key
<
0
)
{
return
(
int
)((
key
+
1
)
/
tsTickPerDay
[
precision
]
/
days
-
1
);
}
else
{
return
(
int
)((
key
/
tsTickPerDay
[
precision
]
/
days
));
}
}
#if 0
#define TSDB_DEFAULT_BLOCK_ROWS(maxRows) ((maxRows)*4 / 5)
void tsdbGetRtnSnap(STsdbRepo *pRepo, SRtn *pRtn);
int tsdbEncodeKVRecord(void **buf, SKVRecord *pRecord);
void *tsdbDecodeKVRecord(void *buf, SKVRecord *pRecord);
void *tsdbCommitData(STsdbRepo *pRepo);
...
...
source/dnode/vnode/tsdb/inc/tsdbDef.h
浏览文件 @
7dd5b4ad
...
...
@@ -27,7 +27,7 @@
#include "tsdb.h"
#include "tsdbCommit.h"
//
#include "tsdbFS.h"
#include "tsdbFS.h"
#include "tsdbFile.h"
#include "tsdbLog.h"
#include "tsdbMemTable.h"
...
...
@@ -47,12 +47,12 @@ struct STsdb {
STsdbMemTable
*
imem
;
SRtn
rtn
;
SMemAllocatorFactory
*
pmaf
;
//
STsdbFS fs;
STsdbFS
fs
;
};
#define REPO_ID(r) 0
#define REPO_CFG(r) (&(r)->config)
//
#define REPO_FS(r) (&(r)->fs)
#define REPO_FS(r) (&(r)->fs)
#ifdef __cplusplus
}
...
...
source/dnode/vnode/tsdb/src/tsdbCommit.c
浏览文件 @
7dd5b4ad
...
...
@@ -32,6 +32,23 @@ int tsdbCommit(STsdb *pTsdb) {
return
0
;
}
void
tsdbGetRtnSnap
(
STsdb
*
pRepo
,
SRtn
*
pRtn
)
{
STsdbCfg
*
pCfg
=
REPO_CFG
(
pRepo
);
TSKEY
minKey
,
midKey
,
maxKey
,
now
;
now
=
taosGetTimestamp
(
pCfg
->
precision
);
minKey
=
now
-
pCfg
->
keep
*
tsTickPerDay
[
pCfg
->
precision
];
midKey
=
now
-
pCfg
->
keep2
*
tsTickPerDay
[
pCfg
->
precision
];
maxKey
=
now
-
pCfg
->
keep1
*
tsTickPerDay
[
pCfg
->
precision
];
pRtn
->
minKey
=
minKey
;
pRtn
->
minFid
=
(
int
)(
TSDB_KEY_FID
(
minKey
,
pCfg
->
daysPerFile
,
pCfg
->
precision
));
pRtn
->
midFid
=
(
int
)(
TSDB_KEY_FID
(
midKey
,
pCfg
->
daysPerFile
,
pCfg
->
precision
));
pRtn
->
maxFid
=
(
int
)(
TSDB_KEY_FID
(
maxKey
,
pCfg
->
daysPerFile
,
pCfg
->
precision
));
tsdbDebug
(
"vgId:%d now:%"
PRId64
" minKey:%"
PRId64
" minFid:%d, midFid:%d, maxFid:%d"
,
REPO_ID
(
pRepo
),
now
,
minKey
,
pRtn
->
minFid
,
pRtn
->
midFid
,
pRtn
->
maxFid
);
}
#if 0
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
...
...
@@ -420,23 +437,6 @@ void *tsdbDecodeKVRecord(void *buf, SKVRecord *pRecord) {
return buf;
}
void tsdbGetRtnSnap(STsdbRepo *pRepo, SRtn *pRtn) {
STsdbCfg *pCfg = REPO_CFG(pRepo);
TSKEY minKey, midKey, maxKey, now;
now = taosGetTimestamp(pCfg->precision);
minKey = now - pCfg->keep * tsTickPerDay[pCfg->precision];
midKey = now - pCfg->keep2 * tsTickPerDay[pCfg->precision];
maxKey = now - pCfg->keep1 * tsTickPerDay[pCfg->precision];
pRtn->minKey = minKey;
pRtn->minFid = (int)(TSDB_KEY_FID(minKey, pCfg->daysPerFile, pCfg->precision));
pRtn->midFid = (int)(TSDB_KEY_FID(midKey, pCfg->daysPerFile, pCfg->precision));
pRtn->maxFid = (int)(TSDB_KEY_FID(maxKey, pCfg->daysPerFile, pCfg->precision));
tsdbDebug("vgId:%d now:%" PRId64 " minKey:%" PRId64 " minFid:%d, midFid:%d, maxFid:%d", REPO_ID(pRepo), now, minKey,
pRtn->minFid, pRtn->midFid, pRtn->maxFid);
}
static int tsdbUpdateMetaRecord(STsdbFS *pfs, SMFile *pMFile, uint64_t uid, void *cont, int contLen, bool compact) {
char buf[64] = "\0";
void * pBuf = buf;
...
...
source/dnode/vnode/tsdb/src/tsdbFS.c
浏览文件 @
7dd5b4ad
此差异已折叠。
点击以展开。
source/dnode/vnode/tsdb/src/tsdbMemTable.c
浏览文件 @
7dd5b4ad
...
...
@@ -335,7 +335,7 @@ static int tsdbTbDataComp(const void *arg1, const void *arg2) {
static
char
*
tsdbTbDataGetUid
(
const
void
*
arg
)
{
STbData
*
pTbData
=
(
STbData
*
)
arg
;
return
&
(
pTbData
->
uid
);
return
(
char
*
)(
&
(
pTbData
->
uid
)
);
}
/* ------------------------ REFACTORING ------------------------ */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录