Skip to content

Commit

Permalink
fix(storage): rename 'RowsetRaw' to 'EncodedRowset', 'ColumnRaw' to '…
Browse files Browse the repository at this point in the history
…EncodedColumn'

Signed-off-by: arkbriar <arkbriar@gmail.com>
  • Loading branch information
arkbriar committed Feb 21, 2022
1 parent 6b8c5eb commit 089c8bc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ use std::sync::Arc;

use crate::catalog::ColumnCatalog;

/// Raw columns.
pub struct ColumnRaw {
/// Encoded column.
pub struct EncodedColumn {
pub index: Vec<u8>,
pub data: Vec<u8>,
}

/// Raw rowset.
pub struct RowsetRaw {
/// Encoded rowset.
pub struct EncodedRowset {
/// Size.
pub size: usize,

/// Column information.
pub columns_info: Arc<[ColumnCatalog]>,

/// Column data.
pub columns: Vec<ColumnRaw>,
pub columns: Vec<EncodedColumn>,
}

impl RowsetRaw {
impl EncodedRowset {
#[allow(dead_code)]
/// Number of rows in the rowset.
pub fn cardinality(&self) -> usize {
Expand Down
4 changes: 2 additions & 2 deletions src/storage/secondary/rowset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
//! * `IntColumnBuilder` - `IntColumn` - `IntColumnIterator` - an entry in proto

pub use disk_rowset::*;
pub use encoded::*;
pub use mem_rowset::*;
pub use raw::*;
pub use rowset_builder::*;
pub use rowset_iterator::*;
pub use rowset_writer::*;

mod disk_rowset;
mod encoded;
mod mem_rowset;
mod raw;
mod rowset_builder;
mod rowset_iterator;
mod rowset_writer;
8 changes: 4 additions & 4 deletions src/storage/secondary/rowset/rowset_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use itertools::Itertools;
use super::super::{ColumnBuilderImpl, IndexBuilder};
use crate::array::DataChunk;
use crate::catalog::ColumnCatalog;
use crate::storage::secondary::rowset::{ColumnRaw, RowsetRaw};
use crate::storage::secondary::rowset::{EncodedColumn, EncodedRowset};
use crate::storage::secondary::ColumnBuilderOptions;

/// Builds a Rowset from [`DataChunk`].
Expand Down Expand Up @@ -48,9 +48,9 @@ impl RowsetBuilder {
}
}

pub fn finish(self) -> RowsetRaw {
pub fn finish(self) -> EncodedRowset {
let checksum_type = self.column_options.checksum_type;
RowsetRaw {
EncodedRowset {
size: self.row_cnt as usize,
columns_info: self.columns.clone(),
columns: self
Expand All @@ -64,7 +64,7 @@ impl RowsetBuilder {
index_builder.append(index);
}

ColumnRaw {
EncodedColumn {
index: index_builder.finish(),
data,
}
Expand Down
6 changes: 3 additions & 3 deletions src/storage/secondary/rowset/rowset_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tokio::fs::{File, OpenOptions};
use tokio::io::{AsyncWriteExt, BufWriter};

use crate::catalog::ColumnCatalog;
use crate::storage::secondary::rowset::RowsetRaw;
use crate::storage::secondary::rowset::EncodedRowset;
use crate::storage::StorageResult;

pub fn path_of_data_column(base: impl AsRef<Path>, column_info: &ColumnCatalog) -> PathBuf {
Expand Down Expand Up @@ -67,9 +67,9 @@ impl RowsetWriter {
Ok(())
}

/// Flush rows in a raw rowset. Create files if not exists.
/// Flush rows in an encoded rowset. Create files if not exists.
/// Panics if the rowset is empty.
pub async fn flush(self, rowset: RowsetRaw) -> StorageResult<()> {
pub async fn flush(self, rowset: EncodedRowset) -> StorageResult<()> {
// Panic on empty flush.
if rowset.is_empty() {
panic!("empty rowset")
Expand Down

0 comments on commit 089c8bc

Please sign in to comment.