refactor code
This commit is contained in:
parent
2d6c9ec7de
commit
3ccf9942a9
|
@ -0,0 +1,13 @@
|
|||
|
||||
# xz
|
||||
ExternalProject_Add(xz
|
||||
GIT_REPOSITORY https://github.com/xz-mirror/xz.git
|
||||
GIT_TAG v5.4.4
|
||||
SOURCE_DIR "${TD_CONTRIB_DIR}/xz"
|
||||
BINARY_DIR ""
|
||||
#BUILD_IN_SOURCE TRUE
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND ""
|
||||
)
|
|
@ -109,7 +109,8 @@ cat("${TD_SUPPORT_DIR}/zlib_CMakeLists.txt.in" ${CONTRIB_TMP_FILE})
|
|||
# cJson
|
||||
cat("${TD_SUPPORT_DIR}/cjson_CMakeLists.txt.in" ${CONTRIB_TMP_FILE})
|
||||
|
||||
# zstd
|
||||
# xz
|
||||
cat("${TD_SUPPORT_DIR}/xz_CMakeLists.txt.in" ${CONTRIB_TMP_FILE})
|
||||
|
||||
if (${BUILD_CONTRIB})
|
||||
if(${BUILD_WITH_ROCKSDB})
|
||||
|
@ -258,6 +259,13 @@ target_include_directories(
|
|||
)
|
||||
unset(CMAKE_PROJECT_INCLUDE_BEFORE)
|
||||
|
||||
add_subdirectory(xz EXCLUDE_FROM_ALL)
|
||||
target_include_directories(
|
||||
xz
|
||||
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/xz
|
||||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/xz
|
||||
)
|
||||
|
||||
# leveldb
|
||||
if(${BUILD_WITH_LEVELDB})
|
||||
option(LEVELDB_BUILD_TESTS "" OFF)
|
||||
|
@ -392,7 +400,6 @@ endif()
|
|||
if(${BUILD_WITH_S3})
|
||||
INCLUDE_DIRECTORIES($ENV{HOME}/.cos-local.2/include)
|
||||
MESSAGE("build with s3: ${BUILD_WITH_S3}")
|
||||
|
||||
# cos
|
||||
elseif(${BUILD_WITH_COS})
|
||||
if(${TD_LINUX})
|
||||
|
@ -432,8 +439,6 @@ if(${BUILD_PTHREAD})
|
|||
endif()
|
||||
|
||||
|
||||
#target_link_libraries(zstd)
|
||||
#target_include_directories()
|
||||
# jemalloc
|
||||
if(${JEMALLOC_ENABLED})
|
||||
include(ExternalProject)
|
||||
|
|
|
@ -232,16 +232,17 @@ typedef int32_t (*__data_decompress_l2_fn_t)(const char *const input, const int3
|
|||
int32_t outputSize, const char type);
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
__data_compress_init initFn;
|
||||
__data_compress_l1_fn_t comprFn;
|
||||
__data_decompress_l1_fn_t decomprFn;
|
||||
} TCompressL1FnSet;
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
__data_compress_init initFn;
|
||||
__data_compress_l2_fn_t comprFn;
|
||||
__data_decompress_l2_fn_t decomprFn;
|
||||
|
||||
} TCompressL2FnSet;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -2546,6 +2546,7 @@ int32_t metaGetColCmpr(SMeta *pMeta, tb_uid_t uid, SHashObj **ppColCmprObj) {
|
|||
rc = metaDecodeEntry(&dc, &e);
|
||||
if (rc < 0) {
|
||||
tDecoderClear(&dc);
|
||||
tdbFree(pData);
|
||||
metaULock(pMeta);
|
||||
taosHashClear(pColCmprObj);
|
||||
return -1;
|
||||
|
@ -2557,6 +2558,8 @@ int32_t metaGetColCmpr(SMeta *pMeta, tb_uid_t uid, SHashObj **ppColCmprObj) {
|
|||
taosHashPut(pColCmprObj, &pCmpr->id, sizeof(pCmpr->id), &pCmpr->alg, sizeof(pCmpr->alg));
|
||||
}
|
||||
} else {
|
||||
tDecoderClear(&dc);
|
||||
tdbFree(pData);
|
||||
metaULock(pMeta);
|
||||
taosHashClear(pColCmprObj);
|
||||
return 0;
|
||||
|
|
|
@ -24,8 +24,8 @@ target_include_directories(
|
|||
target_link_libraries(
|
||||
util
|
||||
PUBLIC os
|
||||
PUBLIC lz4_static
|
||||
PUBLIC api cjson geos_c TSZ
|
||||
PUBLIC lz4_static
|
||||
PUBLIC api cjson geos_c TSZ
|
||||
)
|
||||
|
||||
if(${BUILD_TEST})
|
||||
|
|
|
@ -246,18 +246,19 @@ int32_t l2DecompressImpl_xz(const char *const input, const int32_t nelements, ch
|
|||
return 0;
|
||||
}
|
||||
|
||||
TCompressL1FnSet compressL1Dict[] = {{NULL, NULL, NULL},
|
||||
{NULL, tsCompressTimestampImp2, tsDecompressTimestampImp2},
|
||||
{NULL, tsCompressINTImp2, tsDecompressINTImp2},
|
||||
{NULL, tsCompressDoubleImp2, tsDecompressDoubleImp2},
|
||||
{NULL, tsCompressBoolImp2, tsDecompressBoolImp2},
|
||||
TCompressL1FnSet compressL1Dict[] = {{"distabled", NULL, NULL, NULL},
|
||||
{"timestamp", NULL, tsCompressTimestampImp2, tsDecompressTimestampImp2},
|
||||
{"int", NULL, tsCompressINTImp2, tsDecompressINTImp2},
|
||||
{"double", NULL, tsCompressDoubleImp2, tsDecompressDoubleImp2},
|
||||
{"bool", NULL, tsCompressBoolImp2, tsDecompressBoolImp2},
|
||||
{NULL, NULL, NULL}};
|
||||
TCompressL2FnSet compressL2Dict[] = {{l2ComressInitImpl_disabled, l2CompressImpl_disabled, l2DecompressImpl_disabled},
|
||||
{l2ComressInitImpl_lz4, l2CompressImpl_lz4, l2DecompressImpl_lz4},
|
||||
{l2ComressInitImpl_zlib, l2CompressImpl_zlib, l2DecompressImpl_zlib},
|
||||
{l2ComressInitImpl_zstd, l2CompressImpl_zstd, l2DecompressImpl_zstd},
|
||||
{l2ComressInitImpl_tsz, l2CompressImpl_tsz, l2DecompressImpl_tsz},
|
||||
{l2ComressInitImpl_xz, l2CompressImpl_xz, l2DecompressImpl_xz}};
|
||||
TCompressL2FnSet compressL2Dict[] = {
|
||||
{"disabled", l2ComressInitImpl_disabled, l2CompressImpl_disabled, l2DecompressImpl_disabled},
|
||||
{"lz4", l2ComressInitImpl_lz4, l2CompressImpl_lz4, l2DecompressImpl_lz4},
|
||||
{"zlib", l2ComressInitImpl_zlib, l2CompressImpl_zlib, l2DecompressImpl_zlib},
|
||||
{"zstd", l2ComressInitImpl_zstd, l2CompressImpl_zstd, l2DecompressImpl_zstd},
|
||||
{"tsz", l2ComressInitImpl_tsz, l2CompressImpl_tsz, l2DecompressImpl_tsz},
|
||||
{"xz", l2ComressInitImpl_xz, l2CompressImpl_xz, l2DecompressImpl_xz}};
|
||||
|
||||
static const int32_t TEST_NUMBER = 1;
|
||||
#define is_bigendian() ((*(char *)&TEST_NUMBER) == 0)
|
||||
|
|
Loading…
Reference in New Issue