Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/3238#discussion_r20813987
--- Diff:
yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ClientBase.scala ---
@@ -223,10 +224,42 @@ private[spark] trait ClientBase extends Logging {
}
}
}
+
if (cachedSecondaryJarLinks.nonEmpty) {
sparkConf.set(CONF_SPARK_YARN_SECONDARY_JARS,
cachedSecondaryJarLinks.mkString(","))
}
+ /**
+ * Do the same for datanucleus jars, if they exist in spark home. Find
all datanucleus-* jars,
+ * copy them to the remote fs, and add them to the class path.
+ */
+ for (libsDir <- sparkDatanucleusJars(sparkConf)) {
+ val libsURI = new URI(libsDir)
+ val jarLinks = ListBuffer.empty[String]
+ if (libsURI.getScheme != LOCAL_SCHEME) {
+ val localURI = getQualifiedLocalPath(libsURI).toUri()
+ val jars = FileSystem.get(localURI, hadoopConf).listFiles(new
Path(localURI.getPath), false)
+ while (jars.hasNext) {
+ val jar = jars.next()
+ val name = jar.getPath.getName
+ if (name.startsWith("datanucleus-")) {
+ // copy to remote and add to classpath
+ val src = jar.getPath
+ val destPath = copyFileToRemote(dst, src, replication)
+ distCacheMgr.addResource(fs, hadoopConf, destPath,
+ localResources, LocalResourceType.FILE, name, statCache)
+ jarLinks += name
--- End diff --
Don't you need to add these jars to `cachedSecondaryJarLinks` like in the
other cases?
This probably works now since, IIRC, the classpath has a wildcard `$PWD/*`
entry in it, but I've removed that in https://github.com/apache/spark/pull/3233.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]