mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-24 18:50:49 +00:00
Proper variables capturing in CachedCompressedReadBuffer.
This commit is contained in:
parent
898eb1f1d7
commit
bf3cd54c19
@ -5,6 +5,7 @@
|
||||
#include <Compression/CompressionFactory.h>
|
||||
#include <Compression/CachedCompressedReadBuffer.h>
|
||||
#include <IO/WriteBufferFromFile.h>
|
||||
#include <IO/createReadBufferFromFileBase.h>
|
||||
#include <IO/copyData.h>
|
||||
|
||||
#include <Common/Stopwatch.h>
|
||||
@ -32,7 +33,14 @@ int main(int argc, char ** argv)
|
||||
|
||||
{
|
||||
Stopwatch watch;
|
||||
CachedCompressedReadBuffer in(path, &cache, 0, 0, 0);
|
||||
CachedCompressedReadBuffer in(
|
||||
path,
|
||||
[&]()
|
||||
{
|
||||
return createReadBufferFromFileBase(path, 0, 0, 0);
|
||||
},
|
||||
&cache
|
||||
);
|
||||
WriteBufferFromFile out("/dev/null");
|
||||
copyData(in, out);
|
||||
|
||||
@ -44,7 +52,14 @@ int main(int argc, char ** argv)
|
||||
|
||||
{
|
||||
Stopwatch watch;
|
||||
CachedCompressedReadBuffer in(path, &cache, 0, 0, 0);
|
||||
CachedCompressedReadBuffer in(
|
||||
path,
|
||||
[&]()
|
||||
{
|
||||
return createReadBufferFromFileBase(path, 0, 0, 0);
|
||||
},
|
||||
&cache
|
||||
);
|
||||
WriteBufferFromFile out("/dev/null");
|
||||
copyData(in, out);
|
||||
|
||||
|
@ -40,8 +40,8 @@ MergeTreeReaderCompact::MergeTreeReaderCompact(
|
||||
if (uncompressed_cache)
|
||||
{
|
||||
auto buffer = std::make_unique<CachedCompressedReadBuffer>(
|
||||
full_data_path,
|
||||
[&]()
|
||||
fullPath(data_part->disk, full_data_path),
|
||||
[this, full_data_path, buffer_size]()
|
||||
{
|
||||
return data_part->disk->readFile(
|
||||
full_data_path,
|
||||
|
@ -79,8 +79,8 @@ MergeTreeReaderStream::MergeTreeReaderStream(
|
||||
if (uncompressed_cache)
|
||||
{
|
||||
auto buffer = std::make_unique<CachedCompressedReadBuffer>(
|
||||
path_prefix + data_file_extension,
|
||||
[&]()
|
||||
fullPath(disk, path_prefix + data_file_extension),
|
||||
[this, buffer_size, sum_mark_range_bytes, &settings]()
|
||||
{
|
||||
return disk->readFile(
|
||||
path_prefix + data_file_extension,
|
||||
|
Loading…
Reference in New Issue
Block a user