Skip to content

Commit

Permalink
HSEARCH-1090 IndexReader leaks file handles on close
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed May 4, 2012
1 parent cea2e4c commit 552a612
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Expand Up @@ -42,8 +42,8 @@ public class CacheableMultiReader extends MultiReader {
final ReaderProvider[] managers;

public CacheableMultiReader(IndexReader[] subReaders, ReaderProvider[] managers) {
// don't allow sub readers to be closed:
super( subReaders, false );
// If this flag isn't set to true, the MultiReader will increase the usage counter!
super( subReaders, true );
this.subReaders = subReaders;
this.managers = managers;
}
Expand Down
Expand Up @@ -261,11 +261,15 @@ protected void doUndeleteAll() throws CorruptIndexException, IOException {
}

protected void doCommit(Map<String, String> commitUserData) throws IOException {
throw new UnsupportedOperationException("delegate method is not visible - hope we don't need it");
//can't implement as method is not visibile
//not important either as method is deprecated and all Readers are read-only: nothing to commit
//also, method is going to be removed.
}

protected void doClose() throws IOException {
throw new UnsupportedOperationException("delegate method is not visible - hope we don't need it");
//can't implement as method is not visibile
//not important either as method is deprecated and all Readers are read-only: nothing to flush on close
//also, method is going to be removed.
}

@Override
Expand Down

0 comments on commit 552a612

Please sign in to comment.