Skip to content

Commit

Permalink
Move storage attribute to mod
Browse files Browse the repository at this point in the history
  • Loading branch information
lanlou1554 committed Nov 16, 2024
1 parent 03b6ec3 commit a3b8088
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
15 changes: 13 additions & 2 deletions optd-cost-model/src/storage/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
use persistent::Attribute;
use serde::{Deserialize, Serialize};

use crate::{common::types::TableId, stats::AttributeCombValueStats, CostModelResult};
use crate::{
common::{predicates::constant_pred::ConstantType, types::TableId},
stats::AttributeCombValueStats,
CostModelResult,
};

pub mod mock;
pub mod persistent;

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Attribute {
pub name: String,
pub typ: ConstantType,
pub nullable: bool,
}

#[trait_variant::make(Send)]
pub trait CostModelStorageManager {
async fn get_attribute_info(
Expand Down
10 changes: 1 addition & 9 deletions optd-cost-model/src/storage/persistent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@
use std::sync::Arc;

use optd_persistent::{cost_model::interface::StatType, CostModelStorageLayer};
use serde::{Deserialize, Serialize};

use crate::{
common::{predicates::constant_pred::ConstantType, types::TableId},
stats::{counter::Counter, AttributeCombValueStats, Distribution, MostCommonValues},
CostModelResult,
};

use super::CostModelStorageManager;

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Attribute {
pub name: String,
pub typ: ConstantType,
pub nullable: bool,
}
use super::{Attribute, CostModelStorageManager};

/// TODO: documentation
pub struct CostModelStorageManagerImpl<S: CostModelStorageLayer + Send + Sync> {
Expand Down

0 comments on commit a3b8088

Please sign in to comment.