-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce traits for node read/write from storage
- Loading branch information
Showing
9 changed files
with
71 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use pgrx::PgRelation; | ||
use rkyv::AlignedVec; | ||
|
||
use crate::util::{tape::Tape, ItemPointer}; | ||
|
||
use super::stats::{StatsNodeModify, StatsNodeRead, StatsNodeWrite}; | ||
|
||
pub trait ReadableNode { | ||
type Node<'a>; | ||
unsafe fn read<'a, S: StatsNodeRead>( | ||
index: &'a PgRelation, | ||
index_pointer: ItemPointer, | ||
stats: &mut S, | ||
) -> Self::Node<'a>; | ||
} | ||
|
||
pub trait WriteableNode { | ||
type Node<'a>; | ||
|
||
unsafe fn modify<'a, S: StatsNodeModify>( | ||
index: &'a PgRelation, | ||
index_pointer: ItemPointer, | ||
stats: &mut S, | ||
) -> Self::Node<'a>; | ||
|
||
fn write<S: StatsNodeWrite>(&self, tape: &mut Tape, stats: &mut S) -> ItemPointer; | ||
|
||
fn serialize_to_vec(&self) -> AlignedVec; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters