assert packageName != null;
assert hadoopWorkLocation != null;
assert compilerWorkDirectory != null;
assert linkingResources != null;
try {
BatchDriver analyzed = BatchDriver.analyze(batchDescription);
if (analyzed.hasError()) {
for (String diagnostic : analyzed.getDiagnostics()) {
LOG.error(diagnostic);
}
return false;
}
String batchId = analyzed.getBatchClass().getConfig().name();
ClassLoader serviceLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
@Override
public ClassLoader run() {
URLClassLoader loader = new URLClassLoader(
pluginLibraries.toArray(new URL[pluginLibraries.size()]),
BatchCompilerDriver.class.getClassLoader());
return loader;
}
});
DirectBatchCompiler.compile(
analyzed.getDescription(),
packageName,
hadoopWorkLocation,
new File(outputDirectory, batchId),
new File(compilerWorkDirectory, batchId),
linkingResources,