Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 74 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ async-std = "1.12"
async-trait = "0.1.88"
aws-config = "1.6.1"
aws-sdk-glue = "1.39"
backon = "1.5.1"
base64 = "0.22.1"
bimap = "0.6"
bytes = "1.10"
Expand Down Expand Up @@ -82,6 +83,7 @@ itertools = "0.13"
linkedbytes = "0.1.8"
metainfo = "0.7.14"
mimalloc = "0.1.46"
mockall = "0.13.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add it to dev dependency? Since it's only used in tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I saw you created a PR already: #1507

Thanks for catching this!

mockito = "1"
motore-macros = "0.4.3"
murmur3 = "0.5.2"
Expand Down
2 changes: 2 additions & 0 deletions crates/iceberg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ arrow-string = { workspace = true }
as-any = { workspace = true }
async-std = { workspace = true, optional = true, features = ["attributes"] }
async-trait = { workspace = true }
backon = { workspace = true }
base64 = { workspace = true }
bimap = { workspace = true }
bytes = { workspace = true }
Expand All @@ -66,6 +67,7 @@ expect-test = { workspace = true }
fnv = { workspace = true }
futures = { workspace = true }
itertools = { workspace = true }
mockall = { workspace = true }
moka = { version = "0.12.10", features = ["future"] }
murmur3 = { workspace = true }
num-bigint = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions crates/iceberg/src/catalog/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use std::sync::Arc;
use _serde::deserialize_snapshot;
use async_trait::async_trait;
pub use memory::MemoryCatalog;
use mockall::automock;
use serde_derive::{Deserialize, Serialize};
use typed_builder::TypedBuilder;
use uuid::Uuid;
Expand All @@ -43,6 +44,7 @@ use crate::{Error, ErrorKind, Result};

/// The catalog API for Iceberg Rust.
#[async_trait]
#[automock]
pub trait Catalog: Debug + Sync + Send {
/// List namespaces inside the catalog.
async fn list_namespaces(&self, parent: Option<&NamespaceIdent>)
Expand Down
5 changes: 5 additions & 0 deletions crates/iceberg/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ impl Error {
self.kind
}

/// Return error's retryable status
pub fn retryable(&self) -> bool {
self.retryable
}

/// Return error's message.
#[inline]
pub fn message(&self) -> &str {
Expand Down
20 changes: 20 additions & 0 deletions crates/iceberg/src/spec/table_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,26 @@ pub const RESERVED_PROPERTIES: [&str; 9] = [
PROPERTY_DEFAULT_SORT_ORDER,
];

/// Property key for number of commit retries.
pub const PROPERTY_COMMIT_NUM_RETRIES: &str = "commit.retry.num-retries";
/// Default value for number of commit retries.
pub const PROPERTY_COMMIT_NUM_RETRIES_DEFAULT: usize = 4;

/// Property key for minimum wait time (ms) between retries.
pub const PROPERTY_COMMIT_MIN_RETRY_WAIT_MS: &str = "commit.retry.min-wait-ms";
/// Default value for minimum wait time (ms) between retries.
pub const PROPERTY_COMMIT_MIN_RETRY_WAIT_MS_DEFAULT: u64 = 100;

/// Property key for maximum wait time (ms) between retries.
pub const PROPERTY_COMMIT_MAX_RETRY_WAIT_MS: &str = "commit.retry.max-wait-ms";
/// Default value for maximum wait time (ms) between retries.
pub const PROPERTY_COMMIT_MAX_RETRY_WAIT_MS_DEFAULT: u64 = 60 * 1000; // 1 minute

/// Property key for total maximum retry time (ms).
pub const PROPERTY_COMMIT_TOTAL_RETRY_TIME_MS: &str = "commit.retry.total-timeout-ms";
/// Default value for total maximum retry time (ms).
pub const PROPERTY_COMMIT_TOTAL_RETRY_TIME_MS_DEFAULT: u64 = 30 * 60 * 1000; // 30 minutes

/// Reference to [`TableMetadata`].
pub type TableMetadataRef = Arc<TableMetadata>;

Expand Down
Loading
Loading