[
https://issues.apache.org/jira/browse/YARN-5715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15596324#comment-15596324
]
Varun Saxena commented on YARN-5715:
------------------------------------
Thanks [~rohithsharma] for the patch.
It looks good in general.
Can we improve below statement ? Maybe its just me but this gives the
impression that you need to provide prefix for all subsequent updates only
after prefix is sent once for an entity, which may not necessarily be the first
update of this entity.
{code}
599 * <b>Note</b> : If idPrefix is set by user for any specific entity
then user
600 * <b>MUST</b> provide the same prefix for all subsequent updates of
the same
601 * entity.
{code}
Also I think we can mention " Entities will be stored in the order of id prefix
specified." a little earlier.
Maybe something like below.
{code}
/**
* Sets idPrefix for an entity.
* <p>
* <b>Note</b> : Entities will be stored in the order of idPrefix specified.
If users decide to
* set idPrefix for an entity, they <b>MUST</b> provide the same prefix for
every update of this
* entity.
* </p>
* Example : <blockquote><pre>
* TimelineEntity entity = new TimelineEntity();
* entity.setIdPrefix(value);
* </pre></blockquote>
* Users can use {@link TimelineServiceHelper#invertLong(long)} to invert
* the prefix.
*
* @param entityIdPrefix prefix for an entity.
*/
{code}
cc [~sjlee0]. Any suggestions on the javadoc above ?
> introduce entity prefix for return and sort order
> -------------------------------------------------
>
> Key: YARN-5715
> URL: https://issues.apache.org/jira/browse/YARN-5715
> Project: Hadoop YARN
> Issue Type: Sub-task
> Components: timelineserver
> Reporter: Sangjin Lee
> Assignee: Rohith Sharma K S
> Priority: Critical
> Attachments: YARN-5715-YARN-5355.01.patch,
> YARN-5715-YARN-5355.02.patch, YARN-5715-YARN-5355.03.patch,
> YARN-5715-YARN-5355.04.patch, YARN-5715-YARN-5355.05.patch,
> YARN-5715-YARN-5355.06.patch
>
>
> While looking into YARN-5585, we have come across the need to provide a sort
> order different than the current entity id order. The current entity id order
> returns entities strictly in the lexicographical order, and as such it
> returns the earliest entities first. This may not be the most natural return
> order. A more natural return/sort order would be from the most recent
> entities.
> To solve this, we would like to add what we call the "entity prefix" in the
> row key for the entity table. It is a number (long) that can be easily
> provided by the client on write. In the row key, it would be added before the
> entity id itself.
> The entity prefix would be considered mandatory. On all writes (including
> updates) the correct entity prefix should be set by the client so that the
> correct row key is used. The entity prefix needs to be unique only within the
> scope of the application and the entity type.
> For queries that return a list of entities, the prefix values will be
> returned along with the entity id's. Queries that specify the prefix and the
> id should be returned quickly using the row key. If the query omits the
> prefix but specifies the id (query by id), the query may be less efficient.
> This JIRA should add the entity prefix to the entity API and add its handling
> to the schema and the write path. The read path will be addressed in
> YARN-5585.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]