Tabnine Logo
Input.of
Code IndexAdd Tabnine to your IDE (free)

How to use
of
method
in
co.cask.cdap.api.data.batch.Input

Best Java code snippets using co.cask.cdap.api.data.batch.Input.of (Showing top 8 results out of 315)

origin: co.cask.cdap/hydrator-test

@Override
public void prepareRun(BatchSourceContext context) throws Exception {
 context.setInput(Input.of(config.name, new InputFormatProvider() {
  @Override
  public String getInputFormatClassName() {
   return TextInputFormat.class.getCanonicalName();
  }
  @Override
  public Map<String, String> getInputFormatConfiguration() {
   return ImmutableMap.of(TextInputFormat.INPUT_DIR, config.dirName);
  }
 }));
}
origin: co.cask.hydrator/core-plugins

context.setInput(Input.of(config.referenceName, new SourceInputFormatProvider(XMLInputFormat.class, conf)));
origin: co.cask.hydrator/format-common

context.setInput(Input.of(config.getReferenceName(), new SourceInputFormatProvider(inputFormatClass, conf)));
origin: co.cask.hydrator/core-plugins

@Override
public void prepareRun(BatchSourceContext batchSourceContext) throws Exception {
 excelInputreaderConfig.validate();
 createDatasets(null, batchSourceContext);
 Job job = JobUtils.createInstance();
 String processFiles = "";
 if (!Strings.isNullOrEmpty(excelInputreaderConfig.memoryTableName)) {
  processFiles = GSON.toJson(getAllProcessedFiles(batchSourceContext), ARRAYLIST_PREPROCESSED_FILES);
 }
 ExcelInputFormat.setConfigurations(job, excelInputreaderConfig.filePattern, excelInputreaderConfig.sheet,
                   excelInputreaderConfig.reprocess, excelInputreaderConfig.sheetValue,
                   excelInputreaderConfig.columnList, excelInputreaderConfig.skipFirstRow,
                   excelInputreaderConfig.terminateIfEmptyRow, excelInputreaderConfig.rowsLimit,
                   excelInputreaderConfig.ifErrorRecord, processFiles);
 // Sets the input path(s).
 ExcelInputFormat.addInputPaths(job, excelInputreaderConfig.filePath);
 // Sets the filter based on extended class implementation.
 ExcelInputFormat.setInputPathFilter(job, ExcelReaderRegexFilter.class);
 SourceInputFormatProvider inputFormatProvider = new SourceInputFormatProvider(ExcelInputFormat.class,
                                        job.getConfiguration());
 batchSourceContext.setInput(Input.of(excelInputreaderConfig.referenceName, inputFormatProvider));
}
origin: cdapio/cdap

sourceConf.put(ADDITIONAL_CONFIG, SOURCE_CONFIG);
context.addInput(Input.of("input", new InputFormatProvider() {
 @Override
 public String getInputFormatClassName() {
origin: co.cask.cdap/cdap-app-fabric

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);
}
origin: cdapio/cdap

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);
}
origin: cdapio/cdap

 @Override
 public void initialize() throws Exception {
  // this write should be invalidated if any of the following fails
  KeyValueTable kvTable = getContext().getDataset("recorder");
  kvTable.write("initialized", "true");
  if (getContext().getRuntimeArguments().containsKey("failInput")) {
   getContext().addInput(Input.of("x", new FailingInputFormatProvider()));
  }
  if (getContext().getRuntimeArguments().containsKey("failOutput")) {
   getContext().addOutput(Output.of("x", new FailingOutputFormatProvider()));
  }
 }
}
co.cask.cdap.api.data.batchInputof

Javadoc

Returns an Input defined by an InputFormatProvider.

Popular methods of Input

  • ofDataset
    Returns an Input defined by a dataset.
  • alias
  • fromNamespace
    Sets the namespace of the input.
  • getAlias
  • getName
  • getNamespace
  • ofStream

Popular in Java

  • Making http requests using okhttp
  • startActivity (Activity)
  • getApplicationContext (Context)
  • scheduleAtFixedRate (Timer)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • JLabel (javax.swing)
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now