LUCENE-4055: clean up nocommits

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4055@1342012 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2012-05-23 20:10:47 +00:00
parent 1334bd6c15
commit efefcc832b
4 changed files with 14 additions and 11 deletions

View File

@ -331,7 +331,6 @@ final class IndexFileDeleter {
for(int i=0;i<files.length;i++) { for(int i=0;i<files.length;i++) {
String fileName = files[i]; String fileName = files[i];
// nocommit nuke this filtering
if ((segmentName == null || fileName.startsWith(segmentPrefix1) || fileName.startsWith(segmentPrefix2)) && if ((segmentName == null || fileName.startsWith(segmentPrefix1) || fileName.startsWith(segmentPrefix2)) &&
!fileName.endsWith("write.lock") && !fileName.endsWith("write.lock") &&
!refCounts.containsKey(fileName) && !refCounts.containsKey(fileName) &&

View File

@ -746,10 +746,9 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
} }
} }
// nocommit we can also pull the DV types of the // TODO: we could also pull DV type of each field here,
// fields... and catch DV type change on addDoc // and use that to make sure new segment(s) don't change
// instead of much later in merge // the type...
//}
return map; return map;
} }
@ -3553,7 +3552,9 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
} }
} }
// nocommit why on earth do we suddenly set success back to false here!? // So that, if we hit exc in deleteNewFiles (next)
// or in commitMerge (later), we close the
// per-segment readers in the finally clause below:
success = false; success = false;
synchronized(this) { synchronized(this) {
@ -3573,6 +3574,11 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
} }
merge.info.info.setUseCompoundFile(true); merge.info.info.setUseCompoundFile(true);
} else {
// So that, if we hit exc in commitMerge (later),
// we close the per-segment readers in the finally
// clause below:
success = false;
} }
// Have codec write SegmentInfo. Must do this after // Have codec write SegmentInfo. Must do this after

View File

@ -28,8 +28,6 @@ import org.apache.lucene.store.Directory;
* *
* @lucene.experimental */ * @lucene.experimental */
// nocommit this class feels alot like ReaderAndLiveDocs...?
// like it carries mutable per-segment state....?
public class SegmentInfoPerCommit { public class SegmentInfoPerCommit {
public final SegmentInfo info; public final SegmentInfo info;
@ -135,7 +133,6 @@ public class SegmentInfoPerCommit {
@Override @Override
public SegmentInfoPerCommit clone() { public SegmentInfoPerCommit clone() {
// nocommit ok? SI is immutable!?
return new SegmentInfoPerCommit(info, delCount, delGen); return new SegmentInfoPerCommit(info, delCount, delGen);
} }
} }

View File

@ -21,8 +21,9 @@ import java.util.Map;
import org.apache.lucene.index.DocValues.Type; import org.apache.lucene.index.DocValues.Type;
// nocommit remove this? (require DV type does not change // TODO: maybe we should not automagically promote
// for a given field) // types... and instead require a given field always has the
// same type?
/** /**
* Type promoter that promotes {@link DocValues} during merge based on * Type promoter that promotes {@link DocValues} during merge based on