Java Code Examples for org.apache.flink.api.common.io.FileOutputFormat#setOutputFilePath()
The following examples show how to use
org.apache.flink.api.common.io.FileOutputFormat#setOutputFilePath() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaskTestBase.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
public void registerFileOutputTask(FileOutputFormat<Record> outputFormat, String outPath) { TaskConfig dsConfig = new TaskConfig(this.mockEnv.getTaskConfiguration()); outputFormat.setOutputFilePath(new Path(outPath)); outputFormat.setWriteMode(WriteMode.OVERWRITE); dsConfig.setStubWrapper(new UserCodeObjectWrapper<>(outputFormat)); }
Example 2
Source File: TaskTestBase.java From flink with Apache License 2.0 | 5 votes |
public void registerFileOutputTask( FileOutputFormat<Record> outputFormat, String outPath, Configuration formatParams) { outputFormat.setOutputFilePath(new Path(outPath)); outputFormat.setWriteMode(WriteMode.OVERWRITE); OperatorID operatorID = new OperatorID(); new InputOutputFormatContainer(Thread.currentThread().getContextClassLoader()) .addOutputFormat(operatorID, outputFormat) .addParameters(operatorID, formatParams) .write(new TaskConfig(this.mockEnv.getTaskConfiguration())); }
Example 3
Source File: TaskTestBase.java From flink with Apache License 2.0 | 5 votes |
public void registerFileOutputTask( FileOutputFormat<Record> outputFormat, String outPath, Configuration formatParams) { outputFormat.setOutputFilePath(new Path(outPath)); outputFormat.setWriteMode(WriteMode.OVERWRITE); OperatorID operatorID = new OperatorID(); new InputOutputFormatContainer(Thread.currentThread().getContextClassLoader()) .addOutputFormat(operatorID, outputFormat) .addParameters(operatorID, formatParams) .write(new TaskConfig(this.mockEnv.getTaskConfiguration())); }
Example 4
Source File: DataSet.java From Flink-CEPplus with Apache License 2.0 | 3 votes |
/** * Writes a DataSet using a {@link FileOutputFormat} to a specified location. * This method adds a data sink to the program. * * @param outputFormat The FileOutputFormat to write the DataSet. * @param filePath The path to the location where the DataSet is written. * @return The DataSink that writes the DataSet. * * @see FileOutputFormat */ public DataSink<T> write(FileOutputFormat<T> outputFormat, String filePath) { Preconditions.checkNotNull(filePath, "File path must not be null."); Preconditions.checkNotNull(outputFormat, "Output format must not be null."); outputFormat.setOutputFilePath(new Path(filePath)); return output(outputFormat); }
Example 5
Source File: DataSet.java From Flink-CEPplus with Apache License 2.0 | 3 votes |
/** * Writes a DataSet using a {@link FileOutputFormat} to a specified location. * This method adds a data sink to the program. * * @param outputFormat The FileOutputFormat to write the DataSet. * @param filePath The path to the location where the DataSet is written. * @param writeMode The mode of writing, indicating whether to overwrite existing files. * @return The DataSink that writes the DataSet. * * @see FileOutputFormat */ public DataSink<T> write(FileOutputFormat<T> outputFormat, String filePath, WriteMode writeMode) { Preconditions.checkNotNull(filePath, "File path must not be null."); Preconditions.checkNotNull(writeMode, "Write mode must not be null."); Preconditions.checkNotNull(outputFormat, "Output format must not be null."); outputFormat.setOutputFilePath(new Path(filePath)); outputFormat.setWriteMode(writeMode); return output(outputFormat); }
Example 6
Source File: DataSet.java From flink with Apache License 2.0 | 3 votes |
/** * Writes a DataSet using a {@link FileOutputFormat} to a specified location. * This method adds a data sink to the program. * * @param outputFormat The FileOutputFormat to write the DataSet. * @param filePath The path to the location where the DataSet is written. * @return The DataSink that writes the DataSet. * * @see FileOutputFormat */ public DataSink<T> write(FileOutputFormat<T> outputFormat, String filePath) { Preconditions.checkNotNull(filePath, "File path must not be null."); Preconditions.checkNotNull(outputFormat, "Output format must not be null."); outputFormat.setOutputFilePath(new Path(filePath)); return output(outputFormat); }
Example 7
Source File: DataSet.java From flink with Apache License 2.0 | 3 votes |
/** * Writes a DataSet using a {@link FileOutputFormat} to a specified location. * This method adds a data sink to the program. * * @param outputFormat The FileOutputFormat to write the DataSet. * @param filePath The path to the location where the DataSet is written. * @param writeMode The mode of writing, indicating whether to overwrite existing files. * @return The DataSink that writes the DataSet. * * @see FileOutputFormat */ public DataSink<T> write(FileOutputFormat<T> outputFormat, String filePath, WriteMode writeMode) { Preconditions.checkNotNull(filePath, "File path must not be null."); Preconditions.checkNotNull(writeMode, "Write mode must not be null."); Preconditions.checkNotNull(outputFormat, "Output format must not be null."); outputFormat.setOutputFilePath(new Path(filePath)); outputFormat.setWriteMode(writeMode); return output(outputFormat); }
Example 8
Source File: DataSet.java From flink with Apache License 2.0 | 3 votes |
/** * Writes a DataSet using a {@link FileOutputFormat} to a specified location. * This method adds a data sink to the program. * * @param outputFormat The FileOutputFormat to write the DataSet. * @param filePath The path to the location where the DataSet is written. * @return The DataSink that writes the DataSet. * * @see FileOutputFormat */ public DataSink<T> write(FileOutputFormat<T> outputFormat, String filePath) { Preconditions.checkNotNull(filePath, "File path must not be null."); Preconditions.checkNotNull(outputFormat, "Output format must not be null."); outputFormat.setOutputFilePath(new Path(filePath)); return output(outputFormat); }
Example 9
Source File: DataSet.java From flink with Apache License 2.0 | 3 votes |
/** * Writes a DataSet using a {@link FileOutputFormat} to a specified location. * This method adds a data sink to the program. * * @param outputFormat The FileOutputFormat to write the DataSet. * @param filePath The path to the location where the DataSet is written. * @param writeMode The mode of writing, indicating whether to overwrite existing files. * @return The DataSink that writes the DataSet. * * @see FileOutputFormat */ public DataSink<T> write(FileOutputFormat<T> outputFormat, String filePath, WriteMode writeMode) { Preconditions.checkNotNull(filePath, "File path must not be null."); Preconditions.checkNotNull(writeMode, "Write mode must not be null."); Preconditions.checkNotNull(outputFormat, "Output format must not be null."); outputFormat.setOutputFilePath(new Path(filePath)); outputFormat.setWriteMode(writeMode); return output(outputFormat); }