pub struct PersistentTable<T: ShoalTable, S: ShoalStorage<T>> {
pub partitions: HashMap<u64, Partition<T>>,
/* private fields */
}Expand description
A table that stores data both in memory and on disk
Fields§
§partitions: HashMap<u64, Partition<T>>The rows in this table
Implementations§
Source§impl<T: ShoalTable, S: ShoalStorage<T>> PersistentTable<T, S>
impl<T: ShoalTable, S: ShoalStorage<T>> PersistentTable<T, S>
Sourcepub async fn new(
shard_name: &str,
conf: &Conf,
medium_priority: TaskQueueHandle,
) -> Result<Self, ServerError>
pub async fn new( shard_name: &str, conf: &Conf, medium_priority: TaskQueueHandle, ) -> Result<Self, ServerError>
Create a persistent shoal table
§Arguments
shard_name- The id of the shard that owns this tableconf- The Shoal config
Sourcepub async fn handle(
&mut self,
meta: QueryMetadata,
query: Query<T>,
) -> Option<(SocketAddr, Response<T>)>
pub async fn handle( &mut self, meta: QueryMetadata, query: Query<T>, ) -> Option<(SocketAddr, Response<T>)>
Cast and handle a serialized query
§Arguments
meta- The metadata for this queryquery- The query to execute
Sourcepub async fn flush(&mut self) -> Result<(), ServerError>
pub async fn flush(&mut self) -> Result<(), ServerError>
Flush all pending writes to disk
Sourcepub async fn get_flushed(
&mut self,
) -> Result<&mut Vec<(SocketAddr, Response<T>)>, ServerError>
pub async fn get_flushed( &mut self, ) -> Result<&mut Vec<(SocketAddr, Response<T>)>, ServerError>
Sourcepub async fn shutdown(&mut self) -> Result<(), ServerError>
pub async fn shutdown(&mut self) -> Result<(), ServerError>
Shutdown this table
Trait Implementations§
Source§impl<T: Debug + ShoalTable, S: Debug + ShoalStorage<T>> Debug for PersistentTable<T, S>
impl<T: Debug + ShoalTable, S: Debug + ShoalStorage<T>> Debug for PersistentTable<T, S>
Auto Trait Implementations§
impl<T, S> Freeze for PersistentTable<T, S>where
S: Freeze,
impl<T, S> RefUnwindSafe for PersistentTable<T, S>
impl<T, S> Send for PersistentTable<T, S>
impl<T, S> Sync for PersistentTable<T, S>
impl<T, S> Unpin for PersistentTable<T, S>
impl<T, S> UnwindSafe for PersistentTable<T, S>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.