Tabnine Logo
AddElementsFromKafka.getGroupId
Code IndexAdd Tabnine to your IDE (free)

How to use
getGroupId
method
in
uk.gov.gchq.gaffer.operation.impl.add.AddElementsFromKafka

Best Java code snippets using uk.gov.gchq.gaffer.operation.impl.add.AddElementsFromKafka.getGroupId (Showing top 2 results out of 315)

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

  private Properties createFlinkProperties(final AddElementsFromKafka operation) {
    final Properties properties = new Properties();
    if (null != operation.getOptions()) {
      properties.putAll(operation.getOptions());
    }
    properties.put(FLINK_KAFKA_GROUP_ID, operation.getGroupId());
    properties.put(FLINK_KAFKA_BOOTSTRAP_SERVERS, StringUtils.join(operation.getBootstrapServers(), ","));
    properties.remove(FlinkConstants.SKIP_REBALANCING);
    return properties;
  }
}
origin: uk.gov.gchq.gaffer/flink-library

@Override
public Object doOperation(final AddElementsFromKafka op, final Context context, final Store store) throws OperationException {
  final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
  if (null != op.getParallelism()) {
    env.setParallelism(op.getParallelism());
  }
  final GafferMapFunction function = new GafferMapFunction(op.getConsumeAs(), op.getElementGenerator());
  final DataStream<Element> builder = env.addSource(
      new FlinkKafkaConsumer010<>(
          op.getTopic(),
          function.getSerialisationType(),
          createFlinkProperties(op)))
      .flatMap(function);
  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.getGroupId() + "-" + op.getTopic());
  } catch (final Exception e) {
    throw new OperationException("Failed to add elements from Kafka topic: " + op.getTopic(), e);
  }
  return null;
}
uk.gov.gchq.gaffer.operation.impl.addAddElementsFromKafkagetGroupId

Popular methods of AddElementsFromKafka

  • getBootstrapServers
  • getConsumeAs
  • getElementGenerator
  • getOption
  • getOptions
  • getParallelism
  • getTopic

Popular in Java

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
  • Menu (java.awt)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • BoxLayout (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top Vim plugins
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