hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manoj Govindassamy (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-12473) Change host JSON file format
Date Fri, 15 Sep 2017 23:03:00 GMT

    [ 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

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":
> {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":
> ]
> {noformat}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org

View raw message