lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r826533 - in /lucene/java/trunk/src/java/org/apache/lucene/index: IndexDeletionPolicy.java IndexFileDeleter.java KeepOnlyLastCommitDeletionPolicy.java SnapshotDeletionPolicy.java
Date Sun, 18 Oct 2009 21:50:47 GMT
Author: uschindler
Date: Sun Oct 18 21:50:47 2009
New Revision: 826533

URL: http://svn.apache.org/viewvc?rev=826533&view=rev
Log:
LUCENE-1257: CommitPoint -> IndexCommit in generics

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexDeletionPolicy.java
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java
    lucene/java/trunk/src/java/org/apache/lucene/index/KeepOnlyLastCommitDeletionPolicy.java
    lucene/java/trunk/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexDeletionPolicy.java?rev=826533&r1=826532&r2=826533&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexDeletionPolicy.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexDeletionPolicy.java Sun Oct 18
21:50:47 2009
@@ -70,7 +70,7 @@
    * {@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 @@
    * @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;
 }

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java?rev=826533&r1=826532&r2=826533&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java Sun Oct 18 21:50:47
2009
@@ -84,14 +84,14 @@
    * 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 @@
     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();

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/KeepOnlyLastCommitDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/KeepOnlyLastCommitDeletionPolicy.java?rev=826533&r1=826532&r2=826533&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/KeepOnlyLastCommitDeletionPolicy.java
(original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/KeepOnlyLastCommitDeletionPolicy.java
Sun Oct 18 21:50:47 2009
@@ -31,7 +31,7 @@
   /**
    * 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 @@
   /**
    * 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();

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java?rev=826533&r1=826532&r2=826533&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java Sun Oct
18 21:50:47 2009
@@ -52,12 +52,12 @@
     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 @@
     }
   }
 
-  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++)



Mime
View raw message