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 86F60200C34 for ; Mon, 27 Feb 2017 12:10:49 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8590C160B6C; Mon, 27 Feb 2017 11:10:49 +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 CFEEF160B60 for ; Mon, 27 Feb 2017 12:10:48 +0100 (CET) Received: (qmail 72878 invoked by uid 500); 27 Feb 2017 11:10:47 -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 72867 invoked by uid 99); 27 Feb 2017 11:10:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Feb 2017 11:10:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 32C8AC03F1 for ; Mon, 27 Feb 2017 11:10:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.451 X-Spam-Level: * X-Spam-Status: No, score=1.451 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id hef28uvfBS4Q for ; Mon, 27 Feb 2017 11:10:46 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 29ECC5F58E for ; Mon, 27 Feb 2017 11:10:46 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 911B3E031F for ; Mon, 27 Feb 2017 11:10:45 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 43FD32412D for ; Mon, 27 Feb 2017 11:10:45 +0000 (UTC) Date: Mon, 27 Feb 2017 11:10:45 +0000 (UTC) From: "Ewan Higgs (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-11382) Persist Erasure Coding Policy ID in a new optional field in INodeFile in FSImage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 27 Feb 2017 11:10:49 -0000 [ https://issues.apache.org/jira/browse/HDFS-11382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15885593#comment-15885593 ] Ewan Higgs commented on HDFS-11382: ----------------------------------- Is it possible to add more tests like {{testSaveAndLoadStripedINodeFile}} and/or {{createStripedINodeFile}} which create {{INodeFile}} with bad arguments and verify that it throws? e.g. replication != null and a set erasureCodingPolicyID. > Persist Erasure Coding Policy ID in a new optional field in INodeFile in FSImage > -------------------------------------------------------------------------------- > > Key: HDFS-11382 > URL: https://issues.apache.org/jira/browse/HDFS-11382 > Project: Hadoop HDFS > Issue Type: Task > Components: hdfs > Affects Versions: 3.0.0-alpha1 > Reporter: Manoj Govindassamy > Assignee: Manoj Govindassamy > Attachments: HDFS-11382.01.patch, HDFS-11382.02.patch, HDFS-11382.03.patch > > > For Erasure Coded files, replication field in INodeFile message is re-used to store the EC Policy ID. > *FSDirWriteFileOp#addFile* > {noformat} > private static INodesInPath addFile( > FSDirectory fsd, INodesInPath existing, byte[] localName, > PermissionStatus permissions, short replication, long preferredBlockSize, > String clientName, String clientMachine) > throws IOException { > .. .. .. > try { > ErasureCodingPolicy ecPolicy = FSDirErasureCodingOp. > getErasureCodingPolicy(fsd.getFSNamesystem(), existing); > if (ecPolicy != null) { > replication = ecPolicy.getId(); <=== > } > final BlockType blockType = ecPolicy != null? > BlockType.STRIPED : BlockType.CONTIGUOUS; > INodeFile newNode = newINodeFile(fsd.allocateNewInodeId(), permissions, > modTime, modTime, replication, preferredBlockSize, blockType); > newNode.setLocalName(localName); > newNode.toUnderConstruction(clientName, clientMachine); > newiip = fsd.addINode(existing, newNode, permissions.getPermission()); > {noformat} > With HDFS-11268 fix, {{FSImageFormatPBINode#Loader#loadInodeFile}} is rightly getting the EC ID from the replication field and then uses the right Policy to construct the blocks. > *FSImageFormatPBINode#Loader#loadInodeFile* > {noformat} > ErasureCodingPolicy ecPolicy = (blockType == BlockType.STRIPED) ? > ErasureCodingPolicyManager.getPolicyByPolicyID((byte) replication) : > null; > {noformat} > The original intention was to re-use the replication field so the in-memory representation would be compact. But, this isn't necessary for the on-disk representation. replication is an optional field, and if we add another optional field for the EC policy, it won't be any extra space. > Also, we need to make sure to have the appropriate asserts in place to make sure both fields aren't set for the same INodeField. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org