Files
scylladb/sstables/checksummed_data_source.hh
Ernest Zaslavsky 8d49bb8af2 sstables: Start using make_data_or_index_source in sstable
Convert all necessary methods to be awaitable. Start using `make_data_or_index_source`
when creating data_source for data and index components.

For proper working of compressed/checksummed input streams, start passing
stream creator functors to `make_(checksummed/compressed)_file_(k_l/m)_format_input_stream`.
2025-07-15 10:10:23 +03:00

37 lines
1.3 KiB
C++

/*
* Copyright (C) 2024-present ScyllaDB
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
*/
#pragma once
#include <seastar/core/seastar.hh>
#include <seastar/core/fstream.hh>
#include <seastar/core/iostream.hh>
#include "sstables/types.hh"
namespace sstables {
using stream_creator_fn = std::function<future<input_stream<char>>(uint64_t, uint64_t, file_input_stream_options)>;
using integrity_error_handler = std::function<void(sstring)>;
void throwing_integrity_error_handler(sstring msg);
input_stream<char> make_checksummed_file_k_l_format_input_stream(stream_creator_fn stream_creator,
uint64_t file_len, const sstables::checksum& checksum,
uint64_t offset, size_t len,
class file_input_stream_options options,
std::optional<uint32_t> digest,
integrity_error_handler error_handler = throwing_integrity_error_handler);
input_stream<char> make_checksummed_file_m_format_input_stream(stream_creator_fn stream_creator,
uint64_t file_len, const sstables::checksum& checksum,
uint64_t offset, size_t len,
class file_input_stream_options options,
std::optional<uint32_t> digest,
integrity_error_handler error_handler = throwing_integrity_error_handler);
}