mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-20 00:20:47 +00:00
The immediate motivation for introducing frozen_mutation is inability to deserialize current "mutation" object, which needs schema reference at the time it's constructed. It needs schema to initialize its internal maps with proper key comparators, which depend on schema. frozen_mutation is an immutable, compact form of a mutation. It doesn't use complex in-memory strucutres, data is stored in a linear buffer. In case of frozen_mutation schema needs to be supplied only at the time mutation partition is visited. Therefore it can be trivially deserialized without schema.
19 lines
520 B
C++
19 lines
520 B
C++
/*
|
|
* Copyright (C) 2015 Cloudius Systems, Ltd.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "database_fwd.hh"
|
|
#include "utils/data_output.hh"
|
|
#include "mutation_partition_view.hh"
|
|
|
|
class mutation_partition_serializer {
|
|
public:
|
|
using count_type = uint32_t;
|
|
|
|
static size_t size(const schema& schema, const mutation_partition& p);
|
|
static void write(data_output& out, const schema& schema, const mutation_partition& p);
|
|
static mutation_partition_view view(bytes_view v) { return mutation_partition_view::from_bytes(v); }
|
|
};
|