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 CEEA2200C0D for ; Tue, 31 Jan 2017 20:00:02 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CD862160B52; Tue, 31 Jan 2017 19:00:02 +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 24141160B36 for ; Tue, 31 Jan 2017 20:00:01 +0100 (CET) Received: (qmail 22588 invoked by uid 500); 31 Jan 2017 19:00:01 -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 22576 invoked by uid 99); 31 Jan 2017 19:00:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jan 2017 19:00:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id AABA7C0C6D for ; Tue, 31 Jan 2017 18:59:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.199 X-Spam-Level: X-Spam-Status: No, score=-1.199 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id kiYkUjWnzqf6 for ; Tue, 31 Jan 2017 18:59:54 +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 630FB60DC8 for ; Tue, 31 Jan 2017 18:59:54 +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 9EE41E0290 for ; Tue, 31 Jan 2017 18:59:53 +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 B393C252A8 for ; Tue, 31 Jan 2017 18:59:52 +0000 (UTC) Date: Tue, 31 Jan 2017 18:59:52 +0000 (UTC) From: "Andrew Wang (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] (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: Tue, 31 Jan 2017 19:00:03 -0000 [ https://issues.apache.org/jira/browse/HDFS-11382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Wang updated HDFS-11382: ------------------------------- Hadoop Flags: Incompatible change > 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 > > 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