Class QueryContext
- java.lang.Object
-
- org.apache.ignite.internal.processors.query.h2.opt.QueryContext
-
public class QueryContext extends Object
Thread local SQL query context which is intended to be accessible from everywhere.
-
-
Constructor Summary
Constructors Constructor Description QueryContext(int segment, @Nullable IndexingQueryFilter filter, @Nullable DistributedJoinContext distributedJoinCtx, @Nullable PartitionReservation reservations, boolean loc)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearContext(boolean nodeStop)@Nullable DistributedJoinContextdistributedJoinContext()IndexingQueryFilterfilter()booleanlocal()static QueryContextparseContext(@Nullable IndexingQueryFilter filter, boolean local)intsegment()static QueryContextthreadLocal()Hack with thread local context is used only for H2 methods that is called without Session object.static voidthreadLocal(QueryContext qctx)Hack with thread local context is used only for H2 methods that is called without Session object.StringtoString()
-
-
-
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-Truefor local queries,falsefor 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.
-
filter
public IndexingQueryFilter filter()
- Returns:
- Filter.
-
local
public boolean local()
- Returns:
Truefor local queries,falsefor 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.
-
-