Class GridCacheQueryFutureAdapter<K,​V,​R>

    • Constructor Detail

      • GridCacheQueryFutureAdapter

        protected GridCacheQueryFutureAdapter()
      • GridCacheQueryFutureAdapter

        protected GridCacheQueryFutureAdapter​(GridCacheContext<K,​V> cctx,
                                              GridCacheQueryBean qry,
                                              boolean loc)
        Parameters:
        cctx - Context.
        qry - Query.
        loc - Local query or not.
    • Method Detail

      • fields

        public boolean fields()
        Returns:
        If fields query.
      • next

        public R next()
        Returns next element from result set.

        This is a blocking call which will wait if there are no elements available immediately.

        Specified by:
        next in interface CacheQueryFuture<K>
        Returns:
        Next fetched element or null if all the elements have been fetched.
      • awaitFirstItemAvailable

        public abstract void awaitFirstItemAvailable()
                                              throws IgniteCheckedException
        TODO: IGNITE-15728 Provide custom reducer for ScanQueryFallbackClosableIterator. Waits for the first item is available to return.
        Throws:
        IgniteCheckedException - If query execution failed with an error.
      • onNodeLeft

        protected void onNodeLeft​(UUID evtNodeId)
        Callback that invoked in case of a node left cluster.
        Parameters:
        evtNodeId - Removed or failed node Id.
      • onPage

        public void onPage​(@Nullable
                           @Nullable UUID nodeId,
                           @Nullable
                           @Nullable IndexQueryResultMeta metadata,
                           @Nullable
                           @Nullable Collection<?> data,
                           @Nullable
                           @Nullable Throwable err,
                           boolean lastPage)
        Entrypoint for handling query result page from remote node.
        Parameters:
        nodeId - Sender node.
        metadata - Query response metadata.
        data - Page data.
        err - Error (if was).
        lastPage - Whether it is the last page for sender node.
      • onError

        protected abstract void onError​(Throwable err)
        Invokes in case of this future error.
      • onPage

        protected abstract void onPage​(UUID nodeId,
                                       Collection<R> data,
                                       boolean lastPage)
        Handles new data page from query node.
      • onMeta

        protected void onMeta​(IndexQueryResultMeta meta)
        Handles query meta data from query node.
      • onDone

        public boolean onDone​(Collection<R> res,
                              Throwable err)
        Callback to notify that future is finished. Note that if non-null exception is passed in the result value will be ignored.
        Overrides:
        onDone in class GridFutureAdapter<Collection<R>>
        Parameters:
        res - Optional result.
        err - Optional error.
        Returns:
        True if result was set by this call.