use of org.apache.asterix.external.dataset.adapter.GenericAdapter in project asterixdb by apache.
the class GenericAdapterFactory method createAdapter.
/**
* Runs on each node controller (after serialization-deserialization)
*/
@Override
public synchronized IDataSourceAdapter createAdapter(IHyracksTaskContext ctx, int partition) throws HyracksDataException {
INCServiceContext serviceCtx = ctx.getJobletContext().getServiceContext();
INcApplicationContext appCtx = (INcApplicationContext) serviceCtx.getApplicationContext();
try {
restoreExternalObjects(serviceCtx, appCtx.getLibraryManager());
} catch (Exception e) {
LOGGER.log(Level.INFO, "Failure restoring external objects", e);
throw HyracksDataException.create(e);
}
if (isFeed) {
if (feedLogManager == null) {
feedLogManager = FeedUtils.getFeedLogManager(ctx, partition, feedLogFileSplits);
}
feedLogManager.touch();
}
IDataFlowController controller = DataflowControllerProvider.getDataflowController(recordType, ctx, partition, dataSourceFactory, dataParserFactory, configuration, indexingOp, isFeed, feedLogManager);
if (isFeed) {
return new FeedAdapter((AbstractFeedDataFlowController) controller);
} else {
return new GenericAdapter(controller);
}
}
Aggregations