Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2B298200BDA for ; Mon, 28 Nov 2016 22:14:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2887A160B00; Mon, 28 Nov 2016 21:14:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 70C26160B0D for ; Mon, 28 Nov 2016 22:13:59 +0100 (CET) Received: (qmail 41874 invoked by uid 500); 28 Nov 2016 21:13:58 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 41623 invoked by uid 99); 28 Nov 2016 21:13:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2016 21:13:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 706632C03E1 for ; Mon, 28 Nov 2016 21:13:58 +0000 (UTC) Date: Mon, 28 Nov 2016 21:13:58 +0000 (UTC) From: "Mingliang Liu (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-11156) Webhdfs rest api GET_BLOCK_LOCATIONS output doesn't comply with FileSystem API MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 28 Nov 2016 21:14:00 -0000 [ https://issues.apache.org/jira/browse/HDFS-11156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15703132#comment-15703132 ] Mingliang Liu commented on HDFS-11156: -------------------------------------- The patch looks good to me overall. +1 I have several minor comments: # Do we need to specially handle the case of {{list.isEmpty()}}? Looks pretty similar to the {{else}} clause. {code} 593 } else if (list.isEmpty()) { 594 return new String[0]; 595 } else { 596 final String[] array = new String[list.size()]; 597 int i = 0; 598 for (Object object : list) { 599 array[i++] = object.toString(); 600 } 601 return array; 602 } {code} # Are you considering using {{assertArrayEquals()}}? {code:title=testWebHdfsGetBlockLocationsWithStorageType()} 899 for(int j=0; j Webhdfs rest api GET_BLOCK_LOCATIONS output doesn't comply with FileSystem API > ------------------------------------------------------------------------------ > > Key: HDFS-11156 > URL: https://issues.apache.org/jira/browse/HDFS-11156 > Project: Hadoop HDFS > Issue Type: Bug > Components: webhdfs > Affects Versions: 2.7.3 > Reporter: Weiwei Yang > Assignee: Weiwei Yang > Attachments: HDFS-11156.01.patch, HDFS-11156.02.patch, HDFS-11156.03.patch > > > Following webhdfs REST API > {code} > http://:/webhdfs/v1/?op=GET_BLOCK_LOCATIONS&offset=0&length=1 > {code} > will get a response like > {code} > { > "LocatedBlocks" : { > "fileLength" : 1073741824, > "isLastBlockComplete" : true, > "isUnderConstruction" : false, > "lastLocatedBlock" : { ... }, > "locatedBlocks" : [ {...} ] > } > } > {code} > This represents for *o.a.h.h.p.LocatedBlocks*. However according to *FileSystem* API, > {code} > public BlockLocation[] getFileBlockLocations(Path p, long start, long len) > {code} > clients would expect an array of BlockLocation. This mismatch should be fixed. Marked as Incompatible change as this will change the output of the GET_BLOCK_LOCATIONS API. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org