protected void setTimerTask(boolean isBatch) {
    assert (timerTaskFuture == null);

    timerTaskFuture = timeoutScheduler.schedule(() -> {
      try {
        isTimedout = true;
        if (!isBatch) {
          protocol.cancelCurrentQuery();
        }
        protocol.interrupt();
      } catch (Throwable e) {
        //eat
      }
    }, queryTimeout, TimeUnit.SECONDS);
  }
protected void setTimerTask ( boolean isBatch ) { assert ( timerTaskFuture == null ) ; timerTaskFuture = timeoutScheduler . schedule ( ( ) -> { try { isTimedout = true ; if ( ! isBatch ) { protocol . cancelCurrentQuery ( ) ; } protocol . interrupt ( ) ; } catch ( Throwable e ) { } } , queryTimeout , TimeUnit . SECONDS ) ; }
Part of query prolog - setup timeout timer