SOLR-4931: SolrDeletionPolicy onInit and onCommit methods changed to override exact signatures (with generics) from IndexDeletionPolicy

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1493871 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2013-06-17 18:37:52 +00:00
parent 6b06ac1026
commit 8233c923a1
3 changed files with 15 additions and 12 deletions

View File

@ -198,6 +198,9 @@ Other Changes
* SOLR-4224: Refactor JavaBinCodec input stream definition to enhance reuse.
(phunt via Mark Miller)
* SOLR-4931: SolrDeletionPolicy onInit and onCommit methods changed to override
exact signatures (with generics) from IndexDeletionPolicy (shalin)
================== 4.3.1 ==================
Versions of Major Components

View File

@ -100,7 +100,7 @@ public final class IndexDeletionPolicyWrapper extends IndexDeletionPolicy {
}
}
private List<IndexCommitWrapper> wrap(List<IndexCommit> list) {
private List<IndexCommitWrapper> wrap(List<? extends IndexCommit> list) {
List<IndexCommitWrapper> result = new ArrayList<IndexCommitWrapper>();
for (IndexCommit indexCommit : list) result.add(new IndexCommitWrapper(indexCommit));
return result;
@ -130,7 +130,7 @@ public final class IndexDeletionPolicyWrapper extends IndexDeletionPolicy {
* Internal use for Lucene... do not explicitly call.
*/
@Override
public void onInit(List list) throws IOException {
public void onInit(List<? extends IndexCommit> list) throws IOException {
List<IndexCommitWrapper> wrapperList = wrap(list);
deletionPolicy.onInit(wrapperList);
updateCommitPoints(wrapperList);
@ -141,7 +141,7 @@ public final class IndexDeletionPolicyWrapper extends IndexDeletionPolicy {
* Internal use for Lucene... do not explicitly call.
*/
@Override
public void onCommit(List list) throws IOException {
public void onCommit(List<? extends IndexCommit> list) throws IOException {
List<IndexCommitWrapper> wrapperList = wrap(list);
deletionPolicy.onCommit(wrapperList);
updateCommitPoints(wrapperList);

View File

@ -77,7 +77,7 @@ public class SolrDeletionPolicy extends IndexDeletionPolicy implements NamedList
* Internal use for Lucene... do not explicitly call.
*/
@Override
public void onInit(List commits) throws IOException {
public void onInit(List<? extends IndexCommit> commits) throws IOException {
// SOLR-4547: log basic data at INFO, add filenames at DEBUG.
if (commits.isEmpty()) {
return;
@ -86,26 +86,26 @@ public class SolrDeletionPolicy extends IndexDeletionPolicy implements NamedList
new CommitsLoggingInfo(commits));
log.debug("SolrDeletionPolicy.onInit: commits: {}",
new CommitsLoggingDebug(commits));
updateCommits((List<IndexCommit>) commits);
updateCommits(commits);
}
/**
* Internal use for Lucene... do not explicitly call.
*/
@Override
public void onCommit(List commits) throws IOException {
public void onCommit(List<? extends IndexCommit> commits) throws IOException {
// SOLR-4547: log basic data at INFO, add filenames at DEBUG.
log.info("SolrDeletionPolicy.onCommit: commits: {}",
new CommitsLoggingInfo(commits));
log.debug("SolrDeletionPolicy.onCommit: commits: {}",
new CommitsLoggingDebug(commits));
updateCommits((List<IndexCommit>) commits);
updateCommits(commits);
}
private static class CommitsLoggingInfo {
private List<IndexCommit> commits;
private List<? extends IndexCommit> commits;
public CommitsLoggingInfo(List<IndexCommit> commits) {
public CommitsLoggingInfo(List<? extends IndexCommit> commits) {
this.commits = commits;
}
@ -135,7 +135,7 @@ public class SolrDeletionPolicy extends IndexDeletionPolicy implements NamedList
}
private static class CommitsLoggingDebug extends CommitsLoggingInfo {
public CommitsLoggingDebug(List<IndexCommit> commits) {
public CommitsLoggingDebug(List<? extends IndexCommit> commits) {
super(commits);
}
@ -150,7 +150,7 @@ public class SolrDeletionPolicy extends IndexDeletionPolicy implements NamedList
}
}
private void updateCommits(List<IndexCommit> commits) {
private void updateCommits(List<? extends IndexCommit> commits) {
// to be safe, we should only call delete on a commit point passed to us
// in this specific call (may be across diff IndexWriter instances).
// this will happen rarely, so just synchronize everything