Enum nakadi_types::event_type::CleanupPolicy [−][src]
pub enum CleanupPolicy { Delete, Compact, }
Expand description
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
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.
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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for CleanupPolicy
impl Send for CleanupPolicy
impl Sync for CleanupPolicy
impl Unpin for CleanupPolicy
impl UnwindSafe for CleanupPolicy
Blanket Implementations
Mutably borrows from an owned value. Read more