Codota Logo
StreamExecutionEnvironment.addOperator
Code IndexAdd Codota 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)

  • Common ways to obtain StreamExecutionEnvironment
private void myMethod () {
StreamExecutionEnvironment s =
  • Codota IconStreamExecutionEnvironment.getExecutionEnvironment()
  • Codota IconStreamExecutionEnvironment.createLocalEnvironment()
  • Smart code suggestions by Codota
}
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

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • onCreateOptionsMenu (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now