pub struct EventLogger { /* private fields */ }Expand description
Event logger for MapReduce jobs
Implementations§
Source§impl EventLogger
impl EventLogger
Sourcepub fn new(writers: Vec<Box<dyn EventWriter>>) -> Self
pub fn new(writers: Vec<Box<dyn EventWriter>>) -> Self
Create a new event logger
Sourcepub fn with_config(
writers: Vec<Box<dyn EventWriter>>,
flush_interval: Duration,
buffer_size_limit: usize,
) -> Self
pub fn with_config( writers: Vec<Box<dyn EventWriter>>, flush_interval: Duration, buffer_size_limit: usize, ) -> Self
Create a new event logger with custom configuration
Sourcepub async fn log(&self, event: MapReduceEvent) -> Result<()>
pub async fn log(&self, event: MapReduceEvent) -> Result<()>
Log an event
Sourcepub async fn log_with_metadata(
&self,
event: MapReduceEvent,
metadata: HashMap<String, Value>,
) -> Result<()>
pub async fn log_with_metadata( &self, event: MapReduceEvent, metadata: HashMap<String, Value>, ) -> Result<()>
Log an event with custom metadata
Sourcepub async fn set_correlation_id(&self, id: String)
pub async fn set_correlation_id(&self, id: String)
Set the current correlation ID
Sourcepub async fn current_correlation_id(&self) -> String
pub async fn current_correlation_id(&self) -> String
Get the current correlation ID
Sourcepub async fn log_dlq_event_with_job(
&self,
job_id: String,
event: DLQEvent,
) -> Result<()>
pub async fn log_dlq_event_with_job( &self, job_id: String, event: DLQEvent, ) -> Result<()>
Log a DLQ event with the appropriate job ID
Sourcepub fn start_background_flush(self: Arc<Self>) -> JoinHandle<()>
pub fn start_background_flush(self: Arc<Self>) -> JoinHandle<()>
Start background flush task
Auto Trait Implementations§
impl !RefUnwindSafe for EventLogger
impl !UnwindSafe for EventLogger
impl Freeze for EventLogger
impl Send for EventLogger
impl Sync for EventLogger
impl Unpin for EventLogger
impl UnsafeUnpin for EventLogger
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
Mutably borrows from an owned value. Read more
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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