[ 
https://issues.apache.org/jira/browse/YARN-5577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15445560#comment-15445560
 ] 

Rohith Sharma K S commented on YARN-5577:
-----------------------------------------

I found the way to achieve filtering of an object in infofilter. Infofilters 
uses an JasonParser to parse the value. So this value can be object in the form 
of Json. 
For example : To list all the container entities belongs to app-attempt, query 
can be 
{noformat}
GET 
/ws/v2/timeline/apps/application_1471931266232_0024/entities/YARN_CONTAINER?fields=INFO&infofilters=SYSTEM_INFO_PARENT_ENTITY
 eq 
{"type":"YARN_APPLICATION_ATTEMPT","id":"appattempt_1471931266232_0024_000002"}
{noformat}

Value should be in the form of Json without any space i.e 
{code}{"type":"YARN_APPLICATION_ATTEMPT","id":"appattempt_1471931266232_0024_000002"}{code}

This has to be captured in the AtsV2 documentation along with an example which 
is missing now for infofilters.

> [Atsv2] Publish parent/child entities value as string rather than value as 
> object.
> ----------------------------------------------------------------------------------
>
>                 Key: YARN-5577
>                 URL: https://issues.apache.org/jira/browse/YARN-5577
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: timelinereader, timelineserver
>            Reporter: Rohith Sharma K S
>            Assignee: Rohith Sharma K S
>
> In HierarchicalTimelineEntity, setparent/addChild allows to set parent/child 
> entities at INFO level. The key is an string and value as an object. 
> Like below, for YARN_CONTAINER entity parent entity set for application.
> {code}
> "SYSTEM_INFO_PARENT_ENTITY": {
>        "type": "YARN_APPLICATION",
>        "id": "application_1471931266232_0024"
>      }
> {code}
> But to use infofilter on entity type YARN_CONTAINER for an specific 
> applicationId, IIUC there is no way to pass object as value in infofilter. 
> To make easier retrieval either
> # publish parent/child entity id and type as string rather that object like 
> below
> {code}
> "SYSTEM_INFO_PARENT_ENTITY_TYPE": "YARN_APPLICATION"
> "SYSTEM_INFO_PARENT_ENTITY_ID":"application_1471931266232_0024"
> {code}
> OR
> # Add ability to provide object as filter with below format like 
> {{infofilters=SYSTEM_INFO_PARENT_ENTITY eq ((type eq YARN_APPLICATION) AND 
> (id eq application_1471931266232_0024))}}
> I believe 2nd approach will be well applicable for any entities. But I am not 
> sure does HBase supports such a custom filters while scanning a table. 
> 1st approaches will be much easier to change. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to