pub trait ShuffleReader: Send + Sync {
// Required methods
fn read_partition<'life0, 'async_trait>(
&'life0 self,
partition_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn RecordBatchStream + Unpin + 'static>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn partition_size(&self, partition_id: usize) -> Result<usize>;
}
Expand description
A reader that can read the shuffled partitions.
Required Methods§
Sourcefn read_partition<'life0, 'async_trait>(
&'life0 self,
partition_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn RecordBatchStream + Unpin + 'static>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_partition<'life0, 'async_trait>(
&'life0 self,
partition_id: usize,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn RecordBatchStream + Unpin + 'static>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read a partition by partition_id will return Ok(None) if partition_size is 0 check reader.partition_size(partition_id) before calling this function
Sourcefn partition_size(&self, partition_id: usize) -> Result<usize>
fn partition_size(&self, partition_id: usize) -> Result<usize>
Get the size of the partition by partition_id