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

Colin Patrick McCabe commented on HDFS-7056:
--------------------------------------------

bq. Do you really want to make an exclusion for truncate and call it target?

Hmm.  There are other cases where we use something other than "src" to indicate 
the target path in {{ClientProtocol.java}}.  For example, {{createSymlink}} 
uses "target".  setQuota uses "path" not "src".  I would argue that we should 
not use "src" unless there is a "dst" or destination.  However, I don't feel 
that strongly about this... we can always change it later.

bq. \[return value discussion\]

I agree that {{FileSystem#mkdir}} should never have returned a boolean, but 
only thrown an exception.  But, we can't change it now :(  The same thing 
applies to Java's File methods, by the way... the fact that they don't throw an 
IOException is very frustrating, and motivated Sun to create the new 
{{java.nio.File}} APIs which do throw {{IOException}} rather than just 
returning false on any kind of error.

Similarly, I don't think we can change {{recoverLease}} at this point.  We 
can't break wire compatibility or API compatibility, as you know.  However, I 
think that its return convention is very confusing.  It was a mistake.  I have 
never met someone who wasn't an HDFS developer who understood when this method 
returns false and when it returns true, and I've often been asked about it.  I 
will let other people comment on this, but I would strongly encourage you not 
to copy this convention.

bq. Makes sense. How about truncateBlock?

Sure.

> Snapshot support for truncate
> -----------------------------
>
>                 Key: HDFS-7056
>                 URL: https://issues.apache.org/jira/browse/HDFS-7056
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: namenode
>    Affects Versions: 3.0.0
>            Reporter: Konstantin Shvachko
>            Assignee: Plamen Jeliazkov
>         Attachments: HDFS-3107-HDFS-7056-combined.patch, 
> HDFS-3107-HDFS-7056-combined.patch, HDFS-3107-HDFS-7056-combined.patch, 
> HDFS-3107-HDFS-7056-combined.patch, HDFS-3107-HDFS-7056-combined.patch, 
> HDFS-3107-HDFS-7056-combined.patch, HDFS-3107-HDFS-7056-combined.patch, 
> HDFS-3107-HDFS-7056-combined.patch, HDFS-3107-HDFS-7056-combined.patch, 
> HDFS-7056.patch, HDFS-7056.patch, HDFS-7056.patch, HDFS-7056.patch, 
> HDFS-7056.patch, HDFS-7056.patch, HDFS-7056.patch, HDFS-7056.patch, 
> HDFSSnapshotWithTruncateDesign.docx
>
>
> Implementation of truncate in HDFS-3107 does not allow truncating files which 
> are in a snapshot. It is desirable to be able to truncate and still keep the 
> old file state of the file in the snapshot.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to