[
https://issues.apache.org/jira/browse/HDFS-11644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15968932#comment-15968932
]
Steve Loughran commented on HDFS-11644:
---------------------------------------
Stack-who-must-be-listened-to has some good insights. Like your point about
asking for a feature not of an FS, but a path under an FS.
Less of an issue for things like streams tho'.
What about having some interface,
{code}
public interface StreamCapabilities {
boolean hasCapability(String capability);
}
{code}
Define a standard set of strings for the current capabilities; add more over
time as needed, and you can see if flush/hflush etc are implemented on specific
instance of a stream.
We cannot do a simple "implements interface" check as that doesn't allow for
subclasses to declare that they don't impement an interface —not unless we
define some new interfaces like {{NotSyncable}} fo them to implement, and
checks to become {{if (stream instanceof Syncable && ! stream instanceof
NotSyncable}}. Which is just wrong. Especially if a subclass of the notsyncable
stream goes on to implement syncability.
> DFSStripedOutputStream should not implement Syncable
> ----------------------------------------------------
>
> Key: HDFS-11644
> URL: https://issues.apache.org/jira/browse/HDFS-11644
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: erasure-coding
> Affects Versions: 3.0.0-alpha1
> Reporter: Andrew Wang
> Assignee: Manoj Govindassamy
> Labels: hdfs-ec-3.0-must-do
>
> FSDataOutputStream#hsync checks if a stream implements Syncable, and if so,
> calls hsync. Otherwise, it just calls flush. This is used, for instance, by
> YARN's FileSystemTimelineWriter.
> DFSStripedOutputStream extends DFSOutputStream, which implements Syncable.
> However, DFSStripedOS throws a runtime exception when the Syncable methods
> are called.
> We should refactor the inheritance structure so DFSStripedOS does not
> implement Syncable.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]