[
https://issues.apache.org/jira/browse/HIVE-11724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14905357#comment-14905357
]
Hari Sankar Sivarama Subramaniyan commented on HIVE-11724:
----------------------------------------------------------
[~kiran.kolli] Thanks for the patch. Here are my comments on patch#5.
1. With the current change, if the webhcat server accidently sets
templeton.jobs.listorder to something other than "lexicographicalasc" or
"lexicographicaldesc", say "lexicograpicaldesc" it seems like we will run into
IllegalArgumentException​​ in public JobsListOrder getListJobsOrder() which
might be difficult to debug from client perspective.
One way to avoid this scenario would be to rewrite the code to something
similar(not tested) :
{code}
public JobsListOrder getListJobsOrder() {
String requestedOrder = get(TEMPLETON_JOBSLIST_ORDER);
if (requestedOrder != null) {
for (JobsListOrder​ jl : JobsListOrder.values()) {
if (requestOrder.equalsIgnoreCase(jl.name())) {
return jl;
}
}
// Default to lexicographicalasc
return JobsListOrder.lexicographicalasc;
}
{code}
2. Can you please use 1TBS(K&R variant) style of indentation instead of the GNU
style which seems more consistent with the current code.
3. I believe templeton.jobs.listorder needs to be documented once the change
goes in. We might need to add a TODOC label. [~leftylev] can you please verify.
Thanks
Hari
> WebHcat get jobs to order jobs on time order with latest at top
> ---------------------------------------------------------------
>
> Key: HIVE-11724
> URL: https://issues.apache.org/jira/browse/HIVE-11724
> Project: Hive
> Issue Type: Improvement
> Components: WebHCat
> Affects Versions: 0.14.0
> Reporter: Kiran Kumar Kolli
> Assignee: Kiran Kumar Kolli
> Attachments: HIVE-11724.1.patch, HIVE-11724.2.patch,
> HIVE-11724.3.patch, HIVE-11724.4.patch, HIVE-11724.5.patch
>
>
> HIVE-5519 added pagination feature support to WebHcat. This implementation
> returns the jobs lexicographically resulting in older jobs showing at the
> top.
> Improvement is to order them on time with latest at top. Typically latest
> jobs (or running) ones are more relevant to the user. Time based ordering
> with pagination makes more sense.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)