mirror of https://github.com/apache/lucene.git
LUCENE-4976: fix Solr IndexDeletionPolicy impls to handle empty commits onInit
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1478855 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
64dfbfdfb2
commit
a7bcad65eb
|
@ -237,7 +237,9 @@ public final class IndexDeletionPolicyWrapper extends IndexDeletionPolicy {
|
|||
map.put(wrapper.delegate.getGeneration(), wrapper.delegate);
|
||||
}
|
||||
solrVersionVsCommits = map;
|
||||
latestCommit = ((list.get(list.size() - 1)).delegate);
|
||||
if (!list.isEmpty()) {
|
||||
latestCommit = ((list.get(list.size() - 1)).delegate);
|
||||
}
|
||||
}
|
||||
|
||||
public static long getCommitTimestamp(IndexCommit commit) throws IOException {
|
||||
|
|
|
@ -79,6 +79,9 @@ public class SolrDeletionPolicy extends IndexDeletionPolicy implements NamedList
|
|||
@Override
|
||||
public void onInit(List commits) throws IOException {
|
||||
// SOLR-4547: log basic data at INFO, add filenames at DEBUG.
|
||||
if (commits.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
log.info("SolrDeletionPolicy.onInit: commits: {}",
|
||||
new CommitsLoggingInfo(commits));
|
||||
log.debug("SolrDeletionPolicy.onInit: commits: {}",
|
||||
|
|
Loading…
Reference in New Issue