lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Earwin Burrfoot <ear...@gmail.com>
Subject Re: Lucene-Solr-tests-only-3.x - Build # 1950 - Failure
Date Mon, 29 Nov 2010 20:46:14 GMT
Or you can make threadlocal RNGs.

On Mon, Nov 29, 2010 at 23:20, Yonik Seeley <yonik@lucidimagination.com> wrote:
> On Mon, Nov 29, 2010 at 2:52 PM, Michael McCandless
> <lucene@mikemccandless.com> wrote:
>> Though why doesn't the random seed reproduce it?
>
> OK, I think I see why.
> For reproducibility, the same random number generator should never be
> used across different threads.
> RandomIndexWriter does though... (via MockIndexWriter.testPoint).
>
>  public RandomIndexWriter(Random r, Directory dir, IndexWriterConfig
> c) throws IOException {
>    this.r = r;
>    w = new MockIndexWriter(r, dir, c);
>
> So something like this should work?
>
>    w = new MockIndexWriter(new Random(r.nextInt()), dir, c);
>
>
> -Yonik
> http://www.lucidimagination.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>



-- 
Kirill Zakharenko/Кирилл Захаренко (earwin@gmail.com)
Phone: +7 (495) 683-567-4
ICQ: 104465785

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message