diff --git a/src/DataStreams/copyData.cpp b/src/DataStreams/copyData.cpp index a0651999034..a26052778a8 100644 --- a/src/DataStreams/copyData.cpp +++ b/src/DataStreams/copyData.cpp @@ -49,6 +49,16 @@ void copyDataImpl(IBlockInputStream & from, IBlockOutputStream & to, TCancelCall to.writeSuffix(); } +void copyData(IBlockInputStream & from, IBlockOutputStream & to, const std::function & progress, + std::atomic * is_cancelled) +{ + auto is_cancelled_pred = [is_cancelled] () + { + return isAtomicSet(is_cancelled); + }; + + copyDataImpl(from, to, is_cancelled_pred, progress); +} inline void doNothing(const Block &) {} diff --git a/src/DataStreams/copyData.h b/src/DataStreams/copyData.h index f2bce8f411b..3dc90aed37d 100644 --- a/src/DataStreams/copyData.h +++ b/src/DataStreams/copyData.h @@ -16,6 +16,9 @@ class Block; */ void copyData(IBlockInputStream & from, IBlockOutputStream & to, std::atomic * is_cancelled = nullptr); +void copyData(IBlockInputStream & from, IBlockOutputStream & to, const std::function & progress, + std::atomic * is_cancelled = nullptr); + void copyData(IBlockInputStream & from, IBlockOutputStream & to, const std::function & is_cancelled); void copyData(IBlockInputStream & from, IBlockOutputStream & to, const std::function & is_cancelled,