org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator.<init>()方法的一些代码示例,展示了SingleOutputStreamOperator.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SingleOutputStreamOperator.<init>()方法的具体详情如下:
包路径:org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator
类名称:SingleOutputStreamOperator
方法名:<init>

SingleOutputStreamOperator.<init>介绍

暂无

代码示例

代码示例来源: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

SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, 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_2.10

@Override
protected DataStream<T> setConnectionType(StreamPartitioner<T> partitioner) {
  return new SingleOutputStreamOperator<>(this.getExecutionEnvironment(), new PartitionTransformation<>(this.getTransformation(), partitioner));
}

代码示例来源: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.flink/flink-streaming-java_2.10

SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, transform);

代码示例来源:origin: org.apache.flink/flink-streaming-java

SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, transform);

代码示例来源:origin: org.apache.flink/flink-streaming-java_2.11

SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, 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;
}

相关文章

微信公众号

最新文章

更多