pub(crate) fn to_protobuf(&self) -> std::result::Result<Vec<u8>, prost::EncodeError> {
        let sort_key = self.sort_key.as_ref().map(|key| proto::SortKey {
            expressions: key
                .iter()
                .map(|(name, options)| proto::sort_key::Expr {
                    column: name.to_string(),
                    descending: options.descending,
                    nulls_first: options.nulls_first,
                })
                .collect(),
        });

        let proto_msg = proto::IoxMetadata {
            object_store_id: self.object_store_id.as_bytes().to_vec(),
            creation_timestamp: Some(self.creation_timestamp.date_time().into()),
            namespace_id: self.namespace_id.get(),
            namespace_name: self.namespace_name.to_string(),
            sequencer_id: self.sequencer_id.get(),
            table_id: self.table_id.get(),
            table_name: self.table_name.to_string(),
            partition_id: self.partition_id.get(),
            partition_key: self.partition_key.to_string(),
            min_sequence_number: self.min_sequence_number.get(),
            max_sequence_number: self.max_sequence_number.get(),
            sort_key,
            compaction_level: self.compaction_level as i32,
        };

        let mut buf = Vec::new();
        proto_msg.encode(&mut buf)?;

        Ok(buf)
    }
/// Convert to protobuf v3 message.
Convert to protobuf v3 message.
Convert to protobuf v3 message .
pub(crate) fn to_protobuf(&self) -> std::result::Result<Vec<u8>, prost::EncodeError> {
        let sort_key = self.sort_key.as_ref().map(|key| proto::SortKey {
            expressions: key
                .iter()
                .map(|(name, options)| proto::sort_key::Expr {
                    column: name.to_string(),
                    descending: options.descending,
                    nulls_first: options.nulls_first,
                })
                .collect(),
        });
        let proto_msg = proto::IoxMetadata {
            object_store_id: self.object_store_id.as_bytes().to_vec(),
            creation_timestamp: Some(self.creation_timestamp.date_time().into()),
            namespace_id: self.namespace_id.get(),
            namespace_name: self.namespace_name.to_string(),
            sequencer_id: self.sequencer_id.get(),
            table_id: self.table_id.get(),
            table_name: self.table_name.to_string(),
            partition_id: self.partition_id.get(),
            partition_key: self.partition_key.to_string(),
            min_sequence_number: self.min_sequence_number.get(),
            max_sequence_number: self.max_sequence_number.get(),
            sort_key,
            compaction_level: self.compaction_level as i32,
        };
        let mut buf = Vec::new();
        proto_msg.encode(&mut buf)?;
        Ok(buf)
    }
pub ( crate ) fn to_protobuf ( & self ) -> std :: result :: Result < Vec < u8 > , prost :: EncodeError > { let sort_key = self . sort_key . as_ref ( ) . map ( | key | proto :: SortKey { expressions : key . iter ( ) . map ( | ( name , options ) | proto :: sort_key :: Expr { column : name . to_string ( ) , descending : options . descending , nulls_first : options . nulls_first , } ) . collect ( ) , } ) ; let proto_msg = proto :: IoxMetadata { object_store_id : self . object_store_id . as_bytes ( ) . to_vec ( ) , creation_timestamp : Some ( self . creation_timestamp . date_time ( ) . into ( ) ) , namespace_id : self . namespace_id . get ( ) , namespace_name : self . namespace_name . to_string ( ) , sequencer_id : self . sequencer_id . get ( ) , table_id : self . table_id . get ( ) , table_name : self . table_name . to_string ( ) , partition_id : self . partition_id . get ( ) , partition_key : self . partition_key . to_string ( ) , min_sequence_number : self . min_sequence_number . get ( ) , max_sequence_number : self . max_sequence_number . get ( ) , sort_key , compaction_level : self . compaction_level as i32 , } ; let mut buf = Vec :: new ( ) ; proto_msg . encode ( & mut buf ) ? ; Ok ( buf ) }
Convert to protobuf v3 message.
Convert to protobuf v3 message .
&self
&self