Tabnine Logo
AddElementsFromSocket.getHostname
Code IndexAdd Tabnine to your IDE (free)

How to use
getHostname
method
in
uk.gov.gchq.gaffer.operation.impl.add.AddElementsFromSocket

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

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

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

    final DataStream<Element> builder =
        env.socketTextStream(op.getHostname(), op.getPort(), op.getDelimiter())
            .flatMap(new GafferMapFunction(String.class, op.getElementGenerator()));

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

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

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

Popular methods of AddElementsFromSocket

  • getDelimiter
  • getElementGenerator
  • getOption
  • getParallelism
  • getPort

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • compareTo (BigDecimal)
  • putExtra (Intent)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Github Copilot alternatives
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