use of org.apache.tez.dag.app.dag.impl.TezRootInputInitializerContextImpl in project tez by apache.
the class RootInputInitializerManager method runInputInitializers.
public void runInputInitializers(List<RootInputLeafOutput<InputDescriptor, InputInitializerDescriptor>> inputs) throws TezException {
for (RootInputLeafOutput<InputDescriptor, InputInitializerDescriptor> input : inputs) {
InputInitializerContext context = new TezRootInputInitializerContextImpl(input, vertex, appContext, this);
InputInitializer initializer;
try {
TezUtilsInternal.setHadoopCallerContext(appContext.getHadoopShim(), vertex.getVertexId());
initializer = createInitializer(input, context);
} finally {
appContext.getHadoopShim().clearHadoopCallerContext();
}
InitializerWrapper initializerWrapper = new InitializerWrapper(input, initializer, context, vertex, entityStateTracker, appContext);
// Register pending vertex update registrations
List<VertexUpdateRegistrationHolder> vertexUpdateRegistrations = pendingVertexRegistrations.removeAll(input.getName());
if (vertexUpdateRegistrations != null) {
for (VertexUpdateRegistrationHolder h : vertexUpdateRegistrations) {
initializerWrapper.registerForVertexStateUpdates(h.vertexName, h.stateSet);
}
}
initializerMap.put(input.getName(), initializerWrapper);
ListenableFuture<List<Event>> future = executor.submit(new InputInitializerCallable(initializerWrapper, dagUgi, appContext));
Futures.addCallback(future, createInputInitializerCallback(initializerWrapper));
}
}
Aggregations