Skip to main content

ChunkStep

Struct ChunkStep 

Source
pub struct ChunkStep<I, O> { /* private fields */ }
Expand description

A validated one-step chunk definition.

Implementations§

Source§

impl<I, O> ChunkStep<I, O>

Source

pub fn new( name: StepName, size: ChunkSize, reader: Box<dyn ItemReader<I>>, processor: Arc<dyn ItemProcessor<I, O>>, writer: Arc<dyn ItemWriter<O>>, transactions: Arc<dyn ChunkTransactionManager>, completion: Arc<dyn ChunkCompletion>, ) -> Self

Constructs a chunk step from facade-owned component and transaction ports.

Source

pub fn with_chunk_listener(self, listener: Arc<dyn ChunkListener>) -> Self

Registers a chunk listener in deterministic before-order.

Source

pub fn with_item_listeners(self, listeners: ItemListenerSet<I, O>) -> Self

Installs the authoritative item, retry, and skip listener families.

The set replaces any previously installed families.

Source

pub fn with_fault_runtime(self, fault: FaultRuntime) -> Self

Installs bounded retry, backoff, skip, and rollback behavior.

Without a fault runtime every component failure fails the step after a known rollback, which is the M2 behavior.

Source

pub fn with_listener(self, listener: Arc<dyn StepExecutionListener>) -> Self

Registers a step listener in deterministic before-order.

Source

pub const fn name(&self) -> &StepName

Borrows the step name.

Source

pub async fn execute( &mut self, correlation: &ExecutionCorrelation, stop: &StopToken, ) -> ChunkExecutionReport
where I: Send + Sync, O: Send + Sync,

Executes this step deterministically on the caller’s async runtime.

The reader is stateful, so the definition is mutably borrowed for the duration of the run. Only counts returned by successful transaction commits appear in the report. correlation identifies the execution for item, retry, and skip listeners; it never reaches a component.

Trait Implementations§

Source§

impl<I, O> Debug for ChunkStep<I, O>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<I, O> !RefUnwindSafe for ChunkStep<I, O>

§

impl<I, O> !Sync for ChunkStep<I, O>

§

impl<I, O> !UnwindSafe for ChunkStep<I, O>

§

impl<I, O> Freeze for ChunkStep<I, O>

§

impl<I, O> Send for ChunkStep<I, O>

§

impl<I, O> Unpin for ChunkStep<I, O>

§

impl<I, O> UnsafeUnpin for ChunkStep<I, O>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more