feat: Better progress reporting for stage checkpoints (#2982)

Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
This commit is contained in:
Georgios Konstantopoulos
2023-06-05 09:10:46 -07:00
committed by GitHub
parent 6fab79bbc2
commit 08900740bc
28 changed files with 1601 additions and 341 deletions

View File

@ -115,6 +115,15 @@ impl<'tx, K: TransactionKind, E: EnvironmentKind> DbTx<'tx> for Tx<'tx, K, E> {
) -> Result<<Self as DbTxGAT<'_>>::DupCursor<T>, DatabaseError> {
self.new_cursor()
}
/// Returns number of entries in the table using cheap DB stats invocation.
fn entries<T: Table>(&self) -> Result<usize, DatabaseError> {
Ok(self
.inner
.db_stat_with_dbi(self.get_dbi::<T>()?)
.map_err(|e| DatabaseError::Stats(e.into()))?
.entries())
}
}
impl<E: EnvironmentKind> DbTxMut<'_> for Tx<'_, RW, E> {