use crate::hummock::*;
impl serde::Serialize for BloomFilterType {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::BloomFilterUnspecified => "BLOOM_FILTER_UNSPECIFIED",
Self::Sstable => "SSTABLE",
Self::Blocked => "BLOCKED",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for BloomFilterType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"BLOOM_FILTER_UNSPECIFIED",
"SSTABLE",
"BLOCKED",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = BloomFilterType;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"BLOOM_FILTER_UNSPECIFIED" => Ok(BloomFilterType::BloomFilterUnspecified),
"SSTABLE" => Ok(BloomFilterType::Sstable),
"BLOCKED" => Ok(BloomFilterType::Blocked),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for BranchedObject {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.object_id != 0 {
len += 1;
}
if !self.sst_id.is_empty() {
len += 1;
}
if self.compaction_group_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.BranchedObject", len)?;
if self.object_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("objectId", ToString::to_string(&self.object_id).as_str())?;
}
if !self.sst_id.is_empty() {
struct_ser.serialize_field("sstId", &self.sst_id.iter().map(ToString::to_string).collect::<Vec<_>>())?;
}
if self.compaction_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("compactionGroupId", ToString::to_string(&self.compaction_group_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for BranchedObject {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"object_id",
"objectId",
"sst_id",
"sstId",
"compaction_group_id",
"compactionGroupId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ObjectId,
SstId,
CompactionGroupId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"objectId" | "object_id" => Ok(GeneratedField::ObjectId),
"sstId" | "sst_id" => Ok(GeneratedField::SstId),
"compactionGroupId" | "compaction_group_id" => Ok(GeneratedField::CompactionGroupId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = BranchedObject;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.BranchedObject")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<BranchedObject, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut object_id__ = None;
let mut sst_id__ = None;
let mut compaction_group_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ObjectId => {
if object_id__.is_some() {
return Err(serde::de::Error::duplicate_field("objectId"));
}
object_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SstId => {
if sst_id__.is_some() {
return Err(serde::de::Error::duplicate_field("sstId"));
}
sst_id__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::CompactionGroupId => {
if compaction_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroupId"));
}
compaction_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(BranchedObject {
object_id: object_id__.unwrap_or_default(),
sst_id: sst_id__.unwrap_or_default(),
compaction_group_id: compaction_group_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.BranchedObject", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CancelCompactTask {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.context_id != 0 {
len += 1;
}
if self.task_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.CancelCompactTask", len)?;
if self.context_id != 0 {
struct_ser.serialize_field("contextId", &self.context_id)?;
}
if self.task_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("taskId", ToString::to_string(&self.task_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CancelCompactTask {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"context_id",
"contextId",
"task_id",
"taskId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ContextId,
TaskId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"contextId" | "context_id" => Ok(GeneratedField::ContextId),
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CancelCompactTask;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.CancelCompactTask")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CancelCompactTask, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut context_id__ = None;
let mut task_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ContextId => {
if context_id__.is_some() {
return Err(serde::de::Error::duplicate_field("contextId"));
}
context_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(CancelCompactTask {
context_id: context_id__.unwrap_or_default(),
task_id: task_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.CancelCompactTask", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CancelCompactTaskRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.task_id != 0 {
len += 1;
}
if self.task_status != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.CancelCompactTaskRequest", len)?;
if self.task_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("taskId", ToString::to_string(&self.task_id).as_str())?;
}
if self.task_status != 0 {
let v = compact_task::TaskStatus::try_from(self.task_status)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.task_status)))?;
struct_ser.serialize_field("taskStatus", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CancelCompactTaskRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_id",
"taskId",
"task_status",
"taskStatus",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskId,
TaskStatus,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
"taskStatus" | "task_status" => Ok(GeneratedField::TaskStatus),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CancelCompactTaskRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.CancelCompactTaskRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CancelCompactTaskRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_id__ = None;
let mut task_status__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TaskStatus => {
if task_status__.is_some() {
return Err(serde::de::Error::duplicate_field("taskStatus"));
}
task_status__ = Some(map_.next_value::<compact_task::TaskStatus>()? as i32);
}
}
}
Ok(CancelCompactTaskRequest {
task_id: task_id__.unwrap_or_default(),
task_status: task_status__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.CancelCompactTaskRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CancelCompactTaskResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.ret {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.CancelCompactTaskResponse", len)?;
if self.ret {
struct_ser.serialize_field("ret", &self.ret)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CancelCompactTaskResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"ret",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Ret,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"ret" => Ok(GeneratedField::Ret),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CancelCompactTaskResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.CancelCompactTaskResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CancelCompactTaskResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut ret__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Ret => {
if ret__.is_some() {
return Err(serde::de::Error::duplicate_field("ret"));
}
ret__ = Some(map_.next_value()?);
}
}
}
Ok(CancelCompactTaskResponse {
ret: ret__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.CancelCompactTaskResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CompactStatus {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.compaction_group_id != 0 {
len += 1;
}
if !self.level_handlers.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.CompactStatus", len)?;
if self.compaction_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("compactionGroupId", ToString::to_string(&self.compaction_group_id).as_str())?;
}
if !self.level_handlers.is_empty() {
struct_ser.serialize_field("levelHandlers", &self.level_handlers)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CompactStatus {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"compaction_group_id",
"compactionGroupId",
"level_handlers",
"levelHandlers",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CompactionGroupId,
LevelHandlers,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"compactionGroupId" | "compaction_group_id" => Ok(GeneratedField::CompactionGroupId),
"levelHandlers" | "level_handlers" => Ok(GeneratedField::LevelHandlers),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CompactStatus;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.CompactStatus")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CompactStatus, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut compaction_group_id__ = None;
let mut level_handlers__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CompactionGroupId => {
if compaction_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroupId"));
}
compaction_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::LevelHandlers => {
if level_handlers__.is_some() {
return Err(serde::de::Error::duplicate_field("levelHandlers"));
}
level_handlers__ = Some(map_.next_value()?);
}
}
}
Ok(CompactStatus {
compaction_group_id: compaction_group_id__.unwrap_or_default(),
level_handlers: level_handlers__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.CompactStatus", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CompactTask {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.input_ssts.is_empty() {
len += 1;
}
if !self.splits.is_empty() {
len += 1;
}
if !self.sorted_output_ssts.is_empty() {
len += 1;
}
if self.task_id != 0 {
len += 1;
}
if self.target_level != 0 {
len += 1;
}
if self.gc_delete_keys {
len += 1;
}
if self.base_level != 0 {
len += 1;
}
if self.task_status != 0 {
len += 1;
}
if self.compaction_group_id != 0 {
len += 1;
}
if !self.existing_table_ids.is_empty() {
len += 1;
}
if self.compression_algorithm != 0 {
len += 1;
}
if self.target_file_size != 0 {
len += 1;
}
if self.compaction_filter_mask != 0 {
len += 1;
}
if !self.table_options.is_empty() {
len += 1;
}
if self.current_epoch_time != 0 {
len += 1;
}
if self.target_sub_level_id != 0 {
len += 1;
}
if self.task_type != 0 {
len += 1;
}
if self.split_by_state_table {
len += 1;
}
if self.split_weight_by_vnode != 0 {
len += 1;
}
if !self.table_vnode_partition.is_empty() {
len += 1;
}
if !self.table_watermarks.is_empty() {
len += 1;
}
if !self.table_schemas.is_empty() {
len += 1;
}
if self.max_sub_compaction != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.CompactTask", len)?;
if !self.input_ssts.is_empty() {
struct_ser.serialize_field("inputSsts", &self.input_ssts)?;
}
if !self.splits.is_empty() {
struct_ser.serialize_field("splits", &self.splits)?;
}
if !self.sorted_output_ssts.is_empty() {
struct_ser.serialize_field("sortedOutputSsts", &self.sorted_output_ssts)?;
}
if self.task_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("taskId", ToString::to_string(&self.task_id).as_str())?;
}
if self.target_level != 0 {
struct_ser.serialize_field("targetLevel", &self.target_level)?;
}
if self.gc_delete_keys {
struct_ser.serialize_field("gcDeleteKeys", &self.gc_delete_keys)?;
}
if self.base_level != 0 {
struct_ser.serialize_field("baseLevel", &self.base_level)?;
}
if self.task_status != 0 {
let v = compact_task::TaskStatus::try_from(self.task_status)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.task_status)))?;
struct_ser.serialize_field("taskStatus", &v)?;
}
if self.compaction_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("compactionGroupId", ToString::to_string(&self.compaction_group_id).as_str())?;
}
if !self.existing_table_ids.is_empty() {
struct_ser.serialize_field("existingTableIds", &self.existing_table_ids)?;
}
if self.compression_algorithm != 0 {
struct_ser.serialize_field("compressionAlgorithm", &self.compression_algorithm)?;
}
if self.target_file_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("targetFileSize", ToString::to_string(&self.target_file_size).as_str())?;
}
if self.compaction_filter_mask != 0 {
struct_ser.serialize_field("compactionFilterMask", &self.compaction_filter_mask)?;
}
if !self.table_options.is_empty() {
struct_ser.serialize_field("tableOptions", &self.table_options)?;
}
if self.current_epoch_time != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("currentEpochTime", ToString::to_string(&self.current_epoch_time).as_str())?;
}
if self.target_sub_level_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("targetSubLevelId", ToString::to_string(&self.target_sub_level_id).as_str())?;
}
if self.task_type != 0 {
let v = compact_task::TaskType::try_from(self.task_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.task_type)))?;
struct_ser.serialize_field("taskType", &v)?;
}
if self.split_by_state_table {
struct_ser.serialize_field("splitByStateTable", &self.split_by_state_table)?;
}
if self.split_weight_by_vnode != 0 {
struct_ser.serialize_field("splitWeightByVnode", &self.split_weight_by_vnode)?;
}
if !self.table_vnode_partition.is_empty() {
struct_ser.serialize_field("tableVnodePartition", &self.table_vnode_partition)?;
}
if !self.table_watermarks.is_empty() {
struct_ser.serialize_field("tableWatermarks", &self.table_watermarks)?;
}
if !self.table_schemas.is_empty() {
struct_ser.serialize_field("tableSchemas", &self.table_schemas)?;
}
if self.max_sub_compaction != 0 {
struct_ser.serialize_field("maxSubCompaction", &self.max_sub_compaction)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CompactTask {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"input_ssts",
"inputSsts",
"splits",
"sorted_output_ssts",
"sortedOutputSsts",
"task_id",
"taskId",
"target_level",
"targetLevel",
"gc_delete_keys",
"gcDeleteKeys",
"base_level",
"baseLevel",
"task_status",
"taskStatus",
"compaction_group_id",
"compactionGroupId",
"existing_table_ids",
"existingTableIds",
"compression_algorithm",
"compressionAlgorithm",
"target_file_size",
"targetFileSize",
"compaction_filter_mask",
"compactionFilterMask",
"table_options",
"tableOptions",
"current_epoch_time",
"currentEpochTime",
"target_sub_level_id",
"targetSubLevelId",
"task_type",
"taskType",
"split_by_state_table",
"splitByStateTable",
"split_weight_by_vnode",
"splitWeightByVnode",
"table_vnode_partition",
"tableVnodePartition",
"table_watermarks",
"tableWatermarks",
"table_schemas",
"tableSchemas",
"max_sub_compaction",
"maxSubCompaction",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
InputSsts,
Splits,
SortedOutputSsts,
TaskId,
TargetLevel,
GcDeleteKeys,
BaseLevel,
TaskStatus,
CompactionGroupId,
ExistingTableIds,
CompressionAlgorithm,
TargetFileSize,
CompactionFilterMask,
TableOptions,
CurrentEpochTime,
TargetSubLevelId,
TaskType,
SplitByStateTable,
SplitWeightByVnode,
TableVnodePartition,
TableWatermarks,
TableSchemas,
MaxSubCompaction,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"inputSsts" | "input_ssts" => Ok(GeneratedField::InputSsts),
"splits" => Ok(GeneratedField::Splits),
"sortedOutputSsts" | "sorted_output_ssts" => Ok(GeneratedField::SortedOutputSsts),
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
"targetLevel" | "target_level" => Ok(GeneratedField::TargetLevel),
"gcDeleteKeys" | "gc_delete_keys" => Ok(GeneratedField::GcDeleteKeys),
"baseLevel" | "base_level" => Ok(GeneratedField::BaseLevel),
"taskStatus" | "task_status" => Ok(GeneratedField::TaskStatus),
"compactionGroupId" | "compaction_group_id" => Ok(GeneratedField::CompactionGroupId),
"existingTableIds" | "existing_table_ids" => Ok(GeneratedField::ExistingTableIds),
"compressionAlgorithm" | "compression_algorithm" => Ok(GeneratedField::CompressionAlgorithm),
"targetFileSize" | "target_file_size" => Ok(GeneratedField::TargetFileSize),
"compactionFilterMask" | "compaction_filter_mask" => Ok(GeneratedField::CompactionFilterMask),
"tableOptions" | "table_options" => Ok(GeneratedField::TableOptions),
"currentEpochTime" | "current_epoch_time" => Ok(GeneratedField::CurrentEpochTime),
"targetSubLevelId" | "target_sub_level_id" => Ok(GeneratedField::TargetSubLevelId),
"taskType" | "task_type" => Ok(GeneratedField::TaskType),
"splitByStateTable" | "split_by_state_table" => Ok(GeneratedField::SplitByStateTable),
"splitWeightByVnode" | "split_weight_by_vnode" => Ok(GeneratedField::SplitWeightByVnode),
"tableVnodePartition" | "table_vnode_partition" => Ok(GeneratedField::TableVnodePartition),
"tableWatermarks" | "table_watermarks" => Ok(GeneratedField::TableWatermarks),
"tableSchemas" | "table_schemas" => Ok(GeneratedField::TableSchemas),
"maxSubCompaction" | "max_sub_compaction" => Ok(GeneratedField::MaxSubCompaction),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CompactTask;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.CompactTask")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CompactTask, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut input_ssts__ = None;
let mut splits__ = None;
let mut sorted_output_ssts__ = None;
let mut task_id__ = None;
let mut target_level__ = None;
let mut gc_delete_keys__ = None;
let mut base_level__ = None;
let mut task_status__ = None;
let mut compaction_group_id__ = None;
let mut existing_table_ids__ = None;
let mut compression_algorithm__ = None;
let mut target_file_size__ = None;
let mut compaction_filter_mask__ = None;
let mut table_options__ = None;
let mut current_epoch_time__ = None;
let mut target_sub_level_id__ = None;
let mut task_type__ = None;
let mut split_by_state_table__ = None;
let mut split_weight_by_vnode__ = None;
let mut table_vnode_partition__ = None;
let mut table_watermarks__ = None;
let mut table_schemas__ = None;
let mut max_sub_compaction__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::InputSsts => {
if input_ssts__.is_some() {
return Err(serde::de::Error::duplicate_field("inputSsts"));
}
input_ssts__ = Some(map_.next_value()?);
}
GeneratedField::Splits => {
if splits__.is_some() {
return Err(serde::de::Error::duplicate_field("splits"));
}
splits__ = Some(map_.next_value()?);
}
GeneratedField::SortedOutputSsts => {
if sorted_output_ssts__.is_some() {
return Err(serde::de::Error::duplicate_field("sortedOutputSsts"));
}
sorted_output_ssts__ = Some(map_.next_value()?);
}
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TargetLevel => {
if target_level__.is_some() {
return Err(serde::de::Error::duplicate_field("targetLevel"));
}
target_level__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::GcDeleteKeys => {
if gc_delete_keys__.is_some() {
return Err(serde::de::Error::duplicate_field("gcDeleteKeys"));
}
gc_delete_keys__ = Some(map_.next_value()?);
}
GeneratedField::BaseLevel => {
if base_level__.is_some() {
return Err(serde::de::Error::duplicate_field("baseLevel"));
}
base_level__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TaskStatus => {
if task_status__.is_some() {
return Err(serde::de::Error::duplicate_field("taskStatus"));
}
task_status__ = Some(map_.next_value::<compact_task::TaskStatus>()? as i32);
}
GeneratedField::CompactionGroupId => {
if compaction_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroupId"));
}
compaction_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::ExistingTableIds => {
if existing_table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("existingTableIds"));
}
existing_table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::CompressionAlgorithm => {
if compression_algorithm__.is_some() {
return Err(serde::de::Error::duplicate_field("compressionAlgorithm"));
}
compression_algorithm__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TargetFileSize => {
if target_file_size__.is_some() {
return Err(serde::de::Error::duplicate_field("targetFileSize"));
}
target_file_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CompactionFilterMask => {
if compaction_filter_mask__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionFilterMask"));
}
compaction_filter_mask__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableOptions => {
if table_options__.is_some() {
return Err(serde::de::Error::duplicate_field("tableOptions"));
}
table_options__ = Some(
map_.next_value::<std::collections::BTreeMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::CurrentEpochTime => {
if current_epoch_time__.is_some() {
return Err(serde::de::Error::duplicate_field("currentEpochTime"));
}
current_epoch_time__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TargetSubLevelId => {
if target_sub_level_id__.is_some() {
return Err(serde::de::Error::duplicate_field("targetSubLevelId"));
}
target_sub_level_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TaskType => {
if task_type__.is_some() {
return Err(serde::de::Error::duplicate_field("taskType"));
}
task_type__ = Some(map_.next_value::<compact_task::TaskType>()? as i32);
}
GeneratedField::SplitByStateTable => {
if split_by_state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("splitByStateTable"));
}
split_by_state_table__ = Some(map_.next_value()?);
}
GeneratedField::SplitWeightByVnode => {
if split_weight_by_vnode__.is_some() {
return Err(serde::de::Error::duplicate_field("splitWeightByVnode"));
}
split_weight_by_vnode__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableVnodePartition => {
if table_vnode_partition__.is_some() {
return Err(serde::de::Error::duplicate_field("tableVnodePartition"));
}
table_vnode_partition__ = Some(
map_.next_value::<std::collections::BTreeMap<::pbjson::private::NumberDeserialize<u32>, ::pbjson::private::NumberDeserialize<u32>>>()?
.into_iter().map(|(k,v)| (k.0, v.0)).collect()
);
}
GeneratedField::TableWatermarks => {
if table_watermarks__.is_some() {
return Err(serde::de::Error::duplicate_field("tableWatermarks"));
}
table_watermarks__ = Some(
map_.next_value::<std::collections::BTreeMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::TableSchemas => {
if table_schemas__.is_some() {
return Err(serde::de::Error::duplicate_field("tableSchemas"));
}
table_schemas__ = Some(
map_.next_value::<std::collections::BTreeMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::MaxSubCompaction => {
if max_sub_compaction__.is_some() {
return Err(serde::de::Error::duplicate_field("maxSubCompaction"));
}
max_sub_compaction__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(CompactTask {
input_ssts: input_ssts__.unwrap_or_default(),
splits: splits__.unwrap_or_default(),
sorted_output_ssts: sorted_output_ssts__.unwrap_or_default(),
task_id: task_id__.unwrap_or_default(),
target_level: target_level__.unwrap_or_default(),
gc_delete_keys: gc_delete_keys__.unwrap_or_default(),
base_level: base_level__.unwrap_or_default(),
task_status: task_status__.unwrap_or_default(),
compaction_group_id: compaction_group_id__.unwrap_or_default(),
existing_table_ids: existing_table_ids__.unwrap_or_default(),
compression_algorithm: compression_algorithm__.unwrap_or_default(),
target_file_size: target_file_size__.unwrap_or_default(),
compaction_filter_mask: compaction_filter_mask__.unwrap_or_default(),
table_options: table_options__.unwrap_or_default(),
current_epoch_time: current_epoch_time__.unwrap_or_default(),
target_sub_level_id: target_sub_level_id__.unwrap_or_default(),
task_type: task_type__.unwrap_or_default(),
split_by_state_table: split_by_state_table__.unwrap_or_default(),
split_weight_by_vnode: split_weight_by_vnode__.unwrap_or_default(),
table_vnode_partition: table_vnode_partition__.unwrap_or_default(),
table_watermarks: table_watermarks__.unwrap_or_default(),
table_schemas: table_schemas__.unwrap_or_default(),
max_sub_compaction: max_sub_compaction__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.CompactTask", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for compact_task::TaskStatus {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::Unspecified => "UNSPECIFIED",
Self::Pending => "PENDING",
Self::Success => "SUCCESS",
Self::HeartbeatCanceled => "HEARTBEAT_CANCELED",
Self::NoAvailMemoryResourceCanceled => "NO_AVAIL_MEMORY_RESOURCE_CANCELED",
Self::AssignFailCanceled => "ASSIGN_FAIL_CANCELED",
Self::SendFailCanceled => "SEND_FAIL_CANCELED",
Self::ManualCanceled => "MANUAL_CANCELED",
Self::InvalidGroupCanceled => "INVALID_GROUP_CANCELED",
Self::InputOutdatedCanceled => "INPUT_OUTDATED_CANCELED",
Self::ExecuteFailed => "EXECUTE_FAILED",
Self::JoinHandleFailed => "JOIN_HANDLE_FAILED",
Self::TrackSstObjectIdFailed => "TRACK_SST_OBJECT_ID_FAILED",
Self::NoAvailCpuResourceCanceled => "NO_AVAIL_CPU_RESOURCE_CANCELED",
Self::HeartbeatProgressCanceled => "HEARTBEAT_PROGRESS_CANCELED",
Self::RetentionTimeRejected => "RETENTION_TIME_REJECTED",
Self::ServerlessSendFailCanceled => "SERVERLESS_SEND_FAIL_CANCELED",
Self::ServerlessTableNotFoundCanceled => "SERVERLESS_TABLE_NOT_FOUND_CANCELED",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for compact_task::TaskStatus {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"PENDING",
"SUCCESS",
"HEARTBEAT_CANCELED",
"NO_AVAIL_MEMORY_RESOURCE_CANCELED",
"ASSIGN_FAIL_CANCELED",
"SEND_FAIL_CANCELED",
"MANUAL_CANCELED",
"INVALID_GROUP_CANCELED",
"INPUT_OUTDATED_CANCELED",
"EXECUTE_FAILED",
"JOIN_HANDLE_FAILED",
"TRACK_SST_OBJECT_ID_FAILED",
"NO_AVAIL_CPU_RESOURCE_CANCELED",
"HEARTBEAT_PROGRESS_CANCELED",
"RETENTION_TIME_REJECTED",
"SERVERLESS_SEND_FAIL_CANCELED",
"SERVERLESS_TABLE_NOT_FOUND_CANCELED",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = compact_task::TaskStatus;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"UNSPECIFIED" => Ok(compact_task::TaskStatus::Unspecified),
"PENDING" => Ok(compact_task::TaskStatus::Pending),
"SUCCESS" => Ok(compact_task::TaskStatus::Success),
"HEARTBEAT_CANCELED" => Ok(compact_task::TaskStatus::HeartbeatCanceled),
"NO_AVAIL_MEMORY_RESOURCE_CANCELED" => Ok(compact_task::TaskStatus::NoAvailMemoryResourceCanceled),
"ASSIGN_FAIL_CANCELED" => Ok(compact_task::TaskStatus::AssignFailCanceled),
"SEND_FAIL_CANCELED" => Ok(compact_task::TaskStatus::SendFailCanceled),
"MANUAL_CANCELED" => Ok(compact_task::TaskStatus::ManualCanceled),
"INVALID_GROUP_CANCELED" => Ok(compact_task::TaskStatus::InvalidGroupCanceled),
"INPUT_OUTDATED_CANCELED" => Ok(compact_task::TaskStatus::InputOutdatedCanceled),
"EXECUTE_FAILED" => Ok(compact_task::TaskStatus::ExecuteFailed),
"JOIN_HANDLE_FAILED" => Ok(compact_task::TaskStatus::JoinHandleFailed),
"TRACK_SST_OBJECT_ID_FAILED" => Ok(compact_task::TaskStatus::TrackSstObjectIdFailed),
"NO_AVAIL_CPU_RESOURCE_CANCELED" => Ok(compact_task::TaskStatus::NoAvailCpuResourceCanceled),
"HEARTBEAT_PROGRESS_CANCELED" => Ok(compact_task::TaskStatus::HeartbeatProgressCanceled),
"RETENTION_TIME_REJECTED" => Ok(compact_task::TaskStatus::RetentionTimeRejected),
"SERVERLESS_SEND_FAIL_CANCELED" => Ok(compact_task::TaskStatus::ServerlessSendFailCanceled),
"SERVERLESS_TABLE_NOT_FOUND_CANCELED" => Ok(compact_task::TaskStatus::ServerlessTableNotFoundCanceled),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for compact_task::TaskType {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::TypeUnspecified => "TYPE_UNSPECIFIED",
Self::Dynamic => "DYNAMIC",
Self::SpaceReclaim => "SPACE_RECLAIM",
Self::Manual => "MANUAL",
Self::SharedBuffer => "SHARED_BUFFER",
Self::Ttl => "TTL",
Self::Tombstone => "TOMBSTONE",
Self::Emergency => "EMERGENCY",
Self::VnodeWatermark => "VNODE_WATERMARK",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for compact_task::TaskType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"TYPE_UNSPECIFIED",
"DYNAMIC",
"SPACE_RECLAIM",
"MANUAL",
"SHARED_BUFFER",
"TTL",
"TOMBSTONE",
"EMERGENCY",
"VNODE_WATERMARK",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = compact_task::TaskType;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"TYPE_UNSPECIFIED" => Ok(compact_task::TaskType::TypeUnspecified),
"DYNAMIC" => Ok(compact_task::TaskType::Dynamic),
"SPACE_RECLAIM" => Ok(compact_task::TaskType::SpaceReclaim),
"MANUAL" => Ok(compact_task::TaskType::Manual),
"SHARED_BUFFER" => Ok(compact_task::TaskType::SharedBuffer),
"TTL" => Ok(compact_task::TaskType::Ttl),
"TOMBSTONE" => Ok(compact_task::TaskType::Tombstone),
"EMERGENCY" => Ok(compact_task::TaskType::Emergency),
"VNODE_WATERMARK" => Ok(compact_task::TaskType::VnodeWatermark),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for CompactTaskAssignment {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.compact_task.is_some() {
len += 1;
}
if self.context_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.CompactTaskAssignment", len)?;
if let Some(v) = self.compact_task.as_ref() {
struct_ser.serialize_field("compactTask", v)?;
}
if self.context_id != 0 {
struct_ser.serialize_field("contextId", &self.context_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CompactTaskAssignment {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"compact_task",
"compactTask",
"context_id",
"contextId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CompactTask,
ContextId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"compactTask" | "compact_task" => Ok(GeneratedField::CompactTask),
"contextId" | "context_id" => Ok(GeneratedField::ContextId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CompactTaskAssignment;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.CompactTaskAssignment")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CompactTaskAssignment, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut compact_task__ = None;
let mut context_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CompactTask => {
if compact_task__.is_some() {
return Err(serde::de::Error::duplicate_field("compactTask"));
}
compact_task__ = map_.next_value()?;
}
GeneratedField::ContextId => {
if context_id__.is_some() {
return Err(serde::de::Error::duplicate_field("contextId"));
}
context_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(CompactTaskAssignment {
compact_task: compact_task__,
context_id: context_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.CompactTaskAssignment", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CompactTaskProgress {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.task_id != 0 {
len += 1;
}
if self.num_ssts_sealed != 0 {
len += 1;
}
if self.num_ssts_uploaded != 0 {
len += 1;
}
if self.num_progress_key != 0 {
len += 1;
}
if self.num_pending_read_io != 0 {
len += 1;
}
if self.num_pending_write_io != 0 {
len += 1;
}
if self.compaction_group_id.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.CompactTaskProgress", len)?;
if self.task_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("taskId", ToString::to_string(&self.task_id).as_str())?;
}
if self.num_ssts_sealed != 0 {
struct_ser.serialize_field("numSstsSealed", &self.num_ssts_sealed)?;
}
if self.num_ssts_uploaded != 0 {
struct_ser.serialize_field("numSstsUploaded", &self.num_ssts_uploaded)?;
}
if self.num_progress_key != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("numProgressKey", ToString::to_string(&self.num_progress_key).as_str())?;
}
if self.num_pending_read_io != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("numPendingReadIo", ToString::to_string(&self.num_pending_read_io).as_str())?;
}
if self.num_pending_write_io != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("numPendingWriteIo", ToString::to_string(&self.num_pending_write_io).as_str())?;
}
if let Some(v) = self.compaction_group_id.as_ref() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("compactionGroupId", ToString::to_string(&v).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CompactTaskProgress {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_id",
"taskId",
"num_ssts_sealed",
"numSstsSealed",
"num_ssts_uploaded",
"numSstsUploaded",
"num_progress_key",
"numProgressKey",
"num_pending_read_io",
"numPendingReadIo",
"num_pending_write_io",
"numPendingWriteIo",
"compaction_group_id",
"compactionGroupId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskId,
NumSstsSealed,
NumSstsUploaded,
NumProgressKey,
NumPendingReadIo,
NumPendingWriteIo,
CompactionGroupId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
"numSstsSealed" | "num_ssts_sealed" => Ok(GeneratedField::NumSstsSealed),
"numSstsUploaded" | "num_ssts_uploaded" => Ok(GeneratedField::NumSstsUploaded),
"numProgressKey" | "num_progress_key" => Ok(GeneratedField::NumProgressKey),
"numPendingReadIo" | "num_pending_read_io" => Ok(GeneratedField::NumPendingReadIo),
"numPendingWriteIo" | "num_pending_write_io" => Ok(GeneratedField::NumPendingWriteIo),
"compactionGroupId" | "compaction_group_id" => Ok(GeneratedField::CompactionGroupId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CompactTaskProgress;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.CompactTaskProgress")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CompactTaskProgress, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_id__ = None;
let mut num_ssts_sealed__ = None;
let mut num_ssts_uploaded__ = None;
let mut num_progress_key__ = None;
let mut num_pending_read_io__ = None;
let mut num_pending_write_io__ = None;
let mut compaction_group_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::NumSstsSealed => {
if num_ssts_sealed__.is_some() {
return Err(serde::de::Error::duplicate_field("numSstsSealed"));
}
num_ssts_sealed__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::NumSstsUploaded => {
if num_ssts_uploaded__.is_some() {
return Err(serde::de::Error::duplicate_field("numSstsUploaded"));
}
num_ssts_uploaded__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::NumProgressKey => {
if num_progress_key__.is_some() {
return Err(serde::de::Error::duplicate_field("numProgressKey"));
}
num_progress_key__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::NumPendingReadIo => {
if num_pending_read_io__.is_some() {
return Err(serde::de::Error::duplicate_field("numPendingReadIo"));
}
num_pending_read_io__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::NumPendingWriteIo => {
if num_pending_write_io__.is_some() {
return Err(serde::de::Error::duplicate_field("numPendingWriteIo"));
}
num_pending_write_io__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CompactionGroupId => {
if compaction_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroupId"));
}
compaction_group_id__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
}
}
Ok(CompactTaskProgress {
task_id: task_id__.unwrap_or_default(),
num_ssts_sealed: num_ssts_sealed__.unwrap_or_default(),
num_ssts_uploaded: num_ssts_uploaded__.unwrap_or_default(),
num_progress_key: num_progress_key__.unwrap_or_default(),
num_pending_read_io: num_pending_read_io__.unwrap_or_default(),
num_pending_write_io: num_pending_write_io__.unwrap_or_default(),
compaction_group_id: compaction_group_id__,
})
}
}
deserializer.deserialize_struct("hummock.CompactTaskProgress", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CompactionConfig {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.max_bytes_for_level_base != 0 {
len += 1;
}
if self.max_level != 0 {
len += 1;
}
if self.max_bytes_for_level_multiplier != 0 {
len += 1;
}
if self.max_compaction_bytes != 0 {
len += 1;
}
if self.sub_level_max_compaction_bytes != 0 {
len += 1;
}
if self.level0_tier_compact_file_number != 0 {
len += 1;
}
if self.compaction_mode != 0 {
len += 1;
}
if !self.compression_algorithm.is_empty() {
len += 1;
}
if self.target_file_size_base != 0 {
len += 1;
}
if self.compaction_filter_mask != 0 {
len += 1;
}
if self.max_sub_compaction != 0 {
len += 1;
}
if self.max_space_reclaim_bytes != 0 {
len += 1;
}
if self.split_by_state_table {
len += 1;
}
if self.split_weight_by_vnode != 0 {
len += 1;
}
if self.level0_stop_write_threshold_sub_level_number != 0 {
len += 1;
}
if self.level0_max_compact_file_number != 0 {
len += 1;
}
if self.level0_sub_level_compact_level_count != 0 {
len += 1;
}
if self.level0_overlapping_sub_level_compact_level_count != 0 {
len += 1;
}
if self.tombstone_reclaim_ratio != 0 {
len += 1;
}
if self.enable_emergency_picker {
len += 1;
}
if self.max_l0_compact_level_count.is_some() {
len += 1;
}
if self.sst_allowed_trivial_move_min_size.is_some() {
len += 1;
}
if self.disable_auto_group_scheduling.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.CompactionConfig", len)?;
if self.max_bytes_for_level_base != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("maxBytesForLevelBase", ToString::to_string(&self.max_bytes_for_level_base).as_str())?;
}
if self.max_level != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("maxLevel", ToString::to_string(&self.max_level).as_str())?;
}
if self.max_bytes_for_level_multiplier != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("maxBytesForLevelMultiplier", ToString::to_string(&self.max_bytes_for_level_multiplier).as_str())?;
}
if self.max_compaction_bytes != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("maxCompactionBytes", ToString::to_string(&self.max_compaction_bytes).as_str())?;
}
if self.sub_level_max_compaction_bytes != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("subLevelMaxCompactionBytes", ToString::to_string(&self.sub_level_max_compaction_bytes).as_str())?;
}
if self.level0_tier_compact_file_number != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("level0TierCompactFileNumber", ToString::to_string(&self.level0_tier_compact_file_number).as_str())?;
}
if self.compaction_mode != 0 {
let v = compaction_config::CompactionMode::try_from(self.compaction_mode)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.compaction_mode)))?;
struct_ser.serialize_field("compactionMode", &v)?;
}
if !self.compression_algorithm.is_empty() {
struct_ser.serialize_field("compressionAlgorithm", &self.compression_algorithm)?;
}
if self.target_file_size_base != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("targetFileSizeBase", ToString::to_string(&self.target_file_size_base).as_str())?;
}
if self.compaction_filter_mask != 0 {
struct_ser.serialize_field("compactionFilterMask", &self.compaction_filter_mask)?;
}
if self.max_sub_compaction != 0 {
struct_ser.serialize_field("maxSubCompaction", &self.max_sub_compaction)?;
}
if self.max_space_reclaim_bytes != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("maxSpaceReclaimBytes", ToString::to_string(&self.max_space_reclaim_bytes).as_str())?;
}
if self.split_by_state_table {
struct_ser.serialize_field("splitByStateTable", &self.split_by_state_table)?;
}
if self.split_weight_by_vnode != 0 {
struct_ser.serialize_field("splitWeightByVnode", &self.split_weight_by_vnode)?;
}
if self.level0_stop_write_threshold_sub_level_number != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("level0StopWriteThresholdSubLevelNumber", ToString::to_string(&self.level0_stop_write_threshold_sub_level_number).as_str())?;
}
if self.level0_max_compact_file_number != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("level0MaxCompactFileNumber", ToString::to_string(&self.level0_max_compact_file_number).as_str())?;
}
if self.level0_sub_level_compact_level_count != 0 {
struct_ser.serialize_field("level0SubLevelCompactLevelCount", &self.level0_sub_level_compact_level_count)?;
}
if self.level0_overlapping_sub_level_compact_level_count != 0 {
struct_ser.serialize_field("level0OverlappingSubLevelCompactLevelCount", &self.level0_overlapping_sub_level_compact_level_count)?;
}
if self.tombstone_reclaim_ratio != 0 {
struct_ser.serialize_field("tombstoneReclaimRatio", &self.tombstone_reclaim_ratio)?;
}
if self.enable_emergency_picker {
struct_ser.serialize_field("enableEmergencyPicker", &self.enable_emergency_picker)?;
}
if let Some(v) = self.max_l0_compact_level_count.as_ref() {
struct_ser.serialize_field("maxL0CompactLevelCount", v)?;
}
if let Some(v) = self.sst_allowed_trivial_move_min_size.as_ref() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("sstAllowedTrivialMoveMinSize", ToString::to_string(&v).as_str())?;
}
if let Some(v) = self.disable_auto_group_scheduling.as_ref() {
struct_ser.serialize_field("disableAutoGroupScheduling", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CompactionConfig {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"max_bytes_for_level_base",
"maxBytesForLevelBase",
"max_level",
"maxLevel",
"max_bytes_for_level_multiplier",
"maxBytesForLevelMultiplier",
"max_compaction_bytes",
"maxCompactionBytes",
"sub_level_max_compaction_bytes",
"subLevelMaxCompactionBytes",
"level0_tier_compact_file_number",
"level0TierCompactFileNumber",
"compaction_mode",
"compactionMode",
"compression_algorithm",
"compressionAlgorithm",
"target_file_size_base",
"targetFileSizeBase",
"compaction_filter_mask",
"compactionFilterMask",
"max_sub_compaction",
"maxSubCompaction",
"max_space_reclaim_bytes",
"maxSpaceReclaimBytes",
"split_by_state_table",
"splitByStateTable",
"split_weight_by_vnode",
"splitWeightByVnode",
"level0_stop_write_threshold_sub_level_number",
"level0StopWriteThresholdSubLevelNumber",
"level0_max_compact_file_number",
"level0MaxCompactFileNumber",
"level0_sub_level_compact_level_count",
"level0SubLevelCompactLevelCount",
"level0_overlapping_sub_level_compact_level_count",
"level0OverlappingSubLevelCompactLevelCount",
"tombstone_reclaim_ratio",
"tombstoneReclaimRatio",
"enable_emergency_picker",
"enableEmergencyPicker",
"max_l0_compact_level_count",
"maxL0CompactLevelCount",
"sst_allowed_trivial_move_min_size",
"sstAllowedTrivialMoveMinSize",
"disable_auto_group_scheduling",
"disableAutoGroupScheduling",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
MaxBytesForLevelBase,
MaxLevel,
MaxBytesForLevelMultiplier,
MaxCompactionBytes,
SubLevelMaxCompactionBytes,
Level0TierCompactFileNumber,
CompactionMode,
CompressionAlgorithm,
TargetFileSizeBase,
CompactionFilterMask,
MaxSubCompaction,
MaxSpaceReclaimBytes,
SplitByStateTable,
SplitWeightByVnode,
Level0StopWriteThresholdSubLevelNumber,
Level0MaxCompactFileNumber,
Level0SubLevelCompactLevelCount,
Level0OverlappingSubLevelCompactLevelCount,
TombstoneReclaimRatio,
EnableEmergencyPicker,
MaxL0CompactLevelCount,
SstAllowedTrivialMoveMinSize,
DisableAutoGroupScheduling,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"maxBytesForLevelBase" | "max_bytes_for_level_base" => Ok(GeneratedField::MaxBytesForLevelBase),
"maxLevel" | "max_level" => Ok(GeneratedField::MaxLevel),
"maxBytesForLevelMultiplier" | "max_bytes_for_level_multiplier" => Ok(GeneratedField::MaxBytesForLevelMultiplier),
"maxCompactionBytes" | "max_compaction_bytes" => Ok(GeneratedField::MaxCompactionBytes),
"subLevelMaxCompactionBytes" | "sub_level_max_compaction_bytes" => Ok(GeneratedField::SubLevelMaxCompactionBytes),
"level0TierCompactFileNumber" | "level0_tier_compact_file_number" => Ok(GeneratedField::Level0TierCompactFileNumber),
"compactionMode" | "compaction_mode" => Ok(GeneratedField::CompactionMode),
"compressionAlgorithm" | "compression_algorithm" => Ok(GeneratedField::CompressionAlgorithm),
"targetFileSizeBase" | "target_file_size_base" => Ok(GeneratedField::TargetFileSizeBase),
"compactionFilterMask" | "compaction_filter_mask" => Ok(GeneratedField::CompactionFilterMask),
"maxSubCompaction" | "max_sub_compaction" => Ok(GeneratedField::MaxSubCompaction),
"maxSpaceReclaimBytes" | "max_space_reclaim_bytes" => Ok(GeneratedField::MaxSpaceReclaimBytes),
"splitByStateTable" | "split_by_state_table" => Ok(GeneratedField::SplitByStateTable),
"splitWeightByVnode" | "split_weight_by_vnode" => Ok(GeneratedField::SplitWeightByVnode),
"level0StopWriteThresholdSubLevelNumber" | "level0_stop_write_threshold_sub_level_number" => Ok(GeneratedField::Level0StopWriteThresholdSubLevelNumber),
"level0MaxCompactFileNumber" | "level0_max_compact_file_number" => Ok(GeneratedField::Level0MaxCompactFileNumber),
"level0SubLevelCompactLevelCount" | "level0_sub_level_compact_level_count" => Ok(GeneratedField::Level0SubLevelCompactLevelCount),
"level0OverlappingSubLevelCompactLevelCount" | "level0_overlapping_sub_level_compact_level_count" => Ok(GeneratedField::Level0OverlappingSubLevelCompactLevelCount),
"tombstoneReclaimRatio" | "tombstone_reclaim_ratio" => Ok(GeneratedField::TombstoneReclaimRatio),
"enableEmergencyPicker" | "enable_emergency_picker" => Ok(GeneratedField::EnableEmergencyPicker),
"maxL0CompactLevelCount" | "max_l0_compact_level_count" => Ok(GeneratedField::MaxL0CompactLevelCount),
"sstAllowedTrivialMoveMinSize" | "sst_allowed_trivial_move_min_size" => Ok(GeneratedField::SstAllowedTrivialMoveMinSize),
"disableAutoGroupScheduling" | "disable_auto_group_scheduling" => Ok(GeneratedField::DisableAutoGroupScheduling),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CompactionConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.CompactionConfig")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CompactionConfig, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut max_bytes_for_level_base__ = None;
let mut max_level__ = None;
let mut max_bytes_for_level_multiplier__ = None;
let mut max_compaction_bytes__ = None;
let mut sub_level_max_compaction_bytes__ = None;
let mut level0_tier_compact_file_number__ = None;
let mut compaction_mode__ = None;
let mut compression_algorithm__ = None;
let mut target_file_size_base__ = None;
let mut compaction_filter_mask__ = None;
let mut max_sub_compaction__ = None;
let mut max_space_reclaim_bytes__ = None;
let mut split_by_state_table__ = None;
let mut split_weight_by_vnode__ = None;
let mut level0_stop_write_threshold_sub_level_number__ = None;
let mut level0_max_compact_file_number__ = None;
let mut level0_sub_level_compact_level_count__ = None;
let mut level0_overlapping_sub_level_compact_level_count__ = None;
let mut tombstone_reclaim_ratio__ = None;
let mut enable_emergency_picker__ = None;
let mut max_l0_compact_level_count__ = None;
let mut sst_allowed_trivial_move_min_size__ = None;
let mut disable_auto_group_scheduling__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::MaxBytesForLevelBase => {
if max_bytes_for_level_base__.is_some() {
return Err(serde::de::Error::duplicate_field("maxBytesForLevelBase"));
}
max_bytes_for_level_base__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::MaxLevel => {
if max_level__.is_some() {
return Err(serde::de::Error::duplicate_field("maxLevel"));
}
max_level__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::MaxBytesForLevelMultiplier => {
if max_bytes_for_level_multiplier__.is_some() {
return Err(serde::de::Error::duplicate_field("maxBytesForLevelMultiplier"));
}
max_bytes_for_level_multiplier__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::MaxCompactionBytes => {
if max_compaction_bytes__.is_some() {
return Err(serde::de::Error::duplicate_field("maxCompactionBytes"));
}
max_compaction_bytes__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SubLevelMaxCompactionBytes => {
if sub_level_max_compaction_bytes__.is_some() {
return Err(serde::de::Error::duplicate_field("subLevelMaxCompactionBytes"));
}
sub_level_max_compaction_bytes__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Level0TierCompactFileNumber => {
if level0_tier_compact_file_number__.is_some() {
return Err(serde::de::Error::duplicate_field("level0TierCompactFileNumber"));
}
level0_tier_compact_file_number__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CompactionMode => {
if compaction_mode__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionMode"));
}
compaction_mode__ = Some(map_.next_value::<compaction_config::CompactionMode>()? as i32);
}
GeneratedField::CompressionAlgorithm => {
if compression_algorithm__.is_some() {
return Err(serde::de::Error::duplicate_field("compressionAlgorithm"));
}
compression_algorithm__ = Some(map_.next_value()?);
}
GeneratedField::TargetFileSizeBase => {
if target_file_size_base__.is_some() {
return Err(serde::de::Error::duplicate_field("targetFileSizeBase"));
}
target_file_size_base__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CompactionFilterMask => {
if compaction_filter_mask__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionFilterMask"));
}
compaction_filter_mask__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::MaxSubCompaction => {
if max_sub_compaction__.is_some() {
return Err(serde::de::Error::duplicate_field("maxSubCompaction"));
}
max_sub_compaction__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::MaxSpaceReclaimBytes => {
if max_space_reclaim_bytes__.is_some() {
return Err(serde::de::Error::duplicate_field("maxSpaceReclaimBytes"));
}
max_space_reclaim_bytes__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SplitByStateTable => {
if split_by_state_table__.is_some() {
return Err(serde::de::Error::duplicate_field("splitByStateTable"));
}
split_by_state_table__ = Some(map_.next_value()?);
}
GeneratedField::SplitWeightByVnode => {
if split_weight_by_vnode__.is_some() {
return Err(serde::de::Error::duplicate_field("splitWeightByVnode"));
}
split_weight_by_vnode__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Level0StopWriteThresholdSubLevelNumber => {
if level0_stop_write_threshold_sub_level_number__.is_some() {
return Err(serde::de::Error::duplicate_field("level0StopWriteThresholdSubLevelNumber"));
}
level0_stop_write_threshold_sub_level_number__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Level0MaxCompactFileNumber => {
if level0_max_compact_file_number__.is_some() {
return Err(serde::de::Error::duplicate_field("level0MaxCompactFileNumber"));
}
level0_max_compact_file_number__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Level0SubLevelCompactLevelCount => {
if level0_sub_level_compact_level_count__.is_some() {
return Err(serde::de::Error::duplicate_field("level0SubLevelCompactLevelCount"));
}
level0_sub_level_compact_level_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Level0OverlappingSubLevelCompactLevelCount => {
if level0_overlapping_sub_level_compact_level_count__.is_some() {
return Err(serde::de::Error::duplicate_field("level0OverlappingSubLevelCompactLevelCount"));
}
level0_overlapping_sub_level_compact_level_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TombstoneReclaimRatio => {
if tombstone_reclaim_ratio__.is_some() {
return Err(serde::de::Error::duplicate_field("tombstoneReclaimRatio"));
}
tombstone_reclaim_ratio__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::EnableEmergencyPicker => {
if enable_emergency_picker__.is_some() {
return Err(serde::de::Error::duplicate_field("enableEmergencyPicker"));
}
enable_emergency_picker__ = Some(map_.next_value()?);
}
GeneratedField::MaxL0CompactLevelCount => {
if max_l0_compact_level_count__.is_some() {
return Err(serde::de::Error::duplicate_field("maxL0CompactLevelCount"));
}
max_l0_compact_level_count__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::SstAllowedTrivialMoveMinSize => {
if sst_allowed_trivial_move_min_size__.is_some() {
return Err(serde::de::Error::duplicate_field("sstAllowedTrivialMoveMinSize"));
}
sst_allowed_trivial_move_min_size__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::DisableAutoGroupScheduling => {
if disable_auto_group_scheduling__.is_some() {
return Err(serde::de::Error::duplicate_field("disableAutoGroupScheduling"));
}
disable_auto_group_scheduling__ = map_.next_value()?;
}
}
}
Ok(CompactionConfig {
max_bytes_for_level_base: max_bytes_for_level_base__.unwrap_or_default(),
max_level: max_level__.unwrap_or_default(),
max_bytes_for_level_multiplier: max_bytes_for_level_multiplier__.unwrap_or_default(),
max_compaction_bytes: max_compaction_bytes__.unwrap_or_default(),
sub_level_max_compaction_bytes: sub_level_max_compaction_bytes__.unwrap_or_default(),
level0_tier_compact_file_number: level0_tier_compact_file_number__.unwrap_or_default(),
compaction_mode: compaction_mode__.unwrap_or_default(),
compression_algorithm: compression_algorithm__.unwrap_or_default(),
target_file_size_base: target_file_size_base__.unwrap_or_default(),
compaction_filter_mask: compaction_filter_mask__.unwrap_or_default(),
max_sub_compaction: max_sub_compaction__.unwrap_or_default(),
max_space_reclaim_bytes: max_space_reclaim_bytes__.unwrap_or_default(),
split_by_state_table: split_by_state_table__.unwrap_or_default(),
split_weight_by_vnode: split_weight_by_vnode__.unwrap_or_default(),
level0_stop_write_threshold_sub_level_number: level0_stop_write_threshold_sub_level_number__.unwrap_or_default(),
level0_max_compact_file_number: level0_max_compact_file_number__.unwrap_or_default(),
level0_sub_level_compact_level_count: level0_sub_level_compact_level_count__.unwrap_or_default(),
level0_overlapping_sub_level_compact_level_count: level0_overlapping_sub_level_compact_level_count__.unwrap_or_default(),
tombstone_reclaim_ratio: tombstone_reclaim_ratio__.unwrap_or_default(),
enable_emergency_picker: enable_emergency_picker__.unwrap_or_default(),
max_l0_compact_level_count: max_l0_compact_level_count__,
sst_allowed_trivial_move_min_size: sst_allowed_trivial_move_min_size__,
disable_auto_group_scheduling: disable_auto_group_scheduling__,
})
}
}
deserializer.deserialize_struct("hummock.CompactionConfig", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for compaction_config::CompactionMode {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::Unspecified => "UNSPECIFIED",
Self::Range => "RANGE",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for compaction_config::CompactionMode {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"RANGE",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = compaction_config::CompactionMode;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"UNSPECIFIED" => Ok(compaction_config::CompactionMode::Unspecified),
"RANGE" => Ok(compaction_config::CompactionMode::Range),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for CompactionGroup {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.id != 0 {
len += 1;
}
if self.compaction_config.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.CompactionGroup", len)?;
if self.id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?;
}
if let Some(v) = self.compaction_config.as_ref() {
struct_ser.serialize_field("compactionConfig", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CompactionGroup {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"id",
"compaction_config",
"compactionConfig",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Id,
CompactionConfig,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"id" => Ok(GeneratedField::Id),
"compactionConfig" | "compaction_config" => Ok(GeneratedField::CompactionConfig),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CompactionGroup;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.CompactionGroup")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CompactionGroup, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut id__ = None;
let mut compaction_config__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Id => {
if id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CompactionConfig => {
if compaction_config__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionConfig"));
}
compaction_config__ = map_.next_value()?;
}
}
}
Ok(CompactionGroup {
id: id__.unwrap_or_default(),
compaction_config: compaction_config__,
})
}
}
deserializer.deserialize_struct("hummock.CompactionGroup", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CompactionGroupInfo {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.id != 0 {
len += 1;
}
if self.parent_id != 0 {
len += 1;
}
if !self.member_table_ids.is_empty() {
len += 1;
}
if self.compaction_config.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.CompactionGroupInfo", len)?;
if self.id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?;
}
if self.parent_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("parentId", ToString::to_string(&self.parent_id).as_str())?;
}
if !self.member_table_ids.is_empty() {
struct_ser.serialize_field("memberTableIds", &self.member_table_ids)?;
}
if let Some(v) = self.compaction_config.as_ref() {
struct_ser.serialize_field("compactionConfig", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CompactionGroupInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"id",
"parent_id",
"parentId",
"member_table_ids",
"memberTableIds",
"compaction_config",
"compactionConfig",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Id,
ParentId,
MemberTableIds,
CompactionConfig,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"id" => Ok(GeneratedField::Id),
"parentId" | "parent_id" => Ok(GeneratedField::ParentId),
"memberTableIds" | "member_table_ids" => Ok(GeneratedField::MemberTableIds),
"compactionConfig" | "compaction_config" => Ok(GeneratedField::CompactionConfig),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CompactionGroupInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.CompactionGroupInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CompactionGroupInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut id__ = None;
let mut parent_id__ = None;
let mut member_table_ids__ = None;
let mut compaction_config__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Id => {
if id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::ParentId => {
if parent_id__.is_some() {
return Err(serde::de::Error::duplicate_field("parentId"));
}
parent_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::MemberTableIds => {
if member_table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("memberTableIds"));
}
member_table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::CompactionConfig => {
if compaction_config__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionConfig"));
}
compaction_config__ = map_.next_value()?;
}
}
}
Ok(CompactionGroupInfo {
id: id__.unwrap_or_default(),
parent_id: parent_id__.unwrap_or_default(),
member_table_ids: member_table_ids__.unwrap_or_default(),
compaction_config: compaction_config__,
})
}
}
deserializer.deserialize_struct("hummock.CompactionGroupInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CompatibilityVersion {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::VersionUnspecified => "VERSION_UNSPECIFIED",
Self::NoTrivialSplit => "NO_TRIVIAL_SPLIT",
Self::NoMemberTableIds => "NO_MEMBER_TABLE_IDS",
Self::SplitGroupByTableId => "SPLIT_GROUP_BY_TABLE_ID",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for CompatibilityVersion {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"VERSION_UNSPECIFIED",
"NO_TRIVIAL_SPLIT",
"NO_MEMBER_TABLE_IDS",
"SPLIT_GROUP_BY_TABLE_ID",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CompatibilityVersion;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"VERSION_UNSPECIFIED" => Ok(CompatibilityVersion::VersionUnspecified),
"NO_TRIVIAL_SPLIT" => Ok(CompatibilityVersion::NoTrivialSplit),
"NO_MEMBER_TABLE_IDS" => Ok(CompatibilityVersion::NoMemberTableIds),
"SPLIT_GROUP_BY_TABLE_ID" => Ok(CompatibilityVersion::SplitGroupByTableId),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for DisableCommitEpochRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.DisableCommitEpochRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DisableCommitEpochRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DisableCommitEpochRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.DisableCommitEpochRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DisableCommitEpochRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(DisableCommitEpochRequest {
})
}
}
deserializer.deserialize_struct("hummock.DisableCommitEpochRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DisableCommitEpochResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.current_version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.DisableCommitEpochResponse", len)?;
if let Some(v) = self.current_version.as_ref() {
struct_ser.serialize_field("currentVersion", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DisableCommitEpochResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"current_version",
"currentVersion",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CurrentVersion,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"currentVersion" | "current_version" => Ok(GeneratedField::CurrentVersion),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DisableCommitEpochResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.DisableCommitEpochResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DisableCommitEpochResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut current_version__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CurrentVersion => {
if current_version__.is_some() {
return Err(serde::de::Error::duplicate_field("currentVersion"));
}
current_version__ = map_.next_value()?;
}
}
}
Ok(DisableCommitEpochResponse {
current_version: current_version__,
})
}
}
deserializer.deserialize_struct("hummock.DisableCommitEpochResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for EpochNewChangeLog {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.old_value.is_empty() {
len += 1;
}
if !self.new_value.is_empty() {
len += 1;
}
if !self.epochs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.EpochNewChangeLog", len)?;
if !self.old_value.is_empty() {
struct_ser.serialize_field("oldValue", &self.old_value)?;
}
if !self.new_value.is_empty() {
struct_ser.serialize_field("newValue", &self.new_value)?;
}
if !self.epochs.is_empty() {
struct_ser.serialize_field("epochs", &self.epochs.iter().map(ToString::to_string).collect::<Vec<_>>())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for EpochNewChangeLog {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"old_value",
"oldValue",
"new_value",
"newValue",
"epochs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
OldValue,
NewValue,
Epochs,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"oldValue" | "old_value" => Ok(GeneratedField::OldValue),
"newValue" | "new_value" => Ok(GeneratedField::NewValue),
"epochs" => Ok(GeneratedField::Epochs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = EpochNewChangeLog;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.EpochNewChangeLog")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<EpochNewChangeLog, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut old_value__ = None;
let mut new_value__ = None;
let mut epochs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::OldValue => {
if old_value__.is_some() {
return Err(serde::de::Error::duplicate_field("oldValue"));
}
old_value__ = Some(map_.next_value()?);
}
GeneratedField::NewValue => {
if new_value__.is_some() {
return Err(serde::de::Error::duplicate_field("newValue"));
}
new_value__ = Some(map_.next_value()?);
}
GeneratedField::Epochs => {
if epochs__.is_some() {
return Err(serde::de::Error::duplicate_field("epochs"));
}
epochs__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(EpochNewChangeLog {
old_value: old_value__.unwrap_or_default(),
new_value: new_value__.unwrap_or_default(),
epochs: epochs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.EpochNewChangeLog", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for FullScanTask {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.sst_retention_watermark != 0 {
len += 1;
}
if self.prefix.is_some() {
len += 1;
}
if self.start_after.is_some() {
len += 1;
}
if self.limit.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.FullScanTask", len)?;
if self.sst_retention_watermark != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("sstRetentionWatermark", ToString::to_string(&self.sst_retention_watermark).as_str())?;
}
if let Some(v) = self.prefix.as_ref() {
struct_ser.serialize_field("prefix", v)?;
}
if let Some(v) = self.start_after.as_ref() {
struct_ser.serialize_field("startAfter", v)?;
}
if let Some(v) = self.limit.as_ref() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("limit", ToString::to_string(&v).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for FullScanTask {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"sst_retention_watermark",
"sstRetentionWatermark",
"prefix",
"start_after",
"startAfter",
"limit",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SstRetentionWatermark,
Prefix,
StartAfter,
Limit,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"sstRetentionWatermark" | "sst_retention_watermark" => Ok(GeneratedField::SstRetentionWatermark),
"prefix" => Ok(GeneratedField::Prefix),
"startAfter" | "start_after" => Ok(GeneratedField::StartAfter),
"limit" => Ok(GeneratedField::Limit),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = FullScanTask;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.FullScanTask")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<FullScanTask, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut sst_retention_watermark__ = None;
let mut prefix__ = None;
let mut start_after__ = None;
let mut limit__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SstRetentionWatermark => {
if sst_retention_watermark__.is_some() {
return Err(serde::de::Error::duplicate_field("sstRetentionWatermark"));
}
sst_retention_watermark__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Prefix => {
if prefix__.is_some() {
return Err(serde::de::Error::duplicate_field("prefix"));
}
prefix__ = map_.next_value()?;
}
GeneratedField::StartAfter => {
if start_after__.is_some() {
return Err(serde::de::Error::duplicate_field("startAfter"));
}
start_after__ = map_.next_value()?;
}
GeneratedField::Limit => {
if limit__.is_some() {
return Err(serde::de::Error::duplicate_field("limit"));
}
limit__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
}
}
Ok(FullScanTask {
sst_retention_watermark: sst_retention_watermark__.unwrap_or_default(),
prefix: prefix__,
start_after: start_after__,
limit: limit__,
})
}
}
deserializer.deserialize_struct("hummock.FullScanTask", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetAssignedCompactTaskNumRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.GetAssignedCompactTaskNumRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetAssignedCompactTaskNumRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetAssignedCompactTaskNumRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GetAssignedCompactTaskNumRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetAssignedCompactTaskNumRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GetAssignedCompactTaskNumRequest {
})
}
}
deserializer.deserialize_struct("hummock.GetAssignedCompactTaskNumRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetAssignedCompactTaskNumResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.num_tasks != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.GetAssignedCompactTaskNumResponse", len)?;
if self.num_tasks != 0 {
struct_ser.serialize_field("numTasks", &self.num_tasks)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetAssignedCompactTaskNumResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"num_tasks",
"numTasks",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
NumTasks,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"numTasks" | "num_tasks" => Ok(GeneratedField::NumTasks),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetAssignedCompactTaskNumResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GetAssignedCompactTaskNumResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetAssignedCompactTaskNumResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut num_tasks__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::NumTasks => {
if num_tasks__.is_some() {
return Err(serde::de::Error::duplicate_field("numTasks"));
}
num_tasks__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(GetAssignedCompactTaskNumResponse {
num_tasks: num_tasks__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.GetAssignedCompactTaskNumResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetCompactionScoreRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.compaction_group_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.GetCompactionScoreRequest", len)?;
if self.compaction_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("compactionGroupId", ToString::to_string(&self.compaction_group_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetCompactionScoreRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"compaction_group_id",
"compactionGroupId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CompactionGroupId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"compactionGroupId" | "compaction_group_id" => Ok(GeneratedField::CompactionGroupId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetCompactionScoreRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GetCompactionScoreRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetCompactionScoreRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut compaction_group_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CompactionGroupId => {
if compaction_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroupId"));
}
compaction_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(GetCompactionScoreRequest {
compaction_group_id: compaction_group_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.GetCompactionScoreRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetCompactionScoreResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.compaction_group_id != 0 {
len += 1;
}
if !self.scores.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.GetCompactionScoreResponse", len)?;
if self.compaction_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("compactionGroupId", ToString::to_string(&self.compaction_group_id).as_str())?;
}
if !self.scores.is_empty() {
struct_ser.serialize_field("scores", &self.scores)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetCompactionScoreResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"compaction_group_id",
"compactionGroupId",
"scores",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CompactionGroupId,
Scores,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"compactionGroupId" | "compaction_group_id" => Ok(GeneratedField::CompactionGroupId),
"scores" => Ok(GeneratedField::Scores),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetCompactionScoreResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GetCompactionScoreResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetCompactionScoreResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut compaction_group_id__ = None;
let mut scores__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CompactionGroupId => {
if compaction_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroupId"));
}
compaction_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Scores => {
if scores__.is_some() {
return Err(serde::de::Error::duplicate_field("scores"));
}
scores__ = Some(map_.next_value()?);
}
}
}
Ok(GetCompactionScoreResponse {
compaction_group_id: compaction_group_id__.unwrap_or_default(),
scores: scores__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.GetCompactionScoreResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for get_compaction_score_response::PickerInfo {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.score != 0 {
len += 1;
}
if self.select_level != 0 {
len += 1;
}
if self.target_level != 0 {
len += 1;
}
if !self.picker_type.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.GetCompactionScoreResponse.PickerInfo", len)?;
if self.score != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("score", ToString::to_string(&self.score).as_str())?;
}
if self.select_level != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("selectLevel", ToString::to_string(&self.select_level).as_str())?;
}
if self.target_level != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("targetLevel", ToString::to_string(&self.target_level).as_str())?;
}
if !self.picker_type.is_empty() {
struct_ser.serialize_field("pickerType", &self.picker_type)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for get_compaction_score_response::PickerInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"score",
"select_level",
"selectLevel",
"target_level",
"targetLevel",
"picker_type",
"pickerType",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Score,
SelectLevel,
TargetLevel,
PickerType,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"score" => Ok(GeneratedField::Score),
"selectLevel" | "select_level" => Ok(GeneratedField::SelectLevel),
"targetLevel" | "target_level" => Ok(GeneratedField::TargetLevel),
"pickerType" | "picker_type" => Ok(GeneratedField::PickerType),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = get_compaction_score_response::PickerInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GetCompactionScoreResponse.PickerInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<get_compaction_score_response::PickerInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut score__ = None;
let mut select_level__ = None;
let mut target_level__ = None;
let mut picker_type__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Score => {
if score__.is_some() {
return Err(serde::de::Error::duplicate_field("score"));
}
score__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SelectLevel => {
if select_level__.is_some() {
return Err(serde::de::Error::duplicate_field("selectLevel"));
}
select_level__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TargetLevel => {
if target_level__.is_some() {
return Err(serde::de::Error::duplicate_field("targetLevel"));
}
target_level__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::PickerType => {
if picker_type__.is_some() {
return Err(serde::de::Error::duplicate_field("pickerType"));
}
picker_type__ = Some(map_.next_value()?);
}
}
}
Ok(get_compaction_score_response::PickerInfo {
score: score__.unwrap_or_default(),
select_level: select_level__.unwrap_or_default(),
target_level: target_level__.unwrap_or_default(),
picker_type: picker_type__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.GetCompactionScoreResponse.PickerInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetCurrentVersionRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.GetCurrentVersionRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetCurrentVersionRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetCurrentVersionRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GetCurrentVersionRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetCurrentVersionRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GetCurrentVersionRequest {
})
}
}
deserializer.deserialize_struct("hummock.GetCurrentVersionRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetCurrentVersionResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.status.is_some() {
len += 1;
}
if self.current_version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.GetCurrentVersionResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.current_version.as_ref() {
struct_ser.serialize_field("currentVersion", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetCurrentVersionResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"current_version",
"currentVersion",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
CurrentVersion,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"status" => Ok(GeneratedField::Status),
"currentVersion" | "current_version" => Ok(GeneratedField::CurrentVersion),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetCurrentVersionResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GetCurrentVersionResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetCurrentVersionResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut current_version__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Status => {
if status__.is_some() {
return Err(serde::de::Error::duplicate_field("status"));
}
status__ = map_.next_value()?;
}
GeneratedField::CurrentVersion => {
if current_version__.is_some() {
return Err(serde::de::Error::duplicate_field("currentVersion"));
}
current_version__ = map_.next_value()?;
}
}
}
Ok(GetCurrentVersionResponse {
status: status__,
current_version: current_version__,
})
}
}
deserializer.deserialize_struct("hummock.GetCurrentVersionResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetNewSstIdsRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.number != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.GetNewSstIdsRequest", len)?;
if self.number != 0 {
struct_ser.serialize_field("number", &self.number)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetNewSstIdsRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"number",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Number,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"number" => Ok(GeneratedField::Number),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetNewSstIdsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GetNewSstIdsRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetNewSstIdsRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut number__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Number => {
if number__.is_some() {
return Err(serde::de::Error::duplicate_field("number"));
}
number__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(GetNewSstIdsRequest {
number: number__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.GetNewSstIdsRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetNewSstIdsResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.status.is_some() {
len += 1;
}
if self.start_id != 0 {
len += 1;
}
if self.end_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.GetNewSstIdsResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if self.start_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("startId", ToString::to_string(&self.start_id).as_str())?;
}
if self.end_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("endId", ToString::to_string(&self.end_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetNewSstIdsResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"start_id",
"startId",
"end_id",
"endId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
StartId,
EndId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"status" => Ok(GeneratedField::Status),
"startId" | "start_id" => Ok(GeneratedField::StartId),
"endId" | "end_id" => Ok(GeneratedField::EndId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetNewSstIdsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GetNewSstIdsResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetNewSstIdsResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut start_id__ = None;
let mut end_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Status => {
if status__.is_some() {
return Err(serde::de::Error::duplicate_field("status"));
}
status__ = map_.next_value()?;
}
GeneratedField::StartId => {
if start_id__.is_some() {
return Err(serde::de::Error::duplicate_field("startId"));
}
start_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::EndId => {
if end_id__.is_some() {
return Err(serde::de::Error::duplicate_field("endId"));
}
end_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(GetNewSstIdsResponse {
status: status__,
start_id: start_id__.unwrap_or_default(),
end_id: end_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.GetNewSstIdsResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetVersionByEpochRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.epoch != 0 {
len += 1;
}
if self.table_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.GetVersionByEpochRequest", len)?;
if self.epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
}
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetVersionByEpochRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"epoch",
"table_id",
"tableId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Epoch,
TableId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"epoch" => Ok(GeneratedField::Epoch),
"tableId" | "table_id" => Ok(GeneratedField::TableId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetVersionByEpochRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GetVersionByEpochRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetVersionByEpochRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut epoch__ = None;
let mut table_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Epoch => {
if epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("epoch"));
}
epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableId => {
if table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(GetVersionByEpochRequest {
epoch: epoch__.unwrap_or_default(),
table_id: table_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.GetVersionByEpochRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetVersionByEpochResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.GetVersionByEpochResponse", len)?;
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetVersionByEpochResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Version,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"version" => Ok(GeneratedField::Version),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetVersionByEpochResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GetVersionByEpochResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetVersionByEpochResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut version__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(GetVersionByEpochResponse {
version: version__,
})
}
}
deserializer.deserialize_struct("hummock.GetVersionByEpochResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GroupConstruct {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.group_config.is_some() {
len += 1;
}
if self.parent_group_id != 0 {
len += 1;
}
if !self.table_ids.is_empty() {
len += 1;
}
if self.group_id != 0 {
len += 1;
}
if self.new_sst_start_id != 0 {
len += 1;
}
if self.version != 0 {
len += 1;
}
if self.split_key.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.GroupConstruct", len)?;
if let Some(v) = self.group_config.as_ref() {
struct_ser.serialize_field("groupConfig", v)?;
}
if self.parent_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("parentGroupId", ToString::to_string(&self.parent_group_id).as_str())?;
}
if !self.table_ids.is_empty() {
struct_ser.serialize_field("tableIds", &self.table_ids)?;
}
if self.group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?;
}
if self.new_sst_start_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("newSstStartId", ToString::to_string(&self.new_sst_start_id).as_str())?;
}
if self.version != 0 {
let v = CompatibilityVersion::try_from(self.version)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.version)))?;
struct_ser.serialize_field("version", &v)?;
}
if let Some(v) = self.split_key.as_ref() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("splitKey", pbjson::private::base64::encode(&v).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GroupConstruct {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"group_config",
"groupConfig",
"parent_group_id",
"parentGroupId",
"table_ids",
"tableIds",
"group_id",
"groupId",
"new_sst_start_id",
"newSstStartId",
"version",
"split_key",
"splitKey",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
GroupConfig,
ParentGroupId,
TableIds,
GroupId,
NewSstStartId,
Version,
SplitKey,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"groupConfig" | "group_config" => Ok(GeneratedField::GroupConfig),
"parentGroupId" | "parent_group_id" => Ok(GeneratedField::ParentGroupId),
"tableIds" | "table_ids" => Ok(GeneratedField::TableIds),
"groupId" | "group_id" => Ok(GeneratedField::GroupId),
"newSstStartId" | "new_sst_start_id" => Ok(GeneratedField::NewSstStartId),
"version" => Ok(GeneratedField::Version),
"splitKey" | "split_key" => Ok(GeneratedField::SplitKey),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GroupConstruct;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GroupConstruct")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GroupConstruct, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut group_config__ = None;
let mut parent_group_id__ = None;
let mut table_ids__ = None;
let mut group_id__ = None;
let mut new_sst_start_id__ = None;
let mut version__ = None;
let mut split_key__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::GroupConfig => {
if group_config__.is_some() {
return Err(serde::de::Error::duplicate_field("groupConfig"));
}
group_config__ = map_.next_value()?;
}
GeneratedField::ParentGroupId => {
if parent_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("parentGroupId"));
}
parent_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableIds => {
if table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("tableIds"));
}
table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::GroupId => {
if group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("groupId"));
}
group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::NewSstStartId => {
if new_sst_start_id__.is_some() {
return Err(serde::de::Error::duplicate_field("newSstStartId"));
}
new_sst_start_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = Some(map_.next_value::<CompatibilityVersion>()? as i32);
}
GeneratedField::SplitKey => {
if split_key__.is_some() {
return Err(serde::de::Error::duplicate_field("splitKey"));
}
split_key__ =
map_.next_value::<::std::option::Option<::pbjson::private::BytesDeserialize<_>>>()?.map(|x| x.0)
;
}
}
}
Ok(GroupConstruct {
group_config: group_config__,
parent_group_id: parent_group_id__.unwrap_or_default(),
table_ids: table_ids__.unwrap_or_default(),
group_id: group_id__.unwrap_or_default(),
new_sst_start_id: new_sst_start_id__.unwrap_or_default(),
version: version__.unwrap_or_default(),
split_key: split_key__,
})
}
}
deserializer.deserialize_struct("hummock.GroupConstruct", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GroupDelta {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.delta_type.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.GroupDelta", len)?;
if let Some(v) = self.delta_type.as_ref() {
match v {
group_delta::DeltaType::IntraLevel(v) => {
struct_ser.serialize_field("intraLevel", v)?;
}
group_delta::DeltaType::GroupConstruct(v) => {
struct_ser.serialize_field("groupConstruct", v)?;
}
group_delta::DeltaType::GroupDestroy(v) => {
struct_ser.serialize_field("groupDestroy", v)?;
}
group_delta::DeltaType::GroupMerge(v) => {
struct_ser.serialize_field("groupMerge", v)?;
}
group_delta::DeltaType::NewL0SubLevel(v) => {
struct_ser.serialize_field("newL0SubLevel", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GroupDelta {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"intra_level",
"intraLevel",
"group_construct",
"groupConstruct",
"group_destroy",
"groupDestroy",
"group_merge",
"groupMerge",
"new_l0_sub_level",
"newL0SubLevel",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
IntraLevel,
GroupConstruct,
GroupDestroy,
GroupMerge,
NewL0SubLevel,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"intraLevel" | "intra_level" => Ok(GeneratedField::IntraLevel),
"groupConstruct" | "group_construct" => Ok(GeneratedField::GroupConstruct),
"groupDestroy" | "group_destroy" => Ok(GeneratedField::GroupDestroy),
"groupMerge" | "group_merge" => Ok(GeneratedField::GroupMerge),
"newL0SubLevel" | "new_l0_sub_level" => Ok(GeneratedField::NewL0SubLevel),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GroupDelta;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GroupDelta")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GroupDelta, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut delta_type__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::IntraLevel => {
if delta_type__.is_some() {
return Err(serde::de::Error::duplicate_field("intraLevel"));
}
delta_type__ = map_.next_value::<::std::option::Option<_>>()?.map(group_delta::DeltaType::IntraLevel)
;
}
GeneratedField::GroupConstruct => {
if delta_type__.is_some() {
return Err(serde::de::Error::duplicate_field("groupConstruct"));
}
delta_type__ = map_.next_value::<::std::option::Option<_>>()?.map(group_delta::DeltaType::GroupConstruct)
;
}
GeneratedField::GroupDestroy => {
if delta_type__.is_some() {
return Err(serde::de::Error::duplicate_field("groupDestroy"));
}
delta_type__ = map_.next_value::<::std::option::Option<_>>()?.map(group_delta::DeltaType::GroupDestroy)
;
}
GeneratedField::GroupMerge => {
if delta_type__.is_some() {
return Err(serde::de::Error::duplicate_field("groupMerge"));
}
delta_type__ = map_.next_value::<::std::option::Option<_>>()?.map(group_delta::DeltaType::GroupMerge)
;
}
GeneratedField::NewL0SubLevel => {
if delta_type__.is_some() {
return Err(serde::de::Error::duplicate_field("newL0SubLevel"));
}
delta_type__ = map_.next_value::<::std::option::Option<_>>()?.map(group_delta::DeltaType::NewL0SubLevel)
;
}
}
}
Ok(GroupDelta {
delta_type: delta_type__,
})
}
}
deserializer.deserialize_struct("hummock.GroupDelta", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GroupDestroy {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.GroupDestroy", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GroupDestroy {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GroupDestroy;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GroupDestroy")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GroupDestroy, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GroupDestroy {
})
}
}
deserializer.deserialize_struct("hummock.GroupDestroy", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GroupMerge {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.left_group_id != 0 {
len += 1;
}
if self.right_group_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.GroupMerge", len)?;
if self.left_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("leftGroupId", ToString::to_string(&self.left_group_id).as_str())?;
}
if self.right_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("rightGroupId", ToString::to_string(&self.right_group_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GroupMerge {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"left_group_id",
"leftGroupId",
"right_group_id",
"rightGroupId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
LeftGroupId,
RightGroupId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"leftGroupId" | "left_group_id" => Ok(GeneratedField::LeftGroupId),
"rightGroupId" | "right_group_id" => Ok(GeneratedField::RightGroupId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GroupMerge;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.GroupMerge")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GroupMerge, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut left_group_id__ = None;
let mut right_group_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::LeftGroupId => {
if left_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("leftGroupId"));
}
left_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::RightGroupId => {
if right_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("rightGroupId"));
}
right_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(GroupMerge {
left_group_id: left_group_id__.unwrap_or_default(),
right_group_id: right_group_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.GroupMerge", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HummockPinnedSnapshot {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.context_id != 0 {
len += 1;
}
if self.minimal_pinned_snapshot != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.HummockPinnedSnapshot", len)?;
if self.context_id != 0 {
struct_ser.serialize_field("contextId", &self.context_id)?;
}
if self.minimal_pinned_snapshot != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("minimalPinnedSnapshot", ToString::to_string(&self.minimal_pinned_snapshot).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HummockPinnedSnapshot {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"context_id",
"contextId",
"minimal_pinned_snapshot",
"minimalPinnedSnapshot",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ContextId,
MinimalPinnedSnapshot,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"contextId" | "context_id" => Ok(GeneratedField::ContextId),
"minimalPinnedSnapshot" | "minimal_pinned_snapshot" => Ok(GeneratedField::MinimalPinnedSnapshot),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = HummockPinnedSnapshot;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.HummockPinnedSnapshot")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HummockPinnedSnapshot, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut context_id__ = None;
let mut minimal_pinned_snapshot__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ContextId => {
if context_id__.is_some() {
return Err(serde::de::Error::duplicate_field("contextId"));
}
context_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::MinimalPinnedSnapshot => {
if minimal_pinned_snapshot__.is_some() {
return Err(serde::de::Error::duplicate_field("minimalPinnedSnapshot"));
}
minimal_pinned_snapshot__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(HummockPinnedSnapshot {
context_id: context_id__.unwrap_or_default(),
minimal_pinned_snapshot: minimal_pinned_snapshot__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.HummockPinnedSnapshot", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HummockPinnedVersion {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.context_id != 0 {
len += 1;
}
if self.min_pinned_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.HummockPinnedVersion", len)?;
if self.context_id != 0 {
struct_ser.serialize_field("contextId", &self.context_id)?;
}
if self.min_pinned_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("minPinnedId", ToString::to_string(&self.min_pinned_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HummockPinnedVersion {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"context_id",
"contextId",
"min_pinned_id",
"minPinnedId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ContextId,
MinPinnedId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"contextId" | "context_id" => Ok(GeneratedField::ContextId),
"minPinnedId" | "min_pinned_id" => Ok(GeneratedField::MinPinnedId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = HummockPinnedVersion;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.HummockPinnedVersion")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HummockPinnedVersion, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut context_id__ = None;
let mut min_pinned_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ContextId => {
if context_id__.is_some() {
return Err(serde::de::Error::duplicate_field("contextId"));
}
context_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::MinPinnedId => {
if min_pinned_id__.is_some() {
return Err(serde::de::Error::duplicate_field("minPinnedId"));
}
min_pinned_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(HummockPinnedVersion {
context_id: context_id__.unwrap_or_default(),
min_pinned_id: min_pinned_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.HummockPinnedVersion", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HummockVersion {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.id != 0 {
len += 1;
}
if !self.levels.is_empty() {
len += 1;
}
if self.max_committed_epoch != 0 {
len += 1;
}
if !self.table_watermarks.is_empty() {
len += 1;
}
if !self.table_change_logs.is_empty() {
len += 1;
}
if !self.state_table_info.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.HummockVersion", len)?;
if self.id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?;
}
if !self.levels.is_empty() {
struct_ser.serialize_field("levels", &self.levels)?;
}
if self.max_committed_epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("maxCommittedEpoch", ToString::to_string(&self.max_committed_epoch).as_str())?;
}
if !self.table_watermarks.is_empty() {
struct_ser.serialize_field("tableWatermarks", &self.table_watermarks)?;
}
if !self.table_change_logs.is_empty() {
struct_ser.serialize_field("tableChangeLogs", &self.table_change_logs)?;
}
if !self.state_table_info.is_empty() {
struct_ser.serialize_field("stateTableInfo", &self.state_table_info)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HummockVersion {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"id",
"levels",
"max_committed_epoch",
"maxCommittedEpoch",
"table_watermarks",
"tableWatermarks",
"table_change_logs",
"tableChangeLogs",
"state_table_info",
"stateTableInfo",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Id,
Levels,
MaxCommittedEpoch,
TableWatermarks,
TableChangeLogs,
StateTableInfo,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"id" => Ok(GeneratedField::Id),
"levels" => Ok(GeneratedField::Levels),
"maxCommittedEpoch" | "max_committed_epoch" => Ok(GeneratedField::MaxCommittedEpoch),
"tableWatermarks" | "table_watermarks" => Ok(GeneratedField::TableWatermarks),
"tableChangeLogs" | "table_change_logs" => Ok(GeneratedField::TableChangeLogs),
"stateTableInfo" | "state_table_info" => Ok(GeneratedField::StateTableInfo),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = HummockVersion;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.HummockVersion")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HummockVersion, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut id__ = None;
let mut levels__ = None;
let mut max_committed_epoch__ = None;
let mut table_watermarks__ = None;
let mut table_change_logs__ = None;
let mut state_table_info__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Id => {
if id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Levels => {
if levels__.is_some() {
return Err(serde::de::Error::duplicate_field("levels"));
}
levels__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u64>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::MaxCommittedEpoch => {
if max_committed_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("maxCommittedEpoch"));
}
max_committed_epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableWatermarks => {
if table_watermarks__.is_some() {
return Err(serde::de::Error::duplicate_field("tableWatermarks"));
}
table_watermarks__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::TableChangeLogs => {
if table_change_logs__.is_some() {
return Err(serde::de::Error::duplicate_field("tableChangeLogs"));
}
table_change_logs__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::StateTableInfo => {
if state_table_info__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTableInfo"));
}
state_table_info__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(HummockVersion {
id: id__.unwrap_or_default(),
levels: levels__.unwrap_or_default(),
max_committed_epoch: max_committed_epoch__.unwrap_or_default(),
table_watermarks: table_watermarks__.unwrap_or_default(),
table_change_logs: table_change_logs__.unwrap_or_default(),
state_table_info: state_table_info__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.HummockVersion", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for hummock_version::Levels {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.levels.is_empty() {
len += 1;
}
if self.l0.is_some() {
len += 1;
}
if self.group_id != 0 {
len += 1;
}
if self.parent_group_id != 0 {
len += 1;
}
if !self.member_table_ids.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.HummockVersion.Levels", len)?;
if !self.levels.is_empty() {
struct_ser.serialize_field("levels", &self.levels)?;
}
if let Some(v) = self.l0.as_ref() {
struct_ser.serialize_field("l0", v)?;
}
if self.group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?;
}
if self.parent_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("parentGroupId", ToString::to_string(&self.parent_group_id).as_str())?;
}
if !self.member_table_ids.is_empty() {
struct_ser.serialize_field("memberTableIds", &self.member_table_ids)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for hummock_version::Levels {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"levels",
"l0",
"group_id",
"groupId",
"parent_group_id",
"parentGroupId",
"member_table_ids",
"memberTableIds",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Levels,
L0,
GroupId,
ParentGroupId,
MemberTableIds,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"levels" => Ok(GeneratedField::Levels),
"l0" => Ok(GeneratedField::L0),
"groupId" | "group_id" => Ok(GeneratedField::GroupId),
"parentGroupId" | "parent_group_id" => Ok(GeneratedField::ParentGroupId),
"memberTableIds" | "member_table_ids" => Ok(GeneratedField::MemberTableIds),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = hummock_version::Levels;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.HummockVersion.Levels")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<hummock_version::Levels, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut levels__ = None;
let mut l0__ = None;
let mut group_id__ = None;
let mut parent_group_id__ = None;
let mut member_table_ids__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Levels => {
if levels__.is_some() {
return Err(serde::de::Error::duplicate_field("levels"));
}
levels__ = Some(map_.next_value()?);
}
GeneratedField::L0 => {
if l0__.is_some() {
return Err(serde::de::Error::duplicate_field("l0"));
}
l0__ = map_.next_value()?;
}
GeneratedField::GroupId => {
if group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("groupId"));
}
group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::ParentGroupId => {
if parent_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("parentGroupId"));
}
parent_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::MemberTableIds => {
if member_table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("memberTableIds"));
}
member_table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(hummock_version::Levels {
levels: levels__.unwrap_or_default(),
l0: l0__,
group_id: group_id__.unwrap_or_default(),
parent_group_id: parent_group_id__.unwrap_or_default(),
member_table_ids: member_table_ids__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.HummockVersion.Levels", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HummockVersionArchive {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.version.is_some() {
len += 1;
}
if !self.version_deltas.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.HummockVersionArchive", len)?;
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
if !self.version_deltas.is_empty() {
struct_ser.serialize_field("versionDeltas", &self.version_deltas)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HummockVersionArchive {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"version",
"version_deltas",
"versionDeltas",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Version,
VersionDeltas,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"version" => Ok(GeneratedField::Version),
"versionDeltas" | "version_deltas" => Ok(GeneratedField::VersionDeltas),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = HummockVersionArchive;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.HummockVersionArchive")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HummockVersionArchive, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut version__ = None;
let mut version_deltas__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
GeneratedField::VersionDeltas => {
if version_deltas__.is_some() {
return Err(serde::de::Error::duplicate_field("versionDeltas"));
}
version_deltas__ = Some(map_.next_value()?);
}
}
}
Ok(HummockVersionArchive {
version: version__,
version_deltas: version_deltas__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.HummockVersionArchive", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HummockVersionCheckpoint {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.version.is_some() {
len += 1;
}
if !self.stale_objects.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.HummockVersionCheckpoint", len)?;
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
if !self.stale_objects.is_empty() {
struct_ser.serialize_field("staleObjects", &self.stale_objects)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HummockVersionCheckpoint {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"version",
"stale_objects",
"staleObjects",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Version,
StaleObjects,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"version" => Ok(GeneratedField::Version),
"staleObjects" | "stale_objects" => Ok(GeneratedField::StaleObjects),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = HummockVersionCheckpoint;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.HummockVersionCheckpoint")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HummockVersionCheckpoint, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut version__ = None;
let mut stale_objects__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
GeneratedField::StaleObjects => {
if stale_objects__.is_some() {
return Err(serde::de::Error::duplicate_field("staleObjects"));
}
stale_objects__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u64>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(HummockVersionCheckpoint {
version: version__,
stale_objects: stale_objects__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.HummockVersionCheckpoint", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for hummock_version_checkpoint::StaleObjects {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.id.is_empty() {
len += 1;
}
if self.total_file_size != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.HummockVersionCheckpoint.StaleObjects", len)?;
if !self.id.is_empty() {
struct_ser.serialize_field("id", &self.id.iter().map(ToString::to_string).collect::<Vec<_>>())?;
}
if self.total_file_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("totalFileSize", ToString::to_string(&self.total_file_size).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for hummock_version_checkpoint::StaleObjects {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"id",
"total_file_size",
"totalFileSize",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Id,
TotalFileSize,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"id" => Ok(GeneratedField::Id),
"totalFileSize" | "total_file_size" => Ok(GeneratedField::TotalFileSize),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = hummock_version_checkpoint::StaleObjects;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.HummockVersionCheckpoint.StaleObjects")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<hummock_version_checkpoint::StaleObjects, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut id__ = None;
let mut total_file_size__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Id => {
if id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
id__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::TotalFileSize => {
if total_file_size__.is_some() {
return Err(serde::de::Error::duplicate_field("totalFileSize"));
}
total_file_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(hummock_version_checkpoint::StaleObjects {
id: id__.unwrap_or_default(),
total_file_size: total_file_size__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.HummockVersionCheckpoint.StaleObjects", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HummockVersionDelta {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.id != 0 {
len += 1;
}
if self.prev_id != 0 {
len += 1;
}
if !self.group_deltas.is_empty() {
len += 1;
}
if self.max_committed_epoch != 0 {
len += 1;
}
if self.trivial_move {
len += 1;
}
if !self.new_table_watermarks.is_empty() {
len += 1;
}
if !self.removed_table_ids.is_empty() {
len += 1;
}
if !self.change_log_delta.is_empty() {
len += 1;
}
if !self.state_table_info_delta.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.HummockVersionDelta", len)?;
if self.id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?;
}
if self.prev_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("prevId", ToString::to_string(&self.prev_id).as_str())?;
}
if !self.group_deltas.is_empty() {
struct_ser.serialize_field("groupDeltas", &self.group_deltas)?;
}
if self.max_committed_epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("maxCommittedEpoch", ToString::to_string(&self.max_committed_epoch).as_str())?;
}
if self.trivial_move {
struct_ser.serialize_field("trivialMove", &self.trivial_move)?;
}
if !self.new_table_watermarks.is_empty() {
struct_ser.serialize_field("newTableWatermarks", &self.new_table_watermarks)?;
}
if !self.removed_table_ids.is_empty() {
struct_ser.serialize_field("removedTableIds", &self.removed_table_ids)?;
}
if !self.change_log_delta.is_empty() {
struct_ser.serialize_field("changeLogDelta", &self.change_log_delta)?;
}
if !self.state_table_info_delta.is_empty() {
struct_ser.serialize_field("stateTableInfoDelta", &self.state_table_info_delta)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HummockVersionDelta {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"id",
"prev_id",
"prevId",
"group_deltas",
"groupDeltas",
"max_committed_epoch",
"maxCommittedEpoch",
"trivial_move",
"trivialMove",
"new_table_watermarks",
"newTableWatermarks",
"removed_table_ids",
"removedTableIds",
"change_log_delta",
"changeLogDelta",
"state_table_info_delta",
"stateTableInfoDelta",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Id,
PrevId,
GroupDeltas,
MaxCommittedEpoch,
TrivialMove,
NewTableWatermarks,
RemovedTableIds,
ChangeLogDelta,
StateTableInfoDelta,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"id" => Ok(GeneratedField::Id),
"prevId" | "prev_id" => Ok(GeneratedField::PrevId),
"groupDeltas" | "group_deltas" => Ok(GeneratedField::GroupDeltas),
"maxCommittedEpoch" | "max_committed_epoch" => Ok(GeneratedField::MaxCommittedEpoch),
"trivialMove" | "trivial_move" => Ok(GeneratedField::TrivialMove),
"newTableWatermarks" | "new_table_watermarks" => Ok(GeneratedField::NewTableWatermarks),
"removedTableIds" | "removed_table_ids" => Ok(GeneratedField::RemovedTableIds),
"changeLogDelta" | "change_log_delta" => Ok(GeneratedField::ChangeLogDelta),
"stateTableInfoDelta" | "state_table_info_delta" => Ok(GeneratedField::StateTableInfoDelta),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = HummockVersionDelta;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.HummockVersionDelta")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HummockVersionDelta, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut id__ = None;
let mut prev_id__ = None;
let mut group_deltas__ = None;
let mut max_committed_epoch__ = None;
let mut trivial_move__ = None;
let mut new_table_watermarks__ = None;
let mut removed_table_ids__ = None;
let mut change_log_delta__ = None;
let mut state_table_info_delta__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Id => {
if id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::PrevId => {
if prev_id__.is_some() {
return Err(serde::de::Error::duplicate_field("prevId"));
}
prev_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::GroupDeltas => {
if group_deltas__.is_some() {
return Err(serde::de::Error::duplicate_field("groupDeltas"));
}
group_deltas__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u64>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::MaxCommittedEpoch => {
if max_committed_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("maxCommittedEpoch"));
}
max_committed_epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TrivialMove => {
if trivial_move__.is_some() {
return Err(serde::de::Error::duplicate_field("trivialMove"));
}
trivial_move__ = Some(map_.next_value()?);
}
GeneratedField::NewTableWatermarks => {
if new_table_watermarks__.is_some() {
return Err(serde::de::Error::duplicate_field("newTableWatermarks"));
}
new_table_watermarks__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::RemovedTableIds => {
if removed_table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("removedTableIds"));
}
removed_table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::ChangeLogDelta => {
if change_log_delta__.is_some() {
return Err(serde::de::Error::duplicate_field("changeLogDelta"));
}
change_log_delta__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::StateTableInfoDelta => {
if state_table_info_delta__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTableInfoDelta"));
}
state_table_info_delta__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(HummockVersionDelta {
id: id__.unwrap_or_default(),
prev_id: prev_id__.unwrap_or_default(),
group_deltas: group_deltas__.unwrap_or_default(),
max_committed_epoch: max_committed_epoch__.unwrap_or_default(),
trivial_move: trivial_move__.unwrap_or_default(),
new_table_watermarks: new_table_watermarks__.unwrap_or_default(),
removed_table_ids: removed_table_ids__.unwrap_or_default(),
change_log_delta: change_log_delta__.unwrap_or_default(),
state_table_info_delta: state_table_info_delta__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.HummockVersionDelta", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for hummock_version_delta::ChangeLogDelta {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.new_log.is_some() {
len += 1;
}
if self.truncate_epoch != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.HummockVersionDelta.ChangeLogDelta", len)?;
if let Some(v) = self.new_log.as_ref() {
struct_ser.serialize_field("newLog", v)?;
}
if self.truncate_epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("truncateEpoch", ToString::to_string(&self.truncate_epoch).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for hummock_version_delta::ChangeLogDelta {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"new_log",
"newLog",
"truncate_epoch",
"truncateEpoch",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
NewLog,
TruncateEpoch,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"newLog" | "new_log" => Ok(GeneratedField::NewLog),
"truncateEpoch" | "truncate_epoch" => Ok(GeneratedField::TruncateEpoch),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = hummock_version_delta::ChangeLogDelta;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.HummockVersionDelta.ChangeLogDelta")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<hummock_version_delta::ChangeLogDelta, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut new_log__ = None;
let mut truncate_epoch__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::NewLog => {
if new_log__.is_some() {
return Err(serde::de::Error::duplicate_field("newLog"));
}
new_log__ = map_.next_value()?;
}
GeneratedField::TruncateEpoch => {
if truncate_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("truncateEpoch"));
}
truncate_epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(hummock_version_delta::ChangeLogDelta {
new_log: new_log__,
truncate_epoch: truncate_epoch__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.HummockVersionDelta.ChangeLogDelta", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for hummock_version_delta::GroupDeltas {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.group_deltas.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.HummockVersionDelta.GroupDeltas", len)?;
if !self.group_deltas.is_empty() {
struct_ser.serialize_field("groupDeltas", &self.group_deltas)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for hummock_version_delta::GroupDeltas {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"group_deltas",
"groupDeltas",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
GroupDeltas,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"groupDeltas" | "group_deltas" => Ok(GeneratedField::GroupDeltas),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = hummock_version_delta::GroupDeltas;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.HummockVersionDelta.GroupDeltas")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<hummock_version_delta::GroupDeltas, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut group_deltas__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::GroupDeltas => {
if group_deltas__.is_some() {
return Err(serde::de::Error::duplicate_field("groupDeltas"));
}
group_deltas__ = Some(map_.next_value()?);
}
}
}
Ok(hummock_version_delta::GroupDeltas {
group_deltas: group_deltas__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.HummockVersionDelta.GroupDeltas", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HummockVersionDeltas {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.version_deltas.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.HummockVersionDeltas", len)?;
if !self.version_deltas.is_empty() {
struct_ser.serialize_field("versionDeltas", &self.version_deltas)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HummockVersionDeltas {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"version_deltas",
"versionDeltas",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
VersionDeltas,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"versionDeltas" | "version_deltas" => Ok(GeneratedField::VersionDeltas),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = HummockVersionDeltas;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.HummockVersionDeltas")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HummockVersionDeltas, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut version_deltas__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::VersionDeltas => {
if version_deltas__.is_some() {
return Err(serde::de::Error::duplicate_field("versionDeltas"));
}
version_deltas__ = Some(map_.next_value()?);
}
}
}
Ok(HummockVersionDeltas {
version_deltas: version_deltas__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.HummockVersionDeltas", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HummockVersionStats {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.hummock_version_id != 0 {
len += 1;
}
if !self.table_stats.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.HummockVersionStats", len)?;
if self.hummock_version_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("hummockVersionId", ToString::to_string(&self.hummock_version_id).as_str())?;
}
if !self.table_stats.is_empty() {
struct_ser.serialize_field("tableStats", &self.table_stats)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HummockVersionStats {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"hummock_version_id",
"hummockVersionId",
"table_stats",
"tableStats",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
HummockVersionId,
TableStats,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"hummockVersionId" | "hummock_version_id" => Ok(GeneratedField::HummockVersionId),
"tableStats" | "table_stats" => Ok(GeneratedField::TableStats),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = HummockVersionStats;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.HummockVersionStats")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HummockVersionStats, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut hummock_version_id__ = None;
let mut table_stats__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::HummockVersionId => {
if hummock_version_id__.is_some() {
return Err(serde::de::Error::duplicate_field("hummockVersionId"));
}
hummock_version_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableStats => {
if table_stats__.is_some() {
return Err(serde::de::Error::duplicate_field("tableStats"));
}
table_stats__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(HummockVersionStats {
hummock_version_id: hummock_version_id__.unwrap_or_default(),
table_stats: table_stats__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.HummockVersionStats", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for InitMetadataForReplayRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.tables.is_empty() {
len += 1;
}
if !self.compaction_groups.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.InitMetadataForReplayRequest", len)?;
if !self.tables.is_empty() {
struct_ser.serialize_field("tables", &self.tables)?;
}
if !self.compaction_groups.is_empty() {
struct_ser.serialize_field("compactionGroups", &self.compaction_groups)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for InitMetadataForReplayRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"tables",
"compaction_groups",
"compactionGroups",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Tables,
CompactionGroups,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"tables" => Ok(GeneratedField::Tables),
"compactionGroups" | "compaction_groups" => Ok(GeneratedField::CompactionGroups),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = InitMetadataForReplayRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.InitMetadataForReplayRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<InitMetadataForReplayRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut tables__ = None;
let mut compaction_groups__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Tables => {
if tables__.is_some() {
return Err(serde::de::Error::duplicate_field("tables"));
}
tables__ = Some(map_.next_value()?);
}
GeneratedField::CompactionGroups => {
if compaction_groups__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroups"));
}
compaction_groups__ = Some(map_.next_value()?);
}
}
}
Ok(InitMetadataForReplayRequest {
tables: tables__.unwrap_or_default(),
compaction_groups: compaction_groups__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.InitMetadataForReplayRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for InitMetadataForReplayResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.InitMetadataForReplayResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for InitMetadataForReplayResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = InitMetadataForReplayResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.InitMetadataForReplayResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<InitMetadataForReplayResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(InitMetadataForReplayResponse {
})
}
}
deserializer.deserialize_struct("hummock.InitMetadataForReplayResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for InputLevel {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.level_idx != 0 {
len += 1;
}
if self.level_type != 0 {
len += 1;
}
if !self.table_infos.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.InputLevel", len)?;
if self.level_idx != 0 {
struct_ser.serialize_field("levelIdx", &self.level_idx)?;
}
if self.level_type != 0 {
let v = LevelType::try_from(self.level_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.level_type)))?;
struct_ser.serialize_field("levelType", &v)?;
}
if !self.table_infos.is_empty() {
struct_ser.serialize_field("tableInfos", &self.table_infos)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for InputLevel {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"level_idx",
"levelIdx",
"level_type",
"levelType",
"table_infos",
"tableInfos",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
LevelIdx,
LevelType,
TableInfos,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"levelIdx" | "level_idx" => Ok(GeneratedField::LevelIdx),
"levelType" | "level_type" => Ok(GeneratedField::LevelType),
"tableInfos" | "table_infos" => Ok(GeneratedField::TableInfos),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = InputLevel;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.InputLevel")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<InputLevel, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut level_idx__ = None;
let mut level_type__ = None;
let mut table_infos__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::LevelIdx => {
if level_idx__.is_some() {
return Err(serde::de::Error::duplicate_field("levelIdx"));
}
level_idx__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::LevelType => {
if level_type__.is_some() {
return Err(serde::de::Error::duplicate_field("levelType"));
}
level_type__ = Some(map_.next_value::<LevelType>()? as i32);
}
GeneratedField::TableInfos => {
if table_infos__.is_some() {
return Err(serde::de::Error::duplicate_field("tableInfos"));
}
table_infos__ = Some(map_.next_value()?);
}
}
}
Ok(InputLevel {
level_idx: level_idx__.unwrap_or_default(),
level_type: level_type__.unwrap_or_default(),
table_infos: table_infos__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.InputLevel", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for IntraLevelDelta {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.level_idx != 0 {
len += 1;
}
if self.l0_sub_level_id != 0 {
len += 1;
}
if !self.removed_table_ids.is_empty() {
len += 1;
}
if !self.inserted_table_infos.is_empty() {
len += 1;
}
if self.vnode_partition_count != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.IntraLevelDelta", len)?;
if self.level_idx != 0 {
struct_ser.serialize_field("levelIdx", &self.level_idx)?;
}
if self.l0_sub_level_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("l0SubLevelId", ToString::to_string(&self.l0_sub_level_id).as_str())?;
}
if !self.removed_table_ids.is_empty() {
struct_ser.serialize_field("removedTableIds", &self.removed_table_ids.iter().map(ToString::to_string).collect::<Vec<_>>())?;
}
if !self.inserted_table_infos.is_empty() {
struct_ser.serialize_field("insertedTableInfos", &self.inserted_table_infos)?;
}
if self.vnode_partition_count != 0 {
struct_ser.serialize_field("vnodePartitionCount", &self.vnode_partition_count)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for IntraLevelDelta {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"level_idx",
"levelIdx",
"l0_sub_level_id",
"l0SubLevelId",
"removed_table_ids",
"removedTableIds",
"inserted_table_infos",
"insertedTableInfos",
"vnode_partition_count",
"vnodePartitionCount",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
LevelIdx,
L0SubLevelId,
RemovedTableIds,
InsertedTableInfos,
VnodePartitionCount,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"levelIdx" | "level_idx" => Ok(GeneratedField::LevelIdx),
"l0SubLevelId" | "l0_sub_level_id" => Ok(GeneratedField::L0SubLevelId),
"removedTableIds" | "removed_table_ids" => Ok(GeneratedField::RemovedTableIds),
"insertedTableInfos" | "inserted_table_infos" => Ok(GeneratedField::InsertedTableInfos),
"vnodePartitionCount" | "vnode_partition_count" => Ok(GeneratedField::VnodePartitionCount),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = IntraLevelDelta;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.IntraLevelDelta")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<IntraLevelDelta, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut level_idx__ = None;
let mut l0_sub_level_id__ = None;
let mut removed_table_ids__ = None;
let mut inserted_table_infos__ = None;
let mut vnode_partition_count__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::LevelIdx => {
if level_idx__.is_some() {
return Err(serde::de::Error::duplicate_field("levelIdx"));
}
level_idx__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::L0SubLevelId => {
if l0_sub_level_id__.is_some() {
return Err(serde::de::Error::duplicate_field("l0SubLevelId"));
}
l0_sub_level_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::RemovedTableIds => {
if removed_table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("removedTableIds"));
}
removed_table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::InsertedTableInfos => {
if inserted_table_infos__.is_some() {
return Err(serde::de::Error::duplicate_field("insertedTableInfos"));
}
inserted_table_infos__ = Some(map_.next_value()?);
}
GeneratedField::VnodePartitionCount => {
if vnode_partition_count__.is_some() {
return Err(serde::de::Error::duplicate_field("vnodePartitionCount"));
}
vnode_partition_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(IntraLevelDelta {
level_idx: level_idx__.unwrap_or_default(),
l0_sub_level_id: l0_sub_level_id__.unwrap_or_default(),
removed_table_ids: removed_table_ids__.unwrap_or_default(),
inserted_table_infos: inserted_table_infos__.unwrap_or_default(),
vnode_partition_count: vnode_partition_count__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.IntraLevelDelta", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for KeyRange {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.left.is_empty() {
len += 1;
}
if !self.right.is_empty() {
len += 1;
}
if self.right_exclusive {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.KeyRange", len)?;
if !self.left.is_empty() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("left", pbjson::private::base64::encode(&self.left).as_str())?;
}
if !self.right.is_empty() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("right", pbjson::private::base64::encode(&self.right).as_str())?;
}
if self.right_exclusive {
struct_ser.serialize_field("rightExclusive", &self.right_exclusive)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for KeyRange {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"left",
"right",
"right_exclusive",
"rightExclusive",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Left,
Right,
RightExclusive,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"left" => Ok(GeneratedField::Left),
"right" => Ok(GeneratedField::Right),
"rightExclusive" | "right_exclusive" => Ok(GeneratedField::RightExclusive),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = KeyRange;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.KeyRange")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<KeyRange, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut left__ = None;
let mut right__ = None;
let mut right_exclusive__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Left => {
if left__.is_some() {
return Err(serde::de::Error::duplicate_field("left"));
}
left__ =
Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0)
;
}
GeneratedField::Right => {
if right__.is_some() {
return Err(serde::de::Error::duplicate_field("right"));
}
right__ =
Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0)
;
}
GeneratedField::RightExclusive => {
if right_exclusive__.is_some() {
return Err(serde::de::Error::duplicate_field("rightExclusive"));
}
right_exclusive__ = Some(map_.next_value()?);
}
}
}
Ok(KeyRange {
left: left__.unwrap_or_default(),
right: right__.unwrap_or_default(),
right_exclusive: right_exclusive__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.KeyRange", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for Level {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.level_idx != 0 {
len += 1;
}
if self.level_type != 0 {
len += 1;
}
if !self.table_infos.is_empty() {
len += 1;
}
if self.total_file_size != 0 {
len += 1;
}
if self.sub_level_id != 0 {
len += 1;
}
if self.uncompressed_file_size != 0 {
len += 1;
}
if self.vnode_partition_count != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.Level", len)?;
if self.level_idx != 0 {
struct_ser.serialize_field("levelIdx", &self.level_idx)?;
}
if self.level_type != 0 {
let v = LevelType::try_from(self.level_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.level_type)))?;
struct_ser.serialize_field("levelType", &v)?;
}
if !self.table_infos.is_empty() {
struct_ser.serialize_field("tableInfos", &self.table_infos)?;
}
if self.total_file_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("totalFileSize", ToString::to_string(&self.total_file_size).as_str())?;
}
if self.sub_level_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("subLevelId", ToString::to_string(&self.sub_level_id).as_str())?;
}
if self.uncompressed_file_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("uncompressedFileSize", ToString::to_string(&self.uncompressed_file_size).as_str())?;
}
if self.vnode_partition_count != 0 {
struct_ser.serialize_field("vnodePartitionCount", &self.vnode_partition_count)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for Level {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"level_idx",
"levelIdx",
"level_type",
"levelType",
"table_infos",
"tableInfos",
"total_file_size",
"totalFileSize",
"sub_level_id",
"subLevelId",
"uncompressed_file_size",
"uncompressedFileSize",
"vnode_partition_count",
"vnodePartitionCount",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
LevelIdx,
LevelType,
TableInfos,
TotalFileSize,
SubLevelId,
UncompressedFileSize,
VnodePartitionCount,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"levelIdx" | "level_idx" => Ok(GeneratedField::LevelIdx),
"levelType" | "level_type" => Ok(GeneratedField::LevelType),
"tableInfos" | "table_infos" => Ok(GeneratedField::TableInfos),
"totalFileSize" | "total_file_size" => Ok(GeneratedField::TotalFileSize),
"subLevelId" | "sub_level_id" => Ok(GeneratedField::SubLevelId),
"uncompressedFileSize" | "uncompressed_file_size" => Ok(GeneratedField::UncompressedFileSize),
"vnodePartitionCount" | "vnode_partition_count" => Ok(GeneratedField::VnodePartitionCount),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = Level;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.Level")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<Level, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut level_idx__ = None;
let mut level_type__ = None;
let mut table_infos__ = None;
let mut total_file_size__ = None;
let mut sub_level_id__ = None;
let mut uncompressed_file_size__ = None;
let mut vnode_partition_count__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::LevelIdx => {
if level_idx__.is_some() {
return Err(serde::de::Error::duplicate_field("levelIdx"));
}
level_idx__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::LevelType => {
if level_type__.is_some() {
return Err(serde::de::Error::duplicate_field("levelType"));
}
level_type__ = Some(map_.next_value::<LevelType>()? as i32);
}
GeneratedField::TableInfos => {
if table_infos__.is_some() {
return Err(serde::de::Error::duplicate_field("tableInfos"));
}
table_infos__ = Some(map_.next_value()?);
}
GeneratedField::TotalFileSize => {
if total_file_size__.is_some() {
return Err(serde::de::Error::duplicate_field("totalFileSize"));
}
total_file_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SubLevelId => {
if sub_level_id__.is_some() {
return Err(serde::de::Error::duplicate_field("subLevelId"));
}
sub_level_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::UncompressedFileSize => {
if uncompressed_file_size__.is_some() {
return Err(serde::de::Error::duplicate_field("uncompressedFileSize"));
}
uncompressed_file_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::VnodePartitionCount => {
if vnode_partition_count__.is_some() {
return Err(serde::de::Error::duplicate_field("vnodePartitionCount"));
}
vnode_partition_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(Level {
level_idx: level_idx__.unwrap_or_default(),
level_type: level_type__.unwrap_or_default(),
table_infos: table_infos__.unwrap_or_default(),
total_file_size: total_file_size__.unwrap_or_default(),
sub_level_id: sub_level_id__.unwrap_or_default(),
uncompressed_file_size: uncompressed_file_size__.unwrap_or_default(),
vnode_partition_count: vnode_partition_count__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.Level", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for LevelHandler {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.level != 0 {
len += 1;
}
if !self.tasks.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.LevelHandler", len)?;
if self.level != 0 {
struct_ser.serialize_field("level", &self.level)?;
}
if !self.tasks.is_empty() {
struct_ser.serialize_field("tasks", &self.tasks)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for LevelHandler {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"level",
"tasks",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Level,
Tasks,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"level" => Ok(GeneratedField::Level),
"tasks" => Ok(GeneratedField::Tasks),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = LevelHandler;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.LevelHandler")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<LevelHandler, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut level__ = None;
let mut tasks__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Level => {
if level__.is_some() {
return Err(serde::de::Error::duplicate_field("level"));
}
level__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Tasks => {
if tasks__.is_some() {
return Err(serde::de::Error::duplicate_field("tasks"));
}
tasks__ = Some(map_.next_value()?);
}
}
}
Ok(LevelHandler {
level: level__.unwrap_or_default(),
tasks: tasks__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.LevelHandler", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for level_handler::RunningCompactTask {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.task_id != 0 {
len += 1;
}
if !self.ssts.is_empty() {
len += 1;
}
if self.total_file_size != 0 {
len += 1;
}
if self.target_level != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.LevelHandler.RunningCompactTask", len)?;
if self.task_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("taskId", ToString::to_string(&self.task_id).as_str())?;
}
if !self.ssts.is_empty() {
struct_ser.serialize_field("ssts", &self.ssts.iter().map(ToString::to_string).collect::<Vec<_>>())?;
}
if self.total_file_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("totalFileSize", ToString::to_string(&self.total_file_size).as_str())?;
}
if self.target_level != 0 {
struct_ser.serialize_field("targetLevel", &self.target_level)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for level_handler::RunningCompactTask {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_id",
"taskId",
"ssts",
"total_file_size",
"totalFileSize",
"target_level",
"targetLevel",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskId,
Ssts,
TotalFileSize,
TargetLevel,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
"ssts" => Ok(GeneratedField::Ssts),
"totalFileSize" | "total_file_size" => Ok(GeneratedField::TotalFileSize),
"targetLevel" | "target_level" => Ok(GeneratedField::TargetLevel),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = level_handler::RunningCompactTask;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.LevelHandler.RunningCompactTask")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<level_handler::RunningCompactTask, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_id__ = None;
let mut ssts__ = None;
let mut total_file_size__ = None;
let mut target_level__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Ssts => {
if ssts__.is_some() {
return Err(serde::de::Error::duplicate_field("ssts"));
}
ssts__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::TotalFileSize => {
if total_file_size__.is_some() {
return Err(serde::de::Error::duplicate_field("totalFileSize"));
}
total_file_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TargetLevel => {
if target_level__.is_some() {
return Err(serde::de::Error::duplicate_field("targetLevel"));
}
target_level__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(level_handler::RunningCompactTask {
task_id: task_id__.unwrap_or_default(),
ssts: ssts__.unwrap_or_default(),
total_file_size: total_file_size__.unwrap_or_default(),
target_level: target_level__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.LevelHandler.RunningCompactTask", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for LevelType {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::Unspecified => "LEVEL_TYPE_UNSPECIFIED",
Self::Nonoverlapping => "LEVEL_TYPE_NONOVERLAPPING",
Self::Overlapping => "LEVEL_TYPE_OVERLAPPING",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for LevelType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"LEVEL_TYPE_UNSPECIFIED",
"LEVEL_TYPE_NONOVERLAPPING",
"LEVEL_TYPE_OVERLAPPING",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = LevelType;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"LEVEL_TYPE_UNSPECIFIED" => Ok(LevelType::Unspecified),
"LEVEL_TYPE_NONOVERLAPPING" => Ok(LevelType::Nonoverlapping),
"LEVEL_TYPE_OVERLAPPING" => Ok(LevelType::Overlapping),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for ListActiveWriteLimitRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.ListActiveWriteLimitRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListActiveWriteLimitRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListActiveWriteLimitRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ListActiveWriteLimitRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListActiveWriteLimitRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListActiveWriteLimitRequest {
})
}
}
deserializer.deserialize_struct("hummock.ListActiveWriteLimitRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListActiveWriteLimitResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.write_limits.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ListActiveWriteLimitResponse", len)?;
if !self.write_limits.is_empty() {
struct_ser.serialize_field("writeLimits", &self.write_limits)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListActiveWriteLimitResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"write_limits",
"writeLimits",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WriteLimits,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"writeLimits" | "write_limits" => Ok(GeneratedField::WriteLimits),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListActiveWriteLimitResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ListActiveWriteLimitResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListActiveWriteLimitResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut write_limits__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WriteLimits => {
if write_limits__.is_some() {
return Err(serde::de::Error::duplicate_field("writeLimits"));
}
write_limits__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u64>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(ListActiveWriteLimitResponse {
write_limits: write_limits__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.ListActiveWriteLimitResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListBranchedObjectRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.ListBranchedObjectRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListBranchedObjectRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListBranchedObjectRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ListBranchedObjectRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListBranchedObjectRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListBranchedObjectRequest {
})
}
}
deserializer.deserialize_struct("hummock.ListBranchedObjectRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListBranchedObjectResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.branched_objects.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ListBranchedObjectResponse", len)?;
if !self.branched_objects.is_empty() {
struct_ser.serialize_field("branchedObjects", &self.branched_objects)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListBranchedObjectResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"branched_objects",
"branchedObjects",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
BranchedObjects,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"branchedObjects" | "branched_objects" => Ok(GeneratedField::BranchedObjects),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListBranchedObjectResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ListBranchedObjectResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListBranchedObjectResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut branched_objects__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::BranchedObjects => {
if branched_objects__.is_some() {
return Err(serde::de::Error::duplicate_field("branchedObjects"));
}
branched_objects__ = Some(map_.next_value()?);
}
}
}
Ok(ListBranchedObjectResponse {
branched_objects: branched_objects__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.ListBranchedObjectResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListCompactTaskAssignmentRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.ListCompactTaskAssignmentRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListCompactTaskAssignmentRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListCompactTaskAssignmentRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ListCompactTaskAssignmentRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListCompactTaskAssignmentRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListCompactTaskAssignmentRequest {
})
}
}
deserializer.deserialize_struct("hummock.ListCompactTaskAssignmentRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListCompactTaskAssignmentResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.task_assignment.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ListCompactTaskAssignmentResponse", len)?;
if !self.task_assignment.is_empty() {
struct_ser.serialize_field("taskAssignment", &self.task_assignment)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListCompactTaskAssignmentResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_assignment",
"taskAssignment",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskAssignment,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"taskAssignment" | "task_assignment" => Ok(GeneratedField::TaskAssignment),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListCompactTaskAssignmentResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ListCompactTaskAssignmentResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListCompactTaskAssignmentResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_assignment__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskAssignment => {
if task_assignment__.is_some() {
return Err(serde::de::Error::duplicate_field("taskAssignment"));
}
task_assignment__ = Some(map_.next_value()?);
}
}
}
Ok(ListCompactTaskAssignmentResponse {
task_assignment: task_assignment__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.ListCompactTaskAssignmentResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListCompactTaskProgressRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.ListCompactTaskProgressRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListCompactTaskProgressRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListCompactTaskProgressRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ListCompactTaskProgressRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListCompactTaskProgressRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListCompactTaskProgressRequest {
})
}
}
deserializer.deserialize_struct("hummock.ListCompactTaskProgressRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListCompactTaskProgressResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.task_progress.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ListCompactTaskProgressResponse", len)?;
if !self.task_progress.is_empty() {
struct_ser.serialize_field("taskProgress", &self.task_progress)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListCompactTaskProgressResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_progress",
"taskProgress",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskProgress,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"taskProgress" | "task_progress" => Ok(GeneratedField::TaskProgress),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListCompactTaskProgressResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ListCompactTaskProgressResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListCompactTaskProgressResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_progress__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskProgress => {
if task_progress__.is_some() {
return Err(serde::de::Error::duplicate_field("taskProgress"));
}
task_progress__ = Some(map_.next_value()?);
}
}
}
Ok(ListCompactTaskProgressResponse {
task_progress: task_progress__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.ListCompactTaskProgressResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListHummockMetaConfigRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.ListHummockMetaConfigRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListHummockMetaConfigRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListHummockMetaConfigRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ListHummockMetaConfigRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListHummockMetaConfigRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListHummockMetaConfigRequest {
})
}
}
deserializer.deserialize_struct("hummock.ListHummockMetaConfigRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListHummockMetaConfigResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.configs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ListHummockMetaConfigResponse", len)?;
if !self.configs.is_empty() {
struct_ser.serialize_field("configs", &self.configs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListHummockMetaConfigResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"configs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Configs,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"configs" => Ok(GeneratedField::Configs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListHummockMetaConfigResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ListHummockMetaConfigResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListHummockMetaConfigResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut configs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Configs => {
if configs__.is_some() {
return Err(serde::de::Error::duplicate_field("configs"));
}
configs__ = Some(
map_.next_value::<std::collections::HashMap<_, _>>()?
);
}
}
}
Ok(ListHummockMetaConfigResponse {
configs: configs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.ListHummockMetaConfigResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListVersionDeltasRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.start_id != 0 {
len += 1;
}
if self.num_limit != 0 {
len += 1;
}
if self.committed_epoch_limit != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ListVersionDeltasRequest", len)?;
if self.start_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("startId", ToString::to_string(&self.start_id).as_str())?;
}
if self.num_limit != 0 {
struct_ser.serialize_field("numLimit", &self.num_limit)?;
}
if self.committed_epoch_limit != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("committedEpochLimit", ToString::to_string(&self.committed_epoch_limit).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListVersionDeltasRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"start_id",
"startId",
"num_limit",
"numLimit",
"committed_epoch_limit",
"committedEpochLimit",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
StartId,
NumLimit,
CommittedEpochLimit,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"startId" | "start_id" => Ok(GeneratedField::StartId),
"numLimit" | "num_limit" => Ok(GeneratedField::NumLimit),
"committedEpochLimit" | "committed_epoch_limit" => Ok(GeneratedField::CommittedEpochLimit),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListVersionDeltasRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ListVersionDeltasRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListVersionDeltasRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut start_id__ = None;
let mut num_limit__ = None;
let mut committed_epoch_limit__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::StartId => {
if start_id__.is_some() {
return Err(serde::de::Error::duplicate_field("startId"));
}
start_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::NumLimit => {
if num_limit__.is_some() {
return Err(serde::de::Error::duplicate_field("numLimit"));
}
num_limit__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CommittedEpochLimit => {
if committed_epoch_limit__.is_some() {
return Err(serde::de::Error::duplicate_field("committedEpochLimit"));
}
committed_epoch_limit__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(ListVersionDeltasRequest {
start_id: start_id__.unwrap_or_default(),
num_limit: num_limit__.unwrap_or_default(),
committed_epoch_limit: committed_epoch_limit__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.ListVersionDeltasRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListVersionDeltasResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.version_deltas.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ListVersionDeltasResponse", len)?;
if let Some(v) = self.version_deltas.as_ref() {
struct_ser.serialize_field("versionDeltas", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListVersionDeltasResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"version_deltas",
"versionDeltas",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
VersionDeltas,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"versionDeltas" | "version_deltas" => Ok(GeneratedField::VersionDeltas),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListVersionDeltasResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ListVersionDeltasResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListVersionDeltasResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut version_deltas__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::VersionDeltas => {
if version_deltas__.is_some() {
return Err(serde::de::Error::duplicate_field("versionDeltas"));
}
version_deltas__ = map_.next_value()?;
}
}
}
Ok(ListVersionDeltasResponse {
version_deltas: version_deltas__,
})
}
}
deserializer.deserialize_struct("hummock.ListVersionDeltasResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for MergeCompactionGroupRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.left_group_id != 0 {
len += 1;
}
if self.right_group_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.MergeCompactionGroupRequest", len)?;
if self.left_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("leftGroupId", ToString::to_string(&self.left_group_id).as_str())?;
}
if self.right_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("rightGroupId", ToString::to_string(&self.right_group_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for MergeCompactionGroupRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"left_group_id",
"leftGroupId",
"right_group_id",
"rightGroupId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
LeftGroupId,
RightGroupId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"leftGroupId" | "left_group_id" => Ok(GeneratedField::LeftGroupId),
"rightGroupId" | "right_group_id" => Ok(GeneratedField::RightGroupId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = MergeCompactionGroupRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.MergeCompactionGroupRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<MergeCompactionGroupRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut left_group_id__ = None;
let mut right_group_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::LeftGroupId => {
if left_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("leftGroupId"));
}
left_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::RightGroupId => {
if right_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("rightGroupId"));
}
right_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(MergeCompactionGroupRequest {
left_group_id: left_group_id__.unwrap_or_default(),
right_group_id: right_group_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.MergeCompactionGroupRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for MergeCompactionGroupResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.MergeCompactionGroupResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for MergeCompactionGroupResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = MergeCompactionGroupResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.MergeCompactionGroupResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<MergeCompactionGroupResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(MergeCompactionGroupResponse {
})
}
}
deserializer.deserialize_struct("hummock.MergeCompactionGroupResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for NewL0SubLevel {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.inserted_table_infos.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.NewL0SubLevel", len)?;
if !self.inserted_table_infos.is_empty() {
struct_ser.serialize_field("insertedTableInfos", &self.inserted_table_infos)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for NewL0SubLevel {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"inserted_table_infos",
"insertedTableInfos",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
InsertedTableInfos,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"insertedTableInfos" | "inserted_table_infos" => Ok(GeneratedField::InsertedTableInfos),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = NewL0SubLevel;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.NewL0SubLevel")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<NewL0SubLevel, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut inserted_table_infos__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::InsertedTableInfos => {
if inserted_table_infos__.is_some() {
return Err(serde::de::Error::duplicate_field("insertedTableInfos"));
}
inserted_table_infos__ = Some(map_.next_value()?);
}
}
}
Ok(NewL0SubLevel {
inserted_table_infos: inserted_table_infos__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.NewL0SubLevel", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for OverlappingLevel {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.sub_levels.is_empty() {
len += 1;
}
if self.total_file_size != 0 {
len += 1;
}
if self.uncompressed_file_size != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.OverlappingLevel", len)?;
if !self.sub_levels.is_empty() {
struct_ser.serialize_field("subLevels", &self.sub_levels)?;
}
if self.total_file_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("totalFileSize", ToString::to_string(&self.total_file_size).as_str())?;
}
if self.uncompressed_file_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("uncompressedFileSize", ToString::to_string(&self.uncompressed_file_size).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for OverlappingLevel {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"sub_levels",
"subLevels",
"total_file_size",
"totalFileSize",
"uncompressed_file_size",
"uncompressedFileSize",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SubLevels,
TotalFileSize,
UncompressedFileSize,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"subLevels" | "sub_levels" => Ok(GeneratedField::SubLevels),
"totalFileSize" | "total_file_size" => Ok(GeneratedField::TotalFileSize),
"uncompressedFileSize" | "uncompressed_file_size" => Ok(GeneratedField::UncompressedFileSize),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = OverlappingLevel;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.OverlappingLevel")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<OverlappingLevel, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut sub_levels__ = None;
let mut total_file_size__ = None;
let mut uncompressed_file_size__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SubLevels => {
if sub_levels__.is_some() {
return Err(serde::de::Error::duplicate_field("subLevels"));
}
sub_levels__ = Some(map_.next_value()?);
}
GeneratedField::TotalFileSize => {
if total_file_size__.is_some() {
return Err(serde::de::Error::duplicate_field("totalFileSize"));
}
total_file_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::UncompressedFileSize => {
if uncompressed_file_size__.is_some() {
return Err(serde::de::Error::duplicate_field("uncompressedFileSize"));
}
uncompressed_file_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(OverlappingLevel {
sub_levels: sub_levels__.unwrap_or_default(),
total_file_size: total_file_size__.unwrap_or_default(),
uncompressed_file_size: uncompressed_file_size__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.OverlappingLevel", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for PinVersionRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.context_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.PinVersionRequest", len)?;
if self.context_id != 0 {
struct_ser.serialize_field("contextId", &self.context_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for PinVersionRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"context_id",
"contextId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ContextId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"contextId" | "context_id" => Ok(GeneratedField::ContextId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = PinVersionRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.PinVersionRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<PinVersionRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut context_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ContextId => {
if context_id__.is_some() {
return Err(serde::de::Error::duplicate_field("contextId"));
}
context_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(PinVersionRequest {
context_id: context_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.PinVersionRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for PinVersionResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.pinned_version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.PinVersionResponse", len)?;
if let Some(v) = self.pinned_version.as_ref() {
struct_ser.serialize_field("pinnedVersion", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for PinVersionResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"pinned_version",
"pinnedVersion",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
PinnedVersion,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"pinnedVersion" | "pinned_version" => Ok(GeneratedField::PinnedVersion),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = PinVersionResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.PinVersionResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<PinVersionResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut pinned_version__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::PinnedVersion => {
if pinned_version__.is_some() {
return Err(serde::de::Error::duplicate_field("pinnedVersion"));
}
pinned_version__ = map_.next_value()?;
}
}
}
Ok(PinVersionResponse {
pinned_version: pinned_version__,
})
}
}
deserializer.deserialize_struct("hummock.PinVersionResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for PinnedVersionsSummary {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.pinned_versions.is_empty() {
len += 1;
}
if !self.workers.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.PinnedVersionsSummary", len)?;
if !self.pinned_versions.is_empty() {
struct_ser.serialize_field("pinnedVersions", &self.pinned_versions)?;
}
if !self.workers.is_empty() {
struct_ser.serialize_field("workers", &self.workers)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for PinnedVersionsSummary {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"pinned_versions",
"pinnedVersions",
"workers",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
PinnedVersions,
Workers,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"pinnedVersions" | "pinned_versions" => Ok(GeneratedField::PinnedVersions),
"workers" => Ok(GeneratedField::Workers),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = PinnedVersionsSummary;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.PinnedVersionsSummary")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<PinnedVersionsSummary, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut pinned_versions__ = None;
let mut workers__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::PinnedVersions => {
if pinned_versions__.is_some() {
return Err(serde::de::Error::duplicate_field("pinnedVersions"));
}
pinned_versions__ = Some(map_.next_value()?);
}
GeneratedField::Workers => {
if workers__.is_some() {
return Err(serde::de::Error::duplicate_field("workers"));
}
workers__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(PinnedVersionsSummary {
pinned_versions: pinned_versions__.unwrap_or_default(),
workers: workers__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.PinnedVersionsSummary", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ReplayVersionDeltaRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.version_delta.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ReplayVersionDeltaRequest", len)?;
if let Some(v) = self.version_delta.as_ref() {
struct_ser.serialize_field("versionDelta", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ReplayVersionDeltaRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"version_delta",
"versionDelta",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
VersionDelta,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"versionDelta" | "version_delta" => Ok(GeneratedField::VersionDelta),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ReplayVersionDeltaRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ReplayVersionDeltaRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ReplayVersionDeltaRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut version_delta__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::VersionDelta => {
if version_delta__.is_some() {
return Err(serde::de::Error::duplicate_field("versionDelta"));
}
version_delta__ = map_.next_value()?;
}
}
}
Ok(ReplayVersionDeltaRequest {
version_delta: version_delta__,
})
}
}
deserializer.deserialize_struct("hummock.ReplayVersionDeltaRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ReplayVersionDeltaResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.version.is_some() {
len += 1;
}
if !self.modified_compaction_groups.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ReplayVersionDeltaResponse", len)?;
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
if !self.modified_compaction_groups.is_empty() {
struct_ser.serialize_field("modifiedCompactionGroups", &self.modified_compaction_groups.iter().map(ToString::to_string).collect::<Vec<_>>())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ReplayVersionDeltaResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"version",
"modified_compaction_groups",
"modifiedCompactionGroups",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Version,
ModifiedCompactionGroups,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"version" => Ok(GeneratedField::Version),
"modifiedCompactionGroups" | "modified_compaction_groups" => Ok(GeneratedField::ModifiedCompactionGroups),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ReplayVersionDeltaResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ReplayVersionDeltaResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ReplayVersionDeltaResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut version__ = None;
let mut modified_compaction_groups__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
GeneratedField::ModifiedCompactionGroups => {
if modified_compaction_groups__.is_some() {
return Err(serde::de::Error::duplicate_field("modifiedCompactionGroups"));
}
modified_compaction_groups__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(ReplayVersionDeltaResponse {
version: version__,
modified_compaction_groups: modified_compaction_groups__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.ReplayVersionDeltaResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ReportCompactionTaskRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.event.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ReportCompactionTaskRequest", len)?;
if let Some(v) = self.event.as_ref() {
match v {
report_compaction_task_request::Event::ReportTask(v) => {
struct_ser.serialize_field("reportTask", v)?;
}
report_compaction_task_request::Event::HeartBeat(v) => {
struct_ser.serialize_field("heartBeat", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ReportCompactionTaskRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"report_task",
"reportTask",
"heart_beat",
"heartBeat",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ReportTask,
HeartBeat,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"reportTask" | "report_task" => Ok(GeneratedField::ReportTask),
"heartBeat" | "heart_beat" => Ok(GeneratedField::HeartBeat),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ReportCompactionTaskRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ReportCompactionTaskRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ReportCompactionTaskRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut event__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ReportTask => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("reportTask"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(report_compaction_task_request::Event::ReportTask)
;
}
GeneratedField::HeartBeat => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("heartBeat"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(report_compaction_task_request::Event::HeartBeat)
;
}
}
}
Ok(ReportCompactionTaskRequest {
event: event__,
})
}
}
deserializer.deserialize_struct("hummock.ReportCompactionTaskRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for report_compaction_task_request::HeartBeat {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.progress.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ReportCompactionTaskRequest.HeartBeat", len)?;
if !self.progress.is_empty() {
struct_ser.serialize_field("progress", &self.progress)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for report_compaction_task_request::HeartBeat {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"progress",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Progress,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"progress" => Ok(GeneratedField::Progress),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = report_compaction_task_request::HeartBeat;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ReportCompactionTaskRequest.HeartBeat")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<report_compaction_task_request::HeartBeat, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut progress__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Progress => {
if progress__.is_some() {
return Err(serde::de::Error::duplicate_field("progress"));
}
progress__ = Some(map_.next_value()?);
}
}
}
Ok(report_compaction_task_request::HeartBeat {
progress: progress__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.ReportCompactionTaskRequest.HeartBeat", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for report_compaction_task_request::ReportTask {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.compact_task.is_some() {
len += 1;
}
if !self.table_stats_change.is_empty() {
len += 1;
}
if !self.object_timestamps.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ReportCompactionTaskRequest.ReportTask", len)?;
if let Some(v) = self.compact_task.as_ref() {
struct_ser.serialize_field("compactTask", v)?;
}
if !self.table_stats_change.is_empty() {
struct_ser.serialize_field("tableStatsChange", &self.table_stats_change)?;
}
if !self.object_timestamps.is_empty() {
let v: std::collections::HashMap<_, _> = self.object_timestamps.iter()
.map(|(k, v)| (k, v.to_string())).collect();
struct_ser.serialize_field("objectTimestamps", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for report_compaction_task_request::ReportTask {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"compact_task",
"compactTask",
"table_stats_change",
"tableStatsChange",
"object_timestamps",
"objectTimestamps",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CompactTask,
TableStatsChange,
ObjectTimestamps,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"compactTask" | "compact_task" => Ok(GeneratedField::CompactTask),
"tableStatsChange" | "table_stats_change" => Ok(GeneratedField::TableStatsChange),
"objectTimestamps" | "object_timestamps" => Ok(GeneratedField::ObjectTimestamps),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = report_compaction_task_request::ReportTask;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ReportCompactionTaskRequest.ReportTask")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<report_compaction_task_request::ReportTask, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut compact_task__ = None;
let mut table_stats_change__ = None;
let mut object_timestamps__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CompactTask => {
if compact_task__.is_some() {
return Err(serde::de::Error::duplicate_field("compactTask"));
}
compact_task__ = map_.next_value()?;
}
GeneratedField::TableStatsChange => {
if table_stats_change__.is_some() {
return Err(serde::de::Error::duplicate_field("tableStatsChange"));
}
table_stats_change__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::ObjectTimestamps => {
if object_timestamps__.is_some() {
return Err(serde::de::Error::duplicate_field("objectTimestamps"));
}
object_timestamps__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u64>, ::pbjson::private::NumberDeserialize<u64>>>()?
.into_iter().map(|(k,v)| (k.0, v.0)).collect()
);
}
}
}
Ok(report_compaction_task_request::ReportTask {
compact_task: compact_task__,
table_stats_change: table_stats_change__.unwrap_or_default(),
object_timestamps: object_timestamps__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.ReportCompactionTaskRequest.ReportTask", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ReportCompactionTaskResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.status.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ReportCompactionTaskResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ReportCompactionTaskResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"status" => Ok(GeneratedField::Status),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ReportCompactionTaskResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ReportCompactionTaskResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ReportCompactionTaskResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Status => {
if status__.is_some() {
return Err(serde::de::Error::duplicate_field("status"));
}
status__ = map_.next_value()?;
}
}
}
Ok(ReportCompactionTaskResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("hummock.ReportCompactionTaskResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlGetCheckpointVersionRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.RiseCtlGetCheckpointVersionRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlGetCheckpointVersionRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlGetCheckpointVersionRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlGetCheckpointVersionRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlGetCheckpointVersionRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RiseCtlGetCheckpointVersionRequest {
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlGetCheckpointVersionRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlGetCheckpointVersionResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.checkpoint_version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.RiseCtlGetCheckpointVersionResponse", len)?;
if let Some(v) = self.checkpoint_version.as_ref() {
struct_ser.serialize_field("checkpointVersion", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlGetCheckpointVersionResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"checkpoint_version",
"checkpointVersion",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CheckpointVersion,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"checkpointVersion" | "checkpoint_version" => Ok(GeneratedField::CheckpointVersion),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlGetCheckpointVersionResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlGetCheckpointVersionResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlGetCheckpointVersionResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut checkpoint_version__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CheckpointVersion => {
if checkpoint_version__.is_some() {
return Err(serde::de::Error::duplicate_field("checkpointVersion"));
}
checkpoint_version__ = map_.next_value()?;
}
}
}
Ok(RiseCtlGetCheckpointVersionResponse {
checkpoint_version: checkpoint_version__,
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlGetCheckpointVersionResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlGetPinnedVersionsSummaryRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.RiseCtlGetPinnedVersionsSummaryRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlGetPinnedVersionsSummaryRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlGetPinnedVersionsSummaryRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlGetPinnedVersionsSummaryRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlGetPinnedVersionsSummaryRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RiseCtlGetPinnedVersionsSummaryRequest {
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlGetPinnedVersionsSummaryRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlGetPinnedVersionsSummaryResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.summary.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.RiseCtlGetPinnedVersionsSummaryResponse", len)?;
if let Some(v) = self.summary.as_ref() {
struct_ser.serialize_field("summary", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlGetPinnedVersionsSummaryResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"summary",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Summary,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"summary" => Ok(GeneratedField::Summary),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlGetPinnedVersionsSummaryResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlGetPinnedVersionsSummaryResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlGetPinnedVersionsSummaryResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut summary__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Summary => {
if summary__.is_some() {
return Err(serde::de::Error::duplicate_field("summary"));
}
summary__ = map_.next_value()?;
}
}
}
Ok(RiseCtlGetPinnedVersionsSummaryResponse {
summary: summary__,
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlGetPinnedVersionsSummaryResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlListCompactionGroupRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.RiseCtlListCompactionGroupRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlListCompactionGroupRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlListCompactionGroupRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlListCompactionGroupRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlListCompactionGroupRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RiseCtlListCompactionGroupRequest {
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlListCompactionGroupRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlListCompactionGroupResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.status.is_some() {
len += 1;
}
if !self.compaction_groups.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.RiseCtlListCompactionGroupResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if !self.compaction_groups.is_empty() {
struct_ser.serialize_field("compactionGroups", &self.compaction_groups)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlListCompactionGroupResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"compaction_groups",
"compactionGroups",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
CompactionGroups,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"status" => Ok(GeneratedField::Status),
"compactionGroups" | "compaction_groups" => Ok(GeneratedField::CompactionGroups),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlListCompactionGroupResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlListCompactionGroupResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlListCompactionGroupResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut compaction_groups__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Status => {
if status__.is_some() {
return Err(serde::de::Error::duplicate_field("status"));
}
status__ = map_.next_value()?;
}
GeneratedField::CompactionGroups => {
if compaction_groups__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroups"));
}
compaction_groups__ = Some(map_.next_value()?);
}
}
}
Ok(RiseCtlListCompactionGroupResponse {
status: status__,
compaction_groups: compaction_groups__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlListCompactionGroupResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlListCompactionStatusRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.RiseCtlListCompactionStatusRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlListCompactionStatusRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlListCompactionStatusRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlListCompactionStatusRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlListCompactionStatusRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RiseCtlListCompactionStatusRequest {
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlListCompactionStatusRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlListCompactionStatusResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.compaction_statuses.is_empty() {
len += 1;
}
if !self.task_assignment.is_empty() {
len += 1;
}
if !self.task_progress.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.RiseCtlListCompactionStatusResponse", len)?;
if !self.compaction_statuses.is_empty() {
struct_ser.serialize_field("compactionStatuses", &self.compaction_statuses)?;
}
if !self.task_assignment.is_empty() {
struct_ser.serialize_field("taskAssignment", &self.task_assignment)?;
}
if !self.task_progress.is_empty() {
struct_ser.serialize_field("taskProgress", &self.task_progress)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlListCompactionStatusResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"compaction_statuses",
"compactionStatuses",
"task_assignment",
"taskAssignment",
"task_progress",
"taskProgress",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CompactionStatuses,
TaskAssignment,
TaskProgress,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"compactionStatuses" | "compaction_statuses" => Ok(GeneratedField::CompactionStatuses),
"taskAssignment" | "task_assignment" => Ok(GeneratedField::TaskAssignment),
"taskProgress" | "task_progress" => Ok(GeneratedField::TaskProgress),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlListCompactionStatusResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlListCompactionStatusResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlListCompactionStatusResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut compaction_statuses__ = None;
let mut task_assignment__ = None;
let mut task_progress__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CompactionStatuses => {
if compaction_statuses__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionStatuses"));
}
compaction_statuses__ = Some(map_.next_value()?);
}
GeneratedField::TaskAssignment => {
if task_assignment__.is_some() {
return Err(serde::de::Error::duplicate_field("taskAssignment"));
}
task_assignment__ = Some(map_.next_value()?);
}
GeneratedField::TaskProgress => {
if task_progress__.is_some() {
return Err(serde::de::Error::duplicate_field("taskProgress"));
}
task_progress__ = Some(map_.next_value()?);
}
}
}
Ok(RiseCtlListCompactionStatusResponse {
compaction_statuses: compaction_statuses__.unwrap_or_default(),
task_assignment: task_assignment__.unwrap_or_default(),
task_progress: task_progress__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlListCompactionStatusResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlPauseVersionCheckpointRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.RiseCtlPauseVersionCheckpointRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlPauseVersionCheckpointRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlPauseVersionCheckpointRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlPauseVersionCheckpointRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlPauseVersionCheckpointRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RiseCtlPauseVersionCheckpointRequest {
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlPauseVersionCheckpointRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlPauseVersionCheckpointResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.RiseCtlPauseVersionCheckpointResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlPauseVersionCheckpointResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlPauseVersionCheckpointResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlPauseVersionCheckpointResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlPauseVersionCheckpointResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RiseCtlPauseVersionCheckpointResponse {
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlPauseVersionCheckpointResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlRebuildTableStatsRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.RiseCtlRebuildTableStatsRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlRebuildTableStatsRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlRebuildTableStatsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlRebuildTableStatsRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlRebuildTableStatsRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RiseCtlRebuildTableStatsRequest {
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlRebuildTableStatsRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlRebuildTableStatsResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.RiseCtlRebuildTableStatsResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlRebuildTableStatsResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlRebuildTableStatsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlRebuildTableStatsResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlRebuildTableStatsResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RiseCtlRebuildTableStatsResponse {
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlRebuildTableStatsResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlResumeVersionCheckpointRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.RiseCtlResumeVersionCheckpointRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlResumeVersionCheckpointRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlResumeVersionCheckpointRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlResumeVersionCheckpointRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlResumeVersionCheckpointRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RiseCtlResumeVersionCheckpointRequest {
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlResumeVersionCheckpointRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlResumeVersionCheckpointResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.RiseCtlResumeVersionCheckpointResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlResumeVersionCheckpointResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlResumeVersionCheckpointResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlResumeVersionCheckpointResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlResumeVersionCheckpointResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RiseCtlResumeVersionCheckpointResponse {
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlResumeVersionCheckpointResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlUpdateCompactionConfigRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.compaction_group_ids.is_empty() {
len += 1;
}
if !self.configs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.RiseCtlUpdateCompactionConfigRequest", len)?;
if !self.compaction_group_ids.is_empty() {
struct_ser.serialize_field("compactionGroupIds", &self.compaction_group_ids.iter().map(ToString::to_string).collect::<Vec<_>>())?;
}
if !self.configs.is_empty() {
struct_ser.serialize_field("configs", &self.configs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlUpdateCompactionConfigRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"compaction_group_ids",
"compactionGroupIds",
"configs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CompactionGroupIds,
Configs,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"compactionGroupIds" | "compaction_group_ids" => Ok(GeneratedField::CompactionGroupIds),
"configs" => Ok(GeneratedField::Configs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlUpdateCompactionConfigRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlUpdateCompactionConfigRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlUpdateCompactionConfigRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut compaction_group_ids__ = None;
let mut configs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CompactionGroupIds => {
if compaction_group_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroupIds"));
}
compaction_group_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::Configs => {
if configs__.is_some() {
return Err(serde::de::Error::duplicate_field("configs"));
}
configs__ = Some(map_.next_value()?);
}
}
}
Ok(RiseCtlUpdateCompactionConfigRequest {
compaction_group_ids: compaction_group_ids__.unwrap_or_default(),
configs: configs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlUpdateCompactionConfigRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for rise_ctl_update_compaction_config_request::CompressionAlgorithm {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.level != 0 {
len += 1;
}
if !self.compression_algorithm.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.RiseCtlUpdateCompactionConfigRequest.CompressionAlgorithm", len)?;
if self.level != 0 {
struct_ser.serialize_field("level", &self.level)?;
}
if !self.compression_algorithm.is_empty() {
struct_ser.serialize_field("compressionAlgorithm", &self.compression_algorithm)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for rise_ctl_update_compaction_config_request::CompressionAlgorithm {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"level",
"compression_algorithm",
"compressionAlgorithm",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Level,
CompressionAlgorithm,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"level" => Ok(GeneratedField::Level),
"compressionAlgorithm" | "compression_algorithm" => Ok(GeneratedField::CompressionAlgorithm),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = rise_ctl_update_compaction_config_request::CompressionAlgorithm;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlUpdateCompactionConfigRequest.CompressionAlgorithm")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<rise_ctl_update_compaction_config_request::CompressionAlgorithm, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut level__ = None;
let mut compression_algorithm__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Level => {
if level__.is_some() {
return Err(serde::de::Error::duplicate_field("level"));
}
level__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CompressionAlgorithm => {
if compression_algorithm__.is_some() {
return Err(serde::de::Error::duplicate_field("compressionAlgorithm"));
}
compression_algorithm__ = Some(map_.next_value()?);
}
}
}
Ok(rise_ctl_update_compaction_config_request::CompressionAlgorithm {
level: level__.unwrap_or_default(),
compression_algorithm: compression_algorithm__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlUpdateCompactionConfigRequest.CompressionAlgorithm", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for rise_ctl_update_compaction_config_request::MutableConfig {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.mutable_config.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.RiseCtlUpdateCompactionConfigRequest.MutableConfig", len)?;
if let Some(v) = self.mutable_config.as_ref() {
match v {
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::MaxBytesForLevelBase(v) => {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("maxBytesForLevelBase", ToString::to_string(&v).as_str())?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::MaxBytesForLevelMultiplier(v) => {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("maxBytesForLevelMultiplier", ToString::to_string(&v).as_str())?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::MaxCompactionBytes(v) => {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("maxCompactionBytes", ToString::to_string(&v).as_str())?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::SubLevelMaxCompactionBytes(v) => {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("subLevelMaxCompactionBytes", ToString::to_string(&v).as_str())?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::Level0TierCompactFileNumber(v) => {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("level0TierCompactFileNumber", ToString::to_string(&v).as_str())?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::TargetFileSizeBase(v) => {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("targetFileSizeBase", ToString::to_string(&v).as_str())?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::CompactionFilterMask(v) => {
struct_ser.serialize_field("compactionFilterMask", v)?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::MaxSubCompaction(v) => {
struct_ser.serialize_field("maxSubCompaction", v)?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::Level0StopWriteThresholdSubLevelNumber(v) => {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("level0StopWriteThresholdSubLevelNumber", ToString::to_string(&v).as_str())?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::Level0SubLevelCompactLevelCount(v) => {
struct_ser.serialize_field("level0SubLevelCompactLevelCount", v)?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::Level0OverlappingSubLevelCompactLevelCount(v) => {
struct_ser.serialize_field("level0OverlappingSubLevelCompactLevelCount", v)?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::MaxSpaceReclaimBytes(v) => {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("maxSpaceReclaimBytes", ToString::to_string(&v).as_str())?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::Level0MaxCompactFileNumber(v) => {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("level0MaxCompactFileNumber", ToString::to_string(&v).as_str())?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::EnableEmergencyPicker(v) => {
struct_ser.serialize_field("enableEmergencyPicker", v)?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::TombstoneReclaimRatio(v) => {
struct_ser.serialize_field("tombstoneReclaimRatio", v)?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::CompressionAlgorithm(v) => {
struct_ser.serialize_field("compressionAlgorithm", v)?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::MaxL0CompactLevelCount(v) => {
struct_ser.serialize_field("maxL0CompactLevelCount", v)?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::SstAllowedTrivialMoveMinSize(v) => {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("sstAllowedTrivialMoveMinSize", ToString::to_string(&v).as_str())?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::SplitWeightByVnode(v) => {
struct_ser.serialize_field("splitWeightByVnode", v)?;
}
rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::DisableAutoGroupScheduling(v) => {
struct_ser.serialize_field("disableAutoGroupScheduling", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for rise_ctl_update_compaction_config_request::MutableConfig {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"max_bytes_for_level_base",
"maxBytesForLevelBase",
"max_bytes_for_level_multiplier",
"maxBytesForLevelMultiplier",
"max_compaction_bytes",
"maxCompactionBytes",
"sub_level_max_compaction_bytes",
"subLevelMaxCompactionBytes",
"level0_tier_compact_file_number",
"level0TierCompactFileNumber",
"target_file_size_base",
"targetFileSizeBase",
"compaction_filter_mask",
"compactionFilterMask",
"max_sub_compaction",
"maxSubCompaction",
"level0_stop_write_threshold_sub_level_number",
"level0StopWriteThresholdSubLevelNumber",
"level0_sub_level_compact_level_count",
"level0SubLevelCompactLevelCount",
"level0_overlapping_sub_level_compact_level_count",
"level0OverlappingSubLevelCompactLevelCount",
"max_space_reclaim_bytes",
"maxSpaceReclaimBytes",
"level0_max_compact_file_number",
"level0MaxCompactFileNumber",
"enable_emergency_picker",
"enableEmergencyPicker",
"tombstone_reclaim_ratio",
"tombstoneReclaimRatio",
"compression_algorithm",
"compressionAlgorithm",
"max_l0_compact_level_count",
"maxL0CompactLevelCount",
"sst_allowed_trivial_move_min_size",
"sstAllowedTrivialMoveMinSize",
"split_weight_by_vnode",
"splitWeightByVnode",
"disable_auto_group_scheduling",
"disableAutoGroupScheduling",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
MaxBytesForLevelBase,
MaxBytesForLevelMultiplier,
MaxCompactionBytes,
SubLevelMaxCompactionBytes,
Level0TierCompactFileNumber,
TargetFileSizeBase,
CompactionFilterMask,
MaxSubCompaction,
Level0StopWriteThresholdSubLevelNumber,
Level0SubLevelCompactLevelCount,
Level0OverlappingSubLevelCompactLevelCount,
MaxSpaceReclaimBytes,
Level0MaxCompactFileNumber,
EnableEmergencyPicker,
TombstoneReclaimRatio,
CompressionAlgorithm,
MaxL0CompactLevelCount,
SstAllowedTrivialMoveMinSize,
SplitWeightByVnode,
DisableAutoGroupScheduling,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"maxBytesForLevelBase" | "max_bytes_for_level_base" => Ok(GeneratedField::MaxBytesForLevelBase),
"maxBytesForLevelMultiplier" | "max_bytes_for_level_multiplier" => Ok(GeneratedField::MaxBytesForLevelMultiplier),
"maxCompactionBytes" | "max_compaction_bytes" => Ok(GeneratedField::MaxCompactionBytes),
"subLevelMaxCompactionBytes" | "sub_level_max_compaction_bytes" => Ok(GeneratedField::SubLevelMaxCompactionBytes),
"level0TierCompactFileNumber" | "level0_tier_compact_file_number" => Ok(GeneratedField::Level0TierCompactFileNumber),
"targetFileSizeBase" | "target_file_size_base" => Ok(GeneratedField::TargetFileSizeBase),
"compactionFilterMask" | "compaction_filter_mask" => Ok(GeneratedField::CompactionFilterMask),
"maxSubCompaction" | "max_sub_compaction" => Ok(GeneratedField::MaxSubCompaction),
"level0StopWriteThresholdSubLevelNumber" | "level0_stop_write_threshold_sub_level_number" => Ok(GeneratedField::Level0StopWriteThresholdSubLevelNumber),
"level0SubLevelCompactLevelCount" | "level0_sub_level_compact_level_count" => Ok(GeneratedField::Level0SubLevelCompactLevelCount),
"level0OverlappingSubLevelCompactLevelCount" | "level0_overlapping_sub_level_compact_level_count" => Ok(GeneratedField::Level0OverlappingSubLevelCompactLevelCount),
"maxSpaceReclaimBytes" | "max_space_reclaim_bytes" => Ok(GeneratedField::MaxSpaceReclaimBytes),
"level0MaxCompactFileNumber" | "level0_max_compact_file_number" => Ok(GeneratedField::Level0MaxCompactFileNumber),
"enableEmergencyPicker" | "enable_emergency_picker" => Ok(GeneratedField::EnableEmergencyPicker),
"tombstoneReclaimRatio" | "tombstone_reclaim_ratio" => Ok(GeneratedField::TombstoneReclaimRatio),
"compressionAlgorithm" | "compression_algorithm" => Ok(GeneratedField::CompressionAlgorithm),
"maxL0CompactLevelCount" | "max_l0_compact_level_count" => Ok(GeneratedField::MaxL0CompactLevelCount),
"sstAllowedTrivialMoveMinSize" | "sst_allowed_trivial_move_min_size" => Ok(GeneratedField::SstAllowedTrivialMoveMinSize),
"splitWeightByVnode" | "split_weight_by_vnode" => Ok(GeneratedField::SplitWeightByVnode),
"disableAutoGroupScheduling" | "disable_auto_group_scheduling" => Ok(GeneratedField::DisableAutoGroupScheduling),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = rise_ctl_update_compaction_config_request::MutableConfig;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlUpdateCompactionConfigRequest.MutableConfig")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<rise_ctl_update_compaction_config_request::MutableConfig, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut mutable_config__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::MaxBytesForLevelBase => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("maxBytesForLevelBase"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::MaxBytesForLevelBase(x.0));
}
GeneratedField::MaxBytesForLevelMultiplier => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("maxBytesForLevelMultiplier"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::MaxBytesForLevelMultiplier(x.0));
}
GeneratedField::MaxCompactionBytes => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("maxCompactionBytes"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::MaxCompactionBytes(x.0));
}
GeneratedField::SubLevelMaxCompactionBytes => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("subLevelMaxCompactionBytes"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::SubLevelMaxCompactionBytes(x.0));
}
GeneratedField::Level0TierCompactFileNumber => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("level0TierCompactFileNumber"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::Level0TierCompactFileNumber(x.0));
}
GeneratedField::TargetFileSizeBase => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("targetFileSizeBase"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::TargetFileSizeBase(x.0));
}
GeneratedField::CompactionFilterMask => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionFilterMask"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::CompactionFilterMask(x.0));
}
GeneratedField::MaxSubCompaction => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("maxSubCompaction"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::MaxSubCompaction(x.0));
}
GeneratedField::Level0StopWriteThresholdSubLevelNumber => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("level0StopWriteThresholdSubLevelNumber"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::Level0StopWriteThresholdSubLevelNumber(x.0));
}
GeneratedField::Level0SubLevelCompactLevelCount => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("level0SubLevelCompactLevelCount"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::Level0SubLevelCompactLevelCount(x.0));
}
GeneratedField::Level0OverlappingSubLevelCompactLevelCount => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("level0OverlappingSubLevelCompactLevelCount"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::Level0OverlappingSubLevelCompactLevelCount(x.0));
}
GeneratedField::MaxSpaceReclaimBytes => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("maxSpaceReclaimBytes"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::MaxSpaceReclaimBytes(x.0));
}
GeneratedField::Level0MaxCompactFileNumber => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("level0MaxCompactFileNumber"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::Level0MaxCompactFileNumber(x.0));
}
GeneratedField::EnableEmergencyPicker => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("enableEmergencyPicker"));
}
mutable_config__ = map_.next_value::<::std::option::Option<_>>()?.map(rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::EnableEmergencyPicker);
}
GeneratedField::TombstoneReclaimRatio => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("tombstoneReclaimRatio"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::TombstoneReclaimRatio(x.0));
}
GeneratedField::CompressionAlgorithm => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("compressionAlgorithm"));
}
mutable_config__ = map_.next_value::<::std::option::Option<_>>()?.map(rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::CompressionAlgorithm)
;
}
GeneratedField::MaxL0CompactLevelCount => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("maxL0CompactLevelCount"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::MaxL0CompactLevelCount(x.0));
}
GeneratedField::SstAllowedTrivialMoveMinSize => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("sstAllowedTrivialMoveMinSize"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::SstAllowedTrivialMoveMinSize(x.0));
}
GeneratedField::SplitWeightByVnode => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("splitWeightByVnode"));
}
mutable_config__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::SplitWeightByVnode(x.0));
}
GeneratedField::DisableAutoGroupScheduling => {
if mutable_config__.is_some() {
return Err(serde::de::Error::duplicate_field("disableAutoGroupScheduling"));
}
mutable_config__ = map_.next_value::<::std::option::Option<_>>()?.map(rise_ctl_update_compaction_config_request::mutable_config::MutableConfig::DisableAutoGroupScheduling);
}
}
}
Ok(rise_ctl_update_compaction_config_request::MutableConfig {
mutable_config: mutable_config__,
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlUpdateCompactionConfigRequest.MutableConfig", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RiseCtlUpdateCompactionConfigResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.status.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.RiseCtlUpdateCompactionConfigResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RiseCtlUpdateCompactionConfigResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"status" => Ok(GeneratedField::Status),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RiseCtlUpdateCompactionConfigResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.RiseCtlUpdateCompactionConfigResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RiseCtlUpdateCompactionConfigResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Status => {
if status__.is_some() {
return Err(serde::de::Error::duplicate_field("status"));
}
status__ = map_.next_value()?;
}
}
}
Ok(RiseCtlUpdateCompactionConfigResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("hummock.RiseCtlUpdateCompactionConfigResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SplitCompactionGroupRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.group_id != 0 {
len += 1;
}
if !self.table_ids.is_empty() {
len += 1;
}
if self.partition_vnode_count != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.SplitCompactionGroupRequest", len)?;
if self.group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?;
}
if !self.table_ids.is_empty() {
struct_ser.serialize_field("tableIds", &self.table_ids)?;
}
if self.partition_vnode_count != 0 {
struct_ser.serialize_field("partitionVnodeCount", &self.partition_vnode_count)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SplitCompactionGroupRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"group_id",
"groupId",
"table_ids",
"tableIds",
"partition_vnode_count",
"partitionVnodeCount",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
GroupId,
TableIds,
PartitionVnodeCount,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"groupId" | "group_id" => Ok(GeneratedField::GroupId),
"tableIds" | "table_ids" => Ok(GeneratedField::TableIds),
"partitionVnodeCount" | "partition_vnode_count" => Ok(GeneratedField::PartitionVnodeCount),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SplitCompactionGroupRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.SplitCompactionGroupRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SplitCompactionGroupRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut group_id__ = None;
let mut table_ids__ = None;
let mut partition_vnode_count__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::GroupId => {
if group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("groupId"));
}
group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableIds => {
if table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("tableIds"));
}
table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::PartitionVnodeCount => {
if partition_vnode_count__.is_some() {
return Err(serde::de::Error::duplicate_field("partitionVnodeCount"));
}
partition_vnode_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(SplitCompactionGroupRequest {
group_id: group_id__.unwrap_or_default(),
table_ids: table_ids__.unwrap_or_default(),
partition_vnode_count: partition_vnode_count__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.SplitCompactionGroupRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SplitCompactionGroupResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.new_group_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.SplitCompactionGroupResponse", len)?;
if self.new_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("newGroupId", ToString::to_string(&self.new_group_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SplitCompactionGroupResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"new_group_id",
"newGroupId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
NewGroupId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"newGroupId" | "new_group_id" => Ok(GeneratedField::NewGroupId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SplitCompactionGroupResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.SplitCompactionGroupResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SplitCompactionGroupResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut new_group_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::NewGroupId => {
if new_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("newGroupId"));
}
new_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(SplitCompactionGroupResponse {
new_group_id: new_group_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.SplitCompactionGroupResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SstableInfo {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.object_id != 0 {
len += 1;
}
if self.sst_id != 0 {
len += 1;
}
if self.key_range.is_some() {
len += 1;
}
if self.file_size != 0 {
len += 1;
}
if !self.table_ids.is_empty() {
len += 1;
}
if self.meta_offset != 0 {
len += 1;
}
if self.stale_key_count != 0 {
len += 1;
}
if self.total_key_count != 0 {
len += 1;
}
if self.min_epoch != 0 {
len += 1;
}
if self.max_epoch != 0 {
len += 1;
}
if self.uncompressed_file_size != 0 {
len += 1;
}
if self.range_tombstone_count != 0 {
len += 1;
}
if self.bloom_filter_kind != 0 {
len += 1;
}
if self.sst_size != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.SstableInfo", len)?;
if self.object_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("objectId", ToString::to_string(&self.object_id).as_str())?;
}
if self.sst_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("sstId", ToString::to_string(&self.sst_id).as_str())?;
}
if let Some(v) = self.key_range.as_ref() {
struct_ser.serialize_field("keyRange", v)?;
}
if self.file_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("fileSize", ToString::to_string(&self.file_size).as_str())?;
}
if !self.table_ids.is_empty() {
struct_ser.serialize_field("tableIds", &self.table_ids)?;
}
if self.meta_offset != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("metaOffset", ToString::to_string(&self.meta_offset).as_str())?;
}
if self.stale_key_count != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("staleKeyCount", ToString::to_string(&self.stale_key_count).as_str())?;
}
if self.total_key_count != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("totalKeyCount", ToString::to_string(&self.total_key_count).as_str())?;
}
if self.min_epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("minEpoch", ToString::to_string(&self.min_epoch).as_str())?;
}
if self.max_epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("maxEpoch", ToString::to_string(&self.max_epoch).as_str())?;
}
if self.uncompressed_file_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("uncompressedFileSize", ToString::to_string(&self.uncompressed_file_size).as_str())?;
}
if self.range_tombstone_count != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("rangeTombstoneCount", ToString::to_string(&self.range_tombstone_count).as_str())?;
}
if self.bloom_filter_kind != 0 {
let v = BloomFilterType::try_from(self.bloom_filter_kind)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.bloom_filter_kind)))?;
struct_ser.serialize_field("bloomFilterKind", &v)?;
}
if self.sst_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("sstSize", ToString::to_string(&self.sst_size).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SstableInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"object_id",
"objectId",
"sst_id",
"sstId",
"key_range",
"keyRange",
"file_size",
"fileSize",
"table_ids",
"tableIds",
"meta_offset",
"metaOffset",
"stale_key_count",
"staleKeyCount",
"total_key_count",
"totalKeyCount",
"min_epoch",
"minEpoch",
"max_epoch",
"maxEpoch",
"uncompressed_file_size",
"uncompressedFileSize",
"range_tombstone_count",
"rangeTombstoneCount",
"bloom_filter_kind",
"bloomFilterKind",
"sst_size",
"sstSize",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ObjectId,
SstId,
KeyRange,
FileSize,
TableIds,
MetaOffset,
StaleKeyCount,
TotalKeyCount,
MinEpoch,
MaxEpoch,
UncompressedFileSize,
RangeTombstoneCount,
BloomFilterKind,
SstSize,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"objectId" | "object_id" => Ok(GeneratedField::ObjectId),
"sstId" | "sst_id" => Ok(GeneratedField::SstId),
"keyRange" | "key_range" => Ok(GeneratedField::KeyRange),
"fileSize" | "file_size" => Ok(GeneratedField::FileSize),
"tableIds" | "table_ids" => Ok(GeneratedField::TableIds),
"metaOffset" | "meta_offset" => Ok(GeneratedField::MetaOffset),
"staleKeyCount" | "stale_key_count" => Ok(GeneratedField::StaleKeyCount),
"totalKeyCount" | "total_key_count" => Ok(GeneratedField::TotalKeyCount),
"minEpoch" | "min_epoch" => Ok(GeneratedField::MinEpoch),
"maxEpoch" | "max_epoch" => Ok(GeneratedField::MaxEpoch),
"uncompressedFileSize" | "uncompressed_file_size" => Ok(GeneratedField::UncompressedFileSize),
"rangeTombstoneCount" | "range_tombstone_count" => Ok(GeneratedField::RangeTombstoneCount),
"bloomFilterKind" | "bloom_filter_kind" => Ok(GeneratedField::BloomFilterKind),
"sstSize" | "sst_size" => Ok(GeneratedField::SstSize),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SstableInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.SstableInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SstableInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut object_id__ = None;
let mut sst_id__ = None;
let mut key_range__ = None;
let mut file_size__ = None;
let mut table_ids__ = None;
let mut meta_offset__ = None;
let mut stale_key_count__ = None;
let mut total_key_count__ = None;
let mut min_epoch__ = None;
let mut max_epoch__ = None;
let mut uncompressed_file_size__ = None;
let mut range_tombstone_count__ = None;
let mut bloom_filter_kind__ = None;
let mut sst_size__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ObjectId => {
if object_id__.is_some() {
return Err(serde::de::Error::duplicate_field("objectId"));
}
object_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SstId => {
if sst_id__.is_some() {
return Err(serde::de::Error::duplicate_field("sstId"));
}
sst_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::KeyRange => {
if key_range__.is_some() {
return Err(serde::de::Error::duplicate_field("keyRange"));
}
key_range__ = map_.next_value()?;
}
GeneratedField::FileSize => {
if file_size__.is_some() {
return Err(serde::de::Error::duplicate_field("fileSize"));
}
file_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableIds => {
if table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("tableIds"));
}
table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::MetaOffset => {
if meta_offset__.is_some() {
return Err(serde::de::Error::duplicate_field("metaOffset"));
}
meta_offset__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::StaleKeyCount => {
if stale_key_count__.is_some() {
return Err(serde::de::Error::duplicate_field("staleKeyCount"));
}
stale_key_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TotalKeyCount => {
if total_key_count__.is_some() {
return Err(serde::de::Error::duplicate_field("totalKeyCount"));
}
total_key_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::MinEpoch => {
if min_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("minEpoch"));
}
min_epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::MaxEpoch => {
if max_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("maxEpoch"));
}
max_epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::UncompressedFileSize => {
if uncompressed_file_size__.is_some() {
return Err(serde::de::Error::duplicate_field("uncompressedFileSize"));
}
uncompressed_file_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::RangeTombstoneCount => {
if range_tombstone_count__.is_some() {
return Err(serde::de::Error::duplicate_field("rangeTombstoneCount"));
}
range_tombstone_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::BloomFilterKind => {
if bloom_filter_kind__.is_some() {
return Err(serde::de::Error::duplicate_field("bloomFilterKind"));
}
bloom_filter_kind__ = Some(map_.next_value::<BloomFilterType>()? as i32);
}
GeneratedField::SstSize => {
if sst_size__.is_some() {
return Err(serde::de::Error::duplicate_field("sstSize"));
}
sst_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(SstableInfo {
object_id: object_id__.unwrap_or_default(),
sst_id: sst_id__.unwrap_or_default(),
key_range: key_range__,
file_size: file_size__.unwrap_or_default(),
table_ids: table_ids__.unwrap_or_default(),
meta_offset: meta_offset__.unwrap_or_default(),
stale_key_count: stale_key_count__.unwrap_or_default(),
total_key_count: total_key_count__.unwrap_or_default(),
min_epoch: min_epoch__.unwrap_or_default(),
max_epoch: max_epoch__.unwrap_or_default(),
uncompressed_file_size: uncompressed_file_size__.unwrap_or_default(),
range_tombstone_count: range_tombstone_count__.unwrap_or_default(),
bloom_filter_kind: bloom_filter_kind__.unwrap_or_default(),
sst_size: sst_size__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.SstableInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StateTableInfo {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.committed_epoch != 0 {
len += 1;
}
if self.compaction_group_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.StateTableInfo", len)?;
if self.committed_epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("committedEpoch", ToString::to_string(&self.committed_epoch).as_str())?;
}
if self.compaction_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("compactionGroupId", ToString::to_string(&self.compaction_group_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StateTableInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"committed_epoch",
"committedEpoch",
"compaction_group_id",
"compactionGroupId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CommittedEpoch,
CompactionGroupId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"committedEpoch" | "committed_epoch" => Ok(GeneratedField::CommittedEpoch),
"compactionGroupId" | "compaction_group_id" => Ok(GeneratedField::CompactionGroupId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StateTableInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.StateTableInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StateTableInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut committed_epoch__ = None;
let mut compaction_group_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CommittedEpoch => {
if committed_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("committedEpoch"));
}
committed_epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CompactionGroupId => {
if compaction_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroupId"));
}
compaction_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(StateTableInfo {
committed_epoch: committed_epoch__.unwrap_or_default(),
compaction_group_id: compaction_group_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.StateTableInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for StateTableInfoDelta {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.committed_epoch != 0 {
len += 1;
}
if self.compaction_group_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.StateTableInfoDelta", len)?;
if self.committed_epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("committedEpoch", ToString::to_string(&self.committed_epoch).as_str())?;
}
if self.compaction_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("compactionGroupId", ToString::to_string(&self.compaction_group_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for StateTableInfoDelta {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"committed_epoch",
"committedEpoch",
"compaction_group_id",
"compactionGroupId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CommittedEpoch,
CompactionGroupId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"committedEpoch" | "committed_epoch" => Ok(GeneratedField::CommittedEpoch),
"compactionGroupId" | "compaction_group_id" => Ok(GeneratedField::CompactionGroupId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = StateTableInfoDelta;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.StateTableInfoDelta")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<StateTableInfoDelta, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut committed_epoch__ = None;
let mut compaction_group_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CommittedEpoch => {
if committed_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("committedEpoch"));
}
committed_epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CompactionGroupId => {
if compaction_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroupId"));
}
compaction_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(StateTableInfoDelta {
committed_epoch: committed_epoch__.unwrap_or_default(),
compaction_group_id: compaction_group_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.StateTableInfoDelta", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SubscribeCompactionEventRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.create_at != 0 {
len += 1;
}
if self.event.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.SubscribeCompactionEventRequest", len)?;
if self.create_at != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("createAt", ToString::to_string(&self.create_at).as_str())?;
}
if let Some(v) = self.event.as_ref() {
match v {
subscribe_compaction_event_request::Event::Register(v) => {
struct_ser.serialize_field("register", v)?;
}
subscribe_compaction_event_request::Event::PullTask(v) => {
struct_ser.serialize_field("pullTask", v)?;
}
subscribe_compaction_event_request::Event::ReportTask(v) => {
struct_ser.serialize_field("reportTask", v)?;
}
subscribe_compaction_event_request::Event::HeartBeat(v) => {
struct_ser.serialize_field("heartBeat", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SubscribeCompactionEventRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"create_at",
"createAt",
"register",
"pull_task",
"pullTask",
"report_task",
"reportTask",
"heart_beat",
"heartBeat",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CreateAt,
Register,
PullTask,
ReportTask,
HeartBeat,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"createAt" | "create_at" => Ok(GeneratedField::CreateAt),
"register" => Ok(GeneratedField::Register),
"pullTask" | "pull_task" => Ok(GeneratedField::PullTask),
"reportTask" | "report_task" => Ok(GeneratedField::ReportTask),
"heartBeat" | "heart_beat" => Ok(GeneratedField::HeartBeat),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SubscribeCompactionEventRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.SubscribeCompactionEventRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SubscribeCompactionEventRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut create_at__ = None;
let mut event__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CreateAt => {
if create_at__.is_some() {
return Err(serde::de::Error::duplicate_field("createAt"));
}
create_at__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Register => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("register"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_compaction_event_request::Event::Register)
;
}
GeneratedField::PullTask => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("pullTask"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_compaction_event_request::Event::PullTask)
;
}
GeneratedField::ReportTask => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("reportTask"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_compaction_event_request::Event::ReportTask)
;
}
GeneratedField::HeartBeat => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("heartBeat"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_compaction_event_request::Event::HeartBeat)
;
}
}
}
Ok(SubscribeCompactionEventRequest {
create_at: create_at__.unwrap_or_default(),
event: event__,
})
}
}
deserializer.deserialize_struct("hummock.SubscribeCompactionEventRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for subscribe_compaction_event_request::HeartBeat {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.progress.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.SubscribeCompactionEventRequest.HeartBeat", len)?;
if !self.progress.is_empty() {
struct_ser.serialize_field("progress", &self.progress)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for subscribe_compaction_event_request::HeartBeat {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"progress",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Progress,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"progress" => Ok(GeneratedField::Progress),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = subscribe_compaction_event_request::HeartBeat;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.SubscribeCompactionEventRequest.HeartBeat")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<subscribe_compaction_event_request::HeartBeat, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut progress__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Progress => {
if progress__.is_some() {
return Err(serde::de::Error::duplicate_field("progress"));
}
progress__ = Some(map_.next_value()?);
}
}
}
Ok(subscribe_compaction_event_request::HeartBeat {
progress: progress__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.SubscribeCompactionEventRequest.HeartBeat", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for subscribe_compaction_event_request::PullTask {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.pull_task_count != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.SubscribeCompactionEventRequest.PullTask", len)?;
if self.pull_task_count != 0 {
struct_ser.serialize_field("pullTaskCount", &self.pull_task_count)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for subscribe_compaction_event_request::PullTask {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"pull_task_count",
"pullTaskCount",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
PullTaskCount,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"pullTaskCount" | "pull_task_count" => Ok(GeneratedField::PullTaskCount),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = subscribe_compaction_event_request::PullTask;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.SubscribeCompactionEventRequest.PullTask")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<subscribe_compaction_event_request::PullTask, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut pull_task_count__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::PullTaskCount => {
if pull_task_count__.is_some() {
return Err(serde::de::Error::duplicate_field("pullTaskCount"));
}
pull_task_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(subscribe_compaction_event_request::PullTask {
pull_task_count: pull_task_count__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.SubscribeCompactionEventRequest.PullTask", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for subscribe_compaction_event_request::Register {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.context_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.SubscribeCompactionEventRequest.Register", len)?;
if self.context_id != 0 {
struct_ser.serialize_field("contextId", &self.context_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for subscribe_compaction_event_request::Register {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"context_id",
"contextId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ContextId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"contextId" | "context_id" => Ok(GeneratedField::ContextId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = subscribe_compaction_event_request::Register;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.SubscribeCompactionEventRequest.Register")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<subscribe_compaction_event_request::Register, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut context_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ContextId => {
if context_id__.is_some() {
return Err(serde::de::Error::duplicate_field("contextId"));
}
context_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(subscribe_compaction_event_request::Register {
context_id: context_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.SubscribeCompactionEventRequest.Register", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for subscribe_compaction_event_request::ReportTask {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.table_stats_change.is_empty() {
len += 1;
}
if self.task_id != 0 {
len += 1;
}
if self.task_status != 0 {
len += 1;
}
if !self.sorted_output_ssts.is_empty() {
len += 1;
}
if !self.object_timestamps.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.SubscribeCompactionEventRequest.ReportTask", len)?;
if !self.table_stats_change.is_empty() {
struct_ser.serialize_field("tableStatsChange", &self.table_stats_change)?;
}
if self.task_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("taskId", ToString::to_string(&self.task_id).as_str())?;
}
if self.task_status != 0 {
let v = compact_task::TaskStatus::try_from(self.task_status)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.task_status)))?;
struct_ser.serialize_field("taskStatus", &v)?;
}
if !self.sorted_output_ssts.is_empty() {
struct_ser.serialize_field("sortedOutputSsts", &self.sorted_output_ssts)?;
}
if !self.object_timestamps.is_empty() {
let v: std::collections::HashMap<_, _> = self.object_timestamps.iter()
.map(|(k, v)| (k, v.to_string())).collect();
struct_ser.serialize_field("objectTimestamps", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for subscribe_compaction_event_request::ReportTask {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_stats_change",
"tableStatsChange",
"task_id",
"taskId",
"task_status",
"taskStatus",
"sorted_output_ssts",
"sortedOutputSsts",
"object_timestamps",
"objectTimestamps",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableStatsChange,
TaskId,
TaskStatus,
SortedOutputSsts,
ObjectTimestamps,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"tableStatsChange" | "table_stats_change" => Ok(GeneratedField::TableStatsChange),
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
"taskStatus" | "task_status" => Ok(GeneratedField::TaskStatus),
"sortedOutputSsts" | "sorted_output_ssts" => Ok(GeneratedField::SortedOutputSsts),
"objectTimestamps" | "object_timestamps" => Ok(GeneratedField::ObjectTimestamps),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = subscribe_compaction_event_request::ReportTask;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.SubscribeCompactionEventRequest.ReportTask")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<subscribe_compaction_event_request::ReportTask, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_stats_change__ = None;
let mut task_id__ = None;
let mut task_status__ = None;
let mut sorted_output_ssts__ = None;
let mut object_timestamps__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableStatsChange => {
if table_stats_change__.is_some() {
return Err(serde::de::Error::duplicate_field("tableStatsChange"));
}
table_stats_change__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TaskStatus => {
if task_status__.is_some() {
return Err(serde::de::Error::duplicate_field("taskStatus"));
}
task_status__ = Some(map_.next_value::<compact_task::TaskStatus>()? as i32);
}
GeneratedField::SortedOutputSsts => {
if sorted_output_ssts__.is_some() {
return Err(serde::de::Error::duplicate_field("sortedOutputSsts"));
}
sorted_output_ssts__ = Some(map_.next_value()?);
}
GeneratedField::ObjectTimestamps => {
if object_timestamps__.is_some() {
return Err(serde::de::Error::duplicate_field("objectTimestamps"));
}
object_timestamps__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u64>, ::pbjson::private::NumberDeserialize<u64>>>()?
.into_iter().map(|(k,v)| (k.0, v.0)).collect()
);
}
}
}
Ok(subscribe_compaction_event_request::ReportTask {
table_stats_change: table_stats_change__.unwrap_or_default(),
task_id: task_id__.unwrap_or_default(),
task_status: task_status__.unwrap_or_default(),
sorted_output_ssts: sorted_output_ssts__.unwrap_or_default(),
object_timestamps: object_timestamps__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.SubscribeCompactionEventRequest.ReportTask", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SubscribeCompactionEventResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.create_at != 0 {
len += 1;
}
if self.event.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.SubscribeCompactionEventResponse", len)?;
if self.create_at != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("createAt", ToString::to_string(&self.create_at).as_str())?;
}
if let Some(v) = self.event.as_ref() {
match v {
subscribe_compaction_event_response::Event::CompactTask(v) => {
struct_ser.serialize_field("compactTask", v)?;
}
subscribe_compaction_event_response::Event::VacuumTask(v) => {
struct_ser.serialize_field("vacuumTask", v)?;
}
subscribe_compaction_event_response::Event::FullScanTask(v) => {
struct_ser.serialize_field("fullScanTask", v)?;
}
subscribe_compaction_event_response::Event::ValidationTask(v) => {
struct_ser.serialize_field("validationTask", v)?;
}
subscribe_compaction_event_response::Event::CancelCompactTask(v) => {
struct_ser.serialize_field("cancelCompactTask", v)?;
}
subscribe_compaction_event_response::Event::PullTaskAck(v) => {
struct_ser.serialize_field("pullTaskAck", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SubscribeCompactionEventResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"create_at",
"createAt",
"compact_task",
"compactTask",
"vacuum_task",
"vacuumTask",
"full_scan_task",
"fullScanTask",
"validation_task",
"validationTask",
"cancel_compact_task",
"cancelCompactTask",
"pull_task_ack",
"pullTaskAck",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CreateAt,
CompactTask,
VacuumTask,
FullScanTask,
ValidationTask,
CancelCompactTask,
PullTaskAck,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"createAt" | "create_at" => Ok(GeneratedField::CreateAt),
"compactTask" | "compact_task" => Ok(GeneratedField::CompactTask),
"vacuumTask" | "vacuum_task" => Ok(GeneratedField::VacuumTask),
"fullScanTask" | "full_scan_task" => Ok(GeneratedField::FullScanTask),
"validationTask" | "validation_task" => Ok(GeneratedField::ValidationTask),
"cancelCompactTask" | "cancel_compact_task" => Ok(GeneratedField::CancelCompactTask),
"pullTaskAck" | "pull_task_ack" => Ok(GeneratedField::PullTaskAck),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SubscribeCompactionEventResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.SubscribeCompactionEventResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SubscribeCompactionEventResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut create_at__ = None;
let mut event__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CreateAt => {
if create_at__.is_some() {
return Err(serde::de::Error::duplicate_field("createAt"));
}
create_at__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CompactTask => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("compactTask"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_compaction_event_response::Event::CompactTask)
;
}
GeneratedField::VacuumTask => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("vacuumTask"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_compaction_event_response::Event::VacuumTask)
;
}
GeneratedField::FullScanTask => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("fullScanTask"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_compaction_event_response::Event::FullScanTask)
;
}
GeneratedField::ValidationTask => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("validationTask"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_compaction_event_response::Event::ValidationTask)
;
}
GeneratedField::CancelCompactTask => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("cancelCompactTask"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_compaction_event_response::Event::CancelCompactTask)
;
}
GeneratedField::PullTaskAck => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("pullTaskAck"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_compaction_event_response::Event::PullTaskAck)
;
}
}
}
Ok(SubscribeCompactionEventResponse {
create_at: create_at__.unwrap_or_default(),
event: event__,
})
}
}
deserializer.deserialize_struct("hummock.SubscribeCompactionEventResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for subscribe_compaction_event_response::PullTaskAck {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.SubscribeCompactionEventResponse.PullTaskAck", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for subscribe_compaction_event_response::PullTaskAck {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = subscribe_compaction_event_response::PullTaskAck;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.SubscribeCompactionEventResponse.PullTaskAck")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<subscribe_compaction_event_response::PullTaskAck, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(subscribe_compaction_event_response::PullTaskAck {
})
}
}
deserializer.deserialize_struct("hummock.SubscribeCompactionEventResponse.PullTaskAck", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TableChangeLog {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.change_logs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.TableChangeLog", len)?;
if !self.change_logs.is_empty() {
struct_ser.serialize_field("changeLogs", &self.change_logs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TableChangeLog {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"change_logs",
"changeLogs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ChangeLogs,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"changeLogs" | "change_logs" => Ok(GeneratedField::ChangeLogs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TableChangeLog;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.TableChangeLog")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TableChangeLog, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut change_logs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ChangeLogs => {
if change_logs__.is_some() {
return Err(serde::de::Error::duplicate_field("changeLogs"));
}
change_logs__ = Some(map_.next_value()?);
}
}
}
Ok(TableChangeLog {
change_logs: change_logs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.TableChangeLog", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TableOption {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.retention_seconds.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.TableOption", len)?;
if let Some(v) = self.retention_seconds.as_ref() {
struct_ser.serialize_field("retentionSeconds", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TableOption {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"retention_seconds",
"retentionSeconds",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
RetentionSeconds,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"retentionSeconds" | "retention_seconds" => Ok(GeneratedField::RetentionSeconds),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TableOption;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.TableOption")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TableOption, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut retention_seconds__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::RetentionSeconds => {
if retention_seconds__.is_some() {
return Err(serde::de::Error::duplicate_field("retentionSeconds"));
}
retention_seconds__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
}
}
Ok(TableOption {
retention_seconds: retention_seconds__,
})
}
}
deserializer.deserialize_struct("hummock.TableOption", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TableSchema {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.column_ids.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.TableSchema", len)?;
if !self.column_ids.is_empty() {
struct_ser.serialize_field("columnIds", &self.column_ids)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TableSchema {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"column_ids",
"columnIds",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ColumnIds,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"columnIds" | "column_ids" => Ok(GeneratedField::ColumnIds),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TableSchema;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.TableSchema")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TableSchema, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut column_ids__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ColumnIds => {
if column_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("columnIds"));
}
column_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(TableSchema {
column_ids: column_ids__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.TableSchema", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TableStats {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.total_key_size != 0 {
len += 1;
}
if self.total_value_size != 0 {
len += 1;
}
if self.total_key_count != 0 {
len += 1;
}
if self.total_compressed_size != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.TableStats", len)?;
if self.total_key_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("totalKeySize", ToString::to_string(&self.total_key_size).as_str())?;
}
if self.total_value_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("totalValueSize", ToString::to_string(&self.total_value_size).as_str())?;
}
if self.total_key_count != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("totalKeyCount", ToString::to_string(&self.total_key_count).as_str())?;
}
if self.total_compressed_size != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("totalCompressedSize", ToString::to_string(&self.total_compressed_size).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TableStats {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"total_key_size",
"totalKeySize",
"total_value_size",
"totalValueSize",
"total_key_count",
"totalKeyCount",
"total_compressed_size",
"totalCompressedSize",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TotalKeySize,
TotalValueSize,
TotalKeyCount,
TotalCompressedSize,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"totalKeySize" | "total_key_size" => Ok(GeneratedField::TotalKeySize),
"totalValueSize" | "total_value_size" => Ok(GeneratedField::TotalValueSize),
"totalKeyCount" | "total_key_count" => Ok(GeneratedField::TotalKeyCount),
"totalCompressedSize" | "total_compressed_size" => Ok(GeneratedField::TotalCompressedSize),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TableStats;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.TableStats")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TableStats, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut total_key_size__ = None;
let mut total_value_size__ = None;
let mut total_key_count__ = None;
let mut total_compressed_size__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TotalKeySize => {
if total_key_size__.is_some() {
return Err(serde::de::Error::duplicate_field("totalKeySize"));
}
total_key_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TotalValueSize => {
if total_value_size__.is_some() {
return Err(serde::de::Error::duplicate_field("totalValueSize"));
}
total_value_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TotalKeyCount => {
if total_key_count__.is_some() {
return Err(serde::de::Error::duplicate_field("totalKeyCount"));
}
total_key_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TotalCompressedSize => {
if total_compressed_size__.is_some() {
return Err(serde::de::Error::duplicate_field("totalCompressedSize"));
}
total_compressed_size__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(TableStats {
total_key_size: total_key_size__.unwrap_or_default(),
total_value_size: total_value_size__.unwrap_or_default(),
total_key_count: total_key_count__.unwrap_or_default(),
total_compressed_size: total_compressed_size__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.TableStats", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TableWatermarks {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.epoch_watermarks.is_empty() {
len += 1;
}
if self.is_ascending {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.TableWatermarks", len)?;
if !self.epoch_watermarks.is_empty() {
struct_ser.serialize_field("epochWatermarks", &self.epoch_watermarks)?;
}
if self.is_ascending {
struct_ser.serialize_field("isAscending", &self.is_ascending)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TableWatermarks {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"epoch_watermarks",
"epochWatermarks",
"is_ascending",
"isAscending",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
EpochWatermarks,
IsAscending,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"epochWatermarks" | "epoch_watermarks" => Ok(GeneratedField::EpochWatermarks),
"isAscending" | "is_ascending" => Ok(GeneratedField::IsAscending),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TableWatermarks;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.TableWatermarks")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TableWatermarks, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut epoch_watermarks__ = None;
let mut is_ascending__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::EpochWatermarks => {
if epoch_watermarks__.is_some() {
return Err(serde::de::Error::duplicate_field("epochWatermarks"));
}
epoch_watermarks__ = Some(map_.next_value()?);
}
GeneratedField::IsAscending => {
if is_ascending__.is_some() {
return Err(serde::de::Error::duplicate_field("isAscending"));
}
is_ascending__ = Some(map_.next_value()?);
}
}
}
Ok(TableWatermarks {
epoch_watermarks: epoch_watermarks__.unwrap_or_default(),
is_ascending: is_ascending__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.TableWatermarks", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for table_watermarks::EpochNewWatermarks {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.watermarks.is_empty() {
len += 1;
}
if self.epoch != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.TableWatermarks.EpochNewWatermarks", len)?;
if !self.watermarks.is_empty() {
struct_ser.serialize_field("watermarks", &self.watermarks)?;
}
if self.epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for table_watermarks::EpochNewWatermarks {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"watermarks",
"epoch",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Watermarks,
Epoch,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"watermarks" => Ok(GeneratedField::Watermarks),
"epoch" => Ok(GeneratedField::Epoch),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = table_watermarks::EpochNewWatermarks;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.TableWatermarks.EpochNewWatermarks")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<table_watermarks::EpochNewWatermarks, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut watermarks__ = None;
let mut epoch__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Watermarks => {
if watermarks__.is_some() {
return Err(serde::de::Error::duplicate_field("watermarks"));
}
watermarks__ = Some(map_.next_value()?);
}
GeneratedField::Epoch => {
if epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("epoch"));
}
epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(table_watermarks::EpochNewWatermarks {
watermarks: watermarks__.unwrap_or_default(),
epoch: epoch__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.TableWatermarks.EpochNewWatermarks", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TriggerCompactionDeterministicRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.version_id != 0 {
len += 1;
}
if !self.compaction_groups.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.TriggerCompactionDeterministicRequest", len)?;
if self.version_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("versionId", ToString::to_string(&self.version_id).as_str())?;
}
if !self.compaction_groups.is_empty() {
struct_ser.serialize_field("compactionGroups", &self.compaction_groups.iter().map(ToString::to_string).collect::<Vec<_>>())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TriggerCompactionDeterministicRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"version_id",
"versionId",
"compaction_groups",
"compactionGroups",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
VersionId,
CompactionGroups,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"versionId" | "version_id" => Ok(GeneratedField::VersionId),
"compactionGroups" | "compaction_groups" => Ok(GeneratedField::CompactionGroups),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TriggerCompactionDeterministicRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.TriggerCompactionDeterministicRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TriggerCompactionDeterministicRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut version_id__ = None;
let mut compaction_groups__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::VersionId => {
if version_id__.is_some() {
return Err(serde::de::Error::duplicate_field("versionId"));
}
version_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CompactionGroups => {
if compaction_groups__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroups"));
}
compaction_groups__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(TriggerCompactionDeterministicRequest {
version_id: version_id__.unwrap_or_default(),
compaction_groups: compaction_groups__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.TriggerCompactionDeterministicRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TriggerCompactionDeterministicResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("hummock.TriggerCompactionDeterministicResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TriggerCompactionDeterministicResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TriggerCompactionDeterministicResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.TriggerCompactionDeterministicResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TriggerCompactionDeterministicResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(TriggerCompactionDeterministicResponse {
})
}
}
deserializer.deserialize_struct("hummock.TriggerCompactionDeterministicResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TriggerFullGcRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.sst_retention_time_sec != 0 {
len += 1;
}
if self.prefix.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.TriggerFullGCRequest", len)?;
if self.sst_retention_time_sec != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("sstRetentionTimeSec", ToString::to_string(&self.sst_retention_time_sec).as_str())?;
}
if let Some(v) = self.prefix.as_ref() {
struct_ser.serialize_field("prefix", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TriggerFullGcRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"sst_retention_time_sec",
"sstRetentionTimeSec",
"prefix",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SstRetentionTimeSec,
Prefix,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"sstRetentionTimeSec" | "sst_retention_time_sec" => Ok(GeneratedField::SstRetentionTimeSec),
"prefix" => Ok(GeneratedField::Prefix),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TriggerFullGcRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.TriggerFullGCRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TriggerFullGcRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut sst_retention_time_sec__ = None;
let mut prefix__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SstRetentionTimeSec => {
if sst_retention_time_sec__.is_some() {
return Err(serde::de::Error::duplicate_field("sstRetentionTimeSec"));
}
sst_retention_time_sec__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Prefix => {
if prefix__.is_some() {
return Err(serde::de::Error::duplicate_field("prefix"));
}
prefix__ = map_.next_value()?;
}
}
}
Ok(TriggerFullGcRequest {
sst_retention_time_sec: sst_retention_time_sec__.unwrap_or_default(),
prefix: prefix__,
})
}
}
deserializer.deserialize_struct("hummock.TriggerFullGCRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TriggerFullGcResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.status.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.TriggerFullGCResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TriggerFullGcResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"status" => Ok(GeneratedField::Status),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TriggerFullGcResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.TriggerFullGCResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TriggerFullGcResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Status => {
if status__.is_some() {
return Err(serde::de::Error::duplicate_field("status"));
}
status__ = map_.next_value()?;
}
}
}
Ok(TriggerFullGcResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("hummock.TriggerFullGCResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TriggerManualCompactionRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.compaction_group_id != 0 {
len += 1;
}
if self.key_range.is_some() {
len += 1;
}
if self.table_id != 0 {
len += 1;
}
if self.level != 0 {
len += 1;
}
if !self.sst_ids.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.TriggerManualCompactionRequest", len)?;
if self.compaction_group_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("compactionGroupId", ToString::to_string(&self.compaction_group_id).as_str())?;
}
if let Some(v) = self.key_range.as_ref() {
struct_ser.serialize_field("keyRange", v)?;
}
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if self.level != 0 {
struct_ser.serialize_field("level", &self.level)?;
}
if !self.sst_ids.is_empty() {
struct_ser.serialize_field("sstIds", &self.sst_ids.iter().map(ToString::to_string).collect::<Vec<_>>())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TriggerManualCompactionRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"compaction_group_id",
"compactionGroupId",
"key_range",
"keyRange",
"table_id",
"tableId",
"level",
"sst_ids",
"sstIds",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CompactionGroupId,
KeyRange,
TableId,
Level,
SstIds,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"compactionGroupId" | "compaction_group_id" => Ok(GeneratedField::CompactionGroupId),
"keyRange" | "key_range" => Ok(GeneratedField::KeyRange),
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"level" => Ok(GeneratedField::Level),
"sstIds" | "sst_ids" => Ok(GeneratedField::SstIds),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TriggerManualCompactionRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.TriggerManualCompactionRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TriggerManualCompactionRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut compaction_group_id__ = None;
let mut key_range__ = None;
let mut table_id__ = None;
let mut level__ = None;
let mut sst_ids__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CompactionGroupId => {
if compaction_group_id__.is_some() {
return Err(serde::de::Error::duplicate_field("compactionGroupId"));
}
compaction_group_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::KeyRange => {
if key_range__.is_some() {
return Err(serde::de::Error::duplicate_field("keyRange"));
}
key_range__ = map_.next_value()?;
}
GeneratedField::TableId => {
if table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Level => {
if level__.is_some() {
return Err(serde::de::Error::duplicate_field("level"));
}
level__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SstIds => {
if sst_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("sstIds"));
}
sst_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(TriggerManualCompactionRequest {
compaction_group_id: compaction_group_id__.unwrap_or_default(),
key_range: key_range__,
table_id: table_id__.unwrap_or_default(),
level: level__.unwrap_or_default(),
sst_ids: sst_ids__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.TriggerManualCompactionRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TriggerManualCompactionResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.status.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.TriggerManualCompactionResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TriggerManualCompactionResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"status" => Ok(GeneratedField::Status),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TriggerManualCompactionResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.TriggerManualCompactionResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TriggerManualCompactionResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Status => {
if status__.is_some() {
return Err(serde::de::Error::duplicate_field("status"));
}
status__ = map_.next_value()?;
}
}
}
Ok(TriggerManualCompactionResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("hummock.TriggerManualCompactionResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for UncommittedEpoch {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.epoch != 0 {
len += 1;
}
if !self.tables.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.UncommittedEpoch", len)?;
if self.epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("epoch", ToString::to_string(&self.epoch).as_str())?;
}
if !self.tables.is_empty() {
struct_ser.serialize_field("tables", &self.tables)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for UncommittedEpoch {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"epoch",
"tables",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Epoch,
Tables,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"epoch" => Ok(GeneratedField::Epoch),
"tables" => Ok(GeneratedField::Tables),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = UncommittedEpoch;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.UncommittedEpoch")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<UncommittedEpoch, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut epoch__ = None;
let mut tables__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Epoch => {
if epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("epoch"));
}
epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Tables => {
if tables__.is_some() {
return Err(serde::de::Error::duplicate_field("tables"));
}
tables__ = Some(map_.next_value()?);
}
}
}
Ok(UncommittedEpoch {
epoch: epoch__.unwrap_or_default(),
tables: tables__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.UncommittedEpoch", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for UnpinVersionBeforeRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.context_id != 0 {
len += 1;
}
if self.unpin_version_before != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.UnpinVersionBeforeRequest", len)?;
if self.context_id != 0 {
struct_ser.serialize_field("contextId", &self.context_id)?;
}
if self.unpin_version_before != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("unpinVersionBefore", ToString::to_string(&self.unpin_version_before).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for UnpinVersionBeforeRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"context_id",
"contextId",
"unpin_version_before",
"unpinVersionBefore",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ContextId,
UnpinVersionBefore,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"contextId" | "context_id" => Ok(GeneratedField::ContextId),
"unpinVersionBefore" | "unpin_version_before" => Ok(GeneratedField::UnpinVersionBefore),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = UnpinVersionBeforeRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.UnpinVersionBeforeRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<UnpinVersionBeforeRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut context_id__ = None;
let mut unpin_version_before__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ContextId => {
if context_id__.is_some() {
return Err(serde::de::Error::duplicate_field("contextId"));
}
context_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::UnpinVersionBefore => {
if unpin_version_before__.is_some() {
return Err(serde::de::Error::duplicate_field("unpinVersionBefore"));
}
unpin_version_before__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(UnpinVersionBeforeRequest {
context_id: context_id__.unwrap_or_default(),
unpin_version_before: unpin_version_before__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.UnpinVersionBeforeRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for UnpinVersionBeforeResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.status.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.UnpinVersionBeforeResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for UnpinVersionBeforeResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"status" => Ok(GeneratedField::Status),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = UnpinVersionBeforeResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.UnpinVersionBeforeResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<UnpinVersionBeforeResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Status => {
if status__.is_some() {
return Err(serde::de::Error::duplicate_field("status"));
}
status__ = map_.next_value()?;
}
}
}
Ok(UnpinVersionBeforeResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("hummock.UnpinVersionBeforeResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for UnpinVersionRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.context_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.UnpinVersionRequest", len)?;
if self.context_id != 0 {
struct_ser.serialize_field("contextId", &self.context_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for UnpinVersionRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"context_id",
"contextId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ContextId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"contextId" | "context_id" => Ok(GeneratedField::ContextId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = UnpinVersionRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.UnpinVersionRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<UnpinVersionRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut context_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ContextId => {
if context_id__.is_some() {
return Err(serde::de::Error::duplicate_field("contextId"));
}
context_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(UnpinVersionRequest {
context_id: context_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.UnpinVersionRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for UnpinVersionResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.status.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.UnpinVersionResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for UnpinVersionResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"status" => Ok(GeneratedField::Status),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = UnpinVersionResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.UnpinVersionResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<UnpinVersionResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Status => {
if status__.is_some() {
return Err(serde::de::Error::duplicate_field("status"));
}
status__ = map_.next_value()?;
}
}
}
Ok(UnpinVersionResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("hummock.UnpinVersionResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for VacuumTask {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.sstable_object_ids.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.VacuumTask", len)?;
if !self.sstable_object_ids.is_empty() {
struct_ser.serialize_field("sstableObjectIds", &self.sstable_object_ids.iter().map(ToString::to_string).collect::<Vec<_>>())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for VacuumTask {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"sstable_object_ids",
"sstableObjectIds",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SstableObjectIds,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"sstableObjectIds" | "sstable_object_ids" => Ok(GeneratedField::SstableObjectIds),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = VacuumTask;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.VacuumTask")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<VacuumTask, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut sstable_object_ids__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SstableObjectIds => {
if sstable_object_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("sstableObjectIds"));
}
sstable_object_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(VacuumTask {
sstable_object_ids: sstable_object_ids__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.VacuumTask", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ValidationTask {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.sst_infos.is_empty() {
len += 1;
}
if !self.sst_id_to_worker_id.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.ValidationTask", len)?;
if !self.sst_infos.is_empty() {
struct_ser.serialize_field("sstInfos", &self.sst_infos)?;
}
if !self.sst_id_to_worker_id.is_empty() {
struct_ser.serialize_field("sstIdToWorkerId", &self.sst_id_to_worker_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ValidationTask {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"sst_infos",
"sstInfos",
"sst_id_to_worker_id",
"sstIdToWorkerId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SstInfos,
SstIdToWorkerId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"sstInfos" | "sst_infos" => Ok(GeneratedField::SstInfos),
"sstIdToWorkerId" | "sst_id_to_worker_id" => Ok(GeneratedField::SstIdToWorkerId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ValidationTask;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.ValidationTask")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ValidationTask, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut sst_infos__ = None;
let mut sst_id_to_worker_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SstInfos => {
if sst_infos__.is_some() {
return Err(serde::de::Error::duplicate_field("sstInfos"));
}
sst_infos__ = Some(map_.next_value()?);
}
GeneratedField::SstIdToWorkerId => {
if sst_id_to_worker_id__.is_some() {
return Err(serde::de::Error::duplicate_field("sstIdToWorkerId"));
}
sst_id_to_worker_id__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u64>, ::pbjson::private::NumberDeserialize<u32>>>()?
.into_iter().map(|(k,v)| (k.0, v.0)).collect()
);
}
}
}
Ok(ValidationTask {
sst_infos: sst_infos__.unwrap_or_default(),
sst_id_to_worker_id: sst_id_to_worker_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.ValidationTask", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for VersionUpdatePayload {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.payload.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.VersionUpdatePayload", len)?;
if let Some(v) = self.payload.as_ref() {
match v {
version_update_payload::Payload::VersionDeltas(v) => {
struct_ser.serialize_field("versionDeltas", v)?;
}
version_update_payload::Payload::PinnedVersion(v) => {
struct_ser.serialize_field("pinnedVersion", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for VersionUpdatePayload {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"version_deltas",
"versionDeltas",
"pinned_version",
"pinnedVersion",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
VersionDeltas,
PinnedVersion,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"versionDeltas" | "version_deltas" => Ok(GeneratedField::VersionDeltas),
"pinnedVersion" | "pinned_version" => Ok(GeneratedField::PinnedVersion),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = VersionUpdatePayload;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.VersionUpdatePayload")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<VersionUpdatePayload, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut payload__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::VersionDeltas => {
if payload__.is_some() {
return Err(serde::de::Error::duplicate_field("versionDeltas"));
}
payload__ = map_.next_value::<::std::option::Option<_>>()?.map(version_update_payload::Payload::VersionDeltas)
;
}
GeneratedField::PinnedVersion => {
if payload__.is_some() {
return Err(serde::de::Error::duplicate_field("pinnedVersion"));
}
payload__ = map_.next_value::<::std::option::Option<_>>()?.map(version_update_payload::Payload::PinnedVersion)
;
}
}
}
Ok(VersionUpdatePayload {
payload: payload__,
})
}
}
deserializer.deserialize_struct("hummock.VersionUpdatePayload", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for VnodeWatermark {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.watermark.is_empty() {
len += 1;
}
if self.vnode_bitmap.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.VnodeWatermark", len)?;
if !self.watermark.is_empty() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("watermark", pbjson::private::base64::encode(&self.watermark).as_str())?;
}
if let Some(v) = self.vnode_bitmap.as_ref() {
struct_ser.serialize_field("vnodeBitmap", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for VnodeWatermark {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"watermark",
"vnode_bitmap",
"vnodeBitmap",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Watermark,
VnodeBitmap,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"watermark" => Ok(GeneratedField::Watermark),
"vnodeBitmap" | "vnode_bitmap" => Ok(GeneratedField::VnodeBitmap),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = VnodeWatermark;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.VnodeWatermark")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<VnodeWatermark, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut watermark__ = None;
let mut vnode_bitmap__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Watermark => {
if watermark__.is_some() {
return Err(serde::de::Error::duplicate_field("watermark"));
}
watermark__ =
Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0)
;
}
GeneratedField::VnodeBitmap => {
if vnode_bitmap__.is_some() {
return Err(serde::de::Error::duplicate_field("vnodeBitmap"));
}
vnode_bitmap__ = map_.next_value()?;
}
}
}
Ok(VnodeWatermark {
watermark: watermark__.unwrap_or_default(),
vnode_bitmap: vnode_bitmap__,
})
}
}
deserializer.deserialize_struct("hummock.VnodeWatermark", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for WriteLimits {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.write_limits.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.WriteLimits", len)?;
if !self.write_limits.is_empty() {
struct_ser.serialize_field("writeLimits", &self.write_limits)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for WriteLimits {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"write_limits",
"writeLimits",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WriteLimits,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"writeLimits" | "write_limits" => Ok(GeneratedField::WriteLimits),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = WriteLimits;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.WriteLimits")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<WriteLimits, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut write_limits__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WriteLimits => {
if write_limits__.is_some() {
return Err(serde::de::Error::duplicate_field("writeLimits"));
}
write_limits__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u64>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(WriteLimits {
write_limits: write_limits__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.WriteLimits", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for write_limits::WriteLimit {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.table_ids.is_empty() {
len += 1;
}
if !self.reason.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("hummock.WriteLimits.WriteLimit", len)?;
if !self.table_ids.is_empty() {
struct_ser.serialize_field("tableIds", &self.table_ids)?;
}
if !self.reason.is_empty() {
struct_ser.serialize_field("reason", &self.reason)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for write_limits::WriteLimit {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_ids",
"tableIds",
"reason",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableIds,
Reason,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"tableIds" | "table_ids" => Ok(GeneratedField::TableIds),
"reason" => Ok(GeneratedField::Reason),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = write_limits::WriteLimit;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct hummock.WriteLimits.WriteLimit")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<write_limits::WriteLimit, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_ids__ = None;
let mut reason__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableIds => {
if table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("tableIds"));
}
table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::Reason => {
if reason__.is_some() {
return Err(serde::de::Error::duplicate_field("reason"));
}
reason__ = Some(map_.next_value()?);
}
}
}
Ok(write_limits::WriteLimit {
table_ids: table_ids__.unwrap_or_default(),
reason: reason__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("hummock.WriteLimits.WriteLimit", FIELDS, GeneratedVisitor)
}
}