|
A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
|
Classes | |
| struct | Completion |
| struct | Request |
Public Types | |
| enum class | CompletionKind { kFragment , kEnd , kError } |
| enum class | Operation { kNone , kFetch , kClear } |
| using | NextResult = std::optional< data::NodeFragment > |
Public Member Functions | |
| State (std::shared_ptr< ChunkStore > chunk_store, ChunkStoreReaderOptions reader_options) | |
| void | Wake () |
| void | Cancel () |
| std::vector< data::NodeFragment > | TakeBuffered (size_t limit) |
Pops up to limit prefetched fragments without waiting. | |
| std::optional< data::NodeFragment > | TryTakeSimpleBuffered () |
| a11::Future< NextResult > | Next (absl::Duration timeout) |
| void | Drive () |
| Pump ready fragments inline without waiting. | |
| bool | DriveOnce () |
| void | InstallFetch (const a11::Future< data::NodeFragment > &pending, std::uint64_t position_wanted, std::uint64_t generation) |
| bool | FetchArrived (std::uint64_t arrived_position, std::uint64_t generation, absl::StatusOr< data::NodeFragment > result, bool inline_drive=false) |
| Record a completed fetch, in order. | |
| void | InstallClear (const a11::Future< data::NodeFragment > &pending, std::uint64_t generation) |
| void | ClearDone (std::uint64_t generation, const absl::StatusOr< data::NodeFragment > &result) |
| void | MaybeCompleteDone () |
| a11::Task | Done () |
| void | DrainArrivedLocked (std::vector< Completion > *completions, bool *start_clear, std::uint32_t *clear_seq, std::uint64_t *clear_generation) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu) |
| Apply arrived fetches in position order. | |
| void | FinishFragmentLocked (data::NodeFragment fragment, std::vector< Completion > *completions) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu) |
| size_t | ActivePendingReadCountLocked () const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu) |
| bool | HasReadCapacityLocked (size_t about_to_issue=0) const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu) |
| std::shared_ptr< Request > | PopPendingReadLocked () ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu) |
| void | CollectAvailableLocked (std::vector< Completion > *completions) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu) |
| std::uint64_t position | ABSL_GUARDED_BY (mu) |
| std::uint64_t chunks_read | ABSL_GUARDED_BY (mu)=0 |
| std::string current_mimetype | ABSL_GUARDED_BY (mu) |
| std::optional< absl::Status > status | ABSL_GUARDED_BY (mu) |
| std::deque< data::NodeFragment > buffer | ABSL_GUARDED_BY (mu) |
| std::deque< std::shared_ptr< Request > > pending_reads | ABSL_GUARDED_BY (mu) |
| bool queued | ABSL_GUARDED_BY (mu) |
| Operation operation | ABSL_GUARDED_BY (mu) |
| std::uint64_t operation_generation | ABSL_GUARDED_BY (mu)=0 |
| a11::Future< data::NodeFragment > active_operation | ABSL_GUARDED_BY (mu) |
| std::uint64_t next_fetch_position | ABSL_GUARDED_BY (mu) |
| size_t fetches_in_flight | ABSL_GUARDED_BY (mu)=0 |
| std::uint64_t fetch_generation | ABSL_GUARDED_BY (mu)=0 |
| std::map< std::uint64_t, absl::StatusOr< data::NodeFragment > > arrived | ABSL_GUARDED_BY (mu) |
| std::vector< a11::Future< data::NodeFragment > > active_fetches | ABSL_GUARDED_BY (mu) |
| std::optional< a11::Promise< a11::Unit > > done_promise | ABSL_GUARDED_BY (mu) |
| bool done_completed | ABSL_GUARDED_BY (mu) |
Static Public Member Functions | |
| static a11::internal::CallbackScheduler & | Scheduler () |
| static void | Complete (std::vector< Completion > completions) |
Public Attributes | |
| const std::shared_ptr< ChunkStore > | store |
| const ChunkStoreReaderOptions | options |
| thread::Mutex | mu |
| InlinePumpState | pump |
Static Public Attributes | |
| static constexpr size_t | kMaxFetchesInFlight = 16 |
| Maximum concurrent fetches, bounding the prefetch and reorder buffers. | |
| using a11::stores::ChunkStoreReader::State::NextResult = std::optional<data::NodeFragment> |
|
strong |
|
strong |
|
inline |
| std::uint64_t position a11::stores::ChunkStoreReader::State::ABSL_GUARDED_BY | ( | mu | ) |
| std::string current_mimetype a11::stores::ChunkStoreReader::State::ABSL_GUARDED_BY | ( | mu | ) |
| std::optional< absl::Status > status a11::stores::ChunkStoreReader::State::ABSL_GUARDED_BY | ( | mu | ) |
| std::deque< data::NodeFragment > buffer a11::stores::ChunkStoreReader::State::ABSL_GUARDED_BY | ( | mu | ) |
| std::deque< std::shared_ptr< Request > > pending_reads a11::stores::ChunkStoreReader::State::ABSL_GUARDED_BY | ( | mu | ) |
| bool queued a11::stores::ChunkStoreReader::State::ABSL_GUARDED_BY | ( | mu | ) |
| a11::Future< data::NodeFragment > active_operation a11::stores::ChunkStoreReader::State::ABSL_GUARDED_BY | ( | mu | ) |
| std::uint64_t next_fetch_position a11::stores::ChunkStoreReader::State::ABSL_GUARDED_BY | ( | mu | ) |
| std::map< std::uint64_t, absl::StatusOr< data::NodeFragment > > arrived a11::stores::ChunkStoreReader::State::ABSL_GUARDED_BY | ( | mu | ) |
| std::vector< a11::Future< data::NodeFragment > > active_fetches a11::stores::ChunkStoreReader::State::ABSL_GUARDED_BY | ( | mu | ) |
| std::optional< a11::Promise< a11::Unit > > done_promise a11::stores::ChunkStoreReader::State::ABSL_GUARDED_BY | ( | mu | ) |
| bool done_completed a11::stores::ChunkStoreReader::State::ABSL_GUARDED_BY | ( | mu | ) |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
Apply arrived fetches in position order.
Stops at the first gap or terminal result; later arrivals are discarded.
|
inline |
Pump ready fragments inline without waiting.
Inline completion fills the prefetch buffer for NextMany. The loop bounds stack use on pooled fibers.
|
inline |
|
inline |
Record a completed fetch, in order.
Completed reads wait in arrived until their position is next. Errors follow the same ordering, so a later NotFound cannot end the stream while an earlier read remains outstanding.
| arrived_position | Arrival-order position of this fetch. |
| generation | Fetch generation used to reject stale completions. |
| result | Completed fragment or fetch error. |
| inline_drive | True when the fetch resolved without waiting and DriveOnce() is still on the stack; then this reports back whether to keep driving instead of waking the scheduler. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
Pops up to limit prefetched fragments without waiting.
Returns none while earlier reads are queued, preserving request order. NextMany handles terminal states through the single-fragment path.
|
inline |
|
inline |
|
staticconstexpr |
Maximum concurrent fetches, bounding the prefetch and reorder buffers.
|
mutable |
| const ChunkStoreReaderOptions a11::stores::ChunkStoreReader::State::options |
| InlinePumpState a11::stores::ChunkStoreReader::State::pump |
| const std::shared_ptr<ChunkStore> a11::stores::ChunkStoreReader::State::store |