/**
   * @param cctx Context.
   * @param type Query type.
   * @param clsName Class name.
   * @param clause Clause.
   * @param filter Scan filter.
   * @param part Partition.
   * @param incMeta Include metadata flag.
   * @param keepPortable Keep portable flag.
   */
  public GridCacheQueryAdapter(
      GridCacheContext<?, ?> cctx,
      GridCacheQueryType type,
      @Nullable String clsName,
      @Nullable String clause,
      @Nullable IgniteBiPredicate<Object, Object> filter,
      @Nullable Integer part,
      boolean incMeta,
      boolean keepPortable) {
    assert cctx != null;
    assert type != null;
    assert part == null || part >= 0;

    this.cctx = cctx;
    this.type = type;
    this.clsName = clsName;
    this.clause = clause;
    this.filter = filter;
    this.part = part;
    this.incMeta = incMeta;
    this.keepPortable = keepPortable;

    log = cctx.logger(getClass());

    metrics = new GridCacheQueryMetricsAdapter();
  }