Skip to content

Commit 4b70a26

Browse files
committed
feat: expose LastCheckpointHint internals under internal-api
Make LastCheckpointHint fields publicly readable and `path` / `try_read` callable when the `internal-api` feature is enabled, so downstream consumers can construct checkpoint metadata cache attributes from a hint without re-reading `_last_checkpoint` from storage. Co-authored-by: Isaac
1 parent 8e4c296 commit 4b70a26

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

kernel/src/last_checkpoint_hint.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,24 @@ pub(crate) struct LastCheckpointHint {
4343
#[allow(unreachable_pub)] // used by acceptance tests (TODO make an fn accessor?)
4444
pub version: Version,
4545
/// The number of actions that are stored in the checkpoint.
46-
pub(crate) size: i64,
46+
pub size: i64,
4747
/// The number of fragments if the last checkpoint was written in multiple parts.
48-
pub(crate) parts: Option<usize>,
48+
pub parts: Option<usize>,
4949
/// The number of bytes of the checkpoint.
50-
pub(crate) size_in_bytes: Option<i64>,
50+
pub size_in_bytes: Option<i64>,
5151
/// The number of AddFile actions in the checkpoint.
52-
pub(crate) num_of_add_files: Option<i64>,
52+
pub num_of_add_files: Option<i64>,
5353
/// The schema of the checkpoint file.
54-
pub(crate) checkpoint_schema: Option<SchemaRef>,
54+
pub checkpoint_schema: Option<SchemaRef>,
5555
/// The checksum of the last checkpoint JSON.
56-
pub(crate) checksum: Option<String>,
56+
pub checksum: Option<String>,
5757
/// Additional metadata about the last checkpoint.
58-
pub(crate) tags: Option<HashMap<String, String>>,
58+
pub tags: Option<HashMap<String, String>>,
5959
}
6060

6161
impl LastCheckpointHint {
62-
// Returns the path the last checkpoint file given the log root of a table.
62+
/// Returns the path of the `_last_checkpoint` file given the log root of a table.
63+
#[internal_api]
6364
pub(crate) fn path(log_root: &Url) -> DeltaResult<Url> {
6465
Ok(log_root.join(LAST_CHECKPOINT_FILE_NAME)?)
6566
}
@@ -72,6 +73,7 @@ impl LastCheckpointHint {
7273
/// are assumed to cause failure.
7374
// TODO(#1047): weird that we propagate FileNotFound as part of the iterator instead of top-
7475
// level result coming from storage.read_files
76+
#[internal_api]
7577
#[instrument(name = "last_checkpoint.read", skip_all, err)]
7678
pub(crate) fn try_read(
7779
storage: &dyn StorageHandler,

0 commit comments

Comments
 (0)