Skip to content

Commit 4efcd86

Browse files
authored
Remove deprecated code (#1141)
1 parent b7e4635 commit 4efcd86

File tree

2 files changed

+3
-30
lines changed

2 files changed

+3
-30
lines changed

crates/iceberg/src/spec/snapshot.rs

+1
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ impl Snapshot {
207207
)
208208
}
209209

210+
#[allow(dead_code)]
210211
pub(crate) fn log(&self) -> SnapshotLog {
211212
SnapshotLog {
212213
timestamp_ms: self.timestamp_ms,

crates/iceberg/src/spec/table_metadata.rs

+2-30
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ use uuid::Uuid;
3333
use super::snapshot::SnapshotReference;
3434
pub use super::table_metadata_builder::{TableMetadataBuildResult, TableMetadataBuilder};
3535
use super::{
36-
PartitionSpecRef, PartitionStatisticsFile, SchemaId, SchemaRef, Snapshot, SnapshotRef,
37-
SnapshotRetention, SortOrder, SortOrderRef, StatisticsFile, StructType,
38-
DEFAULT_PARTITION_SPEC_ID,
36+
PartitionSpecRef, PartitionStatisticsFile, SchemaId, SchemaRef, SnapshotRef, SnapshotRetention,
37+
SortOrder, SortOrderRef, StatisticsFile, StructType, DEFAULT_PARTITION_SPEC_ID,
3938
};
4039
use crate::error::{timestamp_ms_to_utc, Result};
4140
use crate::{Error, ErrorKind};
@@ -398,33 +397,6 @@ impl TableMetadata {
398397
self.partition_statistics.get(&snapshot_id)
399398
}
400399

401-
/// Append snapshot to table
402-
#[deprecated(
403-
since = "0.4.0",
404-
note = "please use `TableMetadataBuilder.set_branch_snapshot` instead"
405-
)]
406-
pub fn append_snapshot(&mut self, snapshot: Snapshot) {
407-
self.last_updated_ms = snapshot.timestamp_ms();
408-
self.last_sequence_number = snapshot.sequence_number();
409-
410-
self.refs
411-
.entry(MAIN_BRANCH.to_string())
412-
.and_modify(|s| {
413-
s.snapshot_id = snapshot.snapshot_id();
414-
})
415-
.or_insert_with(|| {
416-
SnapshotReference::new(snapshot.snapshot_id(), SnapshotRetention::Branch {
417-
min_snapshots_to_keep: None,
418-
max_snapshot_age_ms: None,
419-
max_ref_age_ms: None,
420-
})
421-
});
422-
423-
self.snapshot_log.push(snapshot.log());
424-
self.snapshots
425-
.insert(snapshot.snapshot_id(), Arc::new(snapshot));
426-
}
427-
428400
fn construct_refs(&mut self) {
429401
if let Some(current_snapshot_id) = self.current_snapshot_id {
430402
if !self.refs.contains_key(MAIN_BRANCH) {

0 commit comments

Comments
 (0)