mirror of https://github.com/apache/lucene.git
use IWC's codecprovider consistently for all operations
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1149319 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7fb6c2ecfe
commit
cf1120f744
|
@ -114,12 +114,12 @@ public final class IndexUpgrader {
|
|||
}
|
||||
|
||||
public void upgrade() throws IOException {
|
||||
if (!IndexReader.indexExists(dir)) {
|
||||
if (!IndexReader.indexExists(dir, iwc.getCodecProvider())) {
|
||||
throw new IndexNotFoundException(dir.toString());
|
||||
}
|
||||
|
||||
if (!deletePriorCommits) {
|
||||
final Collection<IndexCommit> commits = IndexReader.listCommits(dir);
|
||||
final Collection<IndexCommit> commits = DirectoryReader.listCommits(dir, iwc.getCodecProvider());
|
||||
if (commits.size() > 1) {
|
||||
throw new IllegalArgumentException("This tool was invoked to not delete prior commit points, but the following commits were found: " + commits);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue