[
https://issues.apache.org/jira/browse/LUCENE-8415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16551141#comment-16551141
]
Dawid Weiss commented on LUCENE-8415:
-------------------------------------
bq. you could also do no bookkeeping and simply pay the cost of more renames,
right?
Err, I don't follow? My idea was to ensure a file open for output cannot be
open for input (until the output is closed). This proves quite extensive
code-wise to enforce, so I think it'll be better to leave it up to the
implementation to decide (Directory.openInput may throw an exception on an
input that is still being written to). I'll update the patch and submit for
review (on Monday, unfortunately -- I'm away for the weekend).
On a positive note, removing segment* exceptions from the mock classes didn't
break anything after beasting overnight.
> Clean up Directory contracts (write-once, no reads-before-write-completed)
> --------------------------------------------------------------------------
>
> Key: LUCENE-8415
> URL: https://issues.apache.org/jira/browse/LUCENE-8415
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Dawid Weiss
> Assignee: Dawid Weiss
> Priority: Minor
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Created a PR here for early review.
> https://github.com/apache/lucene-solr/pull/424
> I changed:
> * the wording in Directory documentation to be a bit more formalized about
> what rules a Directory should obey (and users expect).
> * modified the test framework to verify the above in mock classes.
> Currently a number of Directory implementations fail the
> {{testReadFileOpenForWrites}} test that I added, so I'll keep working on that.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]