private void checkLoadedTrailer(int version, FixedFileTrailer expected, FixedFileTrailer loaded)
    throws IOException {
    assertEquals(version, loaded.getMajorVersion());
    assertEquals(expected.getDataIndexCount(), loaded.getDataIndexCount());

    assertEquals(
      Math.min(expected.getEntryCount(), version == 1 ? Integer.MAX_VALUE : Long.MAX_VALUE),
      loaded.getEntryCount());

    if (version == 1) {
      assertEquals(expected.getFileInfoOffset(), loaded.getFileInfoOffset());
    }

    if (version == 2) {
      assertEquals(expected.getLastDataBlockOffset(), loaded.getLastDataBlockOffset());
      assertEquals(expected.getNumDataIndexLevels(), loaded.getNumDataIndexLevels());
      assertEquals(expected.createComparator().getClass().getName(),
        loaded.createComparator().getClass().getName());
      assertEquals(expected.getFirstDataBlockOffset(), loaded.getFirstDataBlockOffset());
      assertTrue(expected.createComparator() instanceof CellComparatorImpl);
      assertEquals(expected.getUncompressedDataIndexSize(), loaded.getUncompressedDataIndexSize());
    }

    assertEquals(expected.getLoadOnOpenDataOffset(), loaded.getLoadOnOpenDataOffset());
    assertEquals(expected.getMetaIndexCount(), loaded.getMetaIndexCount());

    assertEquals(expected.getTotalUncompressedBytes(), loaded.getTotalUncompressedBytes());
  }
The number of used fields by version. Indexed by version minus two. Min version that we support
is V2
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestFixedFileTrailer.java