mikemccand commented on a change in pull request #2052: URL: https://github.com/apache/lucene-solr/pull/2052#discussion_r542469154
########## File path: lucene/misc/src/java/org/apache/lucene/misc/store/DirectIODirectory.java ########## @@ -154,14 +146,43 @@ public IndexOutput createOutput(String name, IOContext context) throws IOExcepti if (context.context != Context.MERGE || context.mergeInfo.estimatedMergeBytes < minBytesDirect) { return delegate.createOutput(name, context); } else { - return new NativeUnixIndexOutput(getDirectory().resolve(name), name, mergeBufferSize); + return new DirectIOIndexOutput(getDirectory().resolve(name), name, mergeBufferSize); } } - @SuppressForbidden(reason = "java.io.File: native API requires old-style FileDescriptor") - private final static class NativeUnixIndexOutput extends IndexOutput { + @Override + public void deleteFile(String name) throws IOException { + delegate.deleteFile(name); + } + + @Override + public Set<String> getPendingDeletions() throws IOException { + return delegate.getPendingDeletions(); + } + + @Override + public String[] listAll() throws IOException { + return delegate.listAll(); + } + + @Override + public long fileLength(String name) throws IOException { + return delegate.fileLength(name); + } + + @Override + public void rename(String source, String dest) throws IOException { + delegate.rename(source, dest); + } + + @Override + public void close() throws IOException { + delegate.close(); Review comment: Oh yeah hmm, that is frustrating :) I was hoping we could pass two things to `IOUtils.close` ... maybe pass `FilterDirectory.this`? Though I suspect that would indeed just call this existing `close()` method, leading to infinite recursion. Hrmph, this is beyond my Java knowledge but sure seems like it ought to be possible. Maybe @uschindler knows :) ---------------------------------------------------------------- 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