Class QueryContext


  • public class QueryContext
    extends Object
    Thread local SQL query context which is intended to be accessible from everywhere.
    • Constructor Detail

      • QueryContext

        public QueryContext​(int segment,
                            @Nullable
                            @Nullable IndexingQueryFilter filter,
                            @Nullable
                            @Nullable DistributedJoinContext distributedJoinCtx,
                            @Nullable
                            @Nullable PartitionReservation reservations,
                            boolean loc)
        Constructor.
        Parameters:
        segment - Index segment ID.
        filter - Filter.
        distributedJoinCtx - Distributed join context.
        loc - True for local queries, false for distributed ones.
    • Method Detail

      • parseContext

        public static QueryContext parseContext​(@Nullable
                                                @Nullable IndexingQueryFilter filter,
                                                boolean local)
        Parameters:
        filter - Filter.
        local - Local query flag.
        Returns:
        Context for parsing.
      • distributedJoinContext

        @Nullable
        public @Nullable DistributedJoinContext distributedJoinContext()
        Returns:
        Distributed join context.
      • segment

        public int segment()
        Returns:
        Index segment ID.
      • clearContext

        public void clearContext​(boolean nodeStop)
        Parameters:
        nodeStop - Node is stopping.
      • local

        public boolean local()
        Returns:
        True for local queries, false for distributed ones.
      • threadLocal

        public static void threadLocal​(QueryContext qctx)
        Hack with thread local context is used only for H2 methods that is called without Session object. e.g. GridH2Table.getRowCountApproximation (used only on optimization phase, after parse).
        Parameters:
        qctx - Context.
      • threadLocal

        public static QueryContext threadLocal()
        Hack with thread local context is used only for H2 methods that is called without Session object. e.g. GridH2Table.getRowCountApproximation (used only on optimization phase, after parse).
        Returns:
        Thread local context.