Use forward declaration for Buffer<> in generic headers

- changes in ReadHelpers.h -- recompiles 1000 modules
- changes in FormatFactor.h -- recompiles 100 modules
This commit is contained in:
Azat Khuzhin 2021-10-16 11:28:10 +03:00
parent c668696047
commit 50231460af
9 changed files with 23 additions and 7 deletions

View File

@ -18,6 +18,7 @@
#include <Common/MemorySanitizer.h>
#include <Common/HashTable/HashMap.h>
#include <IO/AIO.h>
#include <IO/BufferWithOwnMemory.h>
#include <Dictionaries/DictionaryStructure.h>
#include <Dictionaries/ICacheDictionaryStorage.h>
#include <Dictionaries/DictionaryHelpers.h>

View File

@ -13,6 +13,7 @@
#include <Processors/Formats/Impl/ParallelFormattingOutputFormat.h>
#include <Poco/URI.h>
#include <IO/BufferWithOwnMemory.h>
#include <IO/ReadHelpers.h>
namespace DB

View File

@ -1,9 +1,9 @@
#pragma once
#include <Common/Allocator.h>
#include <Columns/IColumn.h>
#include <Formats/FormatSettings.h>
#include <Interpreters/Context_fwd.h>
#include <IO/BufferWithOwnMemory.h>
#include <base/types.h>
#include <boost/noncopyable.hpp>
@ -34,6 +34,9 @@ struct RowOutputFormatParams;
using InputFormatPtr = std::shared_ptr<IInputFormat>;
using OutputFormatPtr = std::shared_ptr<IOutputFormat>;
template <typename Allocator>
struct Memory;
FormatSettings getFormatSettings(ContextPtr context);
template <typename T>
@ -55,7 +58,7 @@ public:
*/
using FileSegmentationEngine = std::function<std::pair<bool, size_t>(
ReadBuffer & buf,
DB::Memory<> & memory,
DB::Memory<Allocator<false>> & memory,
size_t min_chunk_bytes)>;
/// This callback allows to perform some additional actions after writing a single row.

View File

@ -1,4 +1,5 @@
#include <IO/ReadHelpers.h>
#include <Formats/JSONEachRowUtils.h>
#include <base/find_symbols.h>
namespace DB

View File

@ -1,5 +1,9 @@
#pragma once
#include <IO/BufferWithOwnMemory.h>
#include <IO/ReadBuffer.h>
#include <utility>
namespace DB
{

View File

@ -6,6 +6,7 @@
#include <Formats/FormatSettings.h>
#include <IO/WriteHelpers.h>
#include <IO/WriteBufferFromString.h>
#include <IO/BufferWithOwnMemory.h>
#include <IO/readFloatText.h>
#include <IO/Operators.h>
#include <base/find_symbols.h>
@ -1120,7 +1121,7 @@ void skipToUnescapedNextLineOrEOF(ReadBuffer & buf)
}
}
void saveUpToPosition(ReadBuffer & in, DB::Memory<> & memory, char * current)
void saveUpToPosition(ReadBuffer & in, Memory<> & memory, char * current)
{
assert(current >= in.position());
assert(current <= in.buffer().end());
@ -1140,7 +1141,7 @@ void saveUpToPosition(ReadBuffer & in, DB::Memory<> & memory, char * current)
in.position() = current;
}
bool loadAtPosition(ReadBuffer & in, DB::Memory<> & memory, char * & current)
bool loadAtPosition(ReadBuffer & in, Memory<> & memory, char * & current)
{
assert(current <= in.buffer().end());

View File

@ -19,6 +19,7 @@
#include <Core/DecimalFunctions.h>
#include <Core/UUID.h>
#include <Common/Allocator.h>
#include <Common/Exception.h>
#include <Common/StringUtils/StringUtils.h>
#include <Common/Arena.h>
@ -29,7 +30,6 @@
#include <IO/CompressionMethod.h>
#include <IO/ReadBuffer.h>
#include <IO/ReadBufferFromMemory.h>
#include <IO/BufferWithOwnMemory.h>
#include <IO/VarInt.h>
#include <DataTypes/DataTypeDateTime.h>
@ -41,6 +41,9 @@ static constexpr auto DEFAULT_MAX_STRING_SIZE = 1_GiB;
namespace DB
{
template <typename Allocator>
struct Memory;
namespace ErrorCodes
{
extern const int CANNOT_PARSE_DATE;
@ -1290,7 +1293,7 @@ void skipToUnescapedNextLineOrEOF(ReadBuffer & buf);
/** This function just copies the data from buffer's internal position (in.position())
* to current position (from arguments) into memory.
*/
void saveUpToPosition(ReadBuffer & in, Memory<> & memory, char * current);
void saveUpToPosition(ReadBuffer & in, Memory<Allocator<false>> & memory, char * current);
/** This function is negative to eof().
* In fact it returns whether the data was loaded to internal ReadBuffers's buffer or not.
@ -1299,7 +1302,7 @@ void saveUpToPosition(ReadBuffer & in, Memory<> & memory, char * current);
* of our buffer and the current cursor in the end of the buffer. When we call eof() it calls next().
* And this function can fill the buffer with new data, so we will lose the data from previous buffer state.
*/
bool loadAtPosition(ReadBuffer & in, Memory<> & memory, char * & current);
bool loadAtPosition(ReadBuffer & in, Memory<Allocator<false>> & memory, char * & current);
struct PcgDeserializer

View File

@ -1,4 +1,5 @@
#include <IO/ReadHelpers.h>
#include <IO/BufferWithOwnMemory.h>
#include <IO/Operators.h>
#include <Formats/verbosePrintString.h>

View File

@ -1,5 +1,6 @@
#include <IO/ReadHelpers.h>
#include <IO/WriteBufferFromString.h>
#include <IO/BufferWithOwnMemory.h>
#include <IO/Operators.h>
#include <Processors/Formats/Impl/TabSeparatedRowInputFormat.h>