LUCENE-4055: more nocommits

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4055@1340722 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2012-05-20 13:59:20 +00:00
parent fb6c3cfeac
commit 54f5444796
8 changed files with 13 additions and 34 deletions

View File

@ -88,9 +88,6 @@ public class CheckIndex {
/** Number of segments in the index. */
public int numSegments;
/** String description of the version of the index. */
public String segmentFormat;
/** Empty unless you passed specific segments list to check as optional 3rd argument.
* @see CheckIndex#checkIndex(List) */
public List<String> segmentsChecked = new ArrayList<String>();
@ -410,31 +407,8 @@ public class CheckIndex {
String sFormat = "";
boolean skip = false;
// nocommit fixme
/*
if (format == SegmentInfos.FORMAT_DIAGNOSTICS) {
sFormat = "FORMAT_DIAGNOSTICS [Lucene 2.9]";
} else if (format == SegmentInfos.FORMAT_HAS_VECTORS) {
sFormat = "FORMAT_HAS_VECTORS [Lucene 3.1]";
} else if (format == SegmentInfos.FORMAT_3_1) {
sFormat = "FORMAT_3_1 [Lucene 3.1+]";
} else if (format == SegmentInfos.FORMAT_4_0) {
sFormat = "FORMAT_4_0 [Lucene 4.0]";
} else if (format == SegmentInfos.FORMAT_CURRENT) {
throw new RuntimeException("BUG: You should update this tool!");
} else if (format < SegmentInfos.FORMAT_CURRENT) {
sFormat = "int=" + format + " [newer version of Lucene than this tool supports]";
skip = true;
} else if (format > SegmentInfos.FORMAT_MINIMUM) {
sFormat = "int=" + format + " [older version of Lucene than this tool supports]";
skip = true;
}
*/
sFormat = "nocommit not working yet";
result.segmentsFileName = segmentsFileName;
result.numSegments = numSegments;
result.segmentFormat = sFormat;
result.userData = sis.getUserData();
String userDataString;
if (sis.getUserData().size() > 0) {

View File

@ -96,7 +96,7 @@ public final class FieldInfo {
assert normType == null;
assert indexOptions == IndexOptions.DOCS_AND_FREQS_AND_POSITIONS;
} else {
// nocommit this trips:
// nocommit trips:
//assert omitNorms || normType != null;
assert indexOptions != null;
}

View File

@ -3525,7 +3525,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
}
}
// nocommit why do we set success back to false here!?
// nocommit why on earth do we suddenly set success back to false here!?
success = false;
synchronized(this) {

View File

@ -41,6 +41,7 @@ import org.apache.lucene.util.Constants;
*
* @lucene.experimental
*/
// nocommit final...?
public class SegmentInfo implements Cloneable {
// TODO: remove these from this class, for now this is the representation
@ -196,7 +197,6 @@ public class SegmentInfo implements Cloneable {
clearFilesCache();
}
// nocommit this is dangerous... because we lose the codec's customzied class...
@Override
public SegmentInfo clone() {
final HashMap<Integer,Long> clonedNormGen;

View File

@ -93,8 +93,6 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfo> {
// also i think this class should write this, somehow we let
// preflexrw hackishly override this (like seek backwards and overwrite it)
// nocommit fix to read 3.x...
public static final int VERSION_40 = 0;
/** Used for the segments.gen file only!
@ -289,8 +287,6 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfo> {
}
userData = input.readStringStringMap();
} else {
// nocommit 3.x needs normGens too ... we can push
// down to make this 3.x private????
Lucene3xSegmentInfosReader.readLegacyInfos(this, directory, input, format);
Codec codec = Codec.forName("Lucene3x");
for (SegmentInfo info : this) {

View File

@ -62,6 +62,9 @@ public class RateLimiter {
* might exceed the target). It's best to call this
* with a biggish count, not one byte at a time. */
public void pause(long bytes) {
if (bytes == 1) {
return;
}
// TODO: this is purely instantaneous rate; maybe we
// should also offer decayed recent history one?

View File

@ -42,6 +42,9 @@ public class TestStressAdvance extends LuceneTestCase {
final Field idField = newField("id", "", StringField.TYPE_STORED);
doc.add(idField);
int num = atLeast(4097);
if (VERBOSE) {
System.out.println("\nTEST: numDocs=" + num);
}
for(int id=0;id<num;id++) {
if (random().nextInt(4) == 3) {
f.setStringValue("a");
@ -51,6 +54,9 @@ public class TestStressAdvance extends LuceneTestCase {
}
idField.setStringValue(""+id);
w.addDocument(doc);
if (VERBOSE) {
System.out.println("\nTEST: doc upto " + id);
}
}
w.forceMerge(1);

View File

@ -78,7 +78,7 @@ public class MockIndexOutputWrapper extends IndexOutput {
long freeSpace = dir.maxSize == 0 ? 0 : dir.maxSize - dir.sizeInBytes();
long realUsage = 0;
if (dir.rateLimiter != null) {
if (dir.rateLimiter != null && len >= 10) {
dir.rateLimiter.pause(len);
}