lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r774626 - /lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java
Date Thu, 14 May 2009 03:57:12 GMT
Author: markrmiller
Date: Thu May 14 03:57:09 2009
New Revision: 774626

URL: http://svn.apache.org/viewvc?rev=774626&view=rev
Log:
pendingOutput is a bit generic for a field in a large class - changed to pendingSegnOutput

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java?rev=774626&r1=774625&r2=774626&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java Thu May 14 03:57:09
2009
@@ -297,7 +297,7 @@
 
   // Only non-null after prepareCommit has been called and
   // before finishCommit is called
-  ChecksumIndexOutput pendingOutput;
+  ChecksumIndexOutput pendingSegnOutput;
 
   private final void write(Directory directory) throws IOException {
 
@@ -310,34 +310,34 @@
       generation++;
     }
 
-    ChecksumIndexOutput output = new ChecksumIndexOutput(directory.createOutput(segmentFileName));
+    ChecksumIndexOutput segnOutput = new ChecksumIndexOutput(directory.createOutput(segmentFileName));
 
     boolean success = false;
 
     try {
-      output.writeInt(CURRENT_FORMAT); // write FORMAT
-      output.writeLong(++version); // every write changes
+      segnOutput.writeInt(CURRENT_FORMAT); // write FORMAT
+      segnOutput.writeLong(++version); // every write changes
                                    // the index
-      output.writeInt(counter); // write counter
-      output.writeInt(size()); // write infos
+      segnOutput.writeInt(counter); // write counter
+      segnOutput.writeInt(size()); // write infos
       for (int i = 0; i < size(); i++) {
-        info(i).write(output);
+        info(i).write(segnOutput);
       }
       if (userData == null)
-        output.writeByte((byte) 0);
+        segnOutput.writeByte((byte) 0);
       else {
-        output.writeByte((byte) 1);
-        output.writeString(userData);
+        segnOutput.writeByte((byte) 1);
+        segnOutput.writeString(userData);
       }
-      output.prepareCommit();
+      segnOutput.prepareCommit();
       success = true;
-      pendingOutput = output;
+      pendingSegnOutput = segnOutput;
     } finally {
       if (!success) {
         // We hit an exception above; try to close the file
         // but suppress any exception:
         try {
-          output.close();
+          segnOutput.close();
         } catch (Throwable t) {
           // Suppress so we keep throwing the original exception
         }
@@ -765,9 +765,9 @@
   }
 
   public final void rollbackCommit(Directory dir) throws IOException {
-    if (pendingOutput != null) {
+    if (pendingSegnOutput != null) {
       try {
-        pendingOutput.close();
+        pendingSegnOutput.close();
       } catch (Throwable t) {
         // Suppress so we keep throwing the original exception
         // in our caller
@@ -784,7 +784,7 @@
         // Suppress so we keep throwing the original exception
         // in our caller
       }
-      pendingOutput = null;
+      pendingSegnOutput = null;
     }
   }
 
@@ -794,7 +794,7 @@
    *  is called you must call {@link #finishCommit} to complete
    *  the commit or {@link #rollbackCommit} to abort it. */
   public final void prepareCommit(Directory dir) throws IOException {
-    if (pendingOutput != null)
+    if (pendingSegnOutput != null)
       throw new IllegalStateException("prepareCommit was already called");
     write(dir);
   }
@@ -820,13 +820,13 @@
   }
 
   public final void finishCommit(Directory dir) throws IOException {
-    if (pendingOutput == null)
+    if (pendingSegnOutput == null)
       throw new IllegalStateException("prepareCommit was not called");
     boolean success = false;
     try {
-      pendingOutput.finishCommit();
-      pendingOutput.close();
-      pendingOutput = null;
+      pendingSegnOutput.finishCommit();
+      pendingSegnOutput.close();
+      pendingSegnOutput = null;
       success = true;
     } finally {
       if (!success)



Mime
View raw message