LayoutVersion { public static boolean supports(Map<Integer, SortedSet<LayoutFeature>> map, final LayoutFeature f, final int lv) { final SortedSet<LayoutFeature> set = map.get(lv); return set != null && set.contains(f); }  static void updateMap(Map<Integer, SortedSet<LayoutFeature>> map,
      LayoutFeature[] features); String getString(Map<Integer, SortedSet<LayoutFeature>> map,
      LayoutFeature[] values); static boolean supports(Map<Integer, SortedSet<LayoutFeature>> map,
      final LayoutFeature f, final int lv); static int getCurrentLayoutVersion(LayoutFeature[] features); static int getMinimumCompatibleLayoutVersion(
      LayoutFeature[] features); static final int BUGFIX_HDFS_2991_VERSION; }
@Test public void testRelease203() { assertTrue(NameNodeLayoutVersion.supports(LayoutVersion.Feature.DELEGATION_TOKEN, Feature.RESERVED_REL20_203.getInfo().getLayoutVersion())); }
@Test public void testRelease204() { assertTrue(NameNodeLayoutVersion.supports(LayoutVersion.Feature.DELEGATION_TOKEN, Feature.RESERVED_REL20_204.getInfo().getLayoutVersion())); }
@Test public void testRelease1_2_0() { assertTrue(NameNodeLayoutVersion.supports(LayoutVersion.Feature.CONCAT, Feature.RESERVED_REL1_2_0.getInfo().getLayoutVersion())); }
@Test public void testNameNodeFeature() { final LayoutFeature first = NameNodeLayoutVersion.Feature.ROLLING_UPGRADE; assertTrue(NameNodeLayoutVersion.supports(LAST_NON_RESERVED_COMMON_FEATURE, first.getInfo().getLayoutVersion())); assertEquals(LAST_COMMON_FEATURE.getInfo().getLayoutVersion() - 1, first.getInfo().getLayoutVersion()); }
@Test public void testDataNodeFeature() { final LayoutFeature first = DataNodeLayoutVersion.Feature.FIRST_LAYOUT; assertTrue(DataNodeLayoutVersion.supports(LAST_NON_RESERVED_COMMON_FEATURE, first.getInfo().getLayoutVersion())); assertEquals(LAST_COMMON_FEATURE.getInfo().getLayoutVersion() - 1, first.getInfo().getLayoutVersion()); }
@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)); } } }