pub struct EmbeddedBroker {
pub recovered_torn_lines: u64,
/* private fields */
}Expand description
File-backed broker instance.
Fields§
§recovered_torn_lines: u64Torn trailing lines dropped during recovery (exposed to metrics).
Implementations§
Source§impl EmbeddedBroker
impl EmbeddedBroker
Sourcepub fn provision(
data_dir: &Path,
manifest: &BridgeManifest,
) -> Result<Self, BusError>
pub fn provision( data_dir: &Path, manifest: &BridgeManifest, ) -> Result<Self, BusError>
Provision a fresh bridge in data_dir from manifest alone (R12).
Fails if the directory already contains a bridge.
Sourcepub fn open(data_dir: &Path) -> Result<Self, BusError>
pub fn open(data_dir: &Path) -> Result<Self, BusError>
Open an existing bridge, recovering offsets (and truncating at most one torn trailing line per partition) from the segment files.
Sourcepub fn manifest(&self) -> &BridgeManifest
pub fn manifest(&self) -> &BridgeManifest
The manifest this bridge was provisioned from.
Sourcepub fn enforce_retention(&self, now_ms: u64) -> Result<u64, BusError>
pub fn enforce_retention(&self, now_ms: u64) -> Result<u64, BusError>
Enforce per-topic hot retention at time now_ms: when
retention.cold_uri is set, each expired record
is first exported to the cold tier as its own write-once object (via the
authenticated ColdArchive for scheme:// URIs, or
write_cold_event_once for local directory paths) before being
removed from the hot segment via atomic rewrite; with cold_uri
unset, expired records are dropped from the hot segment without
export. Returns the number of
records expired.
Trait Implementations§
Source§impl EventBus for EmbeddedBroker
impl EventBus for EmbeddedBroker
Source§fn set_control_key(&self, _key: [u8; 32]) -> Result<(), BusError>
fn set_control_key(&self, _key: [u8; 32]) -> Result<(), BusError>
Source§fn publish(
&self,
topic: &str,
key: &str,
value: &Value,
) -> Result<PublishAck, BusError>
fn publish( &self, topic: &str, key: &str, value: &Value, ) -> Result<PublishAck, BusError>
value onto topic, partitioned by key. Returns the ack.Source§fn publish_idempotent(
&self,
topic: &str,
key: &str,
value: &Value,
event_uid: &str,
) -> Result<PublishAck, BusError>
fn publish_idempotent( &self, topic: &str, key: &str, value: &Value, event_uid: &str, ) -> Result<PublishAck, BusError>
Source§fn fetch(
&self,
topic: &str,
partition: u32,
offset: u64,
max: usize,
) -> Result<Vec<StoredEvent>, BusError>
fn fetch( &self, topic: &str, partition: u32, offset: u64, max: usize, ) -> Result<Vec<StoredEvent>, BusError>
max events from topic/partition starting at offset
(ordered replay).Source§fn partitions(&self, topic: &str) -> Result<u32, BusError>
fn partitions(&self, topic: &str) -> Result<u32, BusError>
topic.Source§fn maintenance(&self, now_ms: u64) -> Result<u64, BusError>
fn maintenance(&self, now_ms: u64) -> Result<u64, BusError>
Source§fn find_event_by_uid(
&self,
topic: &str,
key: &str,
event_uid: &str,
) -> Result<Option<PublishAck>, BusError>
fn find_event_by_uid( &self, topic: &str, key: &str, event_uid: &str, ) -> Result<Option<PublishAck>, BusError>
Auto Trait Implementations§
impl !Freeze for EmbeddedBroker
impl !RefUnwindSafe for EmbeddedBroker
impl Send for EmbeddedBroker
impl Sync for EmbeddedBroker
impl Unpin for EmbeddedBroker
impl UnsafeUnpin for EmbeddedBroker
impl !UnwindSafe for EmbeddedBroker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more