Tabnine Logo
AddElementsFromFile.getParallelism
Code IndexAdd Tabnine to your IDE (free)

How to use
getParallelism
method
in
uk.gov.gchq.gaffer.operation.impl.add.AddElementsFromFile

Best Java code snippets using uk.gov.gchq.gaffer.operation.impl.add.AddElementsFromFile.getParallelism (Showing top 1 results out of 315)

origin: uk.gov.gchq.gaffer/flink-library

  @Override
  public Object doOperation(final AddElementsFromFile op, final Context context, final Store store) throws OperationException {
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    if (null != op.getParallelism()) {
      env.setParallelism(op.getParallelism());
    }

    final FlatMapOperator<String, Element> builder =
        env.readTextFile(op.getFilename())
            .flatMap(new GafferMapFunction(String.class, op.getElementGenerator()));

    if (Boolean.parseBoolean(op.getOption(FlinkConstants.SKIP_REBALANCING))) {
      builder.output(new GafferOutput(op, store));
    } else {
      builder.rebalance().output(new GafferOutput(op, store));
    }

    try {
      env.execute(op.getClass().getSimpleName() + "-" + op.getFilename());
    } catch (final Exception e) {
      throw new OperationException("Failed to add elements from file: " + op.getFilename(), e);
    }

    return null;
  }
}
uk.gov.gchq.gaffer.operation.impl.addAddElementsFromFilegetParallelism

Popular methods of AddElementsFromFile

  • getElementGenerator
  • getFilename
  • getOption

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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