Skip to content

Commit f9b426e

Browse files
committed
Add a metadata map to the RunMeta struct
1 parent 6fd953a commit f9b426e

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

src/persist-client/build.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ fn main() {
5353
.btree_map(["."])
5454
.bytes([
5555
".mz_persist_client.internal.diff.ProtoStateFieldDiffs",
56+
".mz_persist_client.internal.service.ProtoPushDiff",
57+
".mz_persist_client.internal.state.ProtoEncodedSchemas",
5658
".mz_persist_client.internal.state.ProtoHollowBatchPart",
59+
".mz_persist_client.internal.state.ProtoRunMeta",
5760
".mz_persist_client.internal.state.ProtoVersionedData",
58-
".mz_persist_client.internal.state.ProtoEncodedSchemas",
59-
".mz_persist_client.internal.service.ProtoPushDiff",
6061
]);
6162

6263
// Setting `emit_rerun_if_changed(false)` below causes tonic to entirely

src/persist-client/src/batch.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ where
717717
} else {
718718
None
719719
},
720+
meta: MetadataMap::default(),
720721
});
721722
run_parts.extend(parts);
722723
}
@@ -862,6 +863,7 @@ impl<T: Timestamp + Codec64> BatchParts<T> {
862863
} else {
863864
None
864865
},
866+
meta: MetadataMap::default(),
865867
},
866868
completed_run.parts,
867869
)

src/persist-client/src/internal/encoding.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,7 @@ impl RustType<ProtoRunMeta> for RunMeta {
15181518
deprecated_schema_id: self.deprecated_schema.into_proto(),
15191519
id: self.id.into_proto(),
15201520
len: self.len.into_proto(),
1521+
meta: self.meta.into_proto(),
15211522
}
15221523
}
15231524

@@ -1534,6 +1535,7 @@ impl RustType<ProtoRunMeta> for RunMeta {
15341535
deprecated_schema: proto.deprecated_schema_id.into_rust()?,
15351536
id: proto.id.into_rust()?,
15361537
len: proto.len.into_rust()?,
1538+
meta: proto.meta.into_rust()?,
15371539
})
15381540
}
15391541
}

src/persist-client/src/internal/state.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ message ProtoRunMeta {
9595
optional uint64 deprecated_schema_id = 2;
9696
optional string id = 4;
9797
optional uint64 len = 5;
98+
99+
map<string, bytes> meta = 6;
98100
}
99101

100102
message ProtoHollowRun {

src/persist-client/src/internal/state.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,10 @@ pub struct RunMeta {
820820

821821
/// The number of updates in this run, or `None` if the number is unknown.
822822
pub(crate) len: Option<usize>,
823+
824+
/// Additional unstructured metadata.
825+
#[serde(skip_serializing_if = "MetadataMap::is_empty")]
826+
pub(crate) meta: MetadataMap,
823827
}
824828

825829
/// A subset of a [HollowBatch] corresponding 1:1 to a blob.

0 commit comments

Comments
 (0)