mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Avoid instantiation of CacheBase
's ctor in header file
This commit is contained in:
parent
9e8c731e1e
commit
0b54b34b5b
11
src/IO/UncompressedCache.cpp
Normal file
11
src/IO/UncompressedCache.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include <IO/UncompressedCache.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
template class CacheBase<UInt128, UncompressedCacheCell, UInt128TrivialHash, UncompressedSizeWeightFunction>;
|
||||
|
||||
UncompressedCache::UncompressedCache(const String & cache_policy, size_t max_size_in_bytes, double size_ratio)
|
||||
: Base(cache_policy, max_size_in_bytes, 0, size_ratio)
|
||||
{
|
||||
}
|
||||
}
|
@ -33,6 +33,7 @@ struct UncompressedSizeWeightFunction
|
||||
}
|
||||
};
|
||||
|
||||
extern template class CacheBase<UInt128, UncompressedCacheCell, UInt128TrivialHash, UncompressedSizeWeightFunction>;
|
||||
|
||||
/** Cache of decompressed blocks for implementation of CachedCompressedReadBuffer. thread-safe.
|
||||
*/
|
||||
@ -42,8 +43,7 @@ private:
|
||||
using Base = CacheBase<UInt128, UncompressedCacheCell, UInt128TrivialHash, UncompressedSizeWeightFunction>;
|
||||
|
||||
public:
|
||||
UncompressedCache(const String & cache_policy, size_t max_size_in_bytes, double size_ratio)
|
||||
: Base(cache_policy, max_size_in_bytes, 0, size_ratio) {}
|
||||
UncompressedCache(const String & cache_policy, size_t max_size_in_bytes, double size_ratio);
|
||||
|
||||
/// Calculate key from path to file and offset.
|
||||
static UInt128 hash(const String & path_to_file, size_t offset)
|
||||
|
11
src/Storages/MarkCache.cpp
Normal file
11
src/Storages/MarkCache.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include <Storages/MarkCache.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
template class CacheBase<UInt128, MarksInCompressedFile, UInt128TrivialHash, MarksWeightFunction>;
|
||||
|
||||
MarkCache::MarkCache(const String & cache_policy, size_t max_size_in_bytes, double size_ratio)
|
||||
: Base(cache_policy, max_size_in_bytes, 0, size_ratio)
|
||||
{
|
||||
}
|
||||
}
|
@ -31,7 +31,7 @@ struct MarksWeightFunction
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
extern template class CacheBase<UInt128, MarksInCompressedFile, UInt128TrivialHash, MarksWeightFunction>;
|
||||
/** Cache of 'marks' for StorageMergeTree.
|
||||
* Marks is an index structure that addresses ranges in column file, corresponding to ranges of primary key.
|
||||
*/
|
||||
@ -41,8 +41,7 @@ private:
|
||||
using Base = CacheBase<UInt128, MarksInCompressedFile, UInt128TrivialHash, MarksWeightFunction>;
|
||||
|
||||
public:
|
||||
MarkCache(const String & cache_policy, size_t max_size_in_bytes, double size_ratio)
|
||||
: Base(cache_policy, max_size_in_bytes, 0, size_ratio) {}
|
||||
MarkCache(const String & cache_policy, size_t max_size_in_bytes, double size_ratio);
|
||||
|
||||
/// Calculate key from path to file and offset.
|
||||
static UInt128 hash(const String & path_to_file)
|
||||
|
Loading…
Reference in New Issue
Block a user