You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2015/06/02 17:27:24 UTC
svn commit: r1683128 - in
/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index:
Test2BSortedDocValues.java Test2BSortedDocValuesFixedSorted.java
Test2BSortedDocValuesOrds.java
Author: sarowe
Date: Tue Jun 2 15:27:23 2015
New Revision: 1683128
URL: http://svn.apache.org/r1683128
Log:
LUCENE-6516: Split monster tests in Test2BSortedDocValues out into their own suites so that they can be run in parallel
Added:
lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesFixedSorted.java
- copied, changed from r1683127, lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java
lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesOrds.java
- copied, changed from r1678931, lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java
Removed:
lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java
Copied: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesFixedSorted.java (from r1683127, lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesFixedSorted.java?p2=lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesFixedSorted.java&p1=lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java&r1=1683127&r2=1683128&rev=1683128&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesFixedSorted.java Tue Jun 2 15:27:23 2015
@@ -38,7 +38,7 @@ import com.carrotsearch.randomizedtestin
// 3-core AMD at 2.5Ghz, 12 GB RAM, 5GB test heap, 2 test JVMs, 2TB SATA.
@Monster("Takes ~ 6 hours if the heap is 5gb")
@SuppressSysoutChecks(bugUrl = "Stuff gets printed")
-public class Test2BSortedDocValues extends LuceneTestCase {
+public class Test2BSortedDocValuesFixedSorted extends LuceneTestCase {
// indexes Integer.MAX_VALUE docs with a fixed binary field
public void testFixedSorted() throws Exception {
@@ -92,67 +92,6 @@ public class Test2BSortedDocValues exten
}
}
- r.close();
- dir.close();
- }
-
- // indexes Integer.MAX_VALUE docs with a fixed binary field
- public void test2BOrds() throws Exception {
- BaseDirectoryWrapper dir = newFSDirectory(createTempDir("2BOrds"));
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)dir).setThrottling(MockDirectoryWrapper.Throttling.NEVER);
- }
-
- IndexWriter w = new IndexWriter(dir,
- new IndexWriterConfig(new MockAnalyzer(random()))
- .setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH)
- .setRAMBufferSizeMB(256.0)
- .setMergeScheduler(new ConcurrentMergeScheduler())
- .setMergePolicy(newLogMergePolicy(false, 10))
- .setOpenMode(IndexWriterConfig.OpenMode.CREATE)
- .setCodec(TestUtil.getDefaultCodec()));
-
- Document doc = new Document();
- byte bytes[] = new byte[4];
- BytesRef data = new BytesRef(bytes);
- SortedDocValuesField dvField = new SortedDocValuesField("dv", data);
- doc.add(dvField);
-
- for (int i = 0; i < IndexWriter.MAX_DOCS; i++) {
- bytes[0] = (byte)(i >> 24);
- bytes[1] = (byte)(i >> 16);
- bytes[2] = (byte)(i >> 8);
- bytes[3] = (byte) i;
- w.addDocument(doc);
- if (i % 100000 == 0) {
- System.out.println("indexed: " + i);
- System.out.flush();
- }
- }
-
- w.forceMerge(1);
- w.close();
-
- System.out.println("verifying...");
- System.out.flush();
-
- DirectoryReader r = DirectoryReader.open(dir);
- int counter = 0;
- for (LeafReaderContext context : r.leaves()) {
- LeafReader reader = context.reader();
- BytesRef scratch = new BytesRef();
- BinaryDocValues dv = reader.getSortedDocValues("dv");
- for (int i = 0; i < reader.maxDoc(); i++) {
- bytes[0] = (byte) (counter >> 24);
- bytes[1] = (byte) (counter >> 16);
- bytes[2] = (byte) (counter >> 8);
- bytes[3] = (byte) counter;
- counter++;
- final BytesRef term = dv.get(i);
- assertEquals(data, term);
- }
- }
-
r.close();
dir.close();
}
Copied: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesOrds.java (from r1678931, lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesOrds.java?p2=lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesOrds.java&p1=lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java&r1=1678931&r2=1683128&rev=1683128&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValuesOrds.java Tue Jun 2 15:27:23 2015
@@ -38,63 +38,7 @@ import com.carrotsearch.randomizedtestin
// 3-core AMD at 2.5Ghz, 12 GB RAM, 5GB test heap, 2 test JVMs, 2TB SATA.
@Monster("Takes ~ 6 hours if the heap is 5gb")
@SuppressSysoutChecks(bugUrl = "Stuff gets printed")
-public class Test2BSortedDocValues extends LuceneTestCase {
-
- // indexes Integer.MAX_VALUE docs with a fixed binary field
- public void testFixedSorted() throws Exception {
- BaseDirectoryWrapper dir = newFSDirectory(createTempDir("2BFixedSorted"));
- if (dir instanceof MockDirectoryWrapper) {
- ((MockDirectoryWrapper)dir).setThrottling(MockDirectoryWrapper.Throttling.NEVER);
- }
-
- IndexWriter w = new IndexWriter(dir,
- new IndexWriterConfig(new MockAnalyzer(random()))
- .setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH)
- .setRAMBufferSizeMB(256.0)
- .setMergeScheduler(new ConcurrentMergeScheduler())
- .setMergePolicy(newLogMergePolicy(false, 10))
- .setOpenMode(IndexWriterConfig.OpenMode.CREATE)
- .setCodec(TestUtil.getDefaultCodec()));
-
- Document doc = new Document();
- byte bytes[] = new byte[2];
- BytesRef data = new BytesRef(bytes);
- SortedDocValuesField dvField = new SortedDocValuesField("dv", data);
- doc.add(dvField);
-
- for (int i = 0; i < IndexWriter.MAX_DOCS; i++) {
- bytes[0] = (byte)(i >> 8);
- bytes[1] = (byte) i;
- w.addDocument(doc);
- if (i % 100000 == 0) {
- System.out.println("indexed: " + i);
- System.out.flush();
- }
- }
-
- w.forceMerge(1);
- w.close();
-
- System.out.println("verifying...");
- System.out.flush();
-
- DirectoryReader r = DirectoryReader.open(dir);
- int expectedValue = 0;
- for (LeafReaderContext context : r.leaves()) {
- LeafReader reader = context.reader();
- BinaryDocValues dv = reader.getSortedDocValues("dv");
- for (int i = 0; i < reader.maxDoc(); i++) {
- bytes[0] = (byte)(expectedValue >> 8);
- bytes[1] = (byte) expectedValue;
- final BytesRef term = dv.get(i);
- assertEquals(data, term);
- expectedValue++;
- }
- }
-
- r.close();
- dir.close();
- }
+public class Test2BSortedDocValuesOrds extends LuceneTestCase {
// indexes Integer.MAX_VALUE docs with a fixed binary field
public void test2BOrds() throws Exception {