LUCENE-1257: CommitPoint -> IndexCommit in generics

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@826533 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2009-10-18 21:50:47 +00:00
parent 501d8c59e4
commit 1c0678d148
4 changed files with 11 additions and 11 deletions

View File

@ -70,7 +70,7 @@ public interface IndexDeletionPolicy {
* {@link IndexCommit point-in-time commits},
* sorted by age (the 0th one is the oldest commit).
*/
public void onInit(List<IndexCommit> commits) throws IOException;
public void onInit(List<? extends IndexCommit> commits) throws IOException;
/**
* <p>This is called each time the writer completed a commit.
@ -94,5 +94,5 @@ public interface IndexDeletionPolicy {
* @param commits List of {@link IndexCommit},
* sorted by age (the 0th one is the oldest commit).
*/
public void onCommit(List<IndexCommit> commits) throws IOException;
public void onCommit(List<? extends IndexCommit> commits) throws IOException;
}

View File

@ -84,14 +84,14 @@ final class IndexFileDeleter {
* default delete policy (KeepOnlyLastCommitDeletionPolicy).
* Other policies may leave commit points live for longer
* in which case this list would be longer than 1: */
private List commits = new ArrayList();
private List<CommitPoint> commits = new ArrayList<CommitPoint>();
/* Holds files we had incref'd from the previous
* non-commit checkpoint: */
private List<Collection<String>> lastFiles = new ArrayList<Collection<String>>();
/* Commits that the IndexDeletionPolicy have decided to delete: */
private List commitsToDelete = new ArrayList();
private List<CommitPoint> commitsToDelete = new ArrayList<CommitPoint>();
private PrintStream infoStream;
private Directory directory;
@ -565,13 +565,13 @@ final class IndexFileDeleter {
String segmentsFileName;
boolean deleted;
Directory directory;
Collection<IndexCommit> commitsToDelete;
Collection<CommitPoint> commitsToDelete;
long version;
long generation;
final boolean isOptimized;
final Map<String,String> userData;
public CommitPoint(Collection<IndexCommit> commitsToDelete, Directory directory, SegmentInfos segmentInfos) throws IOException {
public CommitPoint(Collection<CommitPoint> commitsToDelete, Directory directory, SegmentInfos segmentInfos) throws IOException {
this.directory = directory;
this.commitsToDelete = commitsToDelete;
userData = segmentInfos.getUserData();

View File

@ -31,7 +31,7 @@ public final class KeepOnlyLastCommitDeletionPolicy implements IndexDeletionPoli
/**
* Deletes all commits except the most recent one.
*/
public void onInit(List<IndexCommit> commits) {
public void onInit(List<? extends IndexCommit> commits) {
// Note that commits.size() should normally be 1:
onCommit(commits);
}
@ -39,7 +39,7 @@ public final class KeepOnlyLastCommitDeletionPolicy implements IndexDeletionPoli
/**
* Deletes all commits except the most recent one.
*/
public void onCommit(List<IndexCommit> commits) {
public void onCommit(List<? extends IndexCommit> commits) {
// Note that commits.size() should normally be 2 (if not
// called by onInit above):
int size = commits.size();

View File

@ -52,12 +52,12 @@ public class SnapshotDeletionPolicy implements IndexDeletionPolicy {
this.primary = primary;
}
public synchronized void onInit(List<IndexCommit> commits) throws IOException {
public synchronized void onInit(List<? extends IndexCommit> commits) throws IOException {
primary.onInit(wrapCommits(commits));
lastCommit = commits.get(commits.size()-1);
}
public synchronized void onCommit(List<IndexCommit> commits) throws IOException {
public synchronized void onCommit(List<? extends IndexCommit> commits) throws IOException {
primary.onCommit(wrapCommits(commits));
lastCommit = commits.get(commits.size()-1);
}
@ -123,7 +123,7 @@ public class SnapshotDeletionPolicy implements IndexDeletionPolicy {
}
}
private List<IndexCommit> wrapCommits(List<IndexCommit> commits) {
private List<IndexCommit> wrapCommits(List<? extends IndexCommit> commits) {
final int count = commits.size();
List<IndexCommit> myCommits = new ArrayList<IndexCommit>(count);
for(int i=0;i<count;i++)