include/exclude keys on account secondary index (#17110)
* AccountSecondaryIndexes.include/exclude * use normal scan if key is not indexed * add a test to ask for a scan for an excluded secondary index * fix up cli args
This commit is contained in:
committed by
GitHub
parent
4ed828e4ee
commit
7d96f78821
@@ -702,13 +702,17 @@ impl Accounts {
|
||||
index_key: &IndexKey,
|
||||
filter: F,
|
||||
) -> Vec<(Pubkey, AccountSharedData)> {
|
||||
self.accounts_db.index_scan_accounts(
|
||||
ancestors,
|
||||
*index_key,
|
||||
|collector: &mut Vec<(Pubkey, AccountSharedData)>, some_account_tuple| {
|
||||
Self::load_while_filtering(collector, some_account_tuple, |account| filter(account))
|
||||
},
|
||||
)
|
||||
self.accounts_db
|
||||
.index_scan_accounts(
|
||||
ancestors,
|
||||
*index_key,
|
||||
|collector: &mut Vec<(Pubkey, AccountSharedData)>, some_account_tuple| {
|
||||
Self::load_while_filtering(collector, some_account_tuple, |account| {
|
||||
filter(account)
|
||||
})
|
||||
},
|
||||
)
|
||||
.0
|
||||
}
|
||||
|
||||
pub fn load_all(&self, ancestors: &Ancestors) -> Vec<(Pubkey, AccountSharedData, Slot)> {
|
||||
|
Reference in New Issue
Block a user