mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
58 lines
1.2 KiB
C++
58 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <DataStreams/IBlockStream_fwd.h>
|
|
|
|
#include <functional>
|
|
|
|
#include <Processors/QueryPipeline.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class ProcessListEntry;
|
|
|
|
struct BlockIO
|
|
{
|
|
BlockIO() = default;
|
|
BlockIO(BlockIO &&) = default;
|
|
|
|
BlockIO & operator= (BlockIO && rhs);
|
|
~BlockIO();
|
|
|
|
BlockIO(const BlockIO &) = delete;
|
|
BlockIO & operator= (const BlockIO & rhs) = delete;
|
|
|
|
std::shared_ptr<ProcessListEntry> process_list_entry;
|
|
|
|
BlockOutputStreamPtr out;
|
|
BlockInputStreamPtr in;
|
|
|
|
QueryPipeline pipeline;
|
|
|
|
/// Callbacks for query logging could be set here.
|
|
std::function<void(IBlockInputStream *, IBlockOutputStream *)> finish_callback;
|
|
std::function<void()> exception_callback;
|
|
|
|
/// When it is true, don't bother sending any non-empty blocks to the out stream
|
|
bool null_format = false;
|
|
|
|
/// Call these functions if you want to log the request.
|
|
void onFinish()
|
|
{
|
|
if (finish_callback)
|
|
finish_callback(in.get(), out.get());
|
|
}
|
|
|
|
void onException()
|
|
{
|
|
if (exception_callback)
|
|
exception_callback();
|
|
}
|
|
|
|
private:
|
|
void reset();
|
|
};
|
|
|
|
}
|