diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index e4d3aedce76..3573df538aa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -962,6 +962,9 @@ Release 2.6.0 - UNRELEASED HDFS-7208. NN doesn't schedule replication when a DN storage fails. (Ming Ma via szetszwo) + HDFS-5089. When a LayoutVersion support SNAPSHOT, it must support + FSIMAGE_NAME_OPTIMIZATION. (szetszwo) + BREAKDOWN OF HDFS-6134 AND HADOOP-10150 SUBTASKS AND RELATED JIRAS HDFS-6387. HDFS CLI admin tool for creating & deleting an diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LayoutVersion.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LayoutVersion.java index 760db980d91..349f72ceba8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LayoutVersion.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/LayoutVersion.java @@ -107,8 +107,8 @@ public class LayoutVersion { RESERVED_REL1_2_0(-41, -32, "Reserved for release 1.2.0", true, CONCAT), ADD_INODE_ID(-42, -40, "Assign a unique inode id for each inode", false), SNAPSHOT(-43, "Support for snapshot feature"), - RESERVED_REL1_3_0(-44, -41, - "Reserved for release 1.3.0", true, ADD_INODE_ID, SNAPSHOT), + RESERVED_REL1_3_0(-44, -41, "Reserved for release 1.3.0", true, + ADD_INODE_ID, SNAPSHOT, FSIMAGE_NAME_OPTIMIZATION), OPTIMIZE_SNAPSHOT_INODES(-45, -43, "Reduce snapshot inode memory footprint", false), SEQUENTIAL_BLOCK_ID(-46, "Allocate block IDs sequentially and store " + diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/protocol/TestLayoutVersion.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/protocol/TestLayoutVersion.java index dbd96bb6105..bb59a17806e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/protocol/TestLayoutVersion.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/protocol/TestLayoutVersion.java @@ -120,4 +120,19 @@ public class TestLayoutVersion { NameNodeLayoutVersion.supports(feature, lv)); } } + + /** + * When a LayoutVersion support SNAPSHOT, it must support + * FSIMAGE_NAME_OPTIMIZATION. + */ + @Test + public void testSNAPSHOT() { + for(Feature f : Feature.values()) { + final int version = f.getInfo().getLayoutVersion(); + if (NameNodeLayoutVersion.supports(Feature.SNAPSHOT, version)) { + assertTrue(NameNodeLayoutVersion.supports( + Feature.FSIMAGE_NAME_OPTIMIZATION, version)); + } + } + } }