-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HDFS-14718. HttpFS: Sort response by key names as WebHDFS does #1270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
Change-Id: Ia799ee1b242ab420c8d1de2c07efaf060f066434
Map quotaUsageMap = quotaUsageToMap(quotaUsage); | ||
response.put(HttpFSFileSystem.QUOTA_USAGE_JSON, quotaUsageMap); | ||
return response; | ||
} | ||
|
||
private static Map<String, Object> quotaUsageToMap(QuotaUsage quotaUsage) { | ||
Map<String, Object> result = new LinkedHashMap<>(); | ||
Map<String, Object> result = new TreeMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to add a unit test to make sure that the order is preserved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found any existing unit tests that compares the order of the response JSON of WebHDFS and HttpFS. e.g. BaseTestHttpFSWith#testQuotaUsage
checks the the correctness of output from DFS/HttpFS but doesn't care about the order.
That might be something we want to do with a new unit test class. Or is there one test class that does this already?
Initially I was just looking at output for LISTSTATUS. I discovered that WebHDFS responds with sorted keys, but HttpFS doesn't. Then I found other responses from HttpFS also aren't sorted but WebHDFS does. So I extended the scope of this jira.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly don't think people care about the order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. People won't care in production.
I filed this jira just because I was comparing the RAW JSON, and they weren't in the same order.
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
No description provided.