Rename readDistributedAsyncInsertHeader()

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2023-01-21 20:54:49 +01:00
parent a76d7b22c1
commit 00115c6615
5 changed files with 8 additions and 8 deletions

View File

@ -201,7 +201,7 @@ void DistributedAsyncInsertBatch::sendBatch()
for (const auto & file : files)
{
ReadBufferFromFile in(file);
const auto & distributed_header = readDistributedAsyncInsertHeader(in, parent.log);
const auto & distributed_header = DistributedAsyncInsertHeader::read(in, parent.log);
OpenTelemetry::TracingContextHolder thread_trace_context(__PRETTY_FUNCTION__,
distributed_header.client_info.client_trace_context,
@ -240,7 +240,7 @@ void DistributedAsyncInsertBatch::sendSeparateFiles()
try
{
ReadBufferFromFile in(file);
const auto & distributed_header = readDistributedAsyncInsertHeader(in, parent.log);
const auto & distributed_header = DistributedAsyncInsertHeader::read(in, parent.log);
// This function is called in a separated thread, so we set up the trace context from the file
OpenTelemetry::TracingContextHolder thread_trace_context(__PRETTY_FUNCTION__,

View File

@ -417,7 +417,7 @@ void DistributedAsyncInsertDirectoryQueue::processFile(const std::string & file_
CurrentMetrics::Increment metric_increment{CurrentMetrics::DistributedSend};
ReadBufferFromFile in(file_path);
const auto & distributed_header = readDistributedAsyncInsertHeader(in, log);
const auto & distributed_header = DistributedAsyncInsertHeader::read(in, log);
thread_trace_context = std::make_unique<OpenTelemetry::TracingContextHolder>(__PRETTY_FUNCTION__,
distributed_header.client_info.client_trace_context,
@ -563,7 +563,7 @@ void DistributedAsyncInsertDirectoryQueue::processFilesWithBatching()
{
/// Determine metadata of the current file and check if it is not broken.
ReadBufferFromFile in{file_path};
distributed_header = readDistributedAsyncInsertHeader(in, log);
distributed_header = DistributedAsyncInsertHeader::read(in, log);
if (distributed_header.rows)
{

View File

@ -17,7 +17,7 @@ namespace ErrorCodes
extern const int CHECKSUM_DOESNT_MATCH;
}
DistributedAsyncInsertHeader readDistributedAsyncInsertHeader(ReadBufferFromFile & in, Poco::Logger * log)
DistributedAsyncInsertHeader DistributedAsyncInsertHeader::read(ReadBufferFromFile & in, Poco::Logger * log)
{
DistributedAsyncInsertHeader distributed_header;

View File

@ -31,8 +31,8 @@ struct DistributedAsyncInsertHeader
/// dumpStructure() of the header -- obsolete
std::string block_header_string;
Block block_header;
static DistributedAsyncInsertHeader read(ReadBufferFromFile & in, Poco::Logger * log);
};
DistributedAsyncInsertHeader readDistributedAsyncInsertHeader(ReadBufferFromFile & in, Poco::Logger * log);
}

View File

@ -22,7 +22,7 @@ struct DistributedAsyncInsertSource::Data
: log(&Poco::Logger::get("DistributedAsyncInsertSource"))
, in(file_name)
, decompressing_in(in)
, block_in(decompressing_in, readDistributedAsyncInsertHeader(in, log).revision)
, block_in(decompressing_in, DistributedAsyncInsertHeader::read(in, log).revision)
, first_block(block_in.read())
{
}