From f20192ce2ada311c9da8438d723d0843fa2140db Mon Sep 17 00:00:00 2001
From: Dawid Weiss Expert: policy for deletion of stale {@link IndexCommit index commits}.
*
- * Implement this interface, and pass it to one
- * of the {@link IndexWriter} or {@link IndexReader}
- * constructors, to customize when older
+ * Implement this interface, and set it on
+ * {@link IndexWriterConfig#setIndexDeletionPolicy(IndexDeletionPolicy)}
+ * to customize when older
* {@link IndexCommit point-in-time commits}
- * are deleted from the index directory. The default deletion policy
- * is {@link KeepOnlyLastCommitDeletionPolicy}, which always
+ * are deleted from the index directory. The default deletion policy
+ * is {@link KeepOnlyLastCommitDeletionPolicy}, always
* removes old commits as soon as a new commit is done (this
* matches the behavior before 2.2).
Implementers of sub-classes should make sure that {@link #clone()} - * returns an independent instance able to work with any other {@link IndexWriter} - * or {@link Directory} instance.
*/ public abstract class IndexDeletionPolicy { diff --git a/lucene/core/src/java/org/apache/lucene/index/NoDeletionPolicy.java b/lucene/core/src/java/org/apache/lucene/index/NoDeletionPolicy.java index 9b211e190662..95c8bb8efca2 100644 --- a/lucene/core/src/java/org/apache/lucene/index/NoDeletionPolicy.java +++ b/lucene/core/src/java/org/apache/lucene/index/NoDeletionPolicy.java @@ -38,10 +38,4 @@ public void onCommit(List extends IndexCommit> commits) {} @Override public void onInit(List extends IndexCommit> commits) {} - - @Override - public IndexDeletionPolicy clone() { - return this; - } - } diff --git a/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java b/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java index 3616d4e545b8..2969d5ba565f 100644 --- a/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java +++ b/solr/core/src/java/org/apache/solr/core/IndexDeletionPolicyWrapper.java @@ -267,11 +267,5 @@ public static long getCommitTimestamp(IndexCommit commit) throws IOException { return 0; } } - - @Override - public IndexDeletionPolicy clone() { - // see class-level javadocs - return this; - } }