/** * Constructor. * * @param queryType The type of this query * @param dataSource The datasource * @param context The context * @param incrementQueryId true to fork a new context and bump up the query id, or false to create an exact copy * of the context. */ protected AbstractDruidQuery( QueryType queryType, DataSource dataSource, QueryContext context, boolean incrementQueryId ) { this.queryType = queryType; this.dataSource = dataSource; this.context = context == null ? new QueryContext(Collections.<QueryContext.Param, Object>emptyMap(), null) .withQueryId(RequestLog.getId()) : incrementQueryId ? context.fork() : context; }