Class SortedReducer

    • Field Detail

      • firstRowCmp

        protected final Comparator<org.h2.result.SearchRow> firstRowCmp
      • lastRowCmp

        protected final Comparator<org.h2.result.SearchRow> lastRowCmp
    • Constructor Detail

    • Method Detail

      • fetchedAll

        public boolean fetchedAll()
        Check if all rows has been fetched from all sources.
        Returns:
        true If all rows has been fetched, false otherwise.
      • findInStream

        protected org.h2.index.Cursor findInStream​(@Nullable
                                                   @Nullable org.h2.result.SearchRow first,
                                                   @Nullable
                                                   @Nullable org.h2.result.SearchRow last)
        Specified by:
        findInStream in class AbstractReducer
        Parameters:
        first - Row.
        last - Row.
        Returns:
        Cursor over remote streams.
      • findAllFetched

        protected org.h2.index.Cursor findAllFetched​(List<org.h2.result.Row> fetched,
                                                     org.h2.result.SearchRow first,
                                                     org.h2.result.SearchRow last)
        Specified by:
        findAllFetched in class AbstractReducer
        Parameters:
        fetched - Fetched data.
        first - Row.
        last - Row.
        Returns:
        Cursor over fetched data.
      • checkBounds

        protected void checkBounds​(org.h2.result.Row lastEvictedRow,
                                   org.h2.result.SearchRow first,
                                   org.h2.result.SearchRow last)
        Overrides:
        checkBounds in class AbstractReducer
        Parameters:
        lastEvictedRow - Last evicted fetched row.
        first - Lower bound.
        last - Upper bound.
      • binarySearchRow

        protected static int binarySearchRow​(List<org.h2.result.Row> rows,
                                             org.h2.result.SearchRow searchRow,
                                             Comparator<org.h2.result.SearchRow> cmp,
                                             boolean checkLast)
        Parameters:
        rows - Sorted rows list.
        searchRow - Search row.
        cmp - Comparator.
        checkLast - If we need to optimistically check the last row right away.
        Returns:
        Insertion point for the search row.