code: public static void verifyVersion(int reportedVersion,
        int expectedVersion, String annotation) throws IOException {
      if ((reportedVersion ^ expectedVersion) < 0) {
        throw new IOException("reportedVersion and expectedVersion have" +
            " different signs : " + reportedVersion + ", " + expectedVersion);
      }
      // layout_version is negative and data_transfer is positive, so we need to
      // look at the absolute.
      if (Math.abs(reportedVersion) < Math.abs(expectedVersion))
        throw new IncorrectVersionException(
            reportedVersion, "data node " + annotation, expectedVersion);
    }
docs: Verify version.
  
  @param reportedVersion version reported by datanode
  @param expectedVersion version expected by namenode
  @param annotation explanation of the given version
  @throws IncorrectVersionException