jiacai2050 commented on code in PR #1628: URL: https://github.com/apache/horaedb/pull/1628#discussion_r2459405374
########## src/remote_write/src/pb_reader.rs: ########## @@ -0,0 +1,644 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use std::io::{Error, ErrorKind, Result}; + +use bytes::{Buf, Bytes}; + +use crate::pooled_types::{ + PooledExemplar, PooledLabel, PooledMetricMetadata, PooledMetricType, PooledSample, + PooledTimeSeries, PooledWriteRequest, +}; + +const WIRE_TYPE_VARINT: u8 = 0; +const WIRE_TYPE_64BIT: u8 = 1; +const WIRE_TYPE_LENGTH_DELIMITED: u8 = 2; + +const FIELD_NUM_TIMESERIES: u32 = 1; +const FIELD_NUM_METADATA: u32 = 3; +const FIELD_NUM_LABELS: u32 = 1; +const FIELD_NUM_SAMPLES: u32 = 2; +const FIELD_NUM_EXEMPLARS: u32 = 3; +const FIELD_NUM_LABEL_NAME: u32 = 1; +const FIELD_NUM_LABEL_VALUE: u32 = 2; +const FIELD_NUM_SAMPLE_VALUE: u32 = 1; +const FIELD_NUM_SAMPLE_TIMESTAMP: u32 = 2; +const FIELD_NUM_EXEMPLAR_LABELS: u32 = 1; +const FIELD_NUM_EXEMPLAR_VALUE: u32 = 2; +const FIELD_NUM_EXEMPLAR_TIMESTAMP: u32 = 3; +const FIELD_NUM_METADATA_TYPE: u32 = 1; +const FIELD_NUM_METADATA_FAMILY_NAME: u32 = 2; +const FIELD_NUM_METADATA_HELP: u32 = 4; +const FIELD_NUM_METADATA_UNIT: u32 = 5; + +// Taken from https://github.com/v0y4g3r/prom-write-request-bench/blob/step6/optimize-slice/src/bytes.rs under Apache License 2.0. +#[allow(dead_code)] Review Comment: Delete those dead code functions. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
