lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <markrmil...@gmail.com>
Subject Allow IndexReader to take ownership of Directory
Date Sat, 15 Nov 2008 17:48:13 GMT
Does anyone object to making IndexReader

private static IndexReader open(final Directory directory, final boolean 
closeDirectory, final IndexDeletionPolicy deletionPolicy, final 
IndexCommit commit, final boolean readOnly) throws       
CorruptIndexException, IOException {
    return DirectoryIndexReader.open(directory, closeDirectory, 
deletionPolicy, commit, readOnly);
}

public? I think it can be convenient to be able to both control the 
closing of the Directory yourself, as well as give the Directory to an 
IndexReader to manage.

If you have created a DirectoryFactory to supply your IndexReaders, you 
will want to supply external Directory implementations to the 
IndexReaders, and its quite possible that you then want the IndexReader 
to take over the lifecycle of the Directory for you rather than having 
to juggle the two separately

- Mark

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


Mime
View raw message