Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: split common-meta-store #6456

Merged
merged 3 commits into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ members = [
"common/meta/embedded",
"common/meta/raft-store",
"common/meta/sled-store",
"common/meta/store",
"common/meta/types",
"common/metrics",
"common/planners",
Expand Down
27 changes: 27 additions & 0 deletions common/meta/store/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "common-meta-store"
version = "0.1.0"
description = "MetaStore is impl with either a local embedded meta store, or a grpc-client of metasrv"
authors = ["Databend Authors <opensource@datafuselabs.com>"]
license = "Apache-2.0"
publish = false
edition = "2021"

[lib]
doctest = false
test = false

[dependencies]
# Workspace dependencies
common-exception = { path = "../../exception" }
common-grpc = { path = "../../grpc" }
common-meta-api = { path = "../api" }
common-meta-embedded = { path = "../embedded" }
common-meta-grpc = { path = "../grpc" }
common-meta-types = { path = "../types" }
common-tracing = { path = "../../tracing" }

# Crates.io dependencies
async-trait = "0.1.56"

[dev-dependencies]
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// 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::sync::Arc;

Expand Down
1 change: 1 addition & 0 deletions query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ common-meta-embedded = { path = "../common/meta/embedded" }
common-meta-grpc = { path = "../common/meta/grpc" }
common-meta-raft-store = { path = "../common/meta/raft-store" }
common-meta-sled-store = { path = "../common/meta/sled-store" }
common-meta-store = { path = "../common/meta/store" }
common-meta-types = { path = "../common/meta/types" }
common-metrics = { path = "../common/metrics" }
common-planners = { path = "../common/planners" }
Expand Down
2 changes: 1 addition & 1 deletion query/src/catalogs/default/catalog_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use std::sync::Arc;

use common_base::infallible::RwLock;
use common_datablocks::InMemoryData;
use common_meta_store::MetaStore;

use crate::common::MetaStore;
use crate::databases::DatabaseFactory;
use crate::storages::StorageFactory;

Expand Down
2 changes: 1 addition & 1 deletion query/src/catalogs/default/mutable_catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ use common_meta_app::schema::UpdateTableMetaReply;
use common_meta_app::schema::UpdateTableMetaReq;
use common_meta_app::schema::UpsertTableOptionReply;
use common_meta_app::schema::UpsertTableOptionReq;
use common_meta_store::MetaStoreProvider;
use common_meta_types::MetaId;
use common_tracing::tracing;

use super::catalog_context::CatalogContext;
use crate::catalogs::catalog::Catalog;
use crate::common::MetaStoreProvider;
use crate::databases::Database;
use crate::databases::DatabaseContext;
use crate::databases::DatabaseFactory;
Expand Down
2 changes: 1 addition & 1 deletion query/src/clusters/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use common_grpc::ConnectionFactory;
use common_management::ClusterApi;
use common_management::ClusterMgr;
use common_meta_api::KVApi;
use common_meta_store::MetaStoreProvider;
use common_meta_types::NodeInfo;
use common_metrics::label_counter_with_val_and_labels;
use common_tracing::tracing;
Expand All @@ -46,7 +47,6 @@ use rand::thread_rng;
use rand::Rng;

use crate::api::FlightClient;
use crate::common::MetaStoreProvider;
use crate::Config;

pub struct ClusterDiscovery {
Expand Down
18 changes: 0 additions & 18 deletions query/src/common/meta/mod.rs

This file was deleted.

3 changes: 0 additions & 3 deletions query/src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ pub mod context_function;
mod evaluator;
mod expression_evaluator;
mod hashtable;
mod meta;
pub mod service;

pub use evaluator::*;
pub use expression_evaluator::ExpressionEvaluator;
pub use hashtable::*;
pub use meta::MetaStore;
pub use meta::MetaStoreProvider;
2 changes: 1 addition & 1 deletion query/src/users/user_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use common_management::UdfMgr;
use common_management::UserApi;
use common_management::UserMgr;
use common_meta_api::KVApi;
use common_meta_store::MetaStoreProvider;

use crate::common::MetaStoreProvider;
use crate::Config;

pub struct UserApiProvider {
Expand Down