HDFS-5089. When a LayoutVersion support SNAPSHOT, it must support FSIMAGE_NAME_OPTIMIZATION.

This commit is contained in:
Tsz-Wo Nicholas Sze 2014-10-15 20:56:59 -07:00
parent 41980c56d3
commit 2894433332
3 changed files with 20 additions and 2 deletions

View File

@ -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

View File

@ -107,8 +107,8 @@ public static enum Feature implements LayoutFeature {
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 " +

View File

@ -120,4 +120,19 @@ private void validateFeatureList(LayoutFeature f) {
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));
}
}
}
}