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

Function copyDataImpl

src/DataStreams/copyData.cpp:21–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20template <typename TCancelCallback, typename TProgressCallback>
21void copyDataImpl(IBlockInputStream & from, IBlockOutputStream & to, TCancelCallback && is_cancelled, TProgressCallback && progress)
22{
23 from.readPrefix();
24 to.writePrefix();
25
26 while (Block block = from.read())
27 {
28 if (is_cancelled())
29 break;
30
31 to.write(block);
32 progress(block);
33 }
34
35 if (is_cancelled())
36 return;
37
38 /// For outputting additional information in some formats.
39 if (from.getProfileInfo().hasAppliedLimit())
40 to.setRowsBeforeLimit(from.getProfileInfo().getRowsBeforeLimit());
41
42 to.setTotals(from.getTotals());
43 to.setExtremes(from.getExtremes());
44
45 if (is_cancelled())
46 return;
47
48 from.readSuffix();
49 to.writeSuffix();
50}
51
52void copyData(IBlockInputStream & from, IBlockOutputStream & to, const std::function<void(const Block & block)> & progress,
53 std::atomic<bool> * is_cancelled)

Callers 1

copyDataFunction · 0.70

Calls 13

getRowsBeforeLimitMethod · 0.80
readPrefixMethod · 0.45
writePrefixMethod · 0.45
readMethod · 0.45
writeMethod · 0.45
hasAppliedLimitMethod · 0.45
setRowsBeforeLimitMethod · 0.45
setTotalsMethod · 0.45
getTotalsMethod · 0.45
setExtremesMethod · 0.45
getExtremesMethod · 0.45
readSuffixMethod · 0.45

Tested by

no test coverage detected