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 ) ; }
Part of query prolog - setup timeout timer