diff --git a/frozen_mutation.cc b/frozen_mutation.cc index 634aa3d448..4cf9a08fec 100644 --- a/frozen_mutation.cc +++ b/frozen_mutation.cc @@ -8,6 +8,7 @@ #include #include "frozen_mutation.hh" +#include "schema_registry.hh" #include "mutation_partition.hh" #include "mutation.hh" #include "counters.hh" @@ -140,6 +141,18 @@ frozen_mutation freeze(const mutation& m) { return frozen_mutation{ m }; } +std::vector freeze(const std::vector& muts) { + return boost::copy_range>(muts | boost::adaptors::transformed([] (const mutation& m) { + return freeze(m); + })); +} + +std::vector unfreeze(const std::vector& muts) { + return boost::copy_range>(muts | boost::adaptors::transformed([] (const frozen_mutation& fm) { + return fm.unfreeze(local_schema_registry().get(fm.schema_version())); + })); +} + mutation_partition_view frozen_mutation::partition() const { return mutation_partition_view::from_view(mutation_view().partition()); } diff --git a/frozen_mutation.hh b/frozen_mutation.hh index 0b95673a53..f34b8eda9a 100644 --- a/frozen_mutation.hh +++ b/frozen_mutation.hh @@ -225,6 +225,8 @@ public: }; frozen_mutation freeze(const mutation& m); +std::vector freeze(const std::vector&); +std::vector unfreeze(const std::vector&); struct frozen_mutation_and_schema { frozen_mutation fm;