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

Varun Saxena commented on YARN-4224:
------------------------------------

[~leftnoteasy],  ok then what I was thinking was on the right lines.

Coming to your points,
bq. Not sure if it is possible to support queries like: give me flows which 
users satisfy a given regex, and begin/end time is from a range? Could you give 
me an example about what does the query look like?
We may not be able to support queries where users satisfies a particular 
regex(until and unless we do some client side processing in timeline reader) 
because user is generally part of row key. But yes we can limit the results and 
support a host of query parameters. Although for every endpoint this optional 
query parameters would vary but it would be generally a subset of below. 
Typically we can trim results based on created time range, modified time range, 
relationships, event filters(based on existence of some events), config and 
info filters(matching KV Pairs) and metric filters.
{panel}
   *URI Optional Query Parameters :*
   *limit* - Number of entities to return.
   *createdtimestart* - If specified, matched entities should not be created 
before this timestamp.
   *createdtimeend* - If specified, matched entities should not be created 
after this timestamp.
   *modifiedtimestart* - If specified, matched entities should not be modified 
before this timestamp.
   *modifiedtimeend* - If specified, matched entities should not be modified 
after this timestamp.
   *relatesto* - If specified, matched entities should relate to given entities 
associated with a entity type. relatesto is a comma separated list in the 
format \[entitytype\]:\[entityid1\]:\[entityid2\]...For eg : 
relatesto=type1:entity1:entity2,type2:entity3
   *isrelatedto* - If specified, matched entities should be related to given 
entities associated with a entity type. relatesto is a comma separated list in 
the format \[entitytype\]:\[entityid1\]:\[entityid2\]...For e.g., 
isrelatedto=type1:entity1:entity2,type2:entity3
   *infofilters* - If specified, matched entities should have exact matches to 
the given info represented as key-value pairs. This is represented as 
infofilters=info1:value1,info2:value2...
   *conffilters* - If specified, matched entities should have exact matches to 
the given configs represented as key-value pairs. This is represented as 
conffilters=conf1:value1,conf2:value2...
   *metricfilters* - If specified, matched entities should contain the given 
metrics. This is represented as metricfilters=metricid1, metricid2...
   *eventfilters* - If specified, matched entities should contain the given 
events. This is represented as eventfilters=eventid1, eventid2...
   *fields* - Specifies which fields of the entity object to retrieve All 
fields will be retrieved if fields=ALL. If not specified, 4 fields i.e. entity 
type, id, created time and modified time is returned.
{panel}
A typical query based on old URL scheme would look like :
{noformat}
http://localhost:8188/ws/v2/timeline/entities/cluster1/app1/app?metricfilters=metric7&isrelatedto=type1:tid1_1;tid1_2,type2:tid2_1%60&relatesto=flow:flow1&eventfilters=event_2,event_4&;
infofilters=info2:3.5&createdtimestart=1425016502030&createdtimeend=1425016502060
{noformat}

This would change though.
After YARN-3862, we can now support fetching specific configs and metrics. We 
can do this by specifying config and metric prefixes. This has not yet been 
hooked up to REST layer. I will do so in YARN-4447.
Also once YARN-3863 goes in, we will be able to support SQL type queries 
containing ANDs' and ORs' between filters. And have queries like {{metric1 > 30 
AND metric2 < 100}} . I will hook this up to REST layer again via YARN-4447.
Also in future plan to trim down the metrics to return(as they can be quite a 
lot) based on time range. This can be done by YARN-4455. Although we need to 
discuss if modified time can be used for this use case.

> Change the ATSv2 reader side REST interface to conform to current REST APIs' 
> in YARN
> ------------------------------------------------------------------------------------
>
>                 Key: YARN-4224
>                 URL: https://issues.apache.org/jira/browse/YARN-4224
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: timelineserver
>    Affects Versions: YARN-2928
>            Reporter: Varun Saxena
>            Assignee: Varun Saxena
>              Labels: yarn-2928-1st-milestone
>         Attachments: YARN-4224-YARN-2928.01.patch
>
>




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

Reply via email to