dbms: preparation [#METR-18603].

This commit is contained in:
Alexey Milovidov 2015-10-29 23:38:37 +03:00
parent 37ba429c1e
commit 1331e1fb42
6 changed files with 15 additions and 0 deletions

View File

@ -22,6 +22,8 @@ public:
void flush() override { ostr.next(); }
String getContentType() const override { return "application/octet-stream"; }
protected:
WriteBuffer & ostr;
const Block sample;

View File

@ -24,6 +24,8 @@ public:
void setTotals(const Block & totals) override;
void setExtremes(const Block & extremes) override;
String getContentType() const override { return row_output->getContentType(); }
private:
RowOutputStreamPtr row_output;
bool first_row;

View File

@ -42,6 +42,10 @@ public:
virtual void setTotals(const Block & totals) {}
virtual void setExtremes(const Block & extremes) {}
/** Выставлять такой Content-Type при отдаче по HTTP.
*/
virtual String getContentType() const { return "text/plain; charset=UTF-8"; }
virtual ~IBlockOutputStream() {}
/** Не давать изменить таблицу, пока жив поток блоков.

View File

@ -41,6 +41,9 @@ public:
virtual void setTotals(const Block & totals) {}
virtual void setExtremes(const Block & extremes) {}
/** Выставлять такой Content-Type при отдаче по HTTP. */
virtual String getContentType() const { return "text/plain; charset=UTF-8"; }
virtual ~IRowOutputStream() {}
};

View File

@ -42,6 +42,8 @@ public:
void setTotals(const Block & totals_) override { totals = totals_; }
void setExtremes(const Block & extremes_) override { extremes = extremes_; }
String getContentType() const override { return "application/json; charset=UTF-8"; }
protected:
void writeRowsBeforeLimitAtLeast();

View File

@ -30,6 +30,8 @@ public:
static void writeData(const IDataType & type, const ColumnPtr & column, WriteBuffer & ostr, size_t offset, size_t limit);
String getContentType() const override { return "application/octet-stream"; }
private:
WriteBuffer & ostr;
UInt64 client_revision;