@Override public void reactOnQueryTimeoutExceptionWhileExtracting(RuntimeException e) { if ( type == Type.LIMIT ) { //we stop where we are return what we have this.partialResults = true; } else { if ( e == null ) { e = timeoutExceptionFactory.createTimeoutException( "Timeout period exceeded", String.valueOf( query ) ); } throw e; } }
@Override public void reactOnQueryTimeoutExceptionWhileExtracting(RuntimeException e) { if ( type == Type.LIMIT ) { //we stop where we are return what we have this.partialResults = true; } else { if ( e == null ) { e = timeoutExceptionFactory.createTimeoutException( "Timeout period exceeded", String.valueOf( query ) ); } throw e; } }
private boolean isTimedOut(long currentTime) { if ( timeout == null ) { return false; } if ( timedOut ) { return true; } else { final long elapsedTime = currentTime - start; timedOut = elapsedTime > timeout; if ( this.type != Type.LIMIT && timedOut ) { throw timeoutExceptionFactory.createTimeoutException( "Full-text query took longer than expected (in microsecond): " + TimeUnit.NANOSECONDS.toMicros( elapsedTime ), String.valueOf( query ) ); } return timedOut; } }
private boolean isTimedOut(long currentTime) { if ( timeout == null ) { return false; } if ( timedOut ) { return true; } else { final long elapsedTime = currentTime - start; timedOut = elapsedTime > timeout; if ( this.type != Type.LIMIT && timedOut ) { throw timeoutExceptionFactory.createTimeoutException( "Full-text query took longer than expected (in microsecond): " + TimeUnit.NANOSECONDS.toMicros( elapsedTime ), String.valueOf( query ) ); } return timedOut; } }