-
Couldn't load subscription status.
- Fork 118
feat: allow visiting entire domain metadata #1384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
8377f94
574d32a
0c2b4be
1065f8a
a27ad6f
c57dfb2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ | |
| //! Exposes that an engine needs to call from C/C++ to interface with kernel | ||
|
|
||
| #[cfg(feature = "default-engine-base")] | ||
| use std::collections::HashMap; | ||
| use std::default::Default; | ||
| use std::os::raw::{c_char, c_void}; | ||
| use std::ptr::NonNull; | ||
|
|
@@ -16,6 +15,7 @@ use delta_kernel::snapshot::Snapshot; | |
| use delta_kernel::Version; | ||
| use delta_kernel::{DeltaResult, Engine, EngineData}; | ||
| use delta_kernel_ffi_macros::handle_descriptor; | ||
| use std::collections::HashMap; | ||
|
|
||
| // cbindgen doesn't understand our use of feature flags here, and by default it parses `mod handle` | ||
| // twice. So we tell it to ignore one of the declarations to avoid double-definition errors. | ||
|
|
@@ -52,6 +52,17 @@ pub mod transaction; | |
|
|
||
| pub(crate) type NullableCvoid = Option<NonNull<c_void>>; | ||
|
|
||
| #[derive(Default)] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you're not using |
||
| pub struct CStringMap { | ||
| values: HashMap<String, String>, | ||
| } | ||
|
|
||
| impl From<HashMap<String, String>> for CStringMap { | ||
| fn from(val: HashMap<String, String>) -> Self { | ||
| Self { values: val } | ||
| } | ||
| } | ||
|
|
||
| /// Model iterators. This allows an engine to specify iteration however it likes, and we simply wrap | ||
| /// the engine functions. The engine retains ownership of the iterator. | ||
| #[repr(C)] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,17 @@ pub(crate) fn domain_metadata_configuration( | |
| .remove(domain) | ||
| .map(|domain_metadata| domain_metadata.configuration)) | ||
| } | ||
| pub(crate) fn all_domain_metadata_configuration( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: add a newline above |
||
| log_segment: &LogSegment, | ||
| engine: &dyn Engine, | ||
| ) -> DeltaResult<HashMap<String, String>> { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels a bit like an odd api. I'd prefer to return a We already have exactly this type in |
||
| let domain_metadatas = scan_domain_metadatas(log_segment, None, engine)?; | ||
|
|
||
| Ok(domain_metadatas | ||
| .into_iter() | ||
| .map(|(key, domain_metadata)| (key, domain_metadata.configuration)) | ||
| .collect()) | ||
| } | ||
|
|
||
| /// Scan the entire log for all domain metadata actions but terminate early if a specific domain | ||
| /// is provided. Note that this returns the latest domain metadata for each domain, accounting for | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call these
domainandconfigurationto match the protocol. we should probably also include if the domain is removed