19 namespace active_detail {
20 template <
class P, profile_unit = P::unit>
struct family;
29 template <
class P>
using engine = std::conditional_t<rebuilding<P>,
43 using base_type::base_type;
50 return active_engine(base_type::from_snapshot(std::move(value)));
53 requires requires { base_type::from_snapshot(std::move(value), std::move(storage)); } {
54 return active_engine(base_type::from_snapshot(std::move(value), std::move(storage)));
61 std::string_view schema) {
62 if (schema.empty())
throw std::invalid_argument(
"active checkpoint requires an expected schema");
63 if constexpr (active_detail::rebuilding<P>)
64 return world_type::restore(std::move(runtime), metadata_type::decode(bytes), schema);
67 if (bytes.size() >= 56 && bytes.size() - 56 == schema.size()) {
69 previous.validate(runtime.admissions());
71 }
else if (bytes.size() >= 16 && bytes.size() - 16 == schema.size())
72 metadata = metadata_type::decode(bytes);
73 else throw std::invalid_argument(
"active checkpoint does not match the expected schema layout");
74 return world_type::restore(std::move(runtime), std::move(metadata), schema);
std::conditional_t< rebuilding< P >, replacement_rebuild_engine< P, wrapping_fingerprint_algebra, 256, typename family< P >::type >, typed_engine< P, wrapping_fingerprint_algebra, 256, typename family< P >::type > > engine
Definition active_engine.h:31
constexpr bool rebuilding
Definition active_engine.h:27
Definition active_engine.h:18
profile_unit
Definition registry.h:29
Rebuilds one replacement sort with a frozen scan and charged FIFO replay.
Owns catalog reservations and streamed native and index outputs for one runtime worker.
Persists sort-owned native files behind the redundant runtime's exact checkpoints.
Definition active_engine.h:20
Definition active_engine.h:38
typename base_type::metadata_type metadata_type
Definition active_engine.h:41
active_engine(active_engine &&) noexcept(std::is_nothrow_move_constructible_v< base_type >)=default
static active_engine from_snapshot(world_type value, Storage storage)
Definition active_engine.h:52
static active_engine from_snapshot(world_type value)
Definition active_engine.h:49
static world_type restore_checkpoint(runtime_snapshot runtime, std::span< std::byte const > bytes, std::string_view schema)
Definition active_engine.h:60
active_engine(active_engine const &)=delete
active_detail::engine< P > base_type
Definition active_engine.h:39
typename base_type::runtime_family::snapshot_type runtime_snapshot
Definition active_engine.h:42
typename base_type::world_type world_type
Definition active_engine.h:40
active_engine & operator=(active_engine const &)=delete
active_engine(base_type value)
Definition active_engine.h:78
Definition redundant_runtime.h:918
Definition replacement_rebuild.h:129
Definition sort_runtime.h:152
Definition typed_world.h:406