store_api::region_engine

Trait RegionScanner

source
pub trait RegionScanner:
    Debug
    + DisplayAs
    + Send {
    // Required methods
    fn properties(&self) -> &ScannerProperties;
    fn schema(&self) -> SchemaRef;
    fn metadata(&self) -> RegionMetadataRef;
    fn prepare(
        &mut self,
        ranges: Vec<Vec<PartitionRange>>,
        distinguish_partition_range: bool,
    ) -> Result<(), BoxedError>;
    fn scan_partition(
        &self,
        partition: usize,
    ) -> Result<SendableRecordBatchStream, BoxedError>;
    fn has_predicate(&self) -> bool;
}
Expand description

A scanner that provides a way to scan the region concurrently.

The scanner splits the region into partitions so that each partition can be scanned concurrently. You can use this trait to implement an ExecutionPlan.

Required Methods§

source

fn properties(&self) -> &ScannerProperties

Returns the properties of the scanner.

source

fn schema(&self) -> SchemaRef

Returns the schema of the record batches.

source

fn metadata(&self) -> RegionMetadataRef

Returns the metadata of the region.

source

fn prepare( &mut self, ranges: Vec<Vec<PartitionRange>>, distinguish_partition_range: bool, ) -> Result<(), BoxedError>

Prepares the scanner with the given partition ranges.

This method is for the planner to adjust the scanner’s behavior based on the partition ranges.

source

fn scan_partition( &self, partition: usize, ) -> Result<SendableRecordBatchStream, BoxedError>

Scans the partition and returns a stream of record batches.

§Panics

Panics if the partition is out of bound.

source

fn has_predicate(&self) -> bool

Check if there is any predicate that may be executed in this scanner.

Implementors§