Trait tikv::storage::mvcc::reader::scanner::forward::ScanPolicy[][src]

pub trait ScanPolicy<S: Snapshot> {
    type Output;
    fn handle_lock(
        &mut self,
        current_user_key: Key,
        cfg: &mut ScannerConfig<S>,
        cursors: &mut Cursors<S>,
        statistics: &mut Statistics
    ) -> Result<HandleRes<Self::Output>>;
fn handle_write(
        &mut self,
        current_user_key: Key,
        cfg: &mut ScannerConfig<S>,
        cursors: &mut Cursors<S>,
        statistics: &mut Statistics
    ) -> Result<HandleRes<Self::Output>>; }

Defines the behavior of the scanner.

Associated Types

type Output[src]

The type that the scanner outputs.

Loading content...

Required methods

fn handle_lock(
    &mut self,
    current_user_key: Key,
    cfg: &mut ScannerConfig<S>,
    cursors: &mut Cursors<S>,
    statistics: &mut Statistics
) -> Result<HandleRes<Self::Output>>
[src]

Handles the lock that the scanner meets.

If HandleRes::Return(val) is returned, val will be returned to the caller of the scanner. Otherwise, HandleRes::Skip(current_user_key) should be returned. Then, the scanner will handle the write records if the write cursor points to the same user key, or continue scanning.

Note that the method should also take care of moving the cursors.

fn handle_write(
    &mut self,
    current_user_key: Key,
    cfg: &mut ScannerConfig<S>,
    cursors: &mut Cursors<S>,
    statistics: &mut Statistics
) -> Result<HandleRes<Self::Output>>
[src]

Handles the write record that the scanner meets.

If HandleRes::Return(val) is returned, val will be returned to the caller of the scanner. Otherwise, HandleRes::Skip(current_user_key) should be returned and the scanner will continue scanning.

Note that the method should also take care of moving the cursors.

Loading content...

Implementors

impl<S: Snapshot> ScanPolicy<S> for DeltaEntryPolicy[src]

type Output = TxnEntry

impl<S: Snapshot> ScanPolicy<S> for LatestEntryPolicy[src]

type Output = TxnEntry

impl<S: Snapshot> ScanPolicy<S> for LatestKvPolicy[src]

type Output = (Key, Value)

Loading content...