pub struct Table(_);
Expand description
A reference to a latch-free, log-structured table that stores sorted key-value entries.
This is the same as raw::Table
with the Photon
environment.
Implementations§
Methods from Deref<Target = Table<Photon>>§
sourcepub async fn get(&self, key: &[u8], lsn: u64) -> Result<Option<Vec<u8>>>
pub async fn get(&self, key: &[u8], lsn: u64) -> Result<Option<Vec<u8>>>
Gets the value corresponding to the key.
sourcepub async fn put(&self, key: &[u8], lsn: u64, value: &[u8]) -> Result<()>
pub async fn put(&self, key: &[u8], lsn: u64, value: &[u8]) -> Result<()>
Puts a key-value entry to the table.
sourcepub async fn delete(&self, key: &[u8], lsn: u64) -> Result<()>
pub async fn delete(&self, key: &[u8], lsn: u64) -> Result<()>
Deletes the entry corresponding to the key from the table.
sourcepub fn stats(&self) -> TableStats
pub fn stats(&self) -> TableStats
Returns the statistics of the table.
sourcepub fn safe_lsn(&self) -> u64
pub fn safe_lsn(&self) -> u64
Returns the minimal LSN that the table can safely read with.
The table guarantees that entries visible to the returned LSN are retained for reads.
sourcepub fn set_safe_lsn(&self, lsn: u64)
pub fn set_safe_lsn(&self, lsn: u64)
Updates the minimal LSN that the table can safely read with.
The safe LSN must be increasing, so updating it with a smaller value has no effect. When the safe LSN is advanced, the table will gradually drop entries that are not visible to the LSN anymore.
sourcepub async fn flush(&self, opts: &FlushOptions)
pub async fn flush(&self, opts: &FlushOptions)
Flush all write buffer data.
sourcepub async fn wait_for_reclaiming(&self)
pub async fn wait_for_reclaiming(&self)
Wait all pending reclaiming to finish.