Or you can make threadlocal RNGs.

On Mon, Nov 29, 2010 at 23:20, Yonik Seeley <[email protected]> wrote:
> On Mon, Nov 29, 2010 at 2:52 PM, Michael McCandless
> <[email protected]> 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: [email protected]
> For additional commands, e-mail: [email protected]
>
>



-- 
Kirill Zakharenko/Кирилл Захаренко ([email protected])
Phone: +7 (495) 683-567-4
ICQ: 104465785

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to