public static int getVersionNumber(final HBaseProtos.VersionInfo versionInfo) {
    if (versionInfo != null) {
      try {
        final String[] components = getVersionComponents(versionInfo);
        int clientMajor = components.length > 0 ? Integer.parseInt(components[0]) : 0;
        int clientMinor = components.length > 1 ? Integer.parseInt(components[1]) : 0;
        int clientPatch = components.length > 2 ? Integer.parseInt(components[2]) : 0;
        return buildVersionNumber(clientMajor, clientMinor, clientPatch);
      } catch (NumberFormatException e) {
        int clientMajor = versionInfo.hasVersionMajor() ? versionInfo.getVersionMajor() : 0;
        int clientMinor = versionInfo.hasVersionMinor() ? versionInfo.getVersionMinor() : 0;
        return buildVersionNumber(clientMajor, clientMinor, 0);
      }
    }
    return (0); // no version
  }
Pack the full number version in a int. by shifting each component by 8bit, except the dot
release which has 12bit. Examples: (1.3.4 is 0x0103004, 2.1.0 is 0x0201000)
@param versionInfo the VersionInfo object to pack
@return the version number as int. (e.g. 0x0103004 is 1.3.4)
hbase-server/src/main/java/org/apache/hadoop/hbase/client/VersionInfoUtil.java