Skip to main content

reifydb_core/actors/
drop.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 ReifyDB
3
4use reifydb_type::util::cowvec::CowVec;
5
6use crate::{common::CommitVersion, interface::store::EntryKind};
7
8/// A request to drop old versions of a key.
9#[derive(Debug, Clone)]
10pub struct DropRequest {
11	/// The table containing the key.
12	pub table: EntryKind,
13	/// The logical key (without version suffix).
14	pub key: CowVec<u8>,
15	/// The commit version that created this drop request.
16	pub commit_version: CommitVersion,
17	/// A version being written in the same batch (to avoid race).
18	pub pending_version: Option<CommitVersion>,
19}
20
21/// Messages for the drop actor.
22#[derive(Clone)]
23pub enum DropMessage {
24	/// A single drop request to process.
25	Request(DropRequest),
26	/// A batch of drop requests to process.
27	Batch(Vec<DropRequest>),
28	/// Periodic tick for flushing batches.
29	Tick,
30	/// Shutdown the actor.
31	Shutdown,
32}