From 1d46e0a70a40aae5f61642bd606ca5dde82d1f81 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 23 Feb 2022 15:54:59 +0800 Subject: [PATCH] [td-13039]Add api to close file when flushing data out of buffer. --- include/util/tpagedbuf.h | 6 ++++++ source/libs/executor/src/tlinearhash.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/include/util/tpagedbuf.h b/include/util/tpagedbuf.h index d9e233f8bb..4cd0797df3 100644 --- a/include/util/tpagedbuf.h +++ b/include/util/tpagedbuf.h @@ -152,6 +152,12 @@ bool isAllDataInMemBuf(const SDiskbasedBuf* pBuf); */ void setBufPageDirty(void* pPageInfo, bool dirty); +/** + * Set the compress/ no-compress flag for paged buffer, when flushing data in disk. + * @param pBuf + */ +void setBufPageCompressOnDisk(SDiskbasedBuf* pBuf, bool comp); + /** * Print the statistics when closing this buffer * @param pBuf diff --git a/source/libs/executor/src/tlinearhash.c b/source/libs/executor/src/tlinearhash.c index b644801a6e..152102f0c3 100644 --- a/source/libs/executor/src/tlinearhash.c +++ b/source/libs/executor/src/tlinearhash.c @@ -78,6 +78,8 @@ SLHashObj* tHashInit(int32_t inMemPages, int32_t pageSize, _hash_fn_t fn, int32_ return NULL; } + setBufPageCompressOnDisk(pHashObj->pBuf, false); + /** * The number of bits in the hash value, which is used to decide the exact bucket where the object should be located in. * The initial value is 0.