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

Sangjin Lee commented on YARN-3862:
-----------------------------------

[~jrottinghuis] and I went over the patch in some more detail, and have a few 
high level suggestions.

I don't think the qualifiers that are being created currently in 
TimelineEntityReader.constructFilterListBasedOnFields() are quite right. We 
already talked about breaking down and pushing down the logic into its 
appropriate specific entity reader implementations. In addition, instead of 
trying to compute the byte arrays using the raw ingredients like Separators, we 
should rely on the \*ColumnPrefix classes to give you the byte arrays. That 
would lead to more properly encapsulated (and correct) code.

ColumnPrefix classes already do something like the following (see 
ApplicationColumnPrefix.store() for example):
{code}
    byte[] columnQualifier =
        ColumnHelper.getColumnQualifier(this.columnPrefixBytes, qualifier);
{code}

We could expose a new method on ColumnPrefix like
{code}
public interface ColumnPrefix {
  ...
  byte[] getColumnQualifierBytes(String qualifier);
  ...
}
{code}
And specific implementations can implement that method. That way, all the 
proper column prefix handling is managed and encapsulated by ColumnPrefix 
classes.

When we move the logic of creating the filter list to its appropriate entity 
reader classes, those classes already know which column prefix they're dealing 
with, and they can simply call these methods to get the bytes back. That will 
make the implementation much cleaner.

Hope this helps. Let me know if you have any questions... Thanks!

> Decide which contents to retrieve and send back in response in TimelineReader
> -----------------------------------------------------------------------------
>
>                 Key: YARN-3862
>                 URL: https://issues.apache.org/jira/browse/YARN-3862
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: timelineserver
>    Affects Versions: YARN-2928
>            Reporter: Varun Saxena
>            Assignee: Varun Saxena
>         Attachments: YARN-3862-YARN-2928.wip.01.patch, 
> YARN-3862-YARN-2928.wip.02.patch
>
>
> Currently, we will retrieve all the contents of the field if that field is 
> specified in the query API. In case of configs and metrics, this can become a 
> lot of data even though the user doesn't need it. So we need to provide a way 
> to query only a set of configs or metrics.
> As a comma spearated list of configs/metrics to be returned will be quite 
> cumbersome to specify, we have to support either of the following options :
> # Prefix match
> # Regex
> # Group the configs/metrics and query that group.
> We also need a facility to specify a metric time window to return metrics in 
> a that window. This may be useful in plotting graphs 



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

Reply via email to