Package org.apache.spark.util
Class MavenUtils
Object
org.apache.spark.util.MavenUtils
Provides utility functions to be used inside SparkSubmit.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.ivy.core.settings.IvySettings
buildIvySettings
(scala.Option<String> remoteRepos, scala.Option<String> ivyPath, boolean useLocalM2AsCache, PrintStream printStream) Build Ivy Settings using options with default resolversstatic scala.collection.immutable.Seq<org.apache.spark.util.MavenUtils.MavenCoordinate>
extractMavenCoordinates
(String coordinates) Extracts maven coordinates from a comma-delimited string.static scala.collection.immutable.Seq<String>
static String
static org.apache.ivy.core.settings.IvySettings
loadIvySettings
(String settingsFile, scala.Option<String> remoteRepos, scala.Option<String> ivyPath, PrintStream printStream) Load Ivy settings from a given filename, using supplied resolversstatic org.apache.spark.internal.Logging.LogStringContext
LogStringContext
(scala.StringContext sc) static org.slf4j.Logger
static void
org$apache$spark$internal$Logging$$log__$eq
(org.slf4j.Logger x$1) parseQueryParams
(URI uri) Parse URI query string's parameter value oftransitive
,exclude
andrepos
.static scala.collection.immutable.Seq<String>
resolveMavenCoordinates
(String coordinates, org.apache.ivy.core.settings.IvySettings ivySettings, scala.Option<org.apache.ivy.core.settings.IvySettings> noCacheIvySettings, boolean transitive, scala.collection.immutable.Seq<String> exclusions, boolean isTest, PrintStream printStream) Resolves any dependencies that were supplied through maven coordinates
-
Constructor Details
-
MavenUtils
public MavenUtils()
-
-
Method Details
-
JAR_IVY_SETTING_PATH_KEY
-
IVY_DEFAULT_EXCLUDES
-
extractMavenCoordinates
public static scala.collection.immutable.Seq<org.apache.spark.util.MavenUtils.MavenCoordinate> extractMavenCoordinates(String coordinates) Extracts maven coordinates from a comma-delimited string. Coordinates should be provided in the formatgroupId:artifactId:version
orgroupId/artifactId:version
.- Parameters:
coordinates
- Comma-delimited string of maven coordinates- Returns:
- Sequence of Maven coordinates
-
buildIvySettings
public static org.apache.ivy.core.settings.IvySettings buildIvySettings(scala.Option<String> remoteRepos, scala.Option<String> ivyPath, boolean useLocalM2AsCache, PrintStream printStream) Build Ivy Settings using options with default resolvers- Parameters:
remoteRepos
- Comma-delimited string of remote repositories other than maven centralivyPath
- The path to the local ivy repositoryuseLocalM2AsCache
- Whether or not uselocal-m2 repo
as cacheprintStream
- (undocumented)- Returns:
- An IvySettings object
-
loadIvySettings
public static org.apache.ivy.core.settings.IvySettings loadIvySettings(String settingsFile, scala.Option<String> remoteRepos, scala.Option<String> ivyPath, PrintStream printStream) Load Ivy settings from a given filename, using supplied resolvers- Parameters:
settingsFile
- Path to Ivy settings fileremoteRepos
- Comma-delimited string of remote repositories other than maven centralivyPath
- The path to the local ivy repositoryprintStream
- (undocumented)- Returns:
- An IvySettings object
-
resolveMavenCoordinates
public static scala.collection.immutable.Seq<String> resolveMavenCoordinates(String coordinates, org.apache.ivy.core.settings.IvySettings ivySettings, scala.Option<org.apache.ivy.core.settings.IvySettings> noCacheIvySettings, boolean transitive, scala.collection.immutable.Seq<String> exclusions, boolean isTest, PrintStream printStream) Resolves any dependencies that were supplied through maven coordinates- Parameters:
coordinates
- Comma-delimited string of maven coordinatesivySettings
- An IvySettings containing resolvers to usenoCacheIvySettings
- An no-cache(local-m2-cache) IvySettings containing resolvers to usetransitive
- Whether resolving transitive dependencies, default is trueexclusions
- Exclusions to apply when resolving transitive dependenciesisTest
- (undocumented)printStream
- (undocumented)- Returns:
- Seq of path to the jars of the given maven artifacts including their transitive dependencies
-
parseQueryParams
Parse URI query string's parameter value oftransitive
,exclude
andrepos
. Other invalid parameters will be ignored.- Parameters:
uri
- Ivy URI need to be downloaded.- Returns:
- Tuple value of parameter
transitive
,exclude
andrepos
value.1. transitive: whether to download dependency jar of Ivy URI, default value is true and this parameter value is case-insensitive. This mimics Hive's behaviour for parsing the transitive parameter. Invalid value will be treat as false. Example: Input: exclude=org.mortbay.jetty:jetty&transitive=true Output: true
2. exclude: comma separated exclusions to apply when resolving transitive dependencies, consists of
group:module
pairs separated by commas. Example: Input: excludeorg.mortbay.jetty:jetty,org.eclipse.jetty:jetty-http Output: [org.mortbay.jetty:jetty,org.eclipse.jetty:jetty-http]3. repos: comma separated repositories to use when resolving dependencies.
-
org$apache$spark$internal$Logging$$log_
public static org.slf4j.Logger org$apache$spark$internal$Logging$$log_() -
org$apache$spark$internal$Logging$$log__$eq
public static void org$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1) -
LogStringContext
public static org.apache.spark.internal.Logging.LogStringContext LogStringContext(scala.StringContext sc)
-