Class AbstractReducer

    • Field Detail

      • srcNodes

        protected Set<UUID> srcNodes
        Row source nodes.
      • colCnt

        protected int colCnt
      • fetched

        protected final ReduceBlockList<org.h2.result.Row> fetched
        Will be r/w from query execution thread only, does not need to be threadsafe.
    • Method Detail

      • setSources

        public void setSources​(Map<ClusterNode,​BitSet> nodesToSegmentsCnt)
        Set source nodes.
        Specified by:
        setSources in interface Reducer
        Parameters:
        nodesToSegmentsCnt - Mapping of nodes to expected count of segments to scan.
      • sources

        public Set<UUID> sources()
        Specified by:
        sources in interface Reducer
        Returns:
        Return source nodes for this merge index.
      • hasSource

        public boolean hasSource​(UUID nodeId)
        Check if node with given nodeId is data source node for the index.
        Specified by:
        hasSource in interface Reducer
        Parameters:
        nodeId - Node ID.
        Returns:
        true If this index needs data from the given source node, false otherwise.
      • setPageSize

        public void setPageSize​(int pageSize)
        Specified by:
        setPageSize in interface Reducer
        Parameters:
        pageSize - Page size.
      • onFailure

        public void onFailure​(UUID nodeId,
                              javax.cache.CacheException e)
        Fail cursor callback.
        Specified by:
        onFailure in interface Reducer
        Parameters:
        nodeId - Node ID.
        e - Exception.
      • find

        public final org.h2.index.Cursor find​(@Nullable
                                              @Nullable org.h2.result.SearchRow first,
                                              @Nullable
                                              @Nullable org.h2.result.SearchRow last)
        Find a rows and create a cursor to iterate over the result.
        Specified by:
        find in interface Reducer
        Parameters:
        first - Lower bound.
        last - Upper bound.
        Returns:
        Cursor instance.
      • findInStream

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

        protected abstract org.h2.index.Cursor findAllFetched​(List<org.h2.result.Row> fetched,
                                                              @Nullable
                                                              @Nullable org.h2.result.SearchRow first,
                                                              @Nullable
                                                              @Nullable org.h2.result.SearchRow last)
        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)
        Parameters:
        lastEvictedRow - Last evicted fetched row.
        first - Lower bound.
        last - Upper bound.
      • onBlockEvict

        protected void onBlockEvict​(@NotNull
                                    @NotNull List<org.h2.result.Row> evictedBlock)
        Parameters:
        evictedBlock - Evicted block.
      • addPage

        public void addPage​(ReduceResultPage page)
        Offer result page for reduce.
        Specified by:
        addPage in interface Reducer
        Parameters:
        page - Page.
      • addPage0

        protected abstract void addPage0​(ReduceResultPage page)
        Parameters:
        page - Page.
      • fail

        public void fail​(javax.cache.CacheException e)
        Parameters:
        e - Error.
      • createDummyLastPage

        protected final ReduceResultPage createDummyLastPage​(ReduceResultPage lastPage)
        Parameters:
        lastPage - Real last page.
        Returns:
        Created dummy page.
      • pollNextIterator

        protected final Iterator<org.h2.value.Value[]> pollNextIterator​(org.apache.ignite.internal.processors.query.h2.twostep.AbstractReducer.Pollable<ReduceResultPage> queue,
                                                                        Iterator<org.h2.value.Value[]> iter)
        Parameters:
        queue - Queue to poll.
        iter - Current iterator.
        Returns:
        The same or new iterator.