From 0f1747b80d5cc9052fcc69ed0f37852445bc7a09 Mon Sep 17 00:00:00 2001 From: tison Date: Mon, 25 Mar 2024 11:53:51 +0800 Subject: [PATCH] chore: retain original headers (#3572) Signed-off-by: tison Co-authored-by: Yingwen --- licenserc.toml | 6 ++++++ src/common/base/src/readable_size.rs | 16 +--------------- src/partition/src/lib.rs | 1 - src/partition/src/metrics.rs | 13 ------------- src/promql/src/functions/extrapolate_rate.rs | 3 ++- src/servers/src/repeated_field.rs | 19 +++---------------- 6 files changed, 12 insertions(+), 46 deletions(-) delete mode 100644 src/partition/src/metrics.rs diff --git a/licenserc.toml b/licenserc.toml index 8bcf6c4524..f01f7727e8 100644 --- a/licenserc.toml +++ b/licenserc.toml @@ -19,6 +19,12 @@ includes = [ "*.py", ] +excludes = [ + # copied sources + "src/common/base/src/readable_size.rs", + "src/servers/src/repeated_field.rs", +] + [properties] inceptionYear = 2023 copyrightOwner = "Greptime Team" diff --git a/src/common/base/src/readable_size.rs b/src/common/base/src/readable_size.rs index 8c539f3f78..21908526c7 100644 --- a/src/common/base/src/readable_size.rs +++ b/src/common/base/src/readable_size.rs @@ -1,20 +1,6 @@ // Copyright (c) 2017-present, PingCAP, Inc. Licensed under Apache-2.0. -// Copyright 2023 Greptime Team -// -// Licensed 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. - -// This file is copied from https://github.com/tikv/raft-engine/blob/8dd2a39f359ff16f5295f35343f626e0c10132fa/src/util.rs +// This file is copied from https://github.com/tikv/raft-engine/blob/0.3.0/src/util.rs use std::fmt::{self, Debug, Display, Write}; use std::ops::{Div, Mul}; diff --git a/src/partition/src/lib.rs b/src/partition/src/lib.rs index 1d64951e10..647e7f63b8 100644 --- a/src/partition/src/lib.rs +++ b/src/partition/src/lib.rs @@ -18,7 +18,6 @@ pub mod columns; pub mod error; pub mod expr; pub mod manager; -pub mod metrics; pub mod multi_dim; pub mod partition; pub mod range; diff --git a/src/partition/src/metrics.rs b/src/partition/src/metrics.rs deleted file mode 100644 index 59f3388c48..0000000000 --- a/src/partition/src/metrics.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2023 Greptime Team -// -// Licensed 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. diff --git a/src/promql/src/functions/extrapolate_rate.rs b/src/promql/src/functions/extrapolate_rate.rs index ea0c3f2a95..7cba367145 100644 --- a/src/promql/src/functions/extrapolate_rate.rs +++ b/src/promql/src/functions/extrapolate_rate.rs @@ -13,6 +13,7 @@ // limitations under the License. // This file also contains some code from prometheus project. + // Copyright 2015 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -48,7 +49,7 @@ pub type Rate = ExtrapolatedRate; pub type Increase = ExtrapolatedRate; /// Part of the `extrapolatedRate` in Promql, -/// from +/// from #[derive(Debug)] pub struct ExtrapolatedRate { /// Range duration in millisecond diff --git a/src/servers/src/repeated_field.rs b/src/servers/src/repeated_field.rs index 0e3baf16a5..8346427a33 100644 --- a/src/servers/src/repeated_field.rs +++ b/src/servers/src/repeated_field.rs @@ -1,17 +1,3 @@ -// Copyright 2023 Greptime Team -// -// Licensed 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. - // Copyright (c) 2019 Stepan Koltsov // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -32,8 +18,9 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE // OR OTHER DEALINGS IN THE SOFTWARE. -/// ! The [Clear] trait and [RepeatedField] are taken from [rust-protobuf](https://github.com/stepancheg/rust-protobuf/tree/master/protobuf-examples/vs-prost) -/// to leverage the pooling mechanism to avoid frequent heap allocation/deallocation when decoding deeply nested structs. +// The [Clear] trait and [RepeatedField] are taken from [rust-protobuf](https://github.com/stepancheg/rust-protobuf/tree/master/protobuf-examples/vs-prost) +// to leverage the pooling mechanism to avoid frequent heap allocation/deallocation when decoding deeply nested structs. + use std::borrow::Borrow; use std::cmp::Ordering; use std::default::Default;