Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
25148268
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看板
提交
25148268
编写于
11月 09, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: support wider range for future timestamp
上级
ba34b747
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
4 deletion
+18
-4
include/common/tglobal.h
include/common/tglobal.h
+1
-0
include/util/tdef.h
include/util/tdef.h
+1
-1
source/common/src/tglobal.c
source/common/src/tglobal.c
+9
-0
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+4
-0
source/dnode/vnode/src/tsdb/tsdbUtil.c
source/dnode/vnode/src/tsdb/tsdbUtil.c
+2
-2
source/dnode/vnode/src/tsdb/tsdbWrite.c
source/dnode/vnode/src/tsdb/tsdbWrite.c
+1
-1
未找到文件。
include/common/tglobal.h
浏览文件 @
25148268
...
@@ -43,6 +43,7 @@ extern int32_t tsMaxNumOfDistinctResults;
...
@@ -43,6 +43,7 @@ extern int32_t tsMaxNumOfDistinctResults;
extern
int32_t
tsCompatibleModel
;
extern
int32_t
tsCompatibleModel
;
extern
bool
tsPrintAuth
;
extern
bool
tsPrintAuth
;
extern
int64_t
tsTickPerMin
[
3
];
extern
int64_t
tsTickPerMin
[
3
];
extern
int64_t
tsMaxKeyByPrecision
[
3
];
extern
int32_t
tsCountAlwaysReturnValue
;
extern
int32_t
tsCountAlwaysReturnValue
;
// queue & threads
// queue & threads
...
...
include/util/tdef.h
浏览文件 @
25148268
...
@@ -26,7 +26,7 @@ extern "C" {
...
@@ -26,7 +26,7 @@ extern "C" {
#define TSKEY int64_t
#define TSKEY int64_t
#define TSKEY_MIN INT64_MIN
#define TSKEY_MIN INT64_MIN
#define TSKEY_MAX
(INT64_MAX - 1)
#define TSKEY_MAX
INT64_MAX
#define TSKEY_INITIAL_VAL TSKEY_MIN
#define TSKEY_INITIAL_VAL TSKEY_MIN
#define TD_VER_MAX UINT64_MAX // TODO: use the real max version from query handle
#define TD_VER_MAX UINT64_MAX // TODO: use the real max version from query handle
...
...
source/common/src/tglobal.c
浏览文件 @
25148268
...
@@ -141,6 +141,15 @@ bool tsDeployOnSnode = true;
...
@@ -141,6 +141,15 @@ bool tsDeployOnSnode = true;
*/
*/
int64_t
tsTickPerMin
[]
=
{
60000L
,
60000000L
,
60000000000L
};
int64_t
tsTickPerMin
[]
=
{
60000L
,
60000000L
,
60000000000L
};
/**
* @brief max key by precision
* approximately calculation:
* ms: 3600*1000*8765*1000 // 1970 + 1000 years
* us: 3600*1000000*8765*1000 // 1970 + 1000 years
* ns: 3600*1000000000*8765*292 // 1970 + 292 years
*/
int64_t
tsMaxKeyByPrecision
[]
=
{
31556995200000L
,
31556995200000000L
,
9214646400000000000L
};
// lossy compress 6
// lossy compress 6
char
tsLossyColumns
[
32
]
=
""
;
// "float|double" means all float and double columns can be lossy compressed. set empty
char
tsLossyColumns
[
32
]
=
""
;
// "float|double" means all float and double columns can be lossy compressed. set empty
// can close lossy compress.
// can close lossy compress.
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
25148268
...
@@ -495,6 +495,10 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) {
...
@@ -495,6 +495,10 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) {
pCommitter
->
commitFid
=
tsdbKeyFid
(
pCommitter
->
nextKey
,
pCommitter
->
minutes
,
pCommitter
->
precision
);
pCommitter
->
commitFid
=
tsdbKeyFid
(
pCommitter
->
nextKey
,
pCommitter
->
minutes
,
pCommitter
->
precision
);
tsdbFidKeyRange
(
pCommitter
->
commitFid
,
pCommitter
->
minutes
,
pCommitter
->
precision
,
&
pCommitter
->
minKey
,
tsdbFidKeyRange
(
pCommitter
->
commitFid
,
pCommitter
->
minutes
,
pCommitter
->
precision
,
&
pCommitter
->
minKey
,
&
pCommitter
->
maxKey
);
&
pCommitter
->
maxKey
);
#if 0
ASSERT(pCommitter->minKey <= pCommitter->nextKey && pCommitter->maxKey >= pCommitter->nextKey);
#endif
pCommitter
->
nextKey
=
TSKEY_MAX
;
pCommitter
->
nextKey
=
TSKEY_MAX
;
// Reader
// Reader
...
...
source/dnode/vnode/src/tsdb/tsdbUtil.c
浏览文件 @
25148268
...
@@ -505,8 +505,8 @@ int32_t tsdbKeyFid(TSKEY key, int32_t minutes, int8_t precision) {
...
@@ -505,8 +505,8 @@ int32_t tsdbKeyFid(TSKEY key, int32_t minutes, int8_t precision) {
}
}
void
tsdbFidKeyRange
(
int32_t
fid
,
int32_t
minutes
,
int8_t
precision
,
TSKEY
*
minKey
,
TSKEY
*
maxKey
)
{
void
tsdbFidKeyRange
(
int32_t
fid
,
int32_t
minutes
,
int8_t
precision
,
TSKEY
*
minKey
,
TSKEY
*
maxKey
)
{
*
minKey
=
fid
*
minutes
*
tsTickPerMin
[
precision
]
;
*
minKey
=
tsTickPerMin
[
precision
]
*
fid
*
minutes
;
*
maxKey
=
*
minKey
+
minutes
*
tsTickPerMin
[
precision
]
-
1
;
*
maxKey
=
*
minKey
+
tsTickPerMin
[
precision
]
*
minutes
-
1
;
}
}
int32_t
tsdbFidLevel
(
int32_t
fid
,
STsdbKeepCfg
*
pKeepCfg
,
int64_t
now
)
{
int32_t
tsdbFidLevel
(
int32_t
fid
,
STsdbKeepCfg
*
pKeepCfg
,
int64_t
now
)
{
...
...
source/dnode/vnode/src/tsdb/tsdbWrite.c
浏览文件 @
25148268
...
@@ -97,7 +97,7 @@ int tsdbScanAndConvertSubmitMsg(STsdb *pTsdb, SSubmitReq *pMsg) {
...
@@ -97,7 +97,7 @@ int tsdbScanAndConvertSubmitMsg(STsdb *pTsdb, SSubmitReq *pMsg) {
STsdbKeepCfg
*
pCfg
=
&
pTsdb
->
keepCfg
;
STsdbKeepCfg
*
pCfg
=
&
pTsdb
->
keepCfg
;
TSKEY
now
=
taosGetTimestamp
(
pCfg
->
precision
);
TSKEY
now
=
taosGetTimestamp
(
pCfg
->
precision
);
TSKEY
minKey
=
now
-
tsTickPerMin
[
pCfg
->
precision
]
*
pCfg
->
keep2
;
TSKEY
minKey
=
now
-
tsTickPerMin
[
pCfg
->
precision
]
*
pCfg
->
keep2
;
TSKEY
maxKey
=
now
+
tsTickPerMin
[
pCfg
->
precision
]
*
pCfg
->
days
;
TSKEY
maxKey
=
tsMaxKeyByPrecision
[
pCfg
->
precision
]
;
terrno
=
TSDB_CODE_SUCCESS
;
terrno
=
TSDB_CODE_SUCCESS
;
// pMsg->length = htonl(pMsg->length);
// pMsg->length = htonl(pMsg->length);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录