Revert some changes

This commit is contained in:
Alexey Milovidov 2024-11-08 00:56:38 +01:00
parent c78272871f
commit 3fa72482a7
2 changed files with 0 additions and 14 deletions

View File

@ -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();
}

View File

@ -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;