Uncompressed SSTables store their checksums in a separate CRC.db file. Add this in the list of SSTable components. Since this component is used only for validation, load the component on-demand for validation tasks and delete it when all validation tasks finish. In more detail: - Make the checksum component shareable and weakly referencable. Also, add a constructor since it is no longer an aggregate. - Use a weak pointer to store a non-owning reference in the components and a shared pointer to keep the object alive while validation runs. Once validation finishes, the component should be cleaned up automatically. Signed-off-by: Nikos Dragazis <nikolaos.dragazis@scylladb.com>
31 lines
618 B
C++
31 lines
618 B
C++
/*
|
|
* Copyright (C) 2019-present ScyllaDB
|
|
*
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <seastar/core/weak_ptr.hh>
|
|
|
|
#include "compress.hh"
|
|
#include "sstables/types.hh"
|
|
#include "utils/i_filter.hh"
|
|
|
|
namespace sstables {
|
|
|
|
// Immutable components that can be shared among shards.
|
|
struct shareable_components {
|
|
sstables::compression compression;
|
|
utils::filter_ptr filter;
|
|
sstables::summary summary;
|
|
sstables::statistics statistics;
|
|
std::optional<sstables::scylla_metadata> scylla_metadata;
|
|
weak_ptr<sstables::checksum> checksum;
|
|
};
|
|
|
|
} // namespace sstables
|