2011-08-19 19:18:15 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <DB/DataTypes/DataTypeFactory.h>
|
2011-09-04 21:23:19 +00:00
|
|
|
|
#include <DB/DataStreams/IProfilingBlockInputStream.h>
|
2011-08-19 19:18:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/** Десериализует поток блоков из родного бинарного формата (с именами и типами столбцов).
|
|
|
|
|
* Предназначено для взаимодействия между серверами.
|
|
|
|
|
*/
|
2011-09-04 21:23:19 +00:00
|
|
|
|
class NativeBlockInputStream : public IProfilingBlockInputStream
|
2011-08-19 19:18:15 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2012-08-02 17:33:31 +00:00
|
|
|
|
NativeBlockInputStream(ReadBuffer & istr_, const DataTypeFactory & data_type_factory_)
|
2011-08-19 19:18:15 +00:00
|
|
|
|
: istr(istr_), data_type_factory(data_type_factory_) {}
|
|
|
|
|
|
2011-09-04 21:23:19 +00:00
|
|
|
|
String getName() const { return "NativeBlockInputStream"; }
|
2011-08-19 19:18:15 +00:00
|
|
|
|
|
2013-05-03 10:20:53 +00:00
|
|
|
|
String getID() const
|
|
|
|
|
{
|
|
|
|
|
std::stringstream res;
|
|
|
|
|
res << this;
|
|
|
|
|
return res.str();
|
|
|
|
|
}
|
|
|
|
|
|
2012-10-20 02:10:47 +00:00
|
|
|
|
protected:
|
|
|
|
|
Block readImpl();
|
|
|
|
|
|
2011-08-19 19:18:15 +00:00
|
|
|
|
private:
|
|
|
|
|
ReadBuffer & istr;
|
2012-08-02 17:33:31 +00:00
|
|
|
|
const DataTypeFactory & data_type_factory;
|
2011-08-19 19:18:15 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|