Package org.apache.spark.util
Class MavenUtils
Object
org.apache.spark.util.MavenUtils
Provides utility functions to be used inside SparkSubmit.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.ivy.core.settings.IvySettingsbuildIvySettings(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 Stringstatic org.apache.ivy.core.settings.IvySettingsloadIvySettings(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.LogStringContextLogStringContext(scala.StringContext sc) static org.slf4j.Loggerstatic voidorg$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1) parseQueryParams(URI uri) Parse URI query string's parameter value oftransitive,excludeandrepos.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:versionorgroupId/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 repoas 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,excludeandrepos. Other invalid parameters will be ignored.- Parameters:
uri- Ivy URI need to be downloaded.- Returns:
- Tuple value of parameter
transitive,excludeandreposvalue.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:modulepairs 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)
-