mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Revert some changes
This commit is contained in:
parent
c78272871f
commit
3fa72482a7
@ -44,8 +44,6 @@ void ParallelCompressedWriteBuffer::nextImpl()
|
||||
/// The buffer will be compressed and processed in the thread.
|
||||
current_buffer->busy = true;
|
||||
current_buffer->sequence_num = current_sequence_num;
|
||||
current_buffer->out_callback = callback;
|
||||
callback = {};
|
||||
++current_sequence_num;
|
||||
current_buffer->uncompressed_size = offset();
|
||||
pool.scheduleOrThrowOnError([this, my_current_buffer = current_buffer, thread_group = CurrentThread::getGroup()]
|
||||
@ -155,8 +153,6 @@ void ParallelCompressedWriteBuffer::compress(Iterator buffer)
|
||||
}
|
||||
|
||||
std::unique_lock lock(mutex);
|
||||
if (buffer->out_callback)
|
||||
buffer->out_callback();
|
||||
buffer->busy = false;
|
||||
cond.notify_all();
|
||||
}
|
||||
|
@ -31,13 +31,6 @@ public:
|
||||
|
||||
~ParallelCompressedWriteBuffer() override;
|
||||
|
||||
/// This function will be called once after compressing the next data and sending it to the out.
|
||||
/// It can be used to fill information about marks.
|
||||
void setCompletionCallback(std::function<void()> callback_)
|
||||
{
|
||||
callback = callback_;
|
||||
}
|
||||
|
||||
private:
|
||||
void nextImpl() override;
|
||||
void finalizeImpl() override;
|
||||
@ -61,15 +54,12 @@ private:
|
||||
BufferPair * previous = nullptr;
|
||||
size_t sequence_num = 0;
|
||||
bool busy = false;
|
||||
std::function<void()> out_callback;
|
||||
};
|
||||
|
||||
std::mutex mutex;
|
||||
std::condition_variable cond;
|
||||
std::list<BufferPair> buffers;
|
||||
|
||||
std::function<void()> callback;
|
||||
|
||||
using Iterator = std::list<BufferPair>::iterator;
|
||||
Iterator current_buffer;
|
||||
size_t current_sequence_num = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user