This code is unfortunately very complex / confusing, but I *think* this is OK.
Each DeleteSlice holds what that DPWT's current delTerm is supposed to apply to (each DWPT has its own reused DeleteSlice). This blog post from Simon may help to get a bigger picture here: http://blog.trifork.com/2011/05/03/lucene-indexing-gains-concurrency/ Mike McCandless http://blog.mikemccandless.com On Thu, Jul 16, 2015 at 5:10 AM, Đạt Cao Mạnh <[email protected]> wrote: > Hi, currently I'm reading the way Lucene index document and I found this > code and wondering that is it a bug? > > DocumentsWriterPerThread.finishDocument(Term delTerm) { > deleteQueue.add(delTerm, deleteSlice); > // A point > deleteSlice.apply(pendingUpdates, numDocsInRAM); > } > > In the scenario when DWPT1 finish they deleteQueue.add() but not reach the > apply(). DWPT2 finish they deleteQueue.add() but not reach the apply() too. > So the deleteQueue will be in this form > > <DWPT1 delTerm node> -> <DWPT2 delTerm node> > > So when DWPT1 and DWPT2 apply the deleteSlice they will both insert <DWPT1 > delTerm node>, <DWPT2 delTerm node> to their pendingUpdates. > > -- > Best regards, > Cao Mạnh Đạt > D.O.B : 31-07-1991 > Cell: (+84) 946.328.329 > E-mail: [email protected] > > Hanoi University of Science and Technology > School of information & communication technology > Class : Computer Science K54 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
