|
sparrow-ipc 0.3.0
|
Tracks dictionaries during serialization. More...
#include <dictionary_tracker.hpp>
Public Member Functions | |
| std::vector< dictionary_info > | extract_dictionaries_from_batch (const sparrow::record_batch &batch) |
| Extract dictionaries from a record batch. | |
| void | mark_emitted (int64_t id) noexcept |
| Mark a dictionary as emitted. | |
| bool | is_emitted (int64_t id) const noexcept |
| Check if a dictionary has been emitted. | |
| void | reset () noexcept |
| Reset tracking state. | |
Tracks dictionaries during serialization.
This class is responsible for discovering dictionary-encoded fields in record batches, extracting their dictionary data, and managing which dictionaries have been emitted to the output stream.
Dictionaries must be emitted before any RecordBatch that references them. This class ensures proper ordering by tracking emitted dictionary IDs and providing methods to determine which dictionaries need to be sent before each record batch.
Definition at line 37 of file dictionary_tracker.hpp.
|
nodiscard |
Extract dictionaries from a record batch.
Scans all columns in the record batch for dictionary-encoded fields. Returns a vector of dictionaries that need to be emitted before this record batch can be serialized.
| batch | The record batch to scan for dictionaries |
|
nodiscardnoexcept |
Check if a dictionary has been emitted.
| id | The dictionary ID to check |
|
noexcept |
Mark a dictionary as emitted.
After a dictionary has been written to the stream, call this method to record that it has been emitted. This prevents re-emission of the same dictionary for subsequent record batches (unless it's a delta update).
| id | The dictionary ID that was emitted |
|
noexcept |
Reset tracking state.
Clears all tracking information. Useful when starting a new stream.