From f20192ce2ada311c9da8438d723d0843fa2140db Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Wed, 28 Mar 2018 14:16:06 +0200 Subject: [PATCH] LUCENE-8228: IndexDeletionPolicy has obsolete clone() requirements in the javadoc. --- lucene/CHANGES.txt | 3 +++ .../apache/lucene/index/IndexDeletionPolicy.java | 16 +++++++--------- .../apache/lucene/index/NoDeletionPolicy.java | 6 ------ .../solr/core/IndexDeletionPolicyWrapper.java | 6 ------ 4 files changed, 10 insertions(+), 21 deletions(-) diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index b0619301b4fa..9205613090c1 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -113,6 +113,9 @@ New Features Other +* LUCENE-8228: removed obsolete IndexDeletionPolicy clone() requirements from + the javadoc. (Dawid Weiss) + * LUCENE-8219: Use a realistic estimate of the number of nodes and links in LevensteinAutomaton.java, to save reallocation of arrays. (Christian Ziech) diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexDeletionPolicy.java b/lucene/core/src/java/org/apache/lucene/index/IndexDeletionPolicy.java index b556a0444210..2a319af8f97f 100644 --- a/lucene/core/src/java/org/apache/lucene/index/IndexDeletionPolicy.java +++ b/lucene/core/src/java/org/apache/lucene/index/IndexDeletionPolicy.java @@ -25,12 +25,14 @@ /** *

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).

* @@ -48,10 +50,6 @@ * target="top" * href="http://issues.apache.org/jira/browse/LUCENE-710">LUCENE-710 * for details.

- * - *

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 commits) {} @Override public void onInit(List 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; - } }