Package org.apache.hadoop.hbase.client
Class VersionInfoUtil
java.lang.Object
org.apache.hadoop.hbase.client.VersionInfoUtil
Class to help with parsing the version info.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final ThreadLocal<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static int
buildVersionNumber
(int major, int minor, int patch) Pack the full number version in a int.static <T1,
T2, R, E extends Throwable>
RcallWithVersion
(VersionInfoUtil.ServiceCallFunction<T1, T2, R, E> f, T1 t1, T2 t2) static boolean
currentClientHasMinimumVersion
(int major, int minor) static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo
Returns the versionInfo extracted from the current RpcCallContextprivate 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-inversion
int as a version String (e.g.
-
Field Details
-
NonCallVersion
private static final ThreadLocal<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo> NonCallVersion
-
-
Constructor Details
-
VersionInfoUtil
private VersionInfoUtil()
-
-
Method Details
-
currentClientHasMinimumVersion
-
hasMinimumVersion
public static boolean hasMinimumVersion(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo versionInfo, int major, int minor) -
callWithVersion
public static <T1,T2, R callWithVersionR, E extends Throwable> (VersionInfoUtil.ServiceCallFunction<T1, T2, throws ER, E> f, T1 t1, T2 t2) - Throws:
E extends Throwable
-
getCurrentClientVersionInfo
public static org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.VersionInfo getCurrentClientVersionInfo()Returns the versionInfo extracted from the current RpcCallContext -
versionNumberToString
Returns the passed-inversion
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
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 numberminor
- version minor numberpatch
- 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
-