From bf0c58698eb1477cc8ebde1b9df46b574072a8d8 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 4 Nov 2020 12:33:41 -0500 Subject: [PATCH] refactor: rename delorean_data_types crate to data_type (#407) * refactor: rename delorean_data_types crate to data_type - #401 * fix: fmt --- Cargo.lock | 32 +++++++++---------- Cargo.toml | 2 +- .../Cargo.toml | 2 +- .../src/data.rs | 0 .../src/database_rules.rs | 0 .../src/lib.rs | 0 .../src/partition_metadata.rs | 0 delorean_cluster/Cargo.toml | 2 +- delorean_cluster/src/lib.rs | 6 ++-- delorean_mem_qe/Cargo.toml | 2 +- delorean_storage/Cargo.toml | 4 +-- delorean_storage/src/exec/fieldlist.rs | 2 +- delorean_storage/src/exec/seriesset.rs | 2 +- delorean_storage/src/lib.rs | 2 +- delorean_storage/src/test.rs | 2 +- delorean_write_buffer/Cargo.toml | 2 +- delorean_write_buffer/src/column.rs | 2 +- delorean_write_buffer/src/database.rs | 2 +- delorean_write_buffer/src/partition.rs | 2 +- delorean_write_buffer/src/table.rs | 4 +-- 20 files changed, 35 insertions(+), 35 deletions(-) rename {delorean_data_types => data_types}/Cargo.toml (93%) rename {delorean_data_types => data_types}/src/data.rs (100%) rename {delorean_data_types => data_types}/src/database_rules.rs (100%) rename {delorean_data_types => data_types}/src/lib.rs (100%) rename {delorean_data_types => data_types}/src/partition_metadata.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 22fdebb7a3..e224b5b73a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -697,6 +697,19 @@ dependencies = [ "memchr", ] +[[package]] +name = "data_types" +version = "0.1.0" +dependencies = [ + "chrono", + "crc32fast", + "delorean_generated_types", + "delorean_line_parser", + "flatbuffers", + "serde", + "snafu", +] + [[package]] name = "datafusion" version = "3.0.0-SNAPSHOT" @@ -783,8 +796,8 @@ version = "0.1.0" dependencies = [ "async-trait", "bytes", + "data_types", "delorean_arrow", - "delorean_data_types", "delorean_generated_types", "delorean_line_parser", "delorean_object_store", @@ -797,19 +810,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "delorean_data_types" -version = "0.1.0" -dependencies = [ - "chrono", - "crc32fast", - "delorean_generated_types", - "delorean_line_parser", - "flatbuffers", - "serde", - "snafu", -] - [[package]] name = "delorean_generated_types" version = "0.1.0" @@ -912,8 +912,8 @@ version = "0.1.0" dependencies = [ "async-trait", "croaring", + "data_types", "delorean_arrow", - "delorean_data_types", "delorean_line_parser", "delorean_test_helpers", "serde", @@ -1005,8 +1005,8 @@ dependencies = [ "async-trait", "chrono", "criterion", + "data_types", "delorean_arrow", - "delorean_data_types", "delorean_generated_types", "delorean_line_parser", "delorean_storage", diff --git a/Cargo.toml b/Cargo.toml index f23d130d13..283bab2daf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ default-run = "delorean" members = [ "delorean_arrow", "delorean_cluster", - "delorean_data_types", + "data_types", "delorean_generated_types", "delorean_ingest", "delorean_line_parser", diff --git a/delorean_data_types/Cargo.toml b/data_types/Cargo.toml similarity index 93% rename from delorean_data_types/Cargo.toml rename to data_types/Cargo.toml index f8667f8316..ad4285558d 100644 --- a/delorean_data_types/Cargo.toml +++ b/data_types/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "delorean_data_types" +name = "data_types" version = "0.1.0" authors = ["pauldix "] edition = "2018" diff --git a/delorean_data_types/src/data.rs b/data_types/src/data.rs similarity index 100% rename from delorean_data_types/src/data.rs rename to data_types/src/data.rs diff --git a/delorean_data_types/src/database_rules.rs b/data_types/src/database_rules.rs similarity index 100% rename from delorean_data_types/src/database_rules.rs rename to data_types/src/database_rules.rs diff --git a/delorean_data_types/src/lib.rs b/data_types/src/lib.rs similarity index 100% rename from delorean_data_types/src/lib.rs rename to data_types/src/lib.rs diff --git a/delorean_data_types/src/partition_metadata.rs b/data_types/src/partition_metadata.rs similarity index 100% rename from delorean_data_types/src/partition_metadata.rs rename to data_types/src/partition_metadata.rs diff --git a/delorean_cluster/Cargo.toml b/delorean_cluster/Cargo.toml index 0c3f65c742..171f212e20 100644 --- a/delorean_cluster/Cargo.toml +++ b/delorean_cluster/Cargo.toml @@ -11,7 +11,7 @@ snafu = "0.6" serde = "1.0" serde_json = "1.0" async-trait = "0.1" -delorean_data_types = { path = "../delorean_data_types" } +data_types = { path = "../data_types" } delorean_generated_types = { path = "../delorean_generated_types" } delorean_line_parser = { path = "../delorean_line_parser" } delorean_storage = { path = "../delorean_storage" } diff --git a/delorean_cluster/src/lib.rs b/delorean_cluster/src/lib.rs index 248fe08afb..00f2974c4d 100644 --- a/delorean_cluster/src/lib.rs +++ b/delorean_cluster/src/lib.rs @@ -71,11 +71,11 @@ use std::{ }, }; -use delorean_arrow::arrow::record_batch::RecordBatch; -use delorean_data_types::{ +use data_types::{ data::{lines_to_replicated_write, ReplicatedWrite}, database_rules::{DatabaseRules, HostGroup, HostGroupId, MatchTables}, }; +use delorean_arrow::arrow::record_batch::RecordBatch; use delorean_line_parser::ParsedLine; use delorean_object_store::ObjectStore; use delorean_storage::Database; @@ -405,8 +405,8 @@ fn config_location(id: u32) -> String { mod tests { use super::*; use async_trait::async_trait; + use data_types::database_rules::{MatchTables, Matcher, Subscription}; use delorean_arrow::arrow::{csv, util::string_writer::StringWriter}; - use delorean_data_types::database_rules::{MatchTables, Matcher, Subscription}; use delorean_line_parser::parse_lines; use delorean_object_store::{InMemory, ObjectStoreIntegration}; use futures::TryStreamExt; diff --git a/delorean_mem_qe/Cargo.toml b/delorean_mem_qe/Cargo.toml index 1db6b53fa1..2abbf76247 100644 --- a/delorean_mem_qe/Cargo.toml +++ b/delorean_mem_qe/Cargo.toml @@ -21,4 +21,4 @@ human_format = "1.0.3" [dev-dependencies] -criterion = "0.3" \ No newline at end of file +criterion = "0.3" diff --git a/delorean_storage/Cargo.toml b/delorean_storage/Cargo.toml index b0a2a5b5a4..7f73affe5a 100644 --- a/delorean_storage/Cargo.toml +++ b/delorean_storage/Cargo.toml @@ -17,5 +17,5 @@ croaring = "0.4.5" delorean_arrow = { path = "../delorean_arrow" } delorean_line_parser = { path = "../delorean_line_parser" } -delorean_data_types = { path = "../delorean_data_types" } -delorean_test_helpers = { path = "../delorean_test_helpers" } \ No newline at end of file +data_types = { path = "../data_types" } +delorean_test_helpers = { path = "../delorean_test_helpers" } diff --git a/delorean_storage/src/exec/fieldlist.rs b/delorean_storage/src/exec/fieldlist.rs index 9e943bce85..652cc62705 100644 --- a/delorean_storage/src/exec/fieldlist.rs +++ b/delorean_storage/src/exec/fieldlist.rs @@ -3,13 +3,13 @@ //! pull them from RecordBatches use std::collections::BTreeMap; +use data_types::TIME_COLUMN_NAME; use delorean_arrow::arrow::{ self, array::Int64Array, datatypes::{DataType, SchemaRef}, record_batch::RecordBatch, }; -use delorean_data_types::TIME_COLUMN_NAME; use snafu::{ensure, ResultExt, Snafu}; diff --git a/delorean_storage/src/exec/seriesset.rs b/delorean_storage/src/exec/seriesset.rs index 71b2cc742f..421d351d24 100644 --- a/delorean_storage/src/exec/seriesset.rs +++ b/delorean_storage/src/exec/seriesset.rs @@ -22,11 +22,11 @@ use std::sync::Arc; use arrow::{ array::StringArray, datatypes::DataType, datatypes::SchemaRef, record_batch::RecordBatch, }; +use data_types::TIME_COLUMN_NAME; use delorean_arrow::{ arrow::{self}, datafusion::physical_plan::SendableRecordBatchStream, }; -use delorean_data_types::TIME_COLUMN_NAME; use snafu::{ResultExt, Snafu}; use tokio::stream::StreamExt; use tokio::sync::mpsc::{self, error::SendError}; diff --git a/delorean_storage/src/lib.rs b/delorean_storage/src/lib.rs index f7df1eb032..7c2c58d1ec 100644 --- a/delorean_storage/src/lib.rs +++ b/delorean_storage/src/lib.rs @@ -7,8 +7,8 @@ )] use async_trait::async_trait; +use data_types::data::ReplicatedWrite; use delorean_arrow::{arrow::record_batch::RecordBatch, datafusion::logical_plan::Expr}; -use delorean_data_types::data::ReplicatedWrite; use delorean_line_parser::ParsedLine; use exec::{FieldListPlan, GroupedSeriesSetPlans, SeriesSetPlans, StringSetPlan}; diff --git a/delorean_storage/src/test.rs b/delorean_storage/src/test.rs index 73b0461ae5..8520a24b8c 100644 --- a/delorean_storage/src/test.rs +++ b/delorean_storage/src/test.rs @@ -12,7 +12,7 @@ use crate::{ Database, DatabaseStore, Predicate, TimestampRange, }; -use delorean_data_types::data::ReplicatedWrite; +use data_types::data::ReplicatedWrite; use delorean_line_parser::{parse_lines, ParsedLine}; use async_trait::async_trait; diff --git a/delorean_write_buffer/Cargo.toml b/delorean_write_buffer/Cargo.toml index f05f6d2e11..f52ddfa2c8 100644 --- a/delorean_write_buffer/Cargo.toml +++ b/delorean_write_buffer/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [dependencies] delorean_arrow = { path = "../delorean_arrow" } -delorean_data_types = { path = "../delorean_data_types" } +data_types = { path = "../data_types" } delorean_generated_types = { path = "../delorean_generated_types" } delorean_line_parser = { path = "../delorean_line_parser" } delorean_storage = { path = "../delorean_storage" } diff --git a/delorean_write_buffer/src/column.rs b/delorean_write_buffer/src/column.rs index 2df05e11c6..d0c2708495 100644 --- a/delorean_write_buffer/src/column.rs +++ b/delorean_write_buffer/src/column.rs @@ -2,7 +2,7 @@ use delorean_generated_types::wal as wb; use snafu::Snafu; use crate::dictionary::Dictionary; -use delorean_data_types::{data::type_description, partition_metadata::Statistics}; +use data_types::{data::type_description, partition_metadata::Statistics}; #[derive(Debug, Snafu)] pub enum Error { diff --git a/delorean_write_buffer/src/database.rs b/delorean_write_buffer/src/database.rs index 747c42f8fa..26453a6337 100644 --- a/delorean_write_buffer/src/database.rs +++ b/delorean_write_buffer/src/database.rs @@ -20,6 +20,7 @@ use std::io::ErrorKind; use std::path::PathBuf; use std::sync::Arc; +use data_types::data::{split_lines_into_write_entry_partitions, ReplicatedWrite}; use delorean_arrow::{ arrow, arrow::{datatypes::Schema as ArrowSchema, record_batch::RecordBatch}, @@ -32,7 +33,6 @@ use delorean_arrow::{ datasource::MemTable, error::DataFusionError, execution::context::ExecutionContext, }, }; -use delorean_data_types::data::{split_lines_into_write_entry_partitions, ReplicatedWrite}; use crate::dictionary::Error as DictionaryError; use crate::partition::restore_partitions_from_wal; diff --git a/delorean_write_buffer/src/partition.rs b/delorean_write_buffer/src/partition.rs index f8d6d6a7ba..703a89a535 100644 --- a/delorean_write_buffer/src/partition.rs +++ b/delorean_write_buffer/src/partition.rs @@ -3,7 +3,7 @@ use delorean_generated_types::wal as wb; use delorean_wal::{Entry as WalEntry, Result as WalResult}; use std::collections::{BTreeMap, BTreeSet, HashMap}; -use delorean_data_types::TIME_COLUMN_NAME; +use data_types::TIME_COLUMN_NAME; use delorean_storage::TimestampRange; use crate::dictionary::Dictionary; diff --git a/delorean_write_buffer/src/table.rs b/delorean_write_buffer/src/table.rs index f61589bee0..11484fd3b2 100644 --- a/delorean_write_buffer/src/table.rs +++ b/delorean_write_buffer/src/table.rs @@ -14,7 +14,7 @@ use crate::{ dictionary::{Dictionary, Error as DictionaryError}, partition::Partition, }; -use delorean_data_types::TIME_COLUMN_NAME; +use data_types::TIME_COLUMN_NAME; use snafu::{OptionExt, ResultExt, Snafu}; use delorean_arrow::{ @@ -1074,7 +1074,7 @@ impl IntoExpr for str { #[cfg(test)] mod tests { use arrow::util::pretty::pretty_format_batches; - use delorean_data_types::data::split_lines_into_write_entry_partitions; + use data_types::data::split_lines_into_write_entry_partitions; use delorean_line_parser::{parse_lines, ParsedLine}; use delorean_storage::exec::Executor; use delorean_test_helpers::str_vec_to_arc_vec;