@@ -56,7 +56,9 @@ use uuid::Uuid;
5656
5757use crate :: critical:: CriticalReaderId ;
5858use crate :: error:: InvalidUsage ;
59- use crate :: internal:: encoding:: { LazyInlineBatchPart , LazyPartStats , LazyProto , parse_id} ;
59+ use crate :: internal:: encoding:: {
60+ LazyInlineBatchPart , LazyPartStats , LazyProto , MetadataMap , parse_id,
61+ } ;
6062use crate :: internal:: gc:: GcReq ;
6163use crate :: internal:: machine:: retry_external;
6264use crate :: internal:: paths:: { BlobKey , PartId , PartialBatchKey , PartialRollupKey , WriterKey } ;
@@ -825,6 +827,9 @@ pub struct RunMeta {
825827pub struct HollowBatchPart < T > {
826828 /// Pointer usable to retrieve the updates.
827829 pub key : PartialBatchKey ,
830+ /// Miscellaneous metadata.
831+ #[ serde( skip_serializing_if = "MetadataMap::is_empty" ) ]
832+ pub meta : MetadataMap ,
828833 /// The encoded size of this part.
829834 pub encoded_size_bytes : usize ,
830835 /// A lower bound on the keys in the part. (By default, this the minimum
@@ -1213,6 +1218,7 @@ impl<T: Ord> Ord for HollowBatchPart<T> {
12131218 // are added.
12141219 let HollowBatchPart {
12151220 key : self_key,
1221+ meta : self_meta,
12161222 encoded_size_bytes : self_encoded_size_bytes,
12171223 key_lower : self_key_lower,
12181224 structured_key_lower : self_structured_key_lower,
@@ -1225,6 +1231,7 @@ impl<T: Ord> Ord for HollowBatchPart<T> {
12251231 } = self ;
12261232 let HollowBatchPart {
12271233 key : other_key,
1234+ meta : other_meta,
12281235 encoded_size_bytes : other_encoded_size_bytes,
12291236 key_lower : other_key_lower,
12301237 structured_key_lower : other_structured_key_lower,
@@ -1237,6 +1244,7 @@ impl<T: Ord> Ord for HollowBatchPart<T> {
12371244 } = other;
12381245 (
12391246 self_key,
1247+ self_meta,
12401248 self_encoded_size_bytes,
12411249 self_key_lower,
12421250 self_structured_key_lower,
@@ -1249,6 +1257,7 @@ impl<T: Ord> Ord for HollowBatchPart<T> {
12491257 )
12501258 . cmp ( & (
12511259 other_key,
1260+ other_meta,
12521261 other_encoded_size_bytes,
12531262 other_key_lower,
12541263 other_structured_key_lower,
@@ -2998,6 +3007,7 @@ pub(crate) mod tests {
29983007 ) | {
29993008 HollowBatchPart {
30003009 key,
3010+ meta : Default :: default ( ) ,
30013011 encoded_size_bytes,
30023012 key_lower,
30033013 structured_key_lower : None ,
@@ -3171,6 +3181,7 @@ pub(crate) mod tests {
31713181 . map ( |x| {
31723182 RunPart :: Single ( BatchPart :: Hollow ( HollowBatchPart {
31733183 key : PartialBatchKey ( ( * x) . to_owned ( ) ) ,
3184+ meta : Default :: default ( ) ,
31743185 encoded_size_bytes : 0 ,
31753186 key_lower : vec ! [ ] ,
31763187 structured_key_lower : None ,
0 commit comments