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

Steve Loughran edited comment on HADOOP-16906 at 1/28/21, 3:37 PM:
-------------------------------------------------------------------

* new stream capability ("abortable"); default false
* new interface Abortable, implemented by FSDataOutputStream, 
S3ABlockOutputStream and any other stream which could be aborted (Ozone...)
* FSDataOutputStream propagates hasCapability to inner class as it does for 
other features
* FSDataOutputStream.abort() casts inner to Abortable and invokes; raises 
UnsupportedOperationException otherwise
* after successful abort(), stream.write raises an IOE about stream closed
* close() will still work, but it won't manifest the file.

abort() call
# MAY block waiting for in-progress uploads to complete. 
# MUST swallow any exceptions raised during that upload (or do we return a list 
of them?)

maybe have it return an {{AbortCompleted}} class where could add info like this

{code}
class AbortCompleted {
  List<IOException> exceptions;
}
{code}
Contract tests

* if stream hasCapability("abortable"), then abort() succeeeds
* file being written is not visible
* file being overwritten is not changed
* after calling abort, stream cannot be written to; only close() is allowed


was (Author: [email protected]):
* new stream capability ("abortable"); default false
* new interface Abortable, implemented by FSDataOutputStream, 
S3ABlockOutputStream and any other stream which could be aborted (Ozone...)
* FSDataOutputStream propagates hasCapability to inner class as it does for 
other features
* FSDataOutputStream.abort() casts inner to Abortable and invokes; raises 
UnsupportedOperationException otherwise
* after successful abort(), stream.write raises an IOE about stream closed
* close() will still work, but it won't manifest the file.

abort() call
# MAY block waiting for in-progress uploads to complete. 
# MUST swallow any exceptions raised during that upload (or do we return a list 
of them?)

maybe have it return an {{AbortCompleted}} class where could add info like this

{code}
class AbortCompleted {
  List<IOException> exceptions;
}

Contract tests

* if stream hasCapability("abortable"), then abort() succeeeds
* file being written is not visible
* file being overwritten is not changed
* after calling abort, stream cannot be written to; only close() is allowed

> Add some Abortable.abort() interface for streams etc which can be terminated
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-16906
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16906
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs, fs/azure, fs/s3
>    Affects Versions: 3.3.0
>            Reporter: Steve Loughran
>            Priority: Minor
>
> Some IO we want to be able to abort rather than close cleanly, especially if 
> the inner stream is an HTTP connection which itself supports some abort() 
> method. For example: uploads to an object where we want to cancel the upload 
> without close() making an incomplete write visible.
> Proposed: Add a generic interface which things like streams can implement
> {code}
> AbortableIO {
>   public void abortIO() throws IOE;
> }
> {code}
> +do for s3a output stream. I wouldn't do this a passthrough on 
> FSDataOutputStream because we need to consider what expectations callers have 
> of an operation being "aborted"



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to