Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
Test 2
  • Loading branch information
Yueh-Hsuan Chiang authored and yhchiang-sol committed Apr 2, 2023
1 parent 7852fe8 commit 529a7d0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions runtime/src/tiered_storage/hot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ impl HotAccountMeta {
return &*ptr;
}
}

}

impl TieredAccountMeta for HotAccountMeta {
Expand Down Expand Up @@ -194,7 +195,8 @@ impl TieredAccountMeta for HotAccountMeta {
offset += std::mem::size_of::<Hash>();
}
if self.flags_get(AccountMetaFlags::HAS_WRITE_VERSION) {
let write_version: StoredMetaWriteVersion = *Self::get_type(data_block, offset);
let write_version: StoredMetaWriteVersion =
*Self::get_type(data_block, offset);
return Some(write_version);
}
None
Expand Down Expand Up @@ -293,14 +295,15 @@ impl HotStorageReader {
}

fn get_account_address<'a>(&'a self, index: usize) -> std::io::Result<&'a Pubkey> {
let offset =
self.footer.account_pubkeys_offset as usize + (std::mem::size_of::<Pubkey>() * index);
let offset = self.footer.account_pubkeys_offset as usize
+ (std::mem::size_of::<Pubkey>() * index);
let (pubkey, _): (&'a Pubkey, _) = get_type(&self.map, offset)?;
Ok(pubkey)
}

fn get_owner_address<'a>(&'a self, index: usize) -> std::io::Result<&'a Pubkey> {
let offset = self.footer.owners_offset as usize + (std::mem::size_of::<Pubkey>() * index);
let offset =
self.footer.owners_offset as usize + (std::mem::size_of::<Pubkey>() * index);
let (pubkey, _): (&'a Pubkey, _) = get_type(&self.map, offset)?;
Ok(pubkey)
}
Expand Down Expand Up @@ -335,6 +338,8 @@ impl HotStorageReader {
) -> Option<(StoredAccountMeta<'a>, usize)> {
println!("get_account({})", multiplied_index);
let index = Self::multiplied_index_to_index(multiplied_index);
// TODO(yhchiang): remove this TODO
// TODO2
println!("wtf?! index = {}", index);
if index >= self.footer.account_meta_count as usize {
return None;
Expand Down

0 comments on commit 529a7d0

Please sign in to comment.