Class VersionInfoUtil

java.lang.Object
org.apache.hadoop.hbase.client.VersionInfoUtil

@Private public final class VersionInfoUtil extends Object
Class to help with parsing the version info.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static int
    buildVersionNumber(int major, int minor, int patch)
    Pack the full number version in a int.
    static boolean
    currentClientHasMinimumVersion(int major, int minor)
     
    static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo
    Returns the versionInfo extracted from the current RpcCallContext
    private static String[]
    getVersionComponents(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo versionInfo)
    Returns the version components Examples: "1.4.3" returns [1, 4, 3], "4.5.6-SNAPSHOT" returns [4, 5, 6, "SNAPSHOT"]
    static int
    getVersionNumber(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo versionInfo)
    Pack the full number version in a int.
    static boolean
    hasMinimumVersion(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo versionInfo, int major, int minor)
     
    static String
    versionNumberToString(int version)
    Returns the passed-in version int as a version String (e.g.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • currentClientHasMinimumVersion

      public static boolean currentClientHasMinimumVersion(int major, int minor)
    • hasMinimumVersion

      public static boolean hasMinimumVersion(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo versionInfo, int major, int minor)
    • getCurrentClientVersionInfo

      public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo getCurrentClientVersionInfo()
      Returns the versionInfo extracted from the current RpcCallContext
    • versionNumberToString

      public static String versionNumberToString(int version)
      Returns the passed-in version int as a version String (e.g. 0x0103004 is 1.3.4)
    • getVersionNumber

      public static int getVersionNumber(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo versionInfo)
      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)
      Parameters:
      versionInfo - the VersionInfo object to pack
      Returns:
      the version number as int. (e.g. 0x0103004 is 1.3.4)
    • buildVersionNumber

      private static int buildVersionNumber(int major, int minor, int patch)
      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)
      Parameters:
      major - version major number
      minor - version minor number
      patch - version patch number
      Returns:
      the version number as int. (e.g. 0x0103004 is 1.3.4)
    • getVersionComponents

      private static String[] getVersionComponents(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo versionInfo)
      Returns the version components Examples: "1.4.3" returns [1, 4, 3], "4.5.6-SNAPSHOT" returns [4, 5, 6, "SNAPSHOT"]
      Returns:
      the components of the version string