refactor: rename delorean_table to packers (#409)

pull/24376/head
Andrew Lamb 2020-11-05 08:52:22 -05:00 committed by GitHub
parent 075ba0d8d1
commit 8399d2a159
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 49 additions and 52 deletions

38
Cargo.lock generated
View File

@ -715,7 +715,6 @@ dependencies = [
"delorean_parquet",
"delorean_segment_store",
"delorean_storage",
"delorean_table",
"delorean_test_helpers",
"delorean_tsm",
"delorean_wal",
@ -730,6 +729,7 @@ dependencies = [
"hyper",
"influxdb2_client",
"libflate",
"packers",
"predicates",
"prost",
"prost-types",
@ -793,11 +793,11 @@ version = "0.1.0"
dependencies = [
"data_types",
"delorean_line_parser",
"delorean_table",
"delorean_test_helpers",
"delorean_tsm",
"env_logger",
"libflate",
"packers",
"snafu",
"tracing",
]
@ -823,9 +823,9 @@ dependencies = [
"croaring",
"crossbeam",
"delorean_arrow",
"delorean_table",
"env_logger",
"human_format",
"packers",
"snafu",
"tracing",
]
@ -853,8 +853,8 @@ version = "0.1.0"
dependencies = [
"data_types",
"delorean_arrow",
"delorean_table",
"delorean_test_helpers",
"packers",
"snafu",
"tracing",
]
@ -866,7 +866,7 @@ dependencies = [
"criterion",
"croaring",
"delorean_arrow",
"delorean_table",
"packers",
"rand",
]
@ -887,20 +887,6 @@ dependencies = [
"tracing",
]
[[package]]
name = "delorean_table"
version = "0.1.0"
dependencies = [
"data_types",
"delorean_arrow",
"delorean_test_helpers",
"delorean_tsm",
"human_format",
"rand",
"snafu",
"tracing",
]
[[package]]
name = "delorean_test_helpers"
version = "0.1.0"
@ -2083,6 +2069,20 @@ dependencies = [
"libm",
]
[[package]]
name = "packers"
version = "0.1.0"
dependencies = [
"data_types",
"delorean_arrow",
"delorean_test_helpers",
"delorean_tsm",
"human_format",
"rand",
"snafu",
"tracing",
]
[[package]]
name = "parquet"
version = "3.0.0-SNAPSHOT"

View File

@ -17,7 +17,7 @@ members = [
"delorean_mem_qe",
"delorean_parquet",
"delorean_segment_store",
"delorean_table",
"packers",
"delorean_test_helpers",
"delorean_tsm",
"delorean_storage",
@ -39,7 +39,7 @@ delorean_line_parser = { path = "delorean_line_parser" }
delorean_mem_qe = { path = "delorean_mem_qe" }
delorean_parquet = { path = "delorean_parquet" }
delorean_segment_store = { path = "delorean_segment_store" }
delorean_table = { path = "delorean_table" }
packers = { path = "packers" }
delorean_wal = { path = "delorean_wal" }
delorean_wal_writer = { path = "delorean_wal_writer" }
delorean_write_buffer = { path = "delorean_write_buffer" }

View File

@ -6,7 +6,7 @@ use delorean_parquet::{
writer::{CompressionLevel, DeloreanParquetTableWriter},
TryClone,
};
use delorean_table::{DeloreanTableWriter, DeloreanTableWriterSource, Error as TableError};
use packers::{DeloreanTableWriter, DeloreanTableWriterSource, Error as TableError};
use std::time::Duration;
use std::io::{Seek, SeekFrom, Write};

View File

@ -4,7 +4,7 @@ use rand::Rng;
use std::convert::TryFrom;
use std::mem;
use delorean_table::Packer;
use packers::Packer;
const BATCH_SIZES: [usize; 6] = [10, 100, 1000, 10_000, 100_000, 1_000_000];

View File

@ -11,7 +11,7 @@ snafu = "0.6.2"
env_logger = "0.7.1"
tracing = "0.1"
delorean_line_parser = { path = "../delorean_line_parser" }
delorean_table = { path = "../delorean_table" }
packers = { path = "../packers" }
data_types = { path = "../data_types" }
delorean_tsm = { path = "../delorean_tsm" }

View File

@ -11,15 +11,14 @@
use data_types::table_schema::{DataType, Schema, SchemaBuilder};
use delorean_line_parser::{FieldValue, ParsedLine};
use delorean_table::{
packers::{Packer, Packers},
ByteArray, DeloreanTableWriter, DeloreanTableWriterSource, Error as TableError,
};
use delorean_tsm::{
mapper::{ColumnData, MeasurementTable, TSMMeasurementMapper},
reader::{BlockDecoder, TSMBlockReader, TSMIndexReader},
BlockType, TSMError,
};
use packers::{
ByteArray, DeloreanTableWriter, DeloreanTableWriterSource, Error as TableError, Packer, Packers,
};
use snafu::{ensure, OptionExt, ResultExt, Snafu};
use std::{
collections::{BTreeMap, BTreeSet},
@ -47,7 +46,7 @@ impl Default for ConversionSettings {
}
}
/// Converts `ParsedLines` into the delorean_table internal columnar
/// Converts `ParsedLines` into the packers internal columnar
/// data format and then passes that converted data to a
/// `DeloreanTableWriter`
pub struct LineProtocolConverter<'a> {
@ -601,7 +600,7 @@ fn pack_lines<'a>(schema: &Schema, lines: &[ParsedLine<'a>]) -> Vec<Packers> {
// // let sort = [0, 7, 6, 12];
// // let sort = [8, 4, 9, 0, 1, 7, 10, 6, 5, 2, 3, 12];
// let sort = [3, 2, 5, 6, 10, 7, 1, 0, 9, 4, 8, 12];
// delorean_table::sorter::sort(&mut chunked_packers, &sort).unwrap();
// packers::sorter::sort(&mut chunked_packers, &sort).unwrap();
// println!(
// "Writing {:?} packers with size: {:?}",
@ -656,7 +655,7 @@ fn pack_lines<'a>(schema: &Schema, lines: &[ParsedLine<'a>]) -> Vec<Packers> {
// w.write(&record_batch).unwrap();
// }
/// Converts one or more TSM files into the delorean_table internal columnar
/// Converts one or more TSM files into the packers internal columnar
/// data format and then passes that converted data to a `DeloreanTableWriter`.
pub struct TSMFileConverter {
table_writer_source: Box<dyn DeloreanTableWriterSource>,
@ -1088,14 +1087,12 @@ impl std::fmt::Debug for TSMFileConverter {
mod delorean_ingest_tests {
use super::*;
use data_types::table_schema::ColumnDefinition;
use delorean_table::{
DeloreanTableWriter, DeloreanTableWriterSource, Error as TableError, Packers,
};
use delorean_test_helpers::approximately_equal;
use delorean_tsm::{
reader::{BlockData, MockBlockDecoder},
Block,
};
use packers::{DeloreanTableWriter, DeloreanTableWriterSource, Error as TableError, Packers};
use libflate::gzip;
use std::fs::File;

View File

@ -9,7 +9,7 @@ edition = "2018"
[dependencies]
delorean_arrow = { path = "../delorean_arrow" }
delorean_table = { path = "../delorean_table" }
packers = { path = "../packers" }
snafu = "0.6.8"
croaring = "0.4.5"
crossbeam = "0.7.3"

View File

@ -1031,13 +1031,13 @@ impl std::convert::From<Vec<&str>> for DictionaryRLE {
}
// TODO(edd): improve perf here....
impl std::convert::From<&delorean_table::Packer<delorean_table::ByteArray>> for DictionaryRLE {
fn from(p: &delorean_table::Packer<delorean_table::ByteArray>) -> Self {
impl std::convert::From<&packers::Packer<packers::ByteArray>> for DictionaryRLE {
fn from(p: &packers::Packer<packers::ByteArray>) -> Self {
let mut drle = Self::new();
for v in p.values() {
let s = v
.clone()
.unwrap_or_else(|| delorean_table::ByteArray::from("NULL"));
.unwrap_or_else(|| packers::ByteArray::from("NULL"));
drle.push(s.as_utf8().unwrap());
}
drle

View File

@ -11,7 +11,7 @@ snafu = "0.6.2"
tracing = "0.1"
delorean_arrow = { path = "../delorean_arrow" }
delorean_table = { path = "../delorean_table" }
packers = { path = "../packers" }
data_types = { path = "../data_types" }

View File

@ -3,7 +3,7 @@ use delorean_arrow::parquet::{
basic::{Compression, Encoding},
file::reader::{FileReader, SerializedFileReader},
};
use delorean_table::{
use packers::{
stats::{ColumnStatsBuilder, FileStats, FileStatsBuilder},
Name,
};

View File

@ -20,7 +20,7 @@ use std::{
use tracing::debug;
use crate::metadata::parquet_schema_as_string;
use delorean_table::{DeloreanTableWriter, Error as TableError, Packers};
use packers::{DeloreanTableWriter, Error as TableError, Packers};
#[derive(Debug, Snafu)]
pub enum Error {
@ -75,7 +75,7 @@ impl FromStr for CompressionLevel {
}
/// A `DeloreanParquetTableWriter` is used for writing batches of rows
/// represented using the structures in `delorean_table` to parquet files.
/// parquet files.
pub struct DeloreanParquetTableWriter<W>
where
W: ParquetWriter,
@ -95,8 +95,8 @@ where
/// # use std::fs;
/// # use data_types::table_schema;
/// # use data_types::table_schema::DataType;
/// # use delorean_table::DeloreanTableWriter;
/// # use delorean_table::packers::{Packer, Packers};
/// # use packers::DeloreanTableWriter;
/// # use packers::{Packer, Packers};
/// # use delorean_parquet::writer::{DeloreanParquetTableWriter, CompressionLevel};
/// # use delorean_arrow::parquet::data_type::ByteArray;
///

View File

@ -1,5 +1,5 @@
use delorean_parquet::writer::{CompressionLevel, DeloreanParquetTableWriter};
use delorean_table::{packers::Packer, DeloreanTableWriter, Packers};
use packers::{DeloreanTableWriter, Packer, Packers};
use delorean_arrow::parquet::data_type::ByteArray;
use std::fs;

View File

@ -9,7 +9,7 @@ edition = "2018"
[dependencies]
delorean_arrow = { path = "../delorean_arrow" }
delorean_table = { path = "../delorean_table" }
packers = { path = "../packers" }
croaring = "0.4.5"
[dev-dependencies]

View File

@ -1,5 +1,5 @@
[package]
name = "delorean_table"
name = "packers"
version = "0.1.0"
authors = ["Andrew Lamb <alamb@influxdata.com>"]
edition = "2018"

View File

@ -12,9 +12,9 @@ pub mod stats;
use snafu::Snafu;
pub use crate::packers::{Packer, Packers};
use data_types::table_schema::Schema;
pub use delorean_arrow::parquet::data_type::ByteArray;
pub use packers::{Packer, Packers};
use std::borrow::Cow;

View File

@ -69,7 +69,7 @@ impl fmt::Display for ColumnStats {
/// # Example:
/// ```
/// use data_types::table_schema::DataType;
/// use delorean_table::stats::ColumnStatsBuilder;
/// use packers::stats::ColumnStatsBuilder;
///
/// let stats = ColumnStatsBuilder::new("My Column", 3, DataType::Float)
/// .compression("GZIP")

View File

@ -5,7 +5,7 @@ use delorean_ingest::{
use delorean_line_parser::parse_lines;
use delorean_parquet::writer::Error as ParquetWriterError;
use delorean_parquet::writer::{CompressionLevel, DeloreanParquetTableWriter};
use delorean_table::{DeloreanTableWriter, DeloreanTableWriterSource, Error as TableError};
use packers::{DeloreanTableWriter, DeloreanTableWriterSource, Error as TableError};
use snafu::{ResultExt, Snafu};
use std::{
convert::TryInto,

View File

@ -1,8 +1,8 @@
use delorean_arrow::parquet::file::serialized_reader::{FileSource, SliceableCursor};
use delorean_parquet::ChunkReader;
use delorean_table::Name;
/// Module to handle input files (and maybe urls?)
use libflate::gzip;
use packers::Name;
use snafu::{ResultExt, Snafu};
use std::{
borrow::Cow,

View File

@ -1,7 +1,7 @@
//! This module contains code to report compression statistics for storage files
use delorean_parquet::{error::Error as DeloreanParquetError, stats as parquet_stats};
use delorean_table::{
use packers::{
stats::{FileSetStatsBuilder, FileStats},
Name,
};