Return-Path: X-Original-To: apmail-hadoop-yarn-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-yarn-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AE6951126C for ; Tue, 15 Apr 2014 17:21:51 +0000 (UTC) Received: (qmail 31873 invoked by uid 500); 15 Apr 2014 17:21:36 -0000 Delivered-To: apmail-hadoop-yarn-issues-archive@hadoop.apache.org Received: (qmail 31714 invoked by uid 500); 15 Apr 2014 17:21:31 -0000 Mailing-List: contact yarn-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: yarn-issues@hadoop.apache.org Delivered-To: mailing list yarn-issues@hadoop.apache.org Received: (qmail 31459 invoked by uid 99); 15 Apr 2014 17:21:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Apr 2014 17:21:21 +0000 Date: Tue, 15 Apr 2014 17:21:21 +0000 (UTC) From: "Zhijie Shen (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (YARN-1942) ConverterUtils should not be Private MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/YARN-1942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13969771#comment-13969771 ] Zhijie Shen commented on YARN-1942: ----------------------------------- Just think it out loudly. There're a number of XXXXUtils in the scope of Hadoop. Some of them are private and others or public. It's a bit difficult for users to be aware of such util methods, if users don't know much about the hadoop internal. Instead, is it better to have a static *valueOf* method within ApplicationId, ApplicationAttemptId, ContainerId, NodeId and so on to parse a string into an ID object. Though due to compatibility, we cannot do much for the existing apps, IMHO, it may benefit the later adopters. > ConverterUtils should not be Private > ------------------------------------ > > Key: YARN-1942 > URL: https://issues.apache.org/jira/browse/YARN-1942 > Project: Hadoop YARN > Issue Type: Bug > Components: api > Affects Versions: 2.4.0 > Reporter: Thomas Graves > Priority: Critical > > ConverterUtils has a bunch of functions that are useful to application masters. It should either be made public or we make some of the utilities in it public or we provide other external apis for application masters to use. Note that distributedshell and MR are both using these interfaces. > For instance the main use case I see right now is for getting the application attempt id within the appmaster: > String containerIdStr = > System.getenv(Environment.CONTAINER_ID.name()); > ConverterUtils.toContainerId > ContainerId containerId = ConverterUtils.toContainerId(containerIdStr); > ApplicationAttemptId applicationAttemptId = > containerId.getApplicationAttemptId(); > I don't see any other way for the application master to get this information. If there is please let me know. -- This message was sent by Atlassian JIRA (v6.2#6252)