Github user mikemccand commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/497#discussion_r232661519
  
    --- Diff: 
lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java ---
    @@ -100,13 +109,97 @@ public CacheHelper getCoreCacheHelper() {
     
       }
     
    +  /**
    +   * Wrapper class for another PointValues implementation that is used by 
ExitableFields.
    +   */
    +  public static class ExitablePointValues extends PointValues {
    +
    +    private final PointValues in;
    +    private final QueryTimeout queryTimeout;
    +
    +    public ExitablePointValues(PointValues in, QueryTimeout queryTimeout) {
    +      this.in = in;
    +      this.queryTimeout = queryTimeout;
    +      checkAndThrow();
    +    }
    +
    +    /**
    +     * Throws {@link ExitingReaderException} if {@link 
QueryTimeout#shouldExit()} returns true,
    +     * or if {@link Thread#interrupted()} returns true.
    +     */
    +    private void checkAndThrow() {
    +      if (queryTimeout.shouldExit()) {
    +        throw new ExitingReaderException("The request took too long to 
iterate over terms. Timeout: "
    --- End diff --
    
    Maybe change `to iterate over terms` to `to iterate over points`?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to