refactor: Move the logic for getting the input paths into FilesToSplitOrCompact

pull/24376/head
Carol (Nichols || Goulding) 2023-03-22 15:51:43 -04:00
parent e2dcf0b5e9
commit a20c5dcd8b
No known key found for this signature in database
GPG Key ID: E907EE5A736F87D4
2 changed files with 9 additions and 6 deletions

View File

@ -306,12 +306,9 @@ async fn run_plans(
scratchpad_ctx: &mut dyn Scratchpad,
) -> Result<Vec<ParquetFileParams>, DynError> {
// stage files
let input_paths: Vec<ParquetFilePath> = split_or_compact
.files()
.iter()
.map(|f| (*f).into())
.collect();
let input_uuids_inpad = scratchpad_ctx.load_to_scratchpad(&input_paths).await;
let input_uuids_inpad = scratchpad_ctx
.load_to_scratchpad(&split_or_compact.file_input_paths())
.await;
let files_inpad: Vec<_> = split_or_compact
.files()
.into_iter()

View File

@ -1,4 +1,5 @@
use data_types::{CompactionLevel, ParquetFile};
use parquet_file::ParquetFilePath;
/// A file classification specifies the parameters for a single compaction branch.
///
@ -99,6 +100,11 @@ impl FilesToSplitOrCompact {
}
}
/// Paths to the files for giving to the scratchpad.
pub fn file_input_paths(&self) -> Vec<ParquetFilePath> {
self.files().iter().map(|f| (*f).into()).collect()
}
/// References to the inner Parquet files
pub fn files(&self) -> Vec<&ParquetFile> {
match self {