Skip to content

Commit

Permalink
refactor: Rename table-engine to mito (#539)
Browse files Browse the repository at this point in the history
* refactor: Rename table-engine to mito

* style: Format codes

* docs: Update mito engine comment

* docs: Explain what is mito in README
  • Loading branch information
evenyag authored Nov 16, 2022
1 parent 7b43f02 commit 55f18b5
Show file tree
Hide file tree
Showing 24 changed files with 63 additions and 55 deletions.
68 changes: 34 additions & 34 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ members = [
"src/storage",
"src/store-api",
"src/table",
"src/table-engine",
"src/mito",
]

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion src/catalog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ log-store = { path = "../log-store" }
object-store = { path = "../object-store" }
opendal = "0.17"
storage = { path = "../storage" }
table-engine = { path = "../table-engine" }
mito = { path = "../mito" }
tempdir = "0.3"
tokio = { version = "1.0", features = ["full"] }
4 changes: 2 additions & 2 deletions src/catalog/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,13 @@ pub struct TableEntryValue {
#[cfg(test)]
mod tests {
use log_store::fs::noop::NoopLogStore;
use mito::config::EngineConfig;
use mito::engine::MitoEngine;
use object_store::ObjectStore;
use storage::config::EngineConfig as StorageEngineConfig;
use storage::EngineImpl;
use table::metadata::TableType;
use table::metadata::TableType::Base;
use table_engine::config::EngineConfig;
use table_engine::engine::MitoEngine;
use tempdir::TempDir;

use super::*;
Expand Down
2 changes: 1 addition & 1 deletion src/datanode/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ storage = { path = "../storage" }
store-api = { path = "../store-api" }
substrait = { path = "../common/substrait" }
table = { path = "../table" }
table-engine = { path = "../table-engine", features = ["test"] }
mito = { path = "../mito", features = ["test"] }
tokio = { version = "1.18", features = ["full"] }
tokio-stream = { version = "0.1", features = ["net"] }
tonic = "0.8"
Expand Down
4 changes: 2 additions & 2 deletions src/datanode/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ use log_store::fs::config::LogConfig;
use log_store::fs::log::LocalFileLogStore;
use meta_client::client::{MetaClient, MetaClientBuilder};
use meta_client::MetaClientOpts;
use mito::config::EngineConfig as TableEngineConfig;
use mito::engine::MitoEngine;
use object_store::layers::LoggingLayer;
use object_store::services::fs::Builder;
use object_store::{util, ObjectStore};
Expand All @@ -33,8 +35,6 @@ use snafu::prelude::*;
use storage::config::EngineConfig as StorageEngineConfig;
use storage::EngineImpl;
use table::table::TableIdProviderRef;
use table_engine::config::EngineConfig as TableEngineConfig;
use table_engine::engine::MitoEngine;

use crate::datanode::{DatanodeOptions, ObjectStoreConfig};
use crate::error::{
Expand Down
4 changes: 2 additions & 2 deletions src/datanode/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ use catalog::remote::MetaKvBackend;
use common_catalog::consts::MIN_USER_TABLE_ID;
use meta_client::client::{MetaClient, MetaClientBuilder};
use meta_srv::mocks::MockInfo;
use mito::config::EngineConfig as TableEngineConfig;
use query::QueryEngineFactory;
use storage::config::EngineConfig as StorageEngineConfig;
use storage::EngineImpl;
use table::metadata::TableId;
use table::table::{TableIdProvider, TableIdProviderRef};
use table_engine::config::EngineConfig as TableEngineConfig;

use crate::datanode::DatanodeOptions;
use crate::error::Result;
Expand All @@ -38,7 +38,7 @@ impl Instance {
// This method is used in other crate's testing codes, so move it out of "cfg(test)".
// TODO(LFC): Delete it when callers no longer need it.
pub async fn new_mock() -> Result<Self> {
use table_engine::table::test_util::{new_test_object_store, MockEngine, MockMitoEngine};
use mito::table::test_util::{new_test_object_store, MockEngine, MockMitoEngine};

let mock_info = meta_srv::mocks::mock_with_memstore().await;
let meta_client = Some(Arc::new(mock_meta_client(mock_info, 0).await));
Expand Down
4 changes: 2 additions & 2 deletions src/datanode/src/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ mod tests {
use datatypes::schema::{ColumnSchema, SchemaBuilder, SchemaRef};
use datatypes::value::Value;
use log_store::fs::noop::NoopLogStore;
use mito::config::EngineConfig as TableEngineConfig;
use mito::engine::MitoEngine;
use object_store::services::fs::Builder;
use object_store::ObjectStore;
use query::QueryEngineFactory;
Expand All @@ -106,8 +108,6 @@ mod tests {
use table::error::Result as TableResult;
use table::metadata::TableInfoRef;
use table::{Table, TableRef};
use table_engine::config::EngineConfig as TableEngineConfig;
use table_engine::engine::MitoEngine;
use tempdir::TempDir;

use super::*;
Expand Down
4 changes: 2 additions & 2 deletions src/datanode/src/tests/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ use common_catalog::consts::{DEFAULT_CATALOG_NAME, DEFAULT_SCHEMA_NAME, MIN_USER
use datatypes::data_type::ConcreteDataType;
use datatypes::schema::{ColumnSchema, SchemaBuilder};
use frontend::frontend::Mode;
use mito::config::EngineConfig;
use mito::table::test_util::{new_test_object_store, MockEngine, MockMitoEngine};
use snafu::ResultExt;
use table::engine::{EngineContext, TableEngineRef};
use table::requests::CreateTableRequest;
use table_engine::config::EngineConfig;
use table_engine::table::test_util::{new_test_object_store, MockEngine, MockMitoEngine};
use tempdir::TempDir;

use crate::datanode::{DatanodeOptions, ObjectStoreConfig};
Expand Down
2 changes: 1 addition & 1 deletion src/table-engine/Cargo.toml → src/mito/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "table-engine"
name = "mito"
version = "0.1.0"
edition = "2021"
license = "Apache-2.0"
Expand Down
8 changes: 8 additions & 0 deletions src/mito/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Mito

Mito is GreptimeDB's default table engine.

## About Mito
The Alfa Romeo [MiTo](https://en.wikipedia.org/wiki/Alfa_Romeo_MiTo) is a front-wheel drive, three-door supermini designed by Centro Stile Alfa Romeo.

> "You can't be a true petrolhead until you've owned an Alfa Romeo." -- by Jeremy Clarkson
File renamed without changes.
2 changes: 1 addition & 1 deletion src/table-engine/src/engine.rs → src/mito/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn table_dir(schema_name: &str, table_name: &str) -> String {
/// [TableEngine] implementation.
///
/// About mito <https://en.wikipedia.org/wiki/Alfa_Romeo_MiTo>.
/// "you can't be a true petrolhead until you've owned an Alfa Romeo" -- by Jeremy Clarkson
/// "You can't be a true petrolhead until you've owned an Alfa Romeo." -- by Jeremy Clarkson
#[derive(Clone)]
pub struct MitoEngine<S: StorageEngine> {
inner: Arc<MitoEngineInner<S>>,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/script/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ log-store = { path = "../log-store" }
ron = "0.7"
serde = { version = "1.0", features = ["derive"] }
storage = { path = "../storage" }
table-engine = { path = "../table-engine", features = ["test"] }
mito = { path = "../mito", features = ["test"] }
tempdir = "0.3"
tokio = { version = "1.18", features = ["full"] }
tokio-test = "0.4"
6 changes: 3 additions & 3 deletions src/script/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ impl ScriptManager {
#[cfg(test)]
mod tests {
use catalog::CatalogManager;
use mito::config::EngineConfig as TableEngineConfig;
use mito::table::test_util::new_test_object_store;
use query::QueryEngineFactory;
use table_engine::config::EngineConfig as TableEngineConfig;
use table_engine::table::test_util::new_test_object_store;

use super::*;
type DefaultEngine = MitoEngine<EngineImpl<LocalFileLogStore>>;
use log_store::fs::config::LogConfig;
use log_store::fs::log::LocalFileLogStore;
use mito::engine::MitoEngine;
use storage::config::EngineConfig as StorageEngineConfig;
use storage::EngineImpl;
use table_engine::engine::MitoEngine;
use tempdir::TempDir;

#[tokio::test]
Expand Down
2 changes: 1 addition & 1 deletion src/sql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ itertools = "0.10"
once_cell = "1.10"
snafu = { version = "0.7", features = ["backtraces"] }
sqlparser = "0.15.0"
table-engine = { path = "../table-engine" }
mito = { path = "../mito" }
2 changes: 1 addition & 1 deletion src/sql/src/parsers/create_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
use std::cmp::Ordering;

use itertools::Itertools;
use mito::engine;
use once_cell::sync::Lazy;
use snafu::{ensure, OptionExt, ResultExt};
use sqlparser::ast::Value;
use sqlparser::dialect::keywords::Keyword;
use sqlparser::parser::IsOptional::Mandatory;
use sqlparser::tokenizer::{Token, Word};
use table_engine::engine;

use crate::ast::{ColumnDef, Ident, TableConstraint, Value as SqlValue};
use crate::error::{self, InvalidTimeIndexSnafu, Result, SyntaxSnafu};
Expand Down

0 comments on commit 55f18b5

Please sign in to comment.