public QueryMessage(InternalDistributedMember recipient, int regionId, ReplyProcessor21 processor, DefaultQuery query, Object[] parameters, final List buckets) { super(recipient, regionId, processor); this.queryString = query.getQueryString(); this.buckets = buckets; this.parameters = parameters; this.cqQuery = query.isCqQuery(); this.traceOn = query.isTraced() || DefaultQuery.QUERY_VERBOSE; }
/** * Each query can have a different maxQueryExecution time. Make this method public to expose that * feature to callers. * * Must not be called from a thread that is not the query thread, because this class uses a * ThreadLocal on the query thread! */ private void monitorQueryThread(final DefaultQuery query, final long maxQueryExecutionTime) { // cq query is not monitored if (query.isCqQuery()) { return; } query.setCancelationTask(scheduleCancelationTask(query, maxQueryExecutionTime)); if (logger.isDebugEnabled()) { logDebug(query, "Adding thread to QueryMonitor."); } }
@Test public void monitorQueryThreadCqQueryIsNotMonitored() { DefaultQuery query = mock(DefaultQuery.class); when(query.isCqQuery()).thenReturn(true); monitor.monitorQueryThread(query); // Verify that the expiration task was not scheduled for the CQ query Mockito.verify(scheduledThreadPoolExecutor, never()).schedule(captor.capture(), anyLong(), isA(TimeUnit.class)); }
context.setCqQueryContext(query.isCqQuery()); if (GemFireCacheImpl.getInstance() != null) { queryMonitor = GemFireCacheImpl.getInstance().getQueryMonitor();