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 4874299DF for ; Fri, 15 Jun 2012 21:38:43 +0000 (UTC) Received: (qmail 64472 invoked by uid 500); 15 Jun 2012 21:38:43 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 64441 invoked by uid 500); 15 Jun 2012 21:38:43 -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 64433 invoked by uid 99); 15 Jun 2012 21:38:43 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jun 2012 21:38:43 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id DCF5014285F for ; Fri, 15 Jun 2012 21:38:42 +0000 (UTC) Date: Fri, 15 Jun 2012 21:38:42 +0000 (UTC) From: "Tsz Wo (Nicholas), SZE (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <663900973.20229.1339796322906.JavaMail.jiratomcat@issues-vm> In-Reply-To: <991657810.50350.1339109843075.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (HDFS-3516) Check content-type in WebHdfsFileSystem 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-3516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295939#comment-13295939 ] Tsz Wo (Nicholas), SZE commented on HDFS-3516: ---------------------------------------------- For errors, the Java library sends the error message using error stream. So using error stream works well in practice. Also, this is implementation details and not to do with the WebHDFS API spec. (I guess you mean WebHDFS spec by docs. Or do you mean Java API doc?) I think it does not make sense to fall back to input stream (I believe you mean input stream by output stream) since the error messages won't be there. Say, there is funny bug that the op expects 307 TEMPORARY_REDIRECT but the server returns 200 OK with a JSON or HTML response. Then, it does not make sense to print out the response from input steam as error message. > Check content-type in WebHdfsFileSystem > --------------------------------------- > > Key: HDFS-3516 > URL: https://issues.apache.org/jira/browse/HDFS-3516 > Project: Hadoop HDFS > Issue Type: Improvement > Components: hdfs client > Reporter: Tsz Wo (Nicholas), SZE > Assignee: Tsz Wo (Nicholas), SZE > Attachments: h3516_20120607.patch, h3516_20120608.patch, h3516_20120609.patch > > > WebHdfsFileSystem currently tries to parse the response as json. It may be a good idea to check the content-type before parsing it. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira