AcctIdx: misc cleanup (#20398)

This commit is contained in:
Jeff Washington (jwash) 2021-10-04 12:49:20 -04:00 committed by GitHub
parent 8da2eb980a
commit cbf427228c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -201,7 +201,6 @@ impl<T: Clone + Copy> Bucket<T> {
let best_fit_bucket = IndexEntry::data_bucket_from_num_slots(data.len() as u64);
if self.data.get(best_fit_bucket as usize).is_none() {
// fail early if the data bucket we need doesn't exist - we don't want the index entry partially allocated
//error!("resizing because missing bucket");
return Err(BucketMapError::DataNoSpace((best_fit_bucket, 0)));
}
let index_entry = self.find_entry_mut(key);
@ -276,7 +275,7 @@ impl<T: Clone + Copy> Bucket<T> {
pub fn grow_index(&mut self, sz: u8) {
if self.index.capacity_pow2 == sz {
let mut m = Measure::start("");
let mut m = Measure::start("grow_index");
//debug!("GROW_INDEX: {}", sz);
let increment = 1;
for i in increment.. {

View File

@ -85,10 +85,10 @@ impl BucketStorage {
elem_size: u64,
capacity_pow2: u8,
max_search: MaxSearch,
mut stats: Arc<BucketStats>,
stats: Arc<BucketStats>,
) -> Self {
let cell_size = elem_size * num_elems + std::mem::size_of::<Header>() as u64;
let (mmap, path) = Self::new_map(&drives, cell_size as usize, capacity_pow2, &mut stats);
let (mmap, path) = Self::new_map(&drives, cell_size as usize, capacity_pow2, &stats);
Self {
path,
mmap,
@ -249,7 +249,7 @@ impl BucketStorage {
drives: &[PathBuf],
cell_size: usize,
capacity_pow2: u8,
stats: &mut Arc<BucketStats>,
stats: &BucketStats,
) -> (MmapMut, PathBuf) {
let mut measure_new_file = Measure::start("measure_new_file");
let capacity = 1u64 << capacity_pow2;
@ -311,7 +311,7 @@ impl BucketStorage {
&self.drives,
self.cell_size as usize,
self.capacity_pow2 + increment,
&mut self.stats,
&self.stats,
);
(0..old_cap as usize).into_iter().for_each(|i| {
let old_ix = i * self.cell_size as usize;