AcctIdx: remove auto Debug trait (#19905)

This commit is contained in:
Jeff Washington (jwash) 2021-09-15 09:54:16 -05:00 committed by GitHub
parent fb0c590090
commit b467e7fb3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 3 deletions

View File

@ -1,6 +1,7 @@
use crate::accounts_index::IndexValue;
use crate::bucket_map_holder::BucketMapHolder;
use crate::waitable_condvar::WaitableCondvar;
use std::fmt::Debug;
use std::{
sync::{
atomic::{AtomicBool, Ordering},
@ -14,7 +15,7 @@ use std::{
// When this instance is dropped, it will drop the bucket map and cleanup
// and it will stop all the background threads and join them.
#[derive(Debug, Default)]
#[derive(Default)]
pub struct AccountsIndexStorage<T: IndexValue> {
// for managing the bg threads
exit: Arc<AtomicBool>,
@ -25,6 +26,12 @@ pub struct AccountsIndexStorage<T: IndexValue> {
storage: Arc<BucketMapHolder<T>>,
}
impl<T: IndexValue> Debug for AccountsIndexStorage<T> {
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Ok(())
}
}
impl<T: IndexValue> Drop for AccountsIndexStorage<T> {
fn drop(&mut self) {
self.exit.store(true, Ordering::Relaxed);

View File

@ -7,12 +7,18 @@ use std::sync::Arc;
use std::time::Duration;
// will eventually hold the bucket map
#[derive(Debug, Default)]
#[derive(Default)]
pub struct BucketMapHolder<T: IndexValue> {
pub stats: BucketMapHolderStats,
_phantom: std::marker::PhantomData<T>,
}
impl<T: IndexValue> Debug for BucketMapHolder<T> {
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Ok(())
}
}
impl<T: IndexValue> BucketMapHolder<T> {
pub fn new() -> Self {
Self::default()

View File

@ -15,7 +15,6 @@ use std::ops::RangeBounds;
type K = Pubkey;
// one instance of this represents one bin of the accounts index.
#[derive(Debug)]
pub struct InMemAccountsIndex<T: IndexValue> {
// backing store
map_internal: RwLock<HashMap<Pubkey, AccountMapEntry<T>>>,
@ -23,6 +22,12 @@ pub struct InMemAccountsIndex<T: IndexValue> {
bin: usize,
}
impl<T: IndexValue> Debug for InMemAccountsIndex<T> {
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Ok(())
}
}
impl<T: IndexValue> InMemAccountsIndex<T> {
pub fn new(storage: &AccountsIndexStorage<T>, bin: usize) -> Self {
Self {