2018-06-06 20:57:07 +00:00
|
|
|
#pragma once
|
|
|
|
#include <DataStreams/IBlockOutputStream.h>
|
|
|
|
#include <IO/WriteBuffer.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/// Prints internal server logs
|
|
|
|
/// Input blocks have to have the same structure as SystemLogsQueue::getSampleBlock()
|
|
|
|
/// NOTE: IRowOutputStream does not suite well for this case
|
2018-06-15 17:32:35 +00:00
|
|
|
class InternalTextLogsRowOutputStream : public IBlockOutputStream
|
2018-06-06 20:57:07 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2018-06-15 17:32:35 +00:00
|
|
|
InternalTextLogsRowOutputStream(WriteBuffer & buf_out) : wb(buf_out) {}
|
2018-06-06 20:57:07 +00:00
|
|
|
|
|
|
|
Block getHeader() const override;
|
|
|
|
|
|
|
|
void write(const Block & block) override;
|
|
|
|
|
|
|
|
void flush() override
|
|
|
|
{
|
|
|
|
wb.next();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
WriteBuffer & wb;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|