T - The type of the input split (must extend ExternalProcessInputSplit)public abstract class ExternalProcessFixedLengthInputFormat<T extends ExternalProcessInputSplit> extends ExternalProcessInputFormat<T>
Record is generated.
The external process is started outside of the JVM via a provided start command and can be an arbitrary program,
e.g., a data generator or a shell script. The input format checks the exit code of the process
to validate whether the process terminated correctly. A list of allowed exit codes can be provided.
The input format requires (ExternalProcessInputSplit objects that hold the command to execute.
Warning: This format does not consume the standard error stream (stderr) of the started process. This might cause deadlocks.| Modifier and Type | Field and Description |
|---|---|
protected int |
recordLength
fixed length of all records
|
static String |
RECORDLENGTH_PARAMETER_KEY
The config parameter which defines the fixed length of a record.
|
allowedExitCodes, ALLOWEDEXITCODES_PARAMETER_KEY, extProcErrStream, extProcOutStream| Constructor and Description |
|---|
ExternalProcessFixedLengthInputFormat() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.flink.configuration.Configuration parameters) |
org.apache.flink.types.Record |
nextRecord(org.apache.flink.types.Record reuse) |
void |
open(org.apache.flink.core.io.GenericInputSplit split) |
boolean |
reachedEnd() |
abstract boolean |
readBytes(org.apache.flink.types.Record target,
byte[] buffer,
int startPos)
Reads a record out of the given buffer.
|
void |
setTargetReadBufferSize(int targetReadBufferSize)
Sets the target size of the buffer to be used to read from the stdout stream.
|
close, waitForProcessToFinishpublic static final String RECORDLENGTH_PARAMETER_KEY
protected int recordLength
public ExternalProcessFixedLengthInputFormat()
public abstract boolean readBytes(org.apache.flink.types.Record target,
byte[] buffer,
int startPos)
target - The target Recordbuffer - The buffer containing the binary data.startPos - The start position in the byte array.public void configure(org.apache.flink.configuration.Configuration parameters)
configure in interface org.apache.flink.api.common.io.InputFormat<org.apache.flink.types.Record,org.apache.flink.core.io.GenericInputSplit>configure in class ExternalProcessInputFormat<T extends ExternalProcessInputSplit>public void setTargetReadBufferSize(int targetReadBufferSize)
targetReadBufferSize - The target size of the read buffer.public void open(org.apache.flink.core.io.GenericInputSplit split)
throws IOException
open in interface org.apache.flink.api.common.io.InputFormat<org.apache.flink.types.Record,org.apache.flink.core.io.GenericInputSplit>open in class ExternalProcessInputFormat<T extends ExternalProcessInputSplit>IOExceptionpublic boolean reachedEnd()
throws IOException
IOExceptionpublic org.apache.flink.types.Record nextRecord(org.apache.flink.types.Record reuse)
throws IOException
IOExceptionCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.