MCPcopy Create free account
hub / github.com/ByConity/ByConity / write

Method write

src/DataStreams/CountingBlockOutputStream.cpp:37–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35{
36
37void CountingBlockOutputStream::write(const Block & block)
38{
39 stopwatch.start();
40
41 stream->write(block);
42
43 Progress local_progress(block.rows(), block.bytes(), 0);
44
45 if (constraints_filter_stream)
46 {
47 if (const auto *counting_stream = dynamic_cast<const CheckConstraintsFilterBlockOutputStream *>(constraints_filter_stream.get()))
48 {
49 const auto & written_block = counting_stream->getWrittenBlock();
50 local_progress.read_rows = written_block.rows();
51 local_progress.read_bytes = written_block.bytes();
52 }
53 }
54
55 progress.incrementPiecewiseAtomically(local_progress);
56
57 ProfileEvents::increment(ProfileEvents::InsertedRows, local_progress.read_rows);
58 ProfileEvents::increment(ProfileEvents::InsertedBytes, local_progress.read_bytes);
59
60 if (process_elem)
61 process_elem->updateProgressOut(local_progress);
62
63 if (progress_callback)
64 progress_callback(local_progress);
65}
66
67void CountingBlockOutputStream::writePrefix()
68{

Callers

nothing calls this directly

Calls 7

incrementFunction · 0.50
startMethod · 0.45
rowsMethod · 0.45
bytesMethod · 0.45
getMethod · 0.45
updateProgressOutMethod · 0.45

Tested by

no test coverage detected