fix: remove depends from util to common

This commit is contained in:
Alex Duan 2023-09-19 10:46:52 +08:00
parent 88c091e575
commit 4a4e778a6a
4 changed files with 13 additions and 9 deletions

View File

@ -54,7 +54,8 @@ extern "C" {
#ifdef TD_TSZ
extern bool lossyFloat;
extern bool lossyDouble;
int32_t tsCompressInit();
int32_t tsCompressInit(char* lossyColumns, double fPrecision, double dPrecision, unsigned int32_t maxIntervals,
unsigned int32_t intervals, int32_t intervals, const char* compressor);
void tsCompressExit();
int32_t tsCompressFloatLossyImp(const char *const input, const int32_t nelements, char *const output);

View File

@ -19,6 +19,10 @@
#include "index.h"
#include "qworker.h"
#include "tstream.h"
#ifdef TD_TSZ
#include "tglobal.h"
#include "tcompression.h"
#endif
static bool dmRequireNode(SDnode *pDnode, SMgmtWrapper *pWrapper) {
SMgmtInputOpt input = dmBuildMgmtInputOpt(pWrapper);
@ -113,7 +117,7 @@ int32_t dmInitDnode(SDnode *pDnode) {
#ifdef TD_TSZ
// compress module init
tsCompressInit();
tsCompressInit(tsLossyColumns, tsFPrecision, tsDPrecision, tsMaxRange, tsCurRange, (int)tsIfAdtFse, tsCompressor);
#endif
pDnode->wrappers[DNODE].func = dmGetMgmtFunc();

View File

@ -25,7 +25,6 @@ target_link_libraries(
PUBLIC os
PUBLIC lz4_static
PUBLIC api cjson geos_c TSZ
PUBLIC common
)
if(${BUILD_TEST})

View File

@ -52,7 +52,6 @@
#include "lz4.h"
#include "tRealloc.h"
#include "tlog.h"
#include "tglobal.h"
#ifdef TD_TSZ
#include "td_sz.h"
@ -71,20 +70,21 @@ bool lossyFloat = false;
bool lossyDouble = false;
// init call
int32_t tsCompressInit() {
int32_t tsCompressInit(char* lossyColumns, double fPrecision, double dPrecision, unsigned int32_t maxIntervals,
unsigned int32_t intervals, int32_t intervals, const char* compressor)
// config
if (tsLossyColumns[0] == 0) {
if (lossyColumns[0] == 0) {
lossyFloat = false;
lossyDouble = false;
return 0;
}
lossyFloat = strstr(tsLossyColumns, "float") != NULL;
lossyDouble = strstr(tsLossyColumns, "double") != NULL;
lossyFloat = strstr(lossyColumns, "float") != NULL;
lossyDouble = strstr(lossyColumns, "double") != NULL;
if (lossyFloat == false && lossyDouble == false) return 0;
tdszInit(tsFPrecision, tsDPrecision, tsMaxRange, tsCurRange, (int)tsIfAdtFse, tsCompressor);
tdszInit(fPrecision, dPrecision, maxIntervals, intervals, intervals, compressor);
if (lossyFloat) uTrace("lossy compression float is opened. ");
if (lossyDouble) uTrace("lossy compression double is opened. ");
return 1;