Struct garage_block::manager::BlockManager
source · [−]pub struct BlockManager {
pub replication: TableShardedReplication,
pub data_dir: PathBuf,
/* private fields */
}
Expand description
The block manager, handling block exchange between nodes, and block storage on local node
Fields
replication: TableShardedReplication
Replication strategy, allowing to find on which node blocks should be located
data_dir: PathBuf
Directory in which block are stored
Implementations
sourceimpl BlockManager
impl BlockManager
pub fn new(
db: &Db,
data_dir: PathBuf,
compression_level: Option<i32>,
background_tranquility: u32,
replication: TableShardedReplication,
system: Arc<System>
) -> Arc<Self>
sourcepub async fn rpc_get_block(&self, hash: &Hash) -> Result<Vec<u8>, Error>
pub async fn rpc_get_block(&self, hash: &Hash) -> Result<Vec<u8>, Error>
Ask nodes that might have a block for it
sourcepub async fn rpc_put_block(
&self,
hash: Hash,
data: Vec<u8>
) -> Result<(), Error>
pub async fn rpc_put_block(
&self,
hash: Hash,
data: Vec<u8>
) -> Result<(), Error>
Send block to nodes that should have it
sourcepub async fn repair_data_store(
&self,
must_exit: &Receiver<bool>
) -> Result<(), Error>
pub async fn repair_data_store(
&self,
must_exit: &Receiver<bool>
) -> Result<(), Error>
Launch the repair procedure on the data store
This will list all blocks locally present, as well as those that are required because of refcount > 0, and will try to fix any mismatch between the two.
sourcepub async fn scrub_data_store(
&self,
must_exit: &Receiver<bool>,
tranquility: u32
) -> Result<(), Error>
pub async fn scrub_data_store(
&self,
must_exit: &Receiver<bool>,
tranquility: u32
) -> Result<(), Error>
Verify integrity of each block on disk. Use speed_limit
to limit the load generated by
this function.
sourcepub fn resync_queue_len(&self) -> usize
pub fn resync_queue_len(&self) -> usize
Get lenght of resync queue
sourcepub fn resync_errors_len(&self) -> usize
pub fn resync_errors_len(&self) -> usize
Get number of blocks that have an error
Trait Implementations
sourceimpl EndpointHandler<BlockRpc> for BlockManager
impl EndpointHandler<BlockRpc> for BlockManager
Auto Trait Implementations
impl !RefUnwindSafe for BlockManager
impl Send for BlockManager
impl Sync for BlockManager
impl Unpin for BlockManager
impl !UnwindSafe for BlockManager
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more