From 65d9d2cd1eb61c8a949163d86792678d0c243a0e Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Thu, 10 Nov 2022 15:58:16 +0800 Subject: [PATCH] chore: code refactor for tsMaxKey definition --- include/common/tglobal.h | 1 - source/common/src/tglobal.c | 9 +-------- source/dnode/vnode/src/tsdb/tsdbWrite.c | 9 +++++++++ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/common/tglobal.h b/include/common/tglobal.h index bb1c0709b4..681d1beb79 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -43,7 +43,6 @@ extern int32_t tsMaxNumOfDistinctResults; extern int32_t tsCompatibleModel; extern bool tsPrintAuth; extern int64_t tsTickPerMin[3]; -extern int64_t tsMaxKeyByPrecision[3]; extern int32_t tsCountAlwaysReturnValue; // queue & threads diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 695ffbefef..900a8124e3 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -141,14 +141,7 @@ bool tsDeployOnSnode = true; */ 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 char tsLossyColumns[32] = ""; // "float|double" means all float and double columns can be lossy compressed. set empty diff --git a/source/dnode/vnode/src/tsdb/tsdbWrite.c b/source/dnode/vnode/src/tsdb/tsdbWrite.c index 1935d688f0..49d5eaac43 100644 --- a/source/dnode/vnode/src/tsdb/tsdbWrite.c +++ b/source/dnode/vnode/src/tsdb/tsdbWrite.c @@ -15,6 +15,15 @@ #include "tsdb.h" +/** + * @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 + */ +static int64_t tsMaxKeyByPrecision[] = {31556995200000L, 31556995200000000L, 9214646400000000000L}; + // static int tsdbScanAndConvertSubmitMsg(STsdb *pTsdb, SSubmitReq *pMsg); int tsdbInsertData(STsdb *pTsdb, int64_t version, SSubmitReq *pMsg, SSubmitRsp *pRsp) {