Skip to content

Commit

Permalink
Merge pull request #8461 from sundy-li/revert-metrics
Browse files Browse the repository at this point in the history
refactor(query): revert #8444
  • Loading branch information
BohuTANG authored Oct 26, 2022
2 parents 7052bfa + dde429b commit aacf694
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 46 deletions.
22 changes: 0 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/query/datavalues/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ chrono = { version = "0.4.22", features = ["serde"] }
chrono-tz = "0.6.3"
dyn-clone = "1.0.9"
enum_dispatch = "0.3.8"
get-size = { version = "^0.1", features = ["derive"] }
itertools = "0.10.5"
lexical-core = "0.8.5"
micromarshal = "0.2.0"
Expand Down
3 changes: 1 addition & 2 deletions src/query/datavalues/src/data_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ use std::sync::Arc;

use common_exception::ErrorCode;
use common_exception::Result;
use get_size::GetSize;
use ordered_float::OrderedFloat;
use serde_json::json;

use crate::prelude::*;
use crate::type_coercion::merge_types;

/// A specific value of a data type.
#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq, GetSize)]
#[derive(serde::Serialize, serde::Deserialize, Clone, PartialEq)]
pub enum DataValue {
/// Base type.
Null,
Expand Down
3 changes: 0 additions & 3 deletions src/query/datavalues/src/variant_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use std::ops::Deref;

use common_exception::ErrorCode;
use common_exception::Result;
use get_size::GetSize;
use itertools::EitherOrBoth::Both;
use itertools::EitherOrBoth::Left;
use itertools::EitherOrBoth::Right;
Expand All @@ -32,8 +31,6 @@ use serde_json::Value;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
pub struct VariantValue(pub Value);

impl GetSize for VariantValue {}

impl From<Value> for VariantValue {
fn from(val: Value) -> Self {
VariantValue(val)
Expand Down
1 change: 0 additions & 1 deletion src/query/storages/fuse-meta/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ common-datavalues = { path = "../../datavalues" }
common-exception = { path = "../../../common/exception" }
common-metrics = { path = "../../../common/metrics" }

get-size = { version = "^0.1", features = ["derive"] }
once_cell = "1.15.0"
parking_lot = "0.12.1"
serde = { workspace = true }
7 changes: 3 additions & 4 deletions src/query/storages/fuse-meta/src/meta/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use std::collections::HashMap;

use common_base::base::uuid::Uuid;
use common_datavalues::DataValue;
use get_size::GetSize;
use serde::Deserialize;
use serde::Serialize;

Expand All @@ -28,7 +27,7 @@ pub type ClusterKey = (u32, String);

pub type StatisticsOfColumns = HashMap<u32, ColumnStatistics>;

#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, GetSize)]
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
pub struct ColumnStatistics {
pub min: DataValue,
pub max: DataValue,
Expand All @@ -40,7 +39,7 @@ pub struct ColumnStatistics {
pub in_memory_size: u64,
}

#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, GetSize)]
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
pub struct ClusterStatistics {
#[serde(default = "default_cluster_key_id")]
pub cluster_key_id: u32,
Expand All @@ -59,7 +58,7 @@ fn default_level() -> i32 {
0
}

#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Default, GetSize)]
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Default)]
pub struct Statistics {
pub row_count: u64,
pub block_count: u64,
Expand Down
8 changes: 3 additions & 5 deletions src/query/storages/fuse-meta/src/meta/v0/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

use std::collections::HashMap;

use get_size::GetSize;

use crate::meta::common::ColumnStatistics;
use crate::meta::ColumnId;
use crate::meta::Statistics;
Expand All @@ -30,7 +28,7 @@ pub struct SegmentInfo {
}

/// Meta information of a block (currently, the parquet file)
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, GetSize)]
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
pub struct BlockMeta {
/// Pointer of the data Block
pub row_count: u64,
Expand All @@ -42,7 +40,7 @@ pub struct BlockMeta {
}

// TODO move it to common
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, GetSize)]
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
pub struct ColumnMeta {
/// where the data of column start
pub offset: u64,
Expand All @@ -52,7 +50,7 @@ pub struct ColumnMeta {
pub num_values: u64,
}

#[derive(serde::Serialize, serde::Deserialize, Clone, Debug, GetSize)]
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
pub struct BlockLocation {
pub path: String,
// for parquet, this filed can be used to fetch the meta data without seeking around
Expand Down
6 changes: 2 additions & 4 deletions src/query/storages/fuse-meta/src/meta/v1/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use std::collections::HashMap;

use common_datablocks::DataBlock;
use get_size::GetSize;
use serde::Deserialize;
use serde::Serialize;

Expand All @@ -30,7 +29,7 @@ use crate::meta::Statistics;
use crate::meta::Versioned;

/// A segment comprises one or more blocks
#[derive(Serialize, Deserialize, Debug, GetSize)]
#[derive(Serialize, Deserialize, Debug)]
pub struct SegmentInfo {
/// format version
format_version: FormatVersion,
Expand All @@ -42,7 +41,7 @@ pub struct SegmentInfo {

/// Meta information of a block
/// Part of and kept inside the [SegmentInfo]
#[derive(Serialize, Deserialize, Clone, Debug, GetSize)]
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct BlockMeta {
pub row_count: u64,
pub block_size: u64,
Expand All @@ -64,7 +63,6 @@ pub struct BlockMeta {
/// `Lz4` is merely for backward compatibility, it will NO longer be
/// used in the write path.
#[serde(default = "Compression::legacy")]
#[get_size(ignore)]
compression: Compression,
}

Expand Down
1 change: 0 additions & 1 deletion src/query/storages/fuse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ backon = "0.2"
chrono = "0.4.22"
futures = "0.3.24"
futures-util = "0.3.24"
get-size = { version = "^0.1", features = ["derive"] }
itertools = "0.10.5"
metrics = "0.20.1"
opendal = { version = "0.19", features = ["layers-retry"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use common_fuse_meta::meta::Location;
use common_fuse_meta::meta::SegmentInfo;
use common_fuse_meta::meta::Statistics;
use common_fuse_meta::meta::Versioned;
use get_size::GetSize;
use opendal::Operator;

use crate::io::BlockCompactor;
Expand Down Expand Up @@ -109,7 +108,8 @@ impl TableMutator for FullCompactMutator {
.into_iter()
.collect::<Result<Vec<_>>>()?;

metrics_set_segments_memory_usage(segments.get_heap_size() as f64);
// todo: add real metrics
metrics_set_segments_memory_usage(0.0);

let limit = self.compact_params.limit.unwrap_or(segments.len());
if limit < segments.len() {
Expand Down Expand Up @@ -137,7 +137,9 @@ impl TableMutator for FullCompactMutator {
need_merge = true;
}
});
metrics_set_selected_blocks_memory_usage(self.selected_blocks.get_heap_size() as f64);

// todo: add real metrics
metrics_set_selected_blocks_memory_usage(0.0);

// If the number of blocks of segment meets block_per_seg, and the blocks in segments donot need to be compacted,
// then record the segment information.
Expand Down

1 comment on commit aacf694

@vercel
Copy link

@vercel vercel bot commented on aacf694 Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

databend – ./

databend-git-main-databend.vercel.app
databend.rs
databend-databend.vercel.app
databend.vercel.app

Please sign in to comment.