Tabnine Logo
StreamExecutionEnvironment.addOperator
Code IndexAdd Tabnine to your IDE (free)

How to use
addOperator
method
in
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment

Best Java code snippets using org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addOperator (Showing top 20 results out of 315)

origin: apache/flink

/**
 * Method for passing user defined operators along with the type
 * information that will transform the DataStream.
 *
 * @param operatorName
 *            name of the operator, for logging purposes
 * @param outTypeInfo
 *            the output type of the operator
 * @param operator
 *            the object containing the transformation logic
 * @param <R>
 *            type of the return stream
 * @return the data stream constructed
 */
@PublicEvolving
public <R> SingleOutputStreamOperator<R> transform(String operatorName, TypeInformation<R> outTypeInfo, OneInputStreamOperator<T, R> operator) {
  // read the output type of the input Transform to coax out errors about MissingTypeInfo
  transformation.getOutputType();
  OneInputTransformation<T, R> resultTransform = new OneInputTransformation<>(
      this.transformation,
      operatorName,
      operator,
      outTypeInfo,
      environment.getParallelism());
  @SuppressWarnings({ "unchecked", "rawtypes" })
  SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, resultTransform);
  getExecutionEnvironment().addOperator(resultTransform);
  return returnStream;
}
origin: apache/flink

/**
 * Adds the given sink to this DataStream. Only streams with sinks added
 * will be executed once the {@link StreamExecutionEnvironment#execute()}
 * method is called.
 *
 * @param sinkFunction
 *            The object containing the sink's invoke function.
 * @return The closed DataStream.
 */
public DataStreamSink<T> addSink(SinkFunction<T> sinkFunction) {
  // read the output type of the input Transform to coax out errors about MissingTypeInfo
  transformation.getOutputType();
  // configure the type if needed
  if (sinkFunction instanceof InputTypeConfigurable) {
    ((InputTypeConfigurable) sinkFunction).setInputType(getType(), getExecutionConfig());
  }
  StreamSink<T> sinkOperator = new StreamSink<>(clean(sinkFunction));
  DataStreamSink<T> sink = new DataStreamSink<>(this, sinkOperator);
  getExecutionEnvironment().addOperator(sink.getTransformation());
  return sink;
}
origin: apache/flink

SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, transform);
getExecutionEnvironment().addOperator(transform);
origin: apache/flink

@Internal
private <OUT> SingleOutputStreamOperator<OUT> transform(
    final String functionName,
    final TypeInformation<OUT> outTypeInfo,
    final TwoInputStreamOperator<IN1, IN2, OUT> operator) {
  // read the output type of the input Transforms to coax out errors about MissingTypeInfo
  inputStream1.getType();
  inputStream2.getType();
  TwoInputTransformation<IN1, IN2, OUT> transform = new TwoInputTransformation<>(
      inputStream1.getTransformation(),
      inputStream2.getTransformation(),
      functionName,
      operator,
      outTypeInfo,
      environment.getParallelism());
  if (inputStream1 instanceof KeyedStream) {
    KeyedStream<IN1, ?> keyedInput1 = (KeyedStream<IN1, ?>) inputStream1;
    TypeInformation<?> keyType1 = keyedInput1.getKeyType();
    transform.setStateKeySelectors(keyedInput1.getKeySelector(), null);
    transform.setStateKeyType(keyType1);
  }
  @SuppressWarnings({ "unchecked", "rawtypes" })
  SingleOutputStreamOperator<OUT> returnStream = new SingleOutputStreamOperator(environment, transform);
  getExecutionEnvironment().addOperator(transform);
  return returnStream;
}
origin: org.apache.flink/flink-streaming-java

/**
 * Method for passing user defined operators along with the type
 * information that will transform the DataStream.
 *
 * @param operatorName
 *            name of the operator, for logging purposes
 * @param outTypeInfo
 *            the output type of the operator
 * @param operator
 *            the object containing the transformation logic
 * @param <R>
 *            type of the return stream
 * @return the data stream constructed
 */
@PublicEvolving
public <R> SingleOutputStreamOperator<R> transform(String operatorName, TypeInformation<R> outTypeInfo, OneInputStreamOperator<T, R> operator) {
  // read the output type of the input Transform to coax out errors about MissingTypeInfo
  transformation.getOutputType();
  OneInputTransformation<T, R> resultTransform = new OneInputTransformation<>(
      this.transformation,
      operatorName,
      operator,
      outTypeInfo,
      environment.getParallelism());
  @SuppressWarnings({ "unchecked", "rawtypes" })
  SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, resultTransform);
  getExecutionEnvironment().addOperator(resultTransform);
  return returnStream;
}
origin: org.apache.flink/flink-streaming-java_2.11

/**
 * Method for passing user defined operators along with the type
 * information that will transform the DataStream.
 *
 * @param operatorName
 *            name of the operator, for logging purposes
 * @param outTypeInfo
 *            the output type of the operator
 * @param operator
 *            the object containing the transformation logic
 * @param <R>
 *            type of the return stream
 * @return the data stream constructed
 */
