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

Shai Erera commented on LUCENE-2818:
------------------------------------

bq. but constitutes an API backcompat break

Can abort() have a default impl in IndexOutput, such as close() followed by 
deleteFile() maybe? If so, then it won't break anything.

Anyway, I think we can make an exception in this case - only those who impl 
Directory and provide their own IndexOutput extension will be affected, which I 
think is a relatively low number of applications?

bq. What do you think?

Would abort() on Directory fit better? E.g., it can abort all currently open 
and modified files, instead of the caller calling abort() on each IndexOutput? 
Are you thinking of a case where a write failed, and the caller would call 
abort() immediately, instead of some higher-level code? If so, would rollback() 
be a better name?

I always thought of IndexOutput as a means for writing bytes, no special 
semantic logic coded and executed by it. The management code IMO should be 
maintained by higher-level code, such as Directory or even higher (today 
IndexWriter, but that's what you're trying to remove :)).

So on one hand, I'd like to see IndexWriter's code simplified (this class has 
become a monster), but on the other, it doesn't feel right to me to add this 
logic in IndexOutput. Maybe I don't understand the use case for it well though. 
I do think though, that abort() on IndexOutput has a specific, clearer, 
meaning, where on Directory it can be perceived as kinda vague (what exactly is 
it aborting, reading / writing?). And maybe aborting a Directory is not good, 
if say you want to abort/rollback the changes done to a particular file.

All in all, I'm +1 for simplifying IW, but am still +0 on transferring the 
logic to IndexOutput, unless I misunderstand the use case.

> abort() method for IndexOutput
> ------------------------------
>
>                 Key: LUCENE-2818
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2818
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Earwin Burrfoot
>
> I'd like to see abort() method on IndexOutput that silently (no exceptions) 
> closes IO and then does silent papaDir.deleteFile(this.fileName()).
> This will simplify a bunch of error recovery code for IndexWriter and 
> friends, but constitutes an API backcompat break.
> What do you think?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to