10#ifndef A11_STORES_CHUNK_STORE_READER_H_
11#define A11_STORES_CHUNK_STORE_READER_H_
18#include <absl/status/status.h>
19#include <absl/status/statusor.h>
20#include <absl/time/time.h>
84 static absl::StatusOr<std::shared_ptr<ChunkStoreReader>>
Create(
133 absl::Duration
timeout = absl::InfiniteDuration());
146 : state_(std::
move(state)) {}
148 std::shared_ptr<State> state_;
A11's pluggable storage interface for streamed node data: an ordered, appendable log of fragments key...
An ordered, buffered read cursor over a ChunkStore.
Definition chunk_store_reader.h:70
ChunkStoreReaderOptions options() const
Definition chunk_store_reader.cc:553
size_t buffer_size() const
Definition chunk_store_reader.cc:557
void EnsureStarted()
Start the background read pump if it is not already running.
Definition chunk_store_reader.cc:523
a11::Task Done() const
Await completion of the background read pump.
Definition chunk_store_reader.cc:536
a11::Future< std::optional< data::NodeFragment > > Next(absl::Duration timeout=absl::InfiniteDuration())
Get the next fragment from the store.
Definition chunk_store_reader.cc:540
std::shared_ptr< ChunkStore > store() const
Definition chunk_store_reader.cc:549
static absl::StatusOr< std::shared_ptr< ChunkStoreReader > > Create(std::shared_ptr< ChunkStore > store, ChunkStoreReaderOptions options={})
Create a reader over store.
Definition chunk_store_reader.cc:501
~ChunkStoreReader()=default
absl::Status GetStatus() const
Get the reader's current status.
Definition chunk_store_reader.cc:531
void Cancel()
Stop the background read pump.
Definition chunk_store_reader.cc:527
Completion values used by every asynchronous A11 operation.
Future< T > SubmitWithCancellationHook(absl::AnyInvocable< absl::StatusOr< T >() && > work, std::function< void()> cancellation_hook, thread::TreeOptions tree_options)
Run work on A11's fiber pool with application-specific cancellation.
Definition executor.h:30
Tunables controlling how a ChunkStoreReader delivers and buffers fragments.
Definition chunk_store_reader.h:37
bool ordered
Whether fragments are delivered strictly in sequence order.
Definition chunk_store_reader.h:39
std::uint32_t offset
Sequence number at which reading begins.
Definition chunk_store_reader.h:45
bool pop_chunks
Whether fragments are removed from the store as they are read.
Definition chunk_store_reader.h:41
std::optional< std::uint64_t > max_chunks_to_read
Optional cap on the total number of fragments to read.
Definition chunk_store_reader.h:47
absl::Status Validate() const
Validate that the options are internally consistent.
Definition chunk_store_reader.cc:32
std::uint64_t num_chunks_to_buffer
Maximum number of fragments to prefetch into the buffer.
Definition chunk_store_reader.h:43
bool sticky_mimetype
Whether ordered reads inherit the last explicitly set chunk mimetype.
Definition chunk_store_reader.h:49
Definition chunk_store_reader.cc:44
A11's core wire value types: chunks, node fragments and messages.