public class VersionUtils
extends Object
Constructor and Description |
---|
VersionUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isHadoop3()
Whether the Hadoop version used by Spark is 3.x
|
static scala.Option<scala.Tuple3<Object,Object,Object>> |
majorMinorPatchVersion(String version)
Extracts the major, minor and patch parts from the input
version . |
static scala.Tuple2<Object,Object> |
majorMinorVersion(String sparkVersion)
Given a Spark version string, return the (major version number, minor version number).
|
static int |
majorVersion(String sparkVersion)
Given a Spark version string, return the major version number.
|
static int |
minorVersion(String sparkVersion)
Given a Spark version string, return the minor version number.
|
static String |
shortVersion(String sparkVersion)
Given a Spark version string, return the short version string.
|
public static boolean isHadoop3()
public static int majorVersion(String sparkVersion)
sparkVersion
- (undocumented)public static int minorVersion(String sparkVersion)
sparkVersion
- (undocumented)public static String shortVersion(String sparkVersion)
sparkVersion
- (undocumented)public static scala.Tuple2<Object,Object> majorMinorVersion(String sparkVersion)
sparkVersion
- (undocumented)public static scala.Option<scala.Tuple3<Object,Object,Object>> majorMinorPatchVersion(String version)
version
. Note that if minor or patch
version is missing from the input, this will return 0 for these parts. Returns None
if the
input is not of a valid format.
Examples of valid version: - 1 (extracts to (1, 0, 0)) - 2.4 (extracts to (2, 4, 0)) - 3.2.2 (extracts to (3, 2, 2)) - 3.2.2.4 (extracts to 3, 2, 2)) - 3.3.1-SNAPSHOT (extracts to (3, 3, 1)) - 3.2.2.4SNAPSHOT (extracts to (3, 2, 2), only the first 3 components)
Examples of invalid version: - ABC - 1X - 2.4XYZ - 2.4-SNAPSHOT - 3.4.5ABC
version
- (undocumented)None
otherwise.