[ 
https://issues.apache.org/jira/browse/LUCENE-2793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050444#comment-13050444
 ] 

Simon Willnauer commented on LUCENE-2793:
-----------------------------------------

hey varun

patch looks close!

here are some comments:

* the assert context == Context.MERGE should be assert context != Context.MERGE 
|| mergeInfo != null;
* can you move that assert into IOContext(Context, MergeInfo) and let other 
related constructors call this(context, mergeInfo) instead of initializing all 
members themself?
* I think there should be a public static final IOContext READONCE = new 
IOContext(true); then you can make the corresponding constructor private. I 
think the context should be Context.READ instead of default in that case right?
* IOContext(MergePolicy.OneMerge) seems to be unnecessary. I think you should 
add a method to OneMerge to get a MergeInfo from it and only have a MergeInfo 
ctor. Then you can move MergeInfo into OneMerge too.
* PerFieldCodecWrapper still seems to be deleted
* In IndexReader IOContext context=null; should be IOContext context= new 
IOContext(READ); no?
*  no commit should be nocommit - we have a script on jenkins that checks this 
:)
* I still see some whitespace problems in SegmentWriteState.java 
* I think IOContext.DEFAULT_IOCONTEXT should be IOContext.DEFAULT since 
IOContext is implicit


I am waiting for you fixing the tests before I review further. Yet, what is 
missing is still the decision what buffer size to used down in direcotries etc.

good work so far!



> Directory createOutput and openInput should take an IOContext
> -------------------------------------------------------------
>
>                 Key: LUCENE-2793
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2793
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/store
>            Reporter: Michael McCandless
>            Assignee: Varun Thacker
>              Labels: gsoc2011, lucene-gsoc-11, mentor
>         Attachments: LUCENE-2793.patch, LUCENE-2793.patch, LUCENE-2793.patch, 
> LUCENE-2793.patch, LUCENE-2793.patch, LUCENE-2793.patch, LUCENE-2793.patch, 
> LUCENE-2793.patch, LUCENE-2793.patch, LUCENE-2793.patch, LUCENE-2793.patch
>
>
> Today for merging we pass down a larger readBufferSize than for searching 
> because we get better performance.
> I think we should generalize this to a class (IOContext), which would hold 
> the buffer size, but then could hold other flags like DIRECT (bypass OS's 
> buffer cache), SEQUENTIAL, etc.
> Then, we can make the DirectIOLinuxDirectory fully usable because we would 
> only use DIRECT/SEQUENTIAL during merging.
> This will require fixing how IW pools readers, so that a reader opened for 
> merging is not then used for searching, and vice/versa.  Really, it's only 
> all the open file handles that need to be different -- we could in theory 
> share del docs, norms, etc, if that were somehow possible.

--
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