hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joep Rottinghuis (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (YARN-5170) Eliminate singleton converters and static method access
Date Thu, 09 Jun 2016 08:09:21 GMT

     [ https://issues.apache.org/jira/browse/YARN-5170?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Joep Rottinghuis updated YARN-5170:
    Attachment: YARN-5170-YARN-2928.09.patch

[~varun_saxena] Yes, I was hoping to get this in the first release milestone.
The way the converters work and the way RowKeys are now used directly reduces our external
API (in the form of public methods) which I think will be a good thing do to. I think the
code now is also cleaner, more future proof and more performant, because we reduce the number
of rowkey creations during reads and esp. writes.

I didn't put a label on this jira because a) we didn't have a chance to discuss as I had to
miss last week's status discussion, and b) I wasn't sure if I was going to be able to get
this code-complete on time and I didn't want to hold up the merge vote for this.

Review would be appreciated.

I think the patch is ready for review so we can discuss whether we want to pull this in.

> Eliminate singleton converters and static method access
> -------------------------------------------------------
>                 Key: YARN-5170
>                 URL: https://issues.apache.org/jira/browse/YARN-5170
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: timelineserver
>    Affects Versions: YARN-2928
>            Reporter: Joep Rottinghuis
>            Assignee: Joep Rottinghuis
>         Attachments: YARN-5170-YARN-2928.01.patch, YARN-5170-YARN-2928.02.patch, YARN-5170-YARN-2928.03.patch,
YARN-5170-YARN-2928.04.patch, YARN-5170-YARN-2928.05.patch, YARN-5170-YARN-2928.06.patch,
YARN-5170-YARN-2928.07.patch, YARN-5170-YARN-2928.08.patch, YARN-5170-YARN-2928.09.patch
> As part of YARN-5109 we introduced several KeyConverter classes.
> To stay consistent with the existing LongConverter in the sample patch I created I made
these other converter classes singleton as well.
> In conversation with [~sjlee0] who has a general dislike of singletons, we discussed
it is best to get rid of these singletons and make them simply instance variables.
> There are other classes where the keys have static methods referring to a singleton converter.
> Moreover, it turns out that due to code evolution we end up creating the same keys several
> So general approach is to not re-instantiate rowkeys, converters when not needed.
> I would like to create the byte[] rowKey in the RowKey classes their constructor, but
that would leak an incomplete object to the converter.
> There are a few method in TimelineStorageUtils that are used only once, or only by one
class, as part of this refactor I'll move these to keep the "Utils" class as small as possible
and keep them for truly generally used utils that don't really belong anywhere else.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org

View raw message