Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-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 85A3C172AB for ; Mon, 30 Mar 2015 04:32:53 +0000 (UTC) Received: (qmail 40824 invoked by uid 500); 30 Mar 2015 04:32:53 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 40770 invoked by uid 500); 30 Mar 2015 04:32:53 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 40752 invoked by uid 99); 30 Mar 2015 04:32:53 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Mar 2015 04:32:53 +0000 Date: Mon, 30 Mar 2015 04:32:53 +0000 (UTC) From: "Yi Liu (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-7997) The first non-existing xattr should also throw IOException 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/HDFS-7997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14386177#comment-14386177 ] Yi Liu commented on HDFS-7997: ------------------------------ [~sinago], the example you gave is not correct, the xattr should be prefixed with user/trusted/security/system/raw. But the patch looks good. > The first non-existing xattr should also throw IOException > ---------------------------------------------------------- > > Key: HDFS-7997 > URL: https://issues.apache.org/jira/browse/HDFS-7997 > Project: Hadoop HDFS > Issue Type: Bug > Affects Versions: 2.6.0 > Reporter: zhouyingchao > Assignee: zhouyingchao > Priority: Minor > Attachments: HDFS-7997-001.patch > > > We use the following code snippet to get/set xattrs. However, if there are no xattrs have ever been set, the first getXAttr returns null and the second one just throws exception with message like "At least one of the attributes provided was not found.". This is not expected, we believe they should behave in the same way - i.e either both getXAttr returns null or both getXAttr throw exception with the message "... not found". We will provide a patch to make them both throw exception. > .... > attrValueNM = fs.getXAttr(path, "nm"); > if (attrValueNM == null) { > fs.setXAttr("nm", DEFAULT_VALUE); > } > attrValueNN = fs.getXAttr(path, "nn"); > if (attrValueNN == null) { > fs.setXAttr("nn", DEFAULT_VALUE); > } > .... -- This message was sent by Atlassian JIRA (v6.3.4#6332)