[][src]Enum nakadi_types::model::event_type::CleanupPolicy

pub enum CleanupPolicy {
    Delete,
    Compact,
}

Event type cleanup policy. There are two possible values.

It’s not possible to change the value of this field for existing event type.

See also Nakadi Manual

Variants

Delete

This cleanup policy will delete old events after retention time expires. Nakadi guarantees that each event will be available for at least the retention time period. However Nakadi doesn’t guarantee that event will be deleted right after retention time expires.

Compact

This cleanup policy will keep only the latest event for each event key. The compaction is performed per partition, there is no compaction across partitions. The key that will be used as a compaction key should be specified in ‘partition_compaction_key’ field of event metadata. This cleanup policy is not available for ‘undefined’ category of event types.

The compaction can be not applied to events that were published recently and located at the head of the queue, which means that the actual amount of events received by consumers can be different depending on time when the consumption happened.

When using ‘compact’ cleanup policy user should consider that different Nakadi endpoints showing the amount of events will actually show the original amount of events published, not the actual amount of events that are currently there. E.g. subscription /stats endpoint will show the value ‘unconsumed_events’ - but that may not match with the actual amount of events unconsumed in that subscription as ‘compact’ cleanup policy may delete older events in the middle of queue if there is a newer event for the same key published.

For more details about compaction implementation please read the documentation of Log Compaction in Kafka, Nakadi currently relies on this implementation.

Trait Implementations

impl Clone for CleanupPolicy[src]

impl Copy for CleanupPolicy[src]

impl Debug for CleanupPolicy[src]

impl Default for CleanupPolicy[src]

impl<'de> Deserialize<'de> for CleanupPolicy[src]

impl Eq for CleanupPolicy[src]

impl PartialEq<CleanupPolicy> for CleanupPolicy[src]

impl Serialize for CleanupPolicy[src]

impl StructuralEq for CleanupPolicy[src]

impl StructuralPartialEq for CleanupPolicy[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,