Zhijie Shen commented on YARN-3836:

bq. l.550: It sounds like now the type takes precedence over the created time 
in the sort order in this version. Is this intended? If not (timestamp is 
supposed to be first), it might be a good idea to have Identifier implement 
Comparable as well and use that in TimelineEntity.compareTo().

Currently getEntities supports only return the entities of a single entity 
type, such that the ordering among them won't be affected by the entity type. 
In general, it's seem to be more natural to put entities of the same type close 
to each other. For example, we can merge to the collection of entities returned 
from multiple getEntities queries to imitate fetching entities of multiple 
entity types. In case that we have the specific use case (e.g., we want to 
order entities globally across type), it should be fine and not expensive to 
define a customized comparator to do it.

> add equals and hashCode to TimelineEntity and other classes in the data model
> -----------------------------------------------------------------------------
>                 Key: YARN-3836
>                 URL: https://issues.apache.org/jira/browse/YARN-3836
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: timelineserver
>    Affects Versions: YARN-2928
>            Reporter: Sangjin Lee
>            Assignee: Li Lu
>         Attachments: YARN-3836-YARN-2928.001.patch, 
> YARN-3836-YARN-2928.002.patch, YARN-3836-YARN-2928.003.patch
> Classes in the data model API (e.g. {{TimelineEntity}}, 
> {{TimelineEntity.Identifer}}, etc.) do not override {{equals()}} or 
> {{hashCode()}}. This can cause problems when these objects are used in a 
> collection such as a {{HashSet}}. We should implement these methods wherever 
> appropriate.

This message was sent by Atlassian JIRA

Reply via email to