From 97d994ee6f6520a65bcd9ff7641498462c6b8d99 Mon Sep 17 00:00:00 2001
From: Yueh-Hsuan Chiang <93241502+yhchiang-sol@users.noreply.github.com>
Date: Fri, 2 Feb 2024 09:53:13 -0800
Subject: [PATCH] [TieredStorage] Use IndexOffset in TieredStorageMeta and
get_account() (#35046)
#### Problem
TieredStorageMeta and TieredStorageReader::get_account API uses
u32 to represent IndexOffset. However, within the TieredStorage scope,
IndexOffset should be used, it is not until working with AccountsFile API
when u32 representation of offset is needed.
#### Summary of Changes
Have TieredStorageMeta and TieredStorageReader to use IndexOffset.
#### Test Plan
Existing unit-tests.
---
accounts-db/src/account_storage/meta.rs | 2 +-
accounts-db/src/tiered_storage/hot.rs | 10 +++++-----
accounts-db/src/tiered_storage/readable.rs | 14 +++++++-------
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/accounts-db/src/account_storage/meta.rs b/accounts-db/src/account_storage/meta.rs
index 1442b4845bf604..69c24d7be75f7d 100644
--- a/accounts-db/src/account_storage/meta.rs
+++ b/accounts-db/src/account_storage/meta.rs
@@ -142,7 +142,7 @@ impl<'storage> StoredAccountMeta<'storage> {
pub fn offset(&self) -> usize {
match self {
Self::AppendVec(av) => av.offset(),
- Self::Hot(hot) => hot.index(),
+ Self::Hot(hot) => hot.index().0 as usize,
}
}
diff --git a/accounts-db/src/tiered_storage/hot.rs b/accounts-db/src/tiered_storage/hot.rs
index c6e3efdbbb78c6..805b50f2fa3668 100644
--- a/accounts-db/src/tiered_storage/hot.rs
+++ b/accounts-db/src/tiered_storage/hot.rs
@@ -435,7 +435,7 @@ impl HotStorageReader {
pub fn get_account(
&self,
index_offset: IndexOffset,
- ) -> TieredStorageResult