[TieredStorage] Make data_size related APIs cleaner (#32317)

#### Problem
Function data_size_for_shared_block() is designed to provide
the data_size when its account shares its account block with
other accounts.  However, TieredAccountMeta already has another
function for returning data size.

#### Summary of Changes
This PR removes data_size_for_shared_block() from TieredAccountMeta.
Will follow-up with another PR that includes a better API.
This commit is contained in:
Yueh-Hsuan Chiang 2023-06-30 02:44:57 +08:00 committed by GitHub
parent 66233576a1
commit 2850432b57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 13 deletions

View File

@ -110,12 +110,6 @@ impl TieredAccountMeta for HotAccountMeta {
self.packed_fields.padding()
}
/// Always return None as a HotAccountMeta entry never shares its account
/// block with other account meta entries.
fn data_size_for_shared_block(&self) -> Option<usize> {
None
}
/// Returns the index to the accounts' owner in the current AccountsFile.
fn owner_index(&self) -> u32 {
self.packed_fields.owner_index()
@ -282,7 +276,6 @@ pub mod tests {
assert_eq!(meta.lamports(), TEST_LAMPORTS);
assert_eq!(meta.account_data_padding(), TEST_PADDING);
assert_eq!(meta.data_size_for_shared_block(), None);
assert_eq!(meta.owner_index(), TEST_OWNER_INDEX);
assert_eq!(*meta.flags(), flags);
}

View File

@ -51,12 +51,6 @@ pub trait TieredAccountMeta: Sized {
/// Returns the number of padding bytes for the associated account data
fn account_data_padding(&self) -> u8;
/// Returns the size of its account data if the current accout meta
/// shares its account block with other account meta entries.
///
/// Otherwise, None will be returned.
fn data_size_for_shared_block(&self) -> Option<usize>;
/// Returns the index to the accounts' owner in the current AccountsFile.
fn owner_index(&self) -> u32;