org.apache.flink.api.common.io.OutputFormat.open()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(116)

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

OutputFormat.open介绍

[英]Opens a parallel instance of the output format to store the result of its parallel instance.

When this method is called, the output format it guaranteed to be configured.
[中]打开输出格式的并行实例以存储其并行实例的结果。
调用此方法时,输出格式必须保证配置。

代码示例

代码示例来源:origin: apache/flink

@Override
public void open(Configuration parameters) throws Exception {
  RuntimeContext context = getRuntimeContext();
  format.configure(parameters);
  int indexInSubtaskGroup = context.getIndexOfThisSubtask();
  int currentNumberOfSubtasks = context.getNumberOfParallelSubtasks();
  format.open(indexInSubtaskGroup, currentNumberOfSubtasks);
}

代码示例来源:origin: apache/flink

((RichOutputFormat<?>) format).setRuntimeContext(ctx);
format.open(0, 1);
for (IN element : inputData) {
  format.writeRecord(element);

代码示例来源:origin: dbs-leipzig/gradoop

@Override
public void writeRecord(IT record) throws IOException {
 String subDirectory = getDirectoryForRecord(record);
 OutputFormat<IT> format;
 if (formatsPerSubdirectory.containsKey(subDirectory)) {
  format = formatsPerSubdirectory.get(subDirectory);
 } else {
  format = createFormatForDirectory(new Path(rootOutputPath, subDirectory));
  format.open(taskNumber, numTasks);
  formatsPerSubdirectory.put(subDirectory, format);
 }
 format.writeRecord(record);
}

代码示例来源:origin: org.gradoop/gradoop-flink

@Override
public void writeRecord(IT record) throws IOException {
 String subDirectory = getDirectoryForRecord(record);
 OutputFormat<IT> format;
 if (formatsPerSubdirectory.containsKey(subDirectory)) {
  format = formatsPerSubdirectory.get(subDirectory);
 } else {
  format = createFormatForDirectory(new Path(rootOutputPath, subDirectory));
  format.open(taskNumber, numTasks);
  formatsPerSubdirectory.put(subDirectory, format);
 }
 format.writeRecord(record);
}

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

@Override
public void open(Configuration parameters) throws Exception {
  RuntimeContext context = getRuntimeContext();
  format.configure(parameters);
  int indexInSubtaskGroup = context.getIndexOfThisSubtask();
  int currentNumberOfSubtasks = context.getNumberOfParallelSubtasks();
  format.open(indexInSubtaskGroup, currentNumberOfSubtasks);
}

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

@Override
public void open(Configuration parameters) throws Exception {
  RuntimeContext context = getRuntimeContext();
  format.configure(parameters);
  int indexInSubtaskGroup = context.getIndexOfThisSubtask();
  int currentNumberOfSubtasks = context.getNumberOfParallelSubtasks();
  format.open(indexInSubtaskGroup, currentNumberOfSubtasks);
}

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

@Override
public void open(Configuration parameters) throws Exception {
  RuntimeContext context = getRuntimeContext();
  format.configure(parameters);
  int indexInSubtaskGroup = context.getIndexOfThisSubtask();
  int currentNumberOfSubtasks = context.getNumberOfParallelSubtasks();
  format.open(indexInSubtaskGroup, currentNumberOfSubtasks);
}

代码示例来源:origin: com.alibaba.blink/flink-core

((RichOutputFormat<?>) format).setRuntimeContext(ctx);
format.open(0, 1);
for (IN element : inputData) {
  format.writeRecord(element);

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

((RichOutputFormat<?>) format).setRuntimeContext(ctx);
format.open(0, 1);
for (IN element : inputData) {
  format.writeRecord(element);

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

format.open(this.getEnvironment().getTaskInfo().getIndexOfThisSubtask(), this.getEnvironment().getTaskInfo().getNumberOfParallelSubtasks());

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

format.open(this.getEnvironment().getTaskInfo().getIndexOfThisSubtask(), this.getEnvironment().getTaskInfo().getNumberOfParallelSubtasks());

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

format.open(this.getEnvironment().getTaskInfo().getIndexOfThisSubtask(), this.getEnvironment().getTaskInfo().getNumberOfParallelSubtasks());

代码示例来源:origin: com.alibaba.blink/flink-runtime

format.open(this.getEnvironment().getTaskInfo().getIndexOfThisSubtask(), this.getEnvironment().getTaskInfo().getNumberOfParallelSubtasks());

相关文章