while disk index and RAM_A index is mergying, zoie cannot add document to RAM_B?

17 views
Skip to first unread message

xingjian shu

unread,
Mar 15, 2012, 12:05:04 AM3/15/12
to zoie
In class RealtimeIndexDataLoader.java,
we can see method processBatch() is synchronized
and also in the method consume(Collection<DataEvent<D>> events)
there is a synchronized (this) block with comment "this blocks the
batch disk loader thread while indexing to RAM".

Because they are synchronized, we can't execute them at the same time
in two different threads.

Does this means, while disk index and RAM_A index is mergying, zoie
cannot add document to RAM_B?

John

unread,
Apr 9, 2012, 5:48:23 AM4/9/12
to zoie
Normally there is only 1 writing/indexing thread serving many read
threads.

You can however and multiple threads calling consume which
synchronizes putting indexing events on the update queue.

-John
Reply all
Reply to author
Forward
0 new messages