@PublicEvolving
public <R> SingleOutputStreamOperator<R> transform(String operatorName, TypeInformation<R> outTypeInfo, OneInputStreamOperator<T, R> operator) {
  // read the output type of the input Transform to coax out errors about MissingTypeInfo
  transformation.getOutputType();
  OneInputTransformation<T, R> resultTransform = new OneInputTransformation<>(
      this.transformation,
      operatorName,
      operator,
      outTypeInfo,
      environment.getParallelism());
  @SuppressWarnings({ "unchecked", "rawtypes" })
  SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, resultTransform);
  getExecutionEnvironment().addOperator(resultTransform);
  return returnStream;
}
origin: org.apache.flink/flink-streaming-java_2.10

/**
 * Method for passing user defined operators along with the type
 * information that will transform the DataStream.
 *
 * @param operatorName
 *            name of the operator, for logging purposes
 * @param outTypeInfo
 *            the output type of the operator
 * @param operator
 *            the object containing the transformation logic
 * @param <R>
 *            type of the return stream
 * @return the data stream constructed
 */
@PublicEvolving
public <R> SingleOutputStreamOperator<R> transform(String operatorName, TypeInformation<R> outTypeInfo, OneInputStreamOperator<T, R> operator) {
  // read the output type of the input Transform to coax out errors about MissingTypeInfo
  transformation.getOutputType();
  OneInputTransformation<T, R> resultTransform = new OneInputTransformation<>(
      this.transformation,
      operatorName,
      operator,
      outTypeInfo,
      environment.getParallelism());
  @SuppressWarnings({ "unchecked", "rawtypes" })
  SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, resultTransform);
  getExecutionEnvironment().addOperator(resultTransform);
  return returnStream;
}
origin: org.apache.beam/beam-runners-flink

keyedStream.getExecutionEnvironment().addOperator(rawFlinkTransform);
origin: org.apache.beam/beam-runners-flink_2.10

keyedStream.getExecutionEnvironment().addOperator(rawFlinkTransform);
origin: org.apache.flink/flink-streaming-java_2.11

/**
 * Adds the given sink to this DataStream. Only streams with sinks added
 * will be executed once the {@link StreamExecutionEnvironment#execute()}
 * method is called.
 *
 * @param sinkFunction
 *            The object containing the sink's invoke function.
 * @return The closed DataStream.
 */
public DataStreamSink<T> addSink(SinkFunction<T> sinkFunction) {
  // read the output type of the input Transform to coax out errors about MissingTypeInfo
  transformation.getOutputType();
  // configure the type if needed
  if (sinkFunction instanceof InputTypeConfigurable) {
    ((InputTypeConfigurable) sinkFunction).setInputType(getType(), getExecutionConfig());
  }
  StreamSink<T> sinkOperator = new StreamSink<>(clean(sinkFunction));
  DataStreamSink<T> sink = new DataStreamSink<>(this, sinkOperator);
  getExecutionEnvironment().addOperator(sink.getTransformation());
  return sink;
}
origin: org.apache.flink/flink-streaming-java

/**
 * Adds the given sink to this DataStream. Only streams with sinks added
 * will be executed once the {@link StreamExecutionEnvironment#execute()}
 * method is called.
 *
 * @param sinkFunction
 *            The object containing the sink's invoke function.
 * @return The closed DataStream.
 */
public DataStreamSink<T> addSink(SinkFunction<T> sinkFunction) {
  // read the output type of the input Transform to coax out errors about MissingTypeInfo
  transformation.getOutputType();
  // configure the type if needed
  if (sinkFunction instanceof InputTypeConfigurable) {
    ((InputTypeConfigurable) sinkFunction).setInputType(getType(), getExecutionConfig());
  }
  StreamSink<T> sinkOperator = new StreamSink<>(clean(sinkFunction));
  DataStreamSink<T> sink = new DataStreamSink<>(this, sinkOperator);
  getExecutionEnvironment().addOperator(sink.getTransformation());
  return sink;
}
origin: org.apache.flink/flink-streaming-java_2.10

/**
 * Adds the given sink to this DataStream. Only streams with sinks added
 * will be executed once the {@link StreamExecutionEnvironment#execute()}
 * method is called.
 *
 * @param sinkFunction
 *            The object containing the sink's invoke function.
 * @return The closed DataStream.
 */
public DataStreamSink<T> addSink(SinkFunction<T> sinkFunction) {
  // read the output type of the input Transform to coax out errors about MissingTypeInfo
  transformation.getOutputType();
  // configure the type if needed
  if (sinkFunction instanceof InputTypeConfigurable) {
    ((InputTypeConfigurable) sinkFunction).setInputType(getType(), getExecutionConfig());
  }
  StreamSink<T> sinkOperator = new StreamSink<>(clean(sinkFunction));
  DataStreamSink<T> sink = new DataStreamSink<>(this, sinkOperator);
  getExecutionEnvironment().addOperator(sink.getTransformation());
  return sink;
}
origin: org.apache.flink/flink-streaming-java_2.10

SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, transform);
getExecutionEnvironment().addOperator(transform);
origin: org.apache.flink/flink-streaming-java

SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, transform);
getExecutionEnvironment().addOperator(transform);
origin: org.apache.flink/flink-streaming-java_2.11

SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, transform);
getExecutionEnvironment().addOperator(transform);
origin: org.apache.flink/flink-streaming-java_2.11

@Internal
private <OUT> SingleOutputStreamOperator<OUT> transform(
    final String functionName,
    final TypeInformation<OUT> outTypeInfo,
    final TwoInputStreamOperator<IN1, IN2, OUT> operator) {
  // read the output type of the input Transforms to coax out errors about MissingTypeInfo
  inputStream1.getType();
  inputStream2.getType();
  TwoInputTransformation<IN1, IN2, OUT> transform = new TwoInputTransformation<>(
      inputStream1.getTransformation(),
      inputStream2.getTransformation(),
      functionName,
      operator,
      outTypeInfo,
      environment.getParallelism());
  if (inputStream1 instanceof KeyedStream) {
    KeyedStream<IN1, ?> keyedInput1 = (KeyedStream<IN1, ?>) inputStream1;
    TypeInformation<?> keyType1 = keyedInput1.getKeyType();
    transform.setStateKeySelectors(keyedInput1.getKeySelector(), null);
    transform.setStateKeyType(keyType1);
  }
  @SuppressWarnings({ "unchecked", "rawtypes" })
  SingleOutputStreamOperator<OUT> returnStream = new SingleOutputStreamOperator(environment, transform);
  getExecutionEnvironment().addOperator(transform);
  return returnStream;
}
origin: org.apache.flink/flink-streaming-java

@Internal
private <OUT> SingleOutputStreamOperator<OUT> transform(
    final String functionName,
    final TypeInformation<OUT> outTypeInfo,
    final TwoInputStreamOperator<IN1, IN2, OUT> operator) {
  // read the output type of the input Transforms to coax out errors about MissingTypeInfo
  inputStream1.getType();
  inputStream2.getType();
  TwoInputTransformation<IN1, IN2, OUT> transform = new TwoInputTransformation<>(
      inputStream1.getTransformation(),
      inputStream2.getTransformation(),
      functionName,
      operator,
      outTypeInfo,
      environment.getParallelism());
  if (inputStream1 instanceof KeyedStream) {
    KeyedStream<IN1, ?> keyedInput1 = (KeyedStream<IN1, ?>) inputStream1;
    TypeInformation<?> keyType1 = keyedInput1.getKeyType();
    transform.setStateKeySelectors(keyedInput1.getKeySelector(), null);
    transform.setStateKeyType(keyType1);
  }
  @SuppressWarnings({ "unchecked", "rawtypes" })
  SingleOutputStreamOperator<OUT> returnStream = new SingleOutputStreamOperator(environment, transform);
  getExecutionEnvironment().addOperator(transform);
  return returnStream;
}
origin: org.apache.beam/beam-runners-flink_2.11

keyedWorkItemStream.getExecutionEnvironment().addOperator(rawFlinkTransform);
origin: org.apache.beam/beam-runners-flink

keyedWorkItemStream.getExecutionEnvironment().addOperator(rawFlinkTransform);
origin: org.apache.beam/beam-runners-flink_2.10

keyedWorkItemStream.getExecutionEnvironment().addOperator(rawFlinkTransform);
org.apache.flink.streaming.api.environmentStreamExecutionEnvironmentaddOperator

Javadoc

Adds an operator to the list of operators that should be executed when calling #execute.

When calling #execute() only the operators that where previously added to the list are executed.

This is not meant to be used by users. The API methods that create operators must call this method.

Popular methods of StreamExecutionEnvironment

  • execute
  • getExecutionEnvironment
    Creates an execution environment that represents the context in which the program is currently execu
  • addSource
    Ads a data source with a custom type information thus opening a DataStream. Only in very special cas
  • getConfig
    Gets the config object.
  • enableCheckpointing
    Enables checkpointing for the streaming job. The distributed state of the streaming dataflow will be
  • setStreamTimeCharacteristic
    Sets the time characteristic for all streams create from this environment, e.g., processing time, ev
  • setParallelism
    Sets the parallelism for operations executed through this environment. Setting a parallelism of x he
  • fromElements
    Creates a new data stream that contains the given elements. The elements must all be of the same typ
  • setStateBackend
    Sets the state backend that describes how to store and checkpoint operator state. It defines both wh
  • createLocalEnvironment
    Creates a LocalStreamEnvironment. The local execution environment will run the program in a multi-th
  • fromCollection
    Creates a data stream from the given iterator.Because the iterator will remain unmodified until the
  • getCheckpointConfig
    Gets the checkpoint config, which defines values like checkpoint interval, delay between checkpoints
  • fromCollection,
  • getCheckpointConfig,
  • getParallelism,
  • getStreamGraph,
  • setRestartStrategy,
  • socketTextStream,
  • readTextFile,
  • generateSequence,
  • clean,
  • getStreamTimeCharacteristic

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • CodeWhisperer 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