[
https://issues.apache.org/jira/browse/YARN-6159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15864475#comment-15864475
]
Varun Saxena commented on YARN-6159:
------------------------------------
Sorry this would require more changes as we need to reflect YARN-4675 changes
here as well.
We would need to make some changes in the section "Publishing application
specific data" because few things written in paragraph under this section would
no longer hold true after YARN-4675.
For instance, below is not completely correct.
{code}
Developers can continue to use the `TimelineClient` API to publish
per-framework data to the
Timeline Service v.2. You only need to instantiate the right type of the client
to write to v.2.
On the other hand, the entity/object API for v.2 is different than v.1 as the
object model is
significantly changed. The v.2 timeline entity class is
`org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity` whereas the
v.1 class is
`org.apache.hadoop.yarn.api.records.timeline.TimelineEntity`. The methods on
`TimelineClient`
suitable for writing to Timeline Service v.2 are clearly delineated, and they
use the v.2
types as arguments.
{code}
[~Naganarasimha], can you make the necessary changes?
> In timeline v2 documentation, the code snippet given for creating timeline
> client has a mistake
> -----------------------------------------------------------------------------------------------
>
> Key: YARN-6159
> URL: https://issues.apache.org/jira/browse/YARN-6159
> Project: Hadoop YARN
> Issue Type: Bug
> Components: documentation
> Reporter: Varun Saxena
> Assignee: Naganarasimha G R
> Priority: Minor
> Attachments: YARN-6159.v1.001.patch
>
>
> In TimelineServiceV2.md, under section Publishing application specific data,
> we have the following code snippet. Here,
> {{timelineClient.putEntitiesAsync(entity);}} should be
> {{client.putEntitiesAsync(entity);}} instead.
> {code}
> // Create and start the Timeline client v.2
> TimelineClient client = TimelineClient.createTimelineClient(appId);
> client.init(conf);
> client.start();
> try {
> TimelineEntity myEntity = new TimelineEntity();
> myEntity.setEntityType("MY_APPLICATION");
> myEntity.setEntityId("MyApp1")
> // Compose other entity info
> // Blocking write
> client.putEntities(entity);
> TimelineEntity myEntity2 = new TimelineEntity();
> // Compose other info
> // Non-blocking write
> timelineClient.putEntitiesAsync(entity);
> } catch (IOException e) {
> // Handle the exception
> } catch (RuntimeException e) {
> {code}
> Below can also be changed to client to keep it consistent.
> {code}
> amRMClient.registerTimelineClient(timelineClient)Íž
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]