[
https://issues.apache.org/jira/browse/HDFS-8622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14638567#comment-14638567
]
Akira AJISAKA commented on HDFS-8622:
-------------------------------------
Thanks [~jagadesh.kiran] for updating the patch.
{code}
+ try (FSDataOutputStream o = hdfs.create(new Path(dir3, "file4"))) {
+ o.write("1234".getBytes());
+ o.close();
+ }
{code}
1. dir3 should be empty, so the above code should be removed.
{code}
/**
* Tests OfflineImageViewer if the input fsimage has contentSummary
*/
{code}
2. WebImageViewer will support {{GETCONTENTSUMMARY}} for every fsimage, so
would you update the sentence? For example, "Tests GETCONTENTSUMMARY operation
for WebImageViewer."
{code}
try (FSDataOutputStream o = hdfs.create(new Path(dir, "file1"))) {
o.write("123".getBytes());
o.close();
}
{code}
3. You need not call {{o.close()}} if the resource {{o}} is initialized in
try-with-resources statement.
{code}
if (fromINodeId(cid).getType() == INode.Type.DIRECTORY) {
fillDirSummary(cid, data);
} else {
FsImageProto.INodeSection.INodeFile f = fromINodeId(cid).getFile();
long curLength = getFileSize(f);
data[1]++;
data[2] += curLength;
data[3] += (curLength) * (f.getReplication());
}
{code}
4. If the inode is {{FILE}}, {{fromINodeId(cid)}} will be called twice and that
is costly. Would you update the patch as follows?
{code}
INode inode = fromINodeId(cid);
switch (inode.getType()) {
case FILE:
...
case DIRECTORY:
...
default
...
{code}
That way we can skip {{SYMLINK}}.
> Implement GETCONTENTSUMMARY operation for WebImageViewer
> --------------------------------------------------------
>
> Key: HDFS-8622
> URL: https://issues.apache.org/jira/browse/HDFS-8622
> Project: Hadoop HDFS
> Issue Type: New Feature
> Reporter: Jagadesh Kiran N
> Assignee: Jagadesh Kiran N
> Attachments: HDFS-8622-00.patch, HDFS-8622-01.patch,
> HDFS-8622-02.patch, HDFS-8622-03.patch
>
>
> it would be better for administrators if {code} GETCONTENTSUMMARY {code} are
> supported.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)