Package org.apache.wayang.flink.compiler
Class WayangFileOutputFormat<IT>
java.lang.Object
org.apache.flink.api.common.io.RichOutputFormat<IT>
org.apache.flink.api.common.io.FileOutputFormat<IT>
org.apache.wayang.flink.compiler.WayangFileOutputFormat<IT>
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.io.CleanupWhenUnsuccessful,org.apache.flink.api.common.io.InitializeOnMaster,org.apache.flink.api.common.io.OutputFormat<IT>
public class WayangFileOutputFormat<IT>
extends org.apache.flink.api.common.io.FileOutputFormat<IT>
implements org.apache.flink.api.common.io.InitializeOnMaster, org.apache.flink.api.common.io.CleanupWhenUnsuccessful
Wrapper for
FileOutputFormat- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classWrites a block info at the end of the blocks.
Current implementation uses only int and not long.Nested classes/interfaces inherited from class org.apache.flink.api.common.io.FileOutputFormat
org.apache.flink.api.common.io.FileOutputFormat.OutputDirectoryModeNested classes/interfaces inherited from interface org.apache.flink.api.common.io.OutputFormat
org.apache.flink.api.common.io.OutputFormat.InitializationContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe config parameter which defines the fixed length of a record.static final StringThe key under which the name of the target path is stored in the configuration.static final longprotected org.apache.flink.core.fs.PathThe path of the file to be written.protected org.apache.flink.core.fs.FSDataOutputStreamThe stream to which the data is written; -
Constructor Summary
ConstructorsConstructorDescriptionWayangFileOutputFormat(String path) WayangFileOutputFormat(org.apache.flink.core.fs.Path outputPath) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidcomplementBlockInfo(org.apache.flink.api.common.io.BlockInfo blockInfo) voidconfigure(org.apache.flink.configuration.Configuration parameters) protected org.apache.flink.api.common.io.BlockInfoprotected StringgetDirectoryFileName(int taskNumber) org.apache.flink.api.common.io.FileOutputFormat.OutputDirectoryModeorg.apache.flink.core.fs.Pathorg.apache.flink.core.fs.FileSystem.WriteModestatic voidinitDefaultsFromConfiguration(org.apache.flink.configuration.Configuration configuration) Initialize defaults for output format.voidinitializeGlobal(int parallelism) Initialization of the distributed file system if it is used.voidopen(int taskNumber, int numTasks) voidsetOutputDirectoryMode(org.apache.flink.api.common.io.FileOutputFormat.OutputDirectoryMode mode) voidsetOutputFilePath(org.apache.flink.core.fs.Path path) voidsetWriteMode(org.apache.flink.core.fs.FileSystem.WriteMode mode) voidvoidwriteRecord(IT record) Methods inherited from class org.apache.flink.api.common.io.RichOutputFormat
getRuntimeContext, setRuntimeContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.api.common.io.OutputFormat
open
-
Field Details
-
FILE_PARAMETER_KEY
The key under which the name of the target path is stored in the configuration.- See Also:
-
outputFilePath
protected org.apache.flink.core.fs.Path outputFilePathThe path of the file to be written. -
stream
protected transient org.apache.flink.core.fs.FSDataOutputStream streamThe stream to which the data is written; -
BLOCK_SIZE_PARAMETER_KEY
The config parameter which defines the fixed length of a record.- See Also:
-
NATIVE_BLOCK_SIZE
public static final long NATIVE_BLOCK_SIZE- See Also:
-
-
Constructor Details
-
WayangFileOutputFormat
public WayangFileOutputFormat() -
WayangFileOutputFormat
-
WayangFileOutputFormat
public WayangFileOutputFormat(org.apache.flink.core.fs.Path outputPath)
-
-
Method Details
-
initDefaultsFromConfiguration
public static void initDefaultsFromConfiguration(org.apache.flink.configuration.Configuration configuration) Initialize defaults for output format. Needs to be a static method because it is configured for local cluster execution, see LocalFlinkMiniCluster.- Parameters:
configuration- The configuration to load defaults from
-
setOutputFilePath
public void setOutputFilePath(org.apache.flink.core.fs.Path path) - Overrides:
setOutputFilePathin classorg.apache.flink.api.common.io.FileOutputFormat<IT>
-
getOutputFilePath
public org.apache.flink.core.fs.Path getOutputFilePath()- Overrides:
getOutputFilePathin classorg.apache.flink.api.common.io.FileOutputFormat<IT>
-
setWriteMode
public void setWriteMode(org.apache.flink.core.fs.FileSystem.WriteMode mode) - Overrides:
setWriteModein classorg.apache.flink.api.common.io.FileOutputFormat<IT>
-
getWriteMode
public org.apache.flink.core.fs.FileSystem.WriteMode getWriteMode()- Overrides:
getWriteModein classorg.apache.flink.api.common.io.FileOutputFormat<IT>
-
setOutputDirectoryMode
public void setOutputDirectoryMode(org.apache.flink.api.common.io.FileOutputFormat.OutputDirectoryMode mode) - Overrides:
setOutputDirectoryModein classorg.apache.flink.api.common.io.FileOutputFormat<IT>
-
getOutputDirectoryMode
public org.apache.flink.api.common.io.FileOutputFormat.OutputDirectoryMode getOutputDirectoryMode()- Overrides:
getOutputDirectoryModein classorg.apache.flink.api.common.io.FileOutputFormat<IT>
-
configure
public void configure(org.apache.flink.configuration.Configuration parameters) -
open
- Specified by:
openin interfaceorg.apache.flink.api.common.io.OutputFormat<IT>- Overrides:
openin classorg.apache.flink.api.common.io.FileOutputFormat<IT>- Throws:
IOException
-
writeRecord
- Specified by:
writeRecordin interfaceorg.apache.flink.api.common.io.OutputFormat<IT>- Throws:
IOException
-
getDirectoryFileName
- Overrides:
getDirectoryFileNamein classorg.apache.flink.api.common.io.FileOutputFormat<IT>
-
close
- Specified by:
closein interfaceorg.apache.flink.api.common.io.OutputFormat<IT>- Overrides:
closein classorg.apache.flink.api.common.io.FileOutputFormat<IT>- Throws:
IOException
-
initializeGlobal
Initialization of the distributed file system if it is used.- Specified by:
initializeGlobalin interfaceorg.apache.flink.api.common.io.InitializeOnMaster- Overrides:
initializeGlobalin classorg.apache.flink.api.common.io.FileOutputFormat<IT>- Parameters:
parallelism- The task parallelism.- Throws:
IOException
-
tryCleanupOnError
public void tryCleanupOnError()- Specified by:
tryCleanupOnErrorin interfaceorg.apache.flink.api.common.io.CleanupWhenUnsuccessful- Overrides:
tryCleanupOnErrorin classorg.apache.flink.api.common.io.FileOutputFormat<IT>
-
createBlockInfo
protected org.apache.flink.api.common.io.BlockInfo createBlockInfo() -
complementBlockInfo
protected void complementBlockInfo(org.apache.flink.api.common.io.BlockInfo blockInfo)
-