[
https://issues.apache.org/jira/browse/HDFS-12473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16168654#comment-16168654
]
Manoj Govindassamy commented on HDFS-12473:
-------------------------------------------
Thanks for making the hosts file a proper json format. Looks good overall, +1
with following nits.
1. What happens when the hosts file has improper json format? Say the old
format with the new code. Will it be backward compatible or throw
JsonMappingException? Because, the upgrade scenarios need to handle this.
2. {{CombinedHostsFileReader}}
* If {{READER}} and {{JSON_FACTORY}} is no more used, can be removed
* {{#readFile}} can now return _null_ object when there are no hosts defined.
Previously it was always returning an empty HashSet. Hopefully, you verified
for the callers. I see the test {{#testLoadExistingJsonFile}}assuming the
return is non null always.
3. {{CombinedHostsFileWriter}}
* If {{MAPPER}} is no more used, can be removed.
4. {{TestCombinedHostsFileReader}}
* line 64: CombinedHostsFileReader.readFile() can return null if the input
hosts file has no entries. May be we should cover this case as well?
> Change host JSON file format
> ----------------------------
>
> Key: HDFS-12473
> URL: https://issues.apache.org/jira/browse/HDFS-12473
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Reporter: Ming Ma
> Assignee: Ming Ma
> Attachments: HDFS-12473.patch
>
>
> The existing host JSON file format doesn't have a top-level token.
> {noformat}
> {"hostName": "host1"}
> {"hostName": "host2", "upgradeDomain": "ud0"}
> {"hostName": "host3", "adminState": "DECOMMISSIONED"}
> {"hostName": "host4", "upgradeDomain": "ud2", "adminState":
> "DECOMMISSIONED"}
> {"hostName": "host5", "port": 8090}
> {"hostName": "host6", "adminState": "IN_MAINTENANCE"}
> {"hostName": "host7", "adminState": "IN_MAINTENANCE",
> "maintenanceExpireTimeInMS": "112233"}
> {noformat}
> Instead, to conform with the JSON standard it should be like
> {noformat}
> [
> {"hostName": "host1"},
> {"hostName": "host2", "upgradeDomain": "ud0"},
> {"hostName": "host3", "adminState": "DECOMMISSIONED"},
> {"hostName": "host4", "upgradeDomain": "ud2", "adminState":
> "DECOMMISSIONED"},
> {"hostName": "host5", "port": 8090},
> {"hostName": "host6", "adminState": "IN_MAINTENANCE"},
> {"hostName": "host7", "adminState": "IN_MAINTENANCE",
> "maintenanceExpireTimeInMS": "112233"}
> ]
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]