LUCENE-5810: fix MDW logic around fsync, now that NRTCachingDirectory extends FilterDirectory

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1610382 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2014-07-14 10:47:02 +00:00
parent 10ecbc5a97
commit b9a05a7938
1 changed files with 3 additions and 0 deletions

View File

@ -192,6 +192,9 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
private boolean mustSync() {
Directory delegate = in;
while (delegate instanceof FilterDirectory) {
if (delegate instanceof NRTCachingDirectory) {
return true;
}
delegate = ((FilterDirectory) delegate).getDelegate();
}
return delegate instanceof NRTCachingDirectory;