[−][src]Struct rocks::write_batch::WriteBatch
WriteBatch
holds a collection of updates to apply atomically to a DB.
Implementations
impl WriteBatch
[src]
pub fn new() -> WriteBatch
[src]
pub fn with_reserved_bytes(reserved_bytes: usize) -> WriteBatch
[src]
pub fn clear(&mut self)
[src]
Clear all updates buffered in this batch.
pub fn put(&mut self, key: &[u8], value: &[u8]) -> &mut Self
[src]
Store the mapping "key->value" in the database.
pub fn put_cf(
&mut self,
column_family: &ColumnFamilyHandle,
key: &[u8],
value: &[u8]
) -> &mut Self
[src]
&mut self,
column_family: &ColumnFamilyHandle,
key: &[u8],
value: &[u8]
) -> &mut Self
pub fn putv(&mut self, key: &[&[u8]], value: &[&[u8]]) -> &mut Self
[src]
Variant of Put() that gathers output like writev(2). The key and value that will be written to the database are concatentations of arrays of slices.
pub fn putv_cf(
&mut self,
column_family: &ColumnFamilyHandle,
key: &[&[u8]],
value: &[&[u8]]
) -> &mut Self
[src]
&mut self,
column_family: &ColumnFamilyHandle,
key: &[&[u8]],
value: &[&[u8]]
) -> &mut Self
pub fn delete(&mut self, key: &[u8]) -> &mut Self
[src]
If the database contains a mapping for "key", erase it. Else do nothing.
pub fn delete_cf(
&mut self,
column_family: &ColumnFamilyHandle,
key: &[u8]
) -> &mut Self
[src]
&mut self,
column_family: &ColumnFamilyHandle,
key: &[u8]
) -> &mut Self
pub fn deletev(&mut self, key: &[&[u8]]) -> &mut Self
[src]
variant that takes SliceParts
pub fn deletev_cf(
&mut self,
column_family: &ColumnFamilyHandle,
key: &[&[u8]]
) -> &mut Self
[src]
&mut self,
column_family: &ColumnFamilyHandle,
key: &[&[u8]]
) -> &mut Self
pub fn single_delete(&mut self, key: &[u8]) -> &mut Self
[src]
WriteBatch implementation of DB::SingleDelete(). See db.h.
pub fn single_delete_cf(
&mut self,
column_family: &ColumnFamilyHandle,
key: &[u8]
) -> &mut Self
[src]
&mut self,
column_family: &ColumnFamilyHandle,
key: &[u8]
) -> &mut Self
pub fn single_deletev(&mut self, key: &[&[u8]]) -> &mut Self
[src]
variant that takes SliceParts
pub fn single_deletev_cf(
&mut self,
column_family: &ColumnFamilyHandle,
key: &[&[u8]]
) -> &mut Self
[src]
&mut self,
column_family: &ColumnFamilyHandle,
key: &[&[u8]]
) -> &mut Self
pub fn delete_range(&mut self, begin_key: &[u8], end_key: &[u8]) -> &mut Self
[src]
WriteBatch implementation of DB::DeleteRange(). See db.h.
pub fn delete_range_cf(
&mut self,
column_family: &ColumnFamilyHandle,
begin_key: &[u8],
end_key: &[u8]
) -> &mut Self
[src]
&mut self,
column_family: &ColumnFamilyHandle,
begin_key: &[u8],
end_key: &[u8]
) -> &mut Self
pub fn deletev_range(
&mut self,
begin_key: &[&[u8]],
end_key: &[&[u8]]
) -> &mut Self
[src]
&mut self,
begin_key: &[&[u8]],
end_key: &[&[u8]]
) -> &mut Self
variant that takes SliceParts
pub fn deletev_range_cf(
&mut self,
column_family: &ColumnFamilyHandle,
begin_key: &[&[u8]],
end_key: &[&[u8]]
) -> &mut Self
[src]
&mut self,
column_family: &ColumnFamilyHandle,
begin_key: &[&[u8]],
end_key: &[&[u8]]
) -> &mut Self
pub fn merge(&mut self, key: &[u8], value: &[u8]) -> &mut Self
[src]
Merge "value" with the existing value of "key" in the database. "key->merge(existing, value)"
pub fn merge_cf(
&mut self,
column_family: &ColumnFamilyHandle,
key: &[u8],
value: &[u8]
) -> &mut Self
[src]
&mut self,
column_family: &ColumnFamilyHandle,
key: &[u8],
value: &[u8]
) -> &mut Self
pub fn mergev(&mut self, key: &[&[u8]], value: &[&[u8]]) -> &mut Self
[src]
pub fn mergev_cf(
&mut self,
column_family: &ColumnFamilyHandle,
key: &[&[u8]],
value: &[&[u8]]
) -> &mut Self
[src]
&mut self,
column_family: &ColumnFamilyHandle,
key: &[&[u8]],
value: &[&[u8]]
) -> &mut Self
pub fn put_log_data(&mut self, blob: &[u8]) -> &mut Self
[src]
Append a blob of arbitrary size to the records in this batch. The blob will be stored in the transaction log but not in any other file. In particular, it will not be persisted to the SST files. When iterating over this WriteBatch, WriteBatch::Handler::LogData will be called with the contents of the blob as it is encountered. Blobs, puts, deletes, and merges will be encountered in the same order in thich they were inserted. The blob will NOT consume sequence number(s) and will NOT increase the count of the batch
Example application: add timestamps to the transaction log for use in replication.
pub fn set_save_point(&mut self) -> &mut Self
[src]
Records the state of the batch for future calls to RollbackToSavePoint(). May be called multiple times to set multiple save points.
pub fn rollback_to_save_point(&mut self) -> Result<()>
[src]
Remove all entries in this batch (Put, Merge, Delete, PutLogData) since the most recent call to SetSavePoint() and removes the most recent save point. If there is no previous call to SetSavePoint(), Status::NotFound() will be returned. Otherwise returns Status::OK().
pub fn pop_save_point(&mut self) -> Result<()>
[src]
Pop the most recent save point. If there is no previous call to SetSavePoint(), Status::NotFound() will be returned. Otherwise returns Status::OK().
pub fn iterate<H: WriteBatchHandler>(&self, handler: &mut H) -> Result<()>
[src]
Support for iterating over the contents of a batch.
pub fn get_data(&self) -> &[u8]ⓘ
[src]
Retrieve the serialized version of this batch.
pub fn get_data_size(&self) -> usize
[src]
pub fn count(&self) -> usize
[src]
Returns the number of updates in the batch
pub fn has_put(&self) -> bool
[src]
Returns true if PutCF will be called during Iterate
pub fn has_delete(&self) -> bool
[src]
Returns true if DeleteCF will be called during Iterate
pub fn has_single_delete(&self) -> bool
[src]
Returns true if SingleDeleteCF will be called during Iterate
pub fn has_delete_range(&self) -> bool
[src]
Returns true if DeleteRangeCF will be called during Iterate
pub fn has_merge(&self) -> bool
[src]
Returns true if MergeCF will be called during Iterate
pub fn has_begin_prepare(&self) -> bool
[src]
Returns true if MarkBeginPrepare will be called during Iterate
pub fn has_end_prepare(&self) -> bool
[src]
Returns true if MarkEndPrepare will be called during Iterate
pub fn has_commit(&self) -> bool
[src]
Returns trie if MarkCommit will be called during Iterate
pub fn has_rollback(&self) -> bool
[src]
Returns trie if MarkRollback will be called during Iterate
Trait Implementations
impl Clone for WriteBatch
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for WriteBatch
[src]
impl Default for WriteBatch
[src]
impl Drop for WriteBatch
[src]
impl Send for WriteBatch
[src]
impl Sync for WriteBatch
[src]
Auto Trait Implementations
impl RefUnwindSafe for WriteBatch
[src]
impl Unpin for WriteBatch
[src]
impl UnwindSafe for WriteBatch
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,