mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-05 04:17:42 +00:00
change some more comments and revert changes on TableSchema
This commit is contained in:
@@ -250,7 +250,6 @@ impl BlockManager {
|
||||
}
|
||||
|
||||
/// Decrement the number of time a block is used
|
||||
// when counter reach 0, it seems not put to resync which I assume put it to gc?
|
||||
pub fn block_decref(&self, hash: &Hash) -> Result<(), Error> {
|
||||
let new_rc = self.rc.update_and_fetch(&hash, |old| {
|
||||
let old_v = old.map(u64_from_be_bytes).unwrap_or(0);
|
||||
|
||||
@@ -57,7 +57,7 @@ impl CRDT for BucketParams {
|
||||
}
|
||||
|
||||
impl BucketParams {
|
||||
/// Create a new default `BucketParams`
|
||||
/// Initializes a new instance of the Bucket struct
|
||||
pub fn new() -> Self {
|
||||
BucketParams {
|
||||
authorized_keys: crdt::LWWMap::new(),
|
||||
@@ -75,7 +75,7 @@ impl Bucket {
|
||||
}
|
||||
}
|
||||
|
||||
/// Query if bucket is deleted
|
||||
/// Returns true if this represents a deleted bucket
|
||||
pub fn is_deleted(&self) -> bool {
|
||||
*self.state.get() == BucketState::Deleted
|
||||
}
|
||||
@@ -113,10 +113,6 @@ impl TableSchema for BucketTable {
|
||||
type E = Bucket;
|
||||
type Filter = DeletedFilter;
|
||||
|
||||
fn updated(&self, _old: Option<Self::E>, _new: Option<Self::E>) {
|
||||
// nothing to do when updated
|
||||
}
|
||||
|
||||
fn matches_filter(entry: &Self::E, filter: &Self::Filter) -> bool {
|
||||
filter.apply(entry.is_deleted())
|
||||
}
|
||||
|
||||
@@ -125,10 +125,6 @@ impl TableSchema for KeyTable {
|
||||
type E = Key;
|
||||
type Filter = KeyFilter;
|
||||
|
||||
fn updated(&self, _old: Option<Self::E>, _new: Option<Self::E>) {
|
||||
// nothing to do when updated
|
||||
}
|
||||
|
||||
fn matches_filter(entry: &Self::E, filter: &Self::Filter) -> bool {
|
||||
match filter {
|
||||
KeyFilter::Deleted(df) => df.apply(entry.deleted.get()),
|
||||
|
||||
Reference in New Issue
Block a user