/** {@inheritDoc} */
  @Override
  public GridCacheQuery<T> timeout(long timeout) {
    A.ensure(timeout >= 0, "timeout >= 0");

    this.timeout = timeout;

    return this;
  }
  /** {@inheritDoc} */
  @Override
  public GridCacheQuery<T> pageSize(int pageSize) {
    A.ensure(pageSize > 0, "pageSize > 0");

    this.pageSize = pageSize;

    return this;
  }
  /** {@inheritDoc} */
  @Override
  public void timeInterval(long timeInterval) {
    A.ensure(timeInterval >= 0, "timeInterval >= 0");

    if (!guard.enterBusy())
      throw new IllegalStateException("Continuous query can't be changed after it was executed.");

    try {
      this.timeInterval = timeInterval;
    } finally {
      guard.leaveBusy();
    }
  }
  /** {@inheritDoc} */
  @Override
  public void bufferSize(int bufSize) {
    A.ensure(bufSize > 0, "bufSize > 0");

    if (!guard.enterBusy())
      throw new IllegalStateException("Continuous query can't be changed after it was executed.");

    try {
      this.bufSize = bufSize;
    } finally {
      guard.leaveBusy();
    }
  }
  /** {@inheritDoc} */
  @Override
  public void callback(GridBiPredicate<UUID, Collection<Map.Entry<K, V>>> cb) {
    A.notNull(cb, "cb");

    if (!guard.enterBusy())
      throw new IllegalStateException("Continuous query can't be changed after it was executed.");

    try {
      this.cb = cb;
    } finally {
      guard.leaveBusy();
    }
  }