bruno-roustant commented on a change in pull request #2166:
URL: https://github.com/apache/lucene-solr/pull/2166#discussion_r552618150



##########
File path: solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java
##########
@@ -339,10 +332,10 @@ public boolean exists(String path) throws IOException {
    * (non-Javadoc)
    *
    * @see org.apache.solr.core.DirectoryFactory#get(java.lang.String,
-   * java.lang.String, boolean)
+   * java.lang.String, boolean, java.util.function.Function)
    */
   @Override
-  public final Directory get(String path, DirContext dirContext, String 
rawLockType)
+  public final Directory get(String path, DirContext dirContext, String 
rawLockType, Function<Directory, Directory> wrappingFunction)

Review comment:
       I don't think CachingDF should extend DelegatingDF. Here the goal with 
this new param is to allow the caller to have a hook when the Directory is 
created internally. Otherwise there is no way a DelegatingDF "A" can delegate 
to any CachingDF "B" while leveraging the cache inside B and at the same time 
have control over the class of Directory cached and returned.
   Another option could be to first extend the CachingDF with a B' class that 
overrides the createDirectory() method. But that means a DelegatingDF can only 
delegate to a specific class B' extending CachingDF. This would be too limiting.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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

Reply via email to