Skip to content
Open
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ Cargo.lock
tests/data/sync/
/tests/data/unsized_secondary_sync/
/tests/data/unsized_primary_sync/
/tests/data/key/
/tests/data/uuid/
/tests/data/concurrent
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ lockfree = { version = "0.5.1" }
fastrand = "2.3.0"
futures = "0.3.30"
uuid = { version = "1.10.0", features = ["v4", "v7"] }
data_bucket = "0.3.0"
# data_bucket = "0.3.0"
# data_bucket = { git = "https://github.com/pathscale/DataBucket", branch = "page_cdc_correction", version = "0.2.7" }
# data_bucket = { path = "../DataBucket", version = "0.2.10" }
data_bucket = { path = "../DataBucket", version = "0.3.0" }
performance_measurement_codegen = { path = "performance_measurement/codegen", version = "0.1.0", optional = true }
performance_measurement = { path = "performance_measurement", version = "0.1.0", optional = true }
# indexset = { version = "0.12.3", features = ["concurrent", "cdc", "multimap"] }
# indexset = { package = "wt-indexset", path = "../indexset", version = "0.12.5", features = ["concurrent", "cdc", "multimap"] }
indexset = { package = "wt-indexset", version = "0.12.6", features = ["concurrent", "cdc", "multimap"] }
indexset = { package = "wt-indexset", path = "../indexset", version = "0.12.6", features = ["concurrent", "cdc", "multimap"] }
# indexset = { package = "wt-indexset", version = "0.12.6", features = ["concurrent", "cdc", "multimap"] }
convert_case = "0.6.0"
ordered-float = "5.0.0"
parking_lot = "0.12.3"
Expand Down
3 changes: 2 additions & 1 deletion codegen/src/worktable/generator/queries/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl Generator {
quote! {
let secondary_keys_events = self.0.indexes.delete_row_cdc(row, link)?;
let (_, primary_key_events) = TableIndexCdc::remove_cdc(&self.0.pk_map, pk.clone(), link);
self.0.data.delete(link).map_err(WorkTableError::PagesError)?;
let empty_link_registry_ops = self.0.data.delete(link).map_err(WorkTableError::PagesError)?;
let mut op: Operation<
<<#pk_ident as TablePrimaryKey>::Generator as PrimaryKeyGeneratorState>::State,
#pk_ident,
Expand All @@ -86,6 +86,7 @@ impl Generator {
id: uuid::Uuid::now_v7().into(),
secondary_keys_events,
primary_key_events,
empty_link_registry_operations: empty_link_registry_ops,
link,
});
self.2.apply_operation(op);
Expand Down
2 changes: 1 addition & 1 deletion codegen/src/worktable/generator/row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl Generator {
};

quote! {
#[derive(rkyv::Archive, Debug, rkyv::Deserialize, Clone, rkyv::Serialize, PartialEq, MemStat)]
#[derive(rkyv::Archive, Debug, rkyv::Deserialize, Clone, rkyv::Serialize, PartialEq, MemStat, SizeMeasure)]
#custom_derives
#[rkyv(derive(Debug))]
#[repr(C)]
Expand Down
18 changes: 18 additions & 0 deletions codegen/src/worktable/generator/table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ impl Generator {
})
.collect::<Vec<_>>();
let pk_types_unsized = is_unsized_vec(pk_types);
let row_types = &self
.columns
.columns_map
.values()
.map(|t| t.to_string())
.collect::<Vec<_>>();
let row_unsized = is_unsized_vec(row_types);
let derive = if self.is_persist {
if pk_types_unsized {
quote! {
Expand All @@ -108,6 +115,15 @@ impl Generator {
Vec<IndexPair<#primary_key_type, Link>>
}
};
let empty_links_type = if row_unsized {
quote! {
UnsizedEmptyLinkRegistry
}
} else {
quote! {
SizedEmptyLinkRegistry
}
};

if self.config.as_ref().and_then(|c| c.page_size).is_some() {
quote! {
Expand All @@ -116,6 +132,7 @@ impl Generator {
WorkTable<
#row_type,
#primary_key_type,
#empty_links_type,
#avt_type_ident,
#avt_index_ident,
#index_type,
Expand All @@ -134,6 +151,7 @@ impl Generator {
WorkTable<
#row_type,
#primary_key_type,
#empty_links_type,
#avt_type_ident,
#avt_index_ident,
#index_type,
Expand Down
2 changes: 1 addition & 1 deletion codegen/src/worktable/generator/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Generator {
let wrapper_ident = name_generator.get_wrapper_type_ident();

quote! {
#[derive(rkyv::Archive, Debug, rkyv::Deserialize, rkyv::Serialize)]
#[derive(rkyv::Archive, Debug, rkyv::Deserialize, rkyv::Serialize, SizeMeasure)]
#[repr(C)]
pub struct #wrapper_ident {
inner: #row_ident,
Expand Down
Loading
Loading