pub struct TagManager { /* private fields */ }Expand description
Manager for tag files using unified FileIO.
Tags are named snapshots stored as JSON files at {table_path}/tag/tag-{name}.
The tag file format is identical to a Snapshot JSON file.
Reference: org.apache.paimon.utils.TagManager
Implementations§
Source§impl TagManager
impl TagManager
pub fn new(file_io: FileIO, table_path: String) -> Self
Sourcepub fn tag_directory(&self) -> String
pub fn tag_directory(&self) -> String
Path to the tag directory (e.g. table_path/tag).
Sourcepub fn with_branch(&self, branch_name: &str) -> Self
pub fn with_branch(&self, branch_name: &str) -> Self
Create a TagManager for a branch of this table.
Sourcepub fn tag_path(&self, tag_name: &str) -> String
pub fn tag_path(&self, tag_name: &str) -> String
Path to the tag file for the given name (e.g. tag/tag-my_tag).
Sourcepub async fn tag_exists(&self, tag_name: &str) -> Result<bool>
pub async fn tag_exists(&self, tag_name: &str) -> Result<bool>
Check if a tag exists.
Sourcepub async fn get(&self, tag_name: &str) -> Result<Option<Snapshot>>
pub async fn get(&self, tag_name: &str) -> Result<Option<Snapshot>>
Get the snapshot for a tag, or None if the tag file does not exist.
Tag files are JSON with the same schema as Snapshot. Reads directly and catches NotFound to avoid a separate exists() IO round-trip.
Sourcepub async fn list_all_names(&self) -> Result<Vec<String>>
pub async fn list_all_names(&self) -> Result<Vec<String>>
List all tag names sorted ascending. Returns an empty vector when the tag directory does not exist.
Trait Implementations§
Source§impl Clone for TagManager
impl Clone for TagManager
Source§fn clone(&self) -> TagManager
fn clone(&self) -> TagManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TagManager
impl !RefUnwindSafe for TagManager
impl Send for TagManager
impl Sync for TagManager
impl Unpin for TagManager
impl UnsafeUnpin for TagManager
impl !UnwindSafe for TagManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more