[ 
https://issues.apache.org/jira/browse/HDFS-10636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Douglas updated HDFS-10636:
---------------------------------
    Attachment: HDFS-10636.004.patch

Fixed some findbugs, checkstyle.

[~jpallas] generally I agree on using {{Local\*}}, but it does match a 
convention in Hadoop (e.g., {{LocalFileSystem}}, {{LocalRunner}}, 
{{LocalDirAllocator}}, {{ContainerLocalizer}}) to signify intra-node scope. 
Calling these {{File\*}} matches the implementation, but that's incidental to 
these being volumes owned/managed by this DN. That said, this convention isn't 
used broadly in HDFS yet AFAIK, so if there's a better term we could use it.

* I really like the {{ReplicaBuilder}} pattern in this patch. It makes the code 
easier to read. Breaking up the switch statement in {{build()}} avoids a 
checkstyle complaint? This might be more legible if each (fairly long) case 
stmt were in a private method.
* Is {{DataStorage::getTrashDirectoryForBlockFile}} now unused, except by 
tests? {{BlockPoolSliceStorage::getTrashDirectory(File)}} could be inlined into 
the new call, since the direct, {{File}} APIs are vestigial.
* It looks like most of the {{NativeIO}} calls are preserved, largely through 
{{LocalReplica}}. The design here looks clean. In this section:
{noformat}
-      Storage.nativeCopyFileUnbuffered(srcFile, dstFile, true);
+      // create date of the source replica is not longer preserved!
+      copyFileBuffered(srcReplica.getDataInputStream(0),
+          srcReplica.getBlockDataLength(), dstFile);
     } catch (IOException e) {
-      throw new IOException("Failed to copy " + srcFile + " to " + dstFile, e);
+      throw new IOException("Failed to copy " + srcReplica + " block file to "
+          + dstFile, e);
{noformat}
the call to {{Storage::nativeCopyFileUnbuffered}} is removed, so there's no 
path to the {{NativeIO}} libraries. This should be maintained.

> Modify ReplicaInfo to remove the assumption that replica metadata and data 
> are stored in java.io.File.
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-10636
>                 URL: https://issues.apache.org/jira/browse/HDFS-10636
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: datanode, fs
>            Reporter: Virajith Jalaparti
>            Assignee: Virajith Jalaparti
>         Attachments: HDFS-10636.001.patch, HDFS-10636.002.patch, 
> HDFS-10636.003.patch, HDFS-10636.004.patch
>
>
> Replace java.io.File related APIs from {{ReplicaInfo}}, and enable the 
> definition of new {{ReplicaInfo}} sub-classes whose metadata and data can be 
> present on external storages (HDFS-9806). 



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

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

Reply via email to