From cc240447d4997e3ffc0b9932e5119fe1e0d268ea Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Thu, 14 May 2009 03:57:09 +0000 Subject: [PATCH] pendingOutput is a bit generic for a field in a large class - changed to pendingSegnOutput git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@774626 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/index/SegmentInfos.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/java/org/apache/lucene/index/SegmentInfos.java b/src/java/org/apache/lucene/index/SegmentInfos.java index c347bd6b62e..787bda87b85 100644 --- a/src/java/org/apache/lucene/index/SegmentInfos.java +++ b/src/java/org/apache/lucene/index/SegmentInfos.java @@ -297,7 +297,7 @@ final class SegmentInfos extends Vector { // 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 @@ final class SegmentInfos extends Vector { 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 @@ final class SegmentInfos extends Vector { } 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 @@ final class SegmentInfos extends Vector { // Suppress so we keep throwing the original exception // in our caller } - pendingOutput = null; + pendingSegnOutput = null; } } @@ -794,7 +794,7 @@ final class SegmentInfos extends Vector { * 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 @@ final class SegmentInfos extends Vector { } 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)