[
https://issues.apache.org/jira/browse/HDFS-15214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17059066#comment-17059066
]
Íñigo Goiri commented on HDFS-15214:
------------------------------------
Thanks for the patch [~hemanthboyina].
Does it make sense to set the values to 0L even if we didn't get them?
I would think something like this to be cleaner:
{code}
if (m.get("snapshotLength") != null) {
snapshotLength = ((Number) m.get("snapshotLength")).longValue();
builder.snapshotLength(snapshotLength);
}
if (m.get("snapshotFileCount") != null) {
snapshotFileCount = ((Number) m.get("snapshotFileCount")).longValue();
builder.snapshotFileCount(snapshotFileCount);
}
if (m.get("snapshotFileCount") != null) {
snapshotDirectoryCount =
((Number) m.get("snapshotDirectoryCount")).longValue();
builder.snapshotDirectoryCount(snapshotDirectoryCount);
}
if (m.get("snapshotFileCount") != null) {
snapshotSpaceConsumed =
((Number) m.get("snapshotSpaceConsumed")).longValue();
builder.snapshotSpaceConsumed(snapshotSpaceConsumed);
}
{code}
> WebHDFS: Add snapshot counts to Content Summary
> -----------------------------------------------
>
> Key: HDFS-15214
> URL: https://issues.apache.org/jira/browse/HDFS-15214
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: hemanthboyina
> Assignee: hemanthboyina
> Priority: Major
> Attachments: HDFS-15214.001.patch, HDFS-15214.002.patch
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]