jefferyyuan commented on a change in pull request #551: LUCENE-8662: Change 
TermsEnum.seekExact(BytesRef) to abstract
URL: https://github.com/apache/lucene-solr/pull/551#discussion_r252797675
 
 

 ##########
 File path: lucene/core/src/java/org/apache/lucene/index/TermsEnum.java
 ##########
 @@ -65,13 +65,26 @@ public AttributeSource attributes() {
     NOT_FOUND
   };
 
-  /** Attempts to seek to the exact term, returning
-   *  true if the term is found.  If this returns false, the
-   *  enum is unpositioned.  For some codecs, seekExact may
-   *  be substantially faster than {@link #seekCeil}. */
-  public boolean seekExact(BytesRef text) throws IOException {
+  /**
+   * Attempts to seek to the exact term, returning true if the term is found. 
If this returns false, the enum is
+   * unpositioned. For some codecs, seekExact may be substantially faster than 
{@link #seekCeil}.
+   * <p>
+   * 
+   * This method is performance critical and the Default implementation: 
defaultSeekExact may be slow in some cases, so
+   * Subclass SHOULD have its own implementation if possible.
+   * 
+   * @return true if the term is found; return false if the enum is 
unpositioned.
+   */
+  public abstract boolean seekExact(BytesRef text) throws IOException;
+
+  /**
+   * Default implementation for seekExact(BytesRef), which may be slow in some 
cases. <br>
+   * The abstract seekExact(BytesRef) method is performance critical, subclass 
SHOULD have its own implementation if
+   * possible.
+   */
+  public final boolean defaultSeekExactImpl(BytesRef text) throws IOException {
 
 Review comment:
   Thanks @s1monw @dsmiley and changed the code based on your suggestions : )

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to