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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.