mirror of https://github.com/apache/lucene.git
LUCENE-6271: merge trunk changes up to r1670546
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene6271@1670547 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
commit
4ae686243b
|
@ -49,7 +49,7 @@ import org.apache.lucene.util.IOUtils;
|
|||
|
||||
public final class OrdsBlockTreeTermsReader extends FieldsProducer {
|
||||
|
||||
// Open input to the main terms dict file (_X.tiv)
|
||||
// Open input to the main terms dict file (_X.tio)
|
||||
final IndexInput in;
|
||||
|
||||
//private static final boolean DEBUG = BlockTreeTermsWriter.DEBUG;
|
||||
|
|
|
@ -37,17 +37,17 @@ import java.util.Random;
|
|||
* Compares one codec against another
|
||||
*/
|
||||
public class TestDuelingCodecs extends LuceneTestCase {
|
||||
private Directory leftDir;
|
||||
private IndexReader leftReader;
|
||||
private Codec leftCodec;
|
||||
Directory leftDir;
|
||||
IndexReader leftReader;
|
||||
Codec leftCodec;
|
||||
|
||||
private Directory rightDir;
|
||||
private IndexReader rightReader;
|
||||
private Codec rightCodec;
|
||||
private RandomIndexWriter leftWriter;
|
||||
private RandomIndexWriter rightWriter;
|
||||
private long seed;
|
||||
private String info; // for debugging
|
||||
Directory rightDir;
|
||||
IndexReader rightReader;
|
||||
Codec rightCodec;
|
||||
RandomIndexWriter leftWriter;
|
||||
RandomIndexWriter rightWriter;
|
||||
long seed;
|
||||
String info; // for debugging
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
|
@ -143,8 +143,9 @@ public class TestDuelingCodecs extends LuceneTestCase {
|
|||
/**
|
||||
* checks the two indexes are equivalent
|
||||
*/
|
||||
// we use a small amount of docs here, so it works with any codec
|
||||
public void testEquals() throws IOException {
|
||||
int numdocs = TEST_NIGHTLY ? atLeast(2000) : atLeast(100);
|
||||
int numdocs = atLeast(100);
|
||||
createRandomIndex(numdocs, leftWriter, seed);
|
||||
createRandomIndex(numdocs, rightWriter, seed);
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
package org.apache.lucene.index;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import org.apache.lucene.util.LuceneTestCase.Nightly;
|
||||
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
|
||||
|
||||
/**
|
||||
* Just like TestDuelingCodecs, only with a lot more documents.
|
||||
*/
|
||||
@Nightly
|
||||
@SuppressCodecs({"Memory", "Direct"}) // it can be too much for these codecs
|
||||
public class TestDuelingCodecsAtNight extends TestDuelingCodecs {
|
||||
|
||||
// use a big number of documents
|
||||
public void testBigEquals() throws Exception {
|
||||
int numdocs = atLeast(2000);
|
||||
createRandomIndex(numdocs, leftWriter, seed);
|
||||
createRandomIndex(numdocs, rightWriter, seed);
|
||||
|
||||
leftReader = leftWriter.getReader();
|
||||
rightReader = rightWriter.getReader();
|
||||
|
||||
assertReaderEquals(info, leftReader, rightReader);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue