[ 
https://issues.apache.org/jira/browse/LUCENE-2958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Doron Cohen updated LUCENE-2958:
--------------------------------

    Attachment: LUCENE-2958.patch

Updated patch (for 3x):
- from 3x root (previous patch was from benchmark by mistake)
- fixed typos in javadoc
- simplified loop over the fields in WriteLineDocTask
- removed *volatile* but added *final* for *fields/ToWrite*. 

Without volatile one test was failing: 
TestPerfTasksLogic.testParallelDocMaker() but then I was unable to fail it 
again even after removing volatile. 

Once marking these fields *final* definitely volatile is not required.

But I don't understand why was it needed in the first place - ParallelTask in 
TaskSequence clones the tasks, and since WriteLineDocTask does not implement 
clone() all (parallel) tasks will have a reference to same array... which in 
fact can be copied into a local copy by the JVM for efficiency.. but since the 
clone must take place only after the constructor is done, the array is 
initialized already... If I could fail this again I would investigate it but 
now it always passes even without final/volatile. 

So keeping the final, as this is safe, but I don't like the voodooism of it and 
if anyone has a better explanation it would be appreciated.

> WriteLineDocTask improvements
> -----------------------------
>
>                 Key: LUCENE-2958
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2958
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: contrib/benchmark
>            Reporter: Doron Cohen
>            Assignee: Doron Cohen
>            Priority: Minor
>             Fix For: 3.2, 4.0
>
>         Attachments: LUCENE-2958.patch, LUCENE-2958.patch
>
>
> Make WriteLineDocTask and LineDocSource more flexible/extendable:
> * allow to emit lines also for empty docs (keep current behavior as default)
> * allow more/less/other fields

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to