Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-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 B88E0176F4 for ; Fri, 15 May 2015 08:37:01 +0000 (UTC) Received: (qmail 36063 invoked by uid 500); 15 May 2015 08:37:01 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 36010 invoked by uid 500); 15 May 2015 08:37:01 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 35998 invoked by uid 99); 15 May 2015 08:37:01 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 May 2015 08:37:01 +0000 Date: Fri, 15 May 2015 08:37:01 +0000 (UTC) From: "Yi Liu (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-11938) Fix ByteBuffer version encode/decode API of raw erasure coder 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/HADOOP-11938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14545154#comment-14545154 ] Yi Liu commented on HADOOP-11938: --------------------------------- Looks good now, one nit, +1 after addressing in TestRawCoderBase.java {code} Assert.fail("Encoding test with bad input passed"); {code} We should write "Encoding test with bad input should fail". You write oppositely. Same as few other Assert.fail. Furthermore, we need to fix the Jenkins warnings (release audit/checkstyle/whitespace) if they are related to this patch. > Fix ByteBuffer version encode/decode API of raw erasure coder > ------------------------------------------------------------- > > Key: HADOOP-11938 > URL: https://issues.apache.org/jira/browse/HADOOP-11938 > Project: Hadoop Common > Issue Type: Sub-task > Components: io > Reporter: Kai Zheng > Assignee: Kai Zheng > Attachments: HADOOP-11938-HDFS-7285-v1.patch, HADOOP-11938-HDFS-7285-v2.patch, HADOOP-11938-HDFS-7285-v3.patch, HADOOP-11938-HDFS-7285-workaround.patch > > > While investigating a test failure in {{TestRecoverStripedFile}}, one issue in raw erasrue coder, caused by an optimization in below codes. It assumes the heap buffer backed by the bytes array available for reading or writing always starts with zero and takes the whole space. > {code} > protected static byte[][] toArrays(ByteBuffer[] buffers) { > byte[][] bytesArr = new byte[buffers.length][]; > ByteBuffer buffer; > for (int i = 0; i < buffers.length; i++) { > buffer = buffers[i]; > if (buffer == null) { > bytesArr[i] = null; > continue; > } > if (buffer.hasArray()) { > bytesArr[i] = buffer.array(); > } else { > throw new IllegalArgumentException("Invalid ByteBuffer passed, " + > "expecting heap buffer"); > } > } > return bytesArr; > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)