use of co.cask.cdap.internal.app.runtime.batch.dataset.DatasetInputFormatProvider in project cdap by caskdata.
the class BasicMapReduceContext method createInput.
private Input.InputFormatProviderInput createInput(Input.DatasetInput datasetInput) {
String datasetName = datasetInput.getName();
Map<String, String> datasetArgs = datasetInput.getArguments();
// keep track of the original alias to set it on the created Input before returning it
String originalAlias = datasetInput.getAlias();
Dataset dataset;
if (datasetInput.getNamespace() == null) {
dataset = getDataset(datasetName, datasetArgs, AccessType.READ);
} else {
dataset = getDataset(datasetInput.getNamespace(), datasetName, datasetArgs, AccessType.READ);
}
DatasetInputFormatProvider datasetInputFormatProvider = new DatasetInputFormatProvider(datasetInput.getNamespace(), datasetName, datasetArgs, dataset, datasetInput.getSplits(), MapReduceBatchReadableInputFormat.class);
return (Input.InputFormatProviderInput) Input.of(datasetName, datasetInputFormatProvider).alias(originalAlias);
}
Aggregations