mirror of
https://github.com/apache/druid.git
synced 2025-02-17 07:25:02 +00:00
Fix the Injector creation in HadoopTask (#13138)
* Injector fix in HadoopTask * Log the ExtensionsConfig while instantiating the HadoopTask * Log the config in the run() method instead of the ctor
This commit is contained in:
parent
306f612f86
commit
0bfa81b7df
@ -330,6 +330,7 @@ public class HadoopIndexTask extends HadoopTask implements ChatHandler
|
||||
try {
|
||||
registerResourceCloserOnAbnormalExit(config -> killHadoopJob());
|
||||
String hadoopJobIdFile = getHadoopJobIdFileName();
|
||||
logExtensionsConfig();
|
||||
final ClassLoader loader = buildClassLoader(toolbox);
|
||||
boolean determineIntervals = spec.getDataSchema().getGranularitySpec().inputIntervals().isEmpty();
|
||||
|
||||
|
@ -50,7 +50,7 @@ public abstract class HadoopTask extends AbstractBatchIndexTask
|
||||
{
|
||||
private static final Logger log = new Logger(HadoopTask.class);
|
||||
|
||||
static final Injector INJECTOR = new StartupInjectorBuilder().withExtensions().build();
|
||||
static final Injector INJECTOR = new StartupInjectorBuilder().forServer().build();
|
||||
private static final ExtensionsLoader EXTENSIONS_LOADER = ExtensionsLoader.instance(INJECTOR);
|
||||
|
||||
private final List<String> hadoopDependencyCoordinates;
|
||||
@ -207,6 +207,15 @@ public abstract class HadoopTask extends AbstractBatchIndexTask
|
||||
return classLoader;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method logs the {@link ExtensionsConfig} that was used to fetch the hadoop dependencies and build the classpath
|
||||
* for the jobs
|
||||
*/
|
||||
protected static void logExtensionsConfig()
|
||||
{
|
||||
log.info("HadoopTask started with the following config:\n%s", EXTENSIONS_LOADER.config().toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* This method tries to isolate class loading during a Function call
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user