refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
2024-12-27 17:31:17 -06:00
parent b04f903e4d
commit 1e32fab8b0
2 changed files with 11 additions and 11 deletions

View File

@ -28,16 +28,16 @@ direct_open_file::direct_open_file(std::uint64_t chunk_size,
: ring_file_base(chunk_size, chunk_timeout, fsi, provider, min_ring_size,
true) {}
auto direct_open_file::on_check_start() -> bool {
return (get_file_size() == 0U || has_reader_thread());
}
auto direct_open_file::handle_read_buffer(
std::size_t chunk,
std::function<api_error(data_buffer &data)> func) -> api_error {
return func(ring_data_.at(chunk % get_read_state_size()));
}
auto direct_open_file::on_check_start() -> bool {
return (get_file_size() == 0U || has_reader_thread());
}
auto direct_open_file::use_buffer(
std::size_t chunk,
std::function<api_error(const data_buffer &data)> func) -> api_error {

View File

@ -40,6 +40,13 @@ ring_buffer_open_file::ring_buffer_open_file(std::string buffer_directory,
utils::create_uuid_string(),
})) {}
auto ring_buffer_open_file::handle_read_buffer(
std::size_t /* chunk */,
std::function<api_error(data_buffer &data)> func) -> api_error {
data_buffer buffer;
return func(buffer);
}
auto ring_buffer_open_file::on_check_start() -> bool {
REPERTORY_USES_FUNCTION_NAME();
@ -103,13 +110,6 @@ void ring_buffer_open_file::on_destroy() {
utils::get_last_error_code(), "failed to delete file");
}
auto ring_buffer_open_file::handle_read_buffer(
std::size_t /* chunk */,
std::function<api_error(data_buffer &data)> func) -> api_error {
data_buffer buffer;
return func(buffer);
}
auto ring_buffer_open_file::use_buffer(
std::size_t chunk,
std::function<api_error(const data_buffer &data)> func) -> api_error {