ClickHouse/dbms/include/DB/Core/Progress.h

37 lines
626 B
C
Raw Normal View History

2012-05-16 18:03:00 +00:00
#pragma once
#include <DB/IO/ReadBuffer.h>
#include <DB/IO/WriteBuffer.h>
#include <DB/IO/ReadHelpers.h>
#include <DB/IO/WriteHelpers.h>
namespace DB
{
/// Прогресс выполнения запроса
struct Progress
{
size_t rows; /// Строк обработано.
size_t bytes; /// Байт обработано.
Progress() : rows(0), bytes(0) {}
Progress(size_t rows_, size_t bytes_) : rows(rows_), bytes(bytes_) {}
void read(ReadBuffer & in)
{
2012-05-16 18:32:32 +00:00
readVarUInt(rows, in);
readVarUInt(bytes, in);
2012-05-16 18:03:00 +00:00
}
void write(WriteBuffer & out)
{
2012-05-16 18:32:32 +00:00
writeVarUInt(rows, out);
writeVarUInt(bytes, out);
2012-05-16 18:03:00 +00:00
}
};
}