Module frame_finder

Source
Expand description

Helper functions for finding affected ranges from over window range cache for a given set of changes (delta).

Functionsยง

calc_logical_boundary_for_range_frames ๐Ÿ”’
Given the curr keys of the first and the last affected frames, calculate the order values of the logical start row of the first frame and the logical end row of the last frame.
calc_logical_curr_for_range_frames ๐Ÿ”’
Given the first and last key in delta, calculate the order values of the first and the last frames logically affected by some RANGE frames.
calc_logical_ord_for_range_frames ๐Ÿ”’
Given a pair of left and right state keys, calculate the leftmost (smallest) and rightmost (largest) order values after the two given offset_fns are applied, for all range frames.
find_boundary_for_rows_frame ๐Ÿ”’
find_curr_for_rows_frame ๐Ÿ”’
find_first_curr_for_rows_frame ๐Ÿ”’
For a canonical ROWS frame, given a key in delta, find the cache key corresponding to the CURRENT ROW of the first frame that contains the given key.
find_for_range_frames ๐Ÿ”’
find_frame_end_for_rows_frame ๐Ÿ”’
For a canonical ROWS frame, given a key in part_with_delta corresponding to some CURRENT ROW, find the cache key corresponding to the end row in that frame.
find_frame_start_for_rows_frame ๐Ÿ”’
For a canonical ROWS frame, given a key in part_with_delta corresponding to some CURRENT ROW, find the cache key corresponding to the start row in that frame.
find_last_curr_for_rows_frame ๐Ÿ”’
For a canonical ROWS frame, given a key in delta, find the cache key corresponding to the CURRENT ROW of the last frame that contains the given key.
find_left_for_range_frames ๐Ÿ”’
Given a left logical order value (e.g. first curr order value, first delta order value), find the most closed cache key in part_with_delta. Ideally this function returns the smallest key that is larger than or equal to the given logical order (using lower_bound).
find_right_for_range_frames ๐Ÿ”’
Given a right logical order value (e.g. last curr order value, last delta order value), find the most closed cache key in part_with_delta. Ideally this function returns the largest key that is smaller than or equal to the given logical order (using lower_bound).
merge_rows_frames ๐Ÿ”’
Merge several ROWS frames into one super frame. The returned super frame is guaranteed to be canonical, which means that the CURRENT ROW is always included in the returned frame.