You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2013/05/03 18:08:19 UTC
svn commit: r1478854 - in
/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core:
IndexDeletionPolicyWrapper.java SolrDeletionPolicy.java
Author: mikemccand
Date: Fri May 3 16:08:18 2013
New Revision: 1478854
URL: http://svn.apache.org/r1478854
Log:
LUCENE-4976: fix Solr IndexDeletionPolicy impls to handle empty commits onInit
Modified:
lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java
lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java?rev=1478854&r1=1478853&r2=1478854&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java Fri May 3 16:08:18 2013
@@ -237,7 +237,9 @@ public final class IndexDeletionPolicyWr
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 {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java?rev=1478854&r1=1478853&r2=1478854&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/core/SolrDeletionPolicy.java Fri May 3 16:08:18 2013
@@ -79,6 +79,9 @@ public class SolrDeletionPolicy extends
@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: {}",