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, extProcOutStreampartitionNumber| Constructor and Description |
|---|
ExternalProcessFixedLengthInputFormat() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Configuration parameters) |
Record |
nextRecord(Record reuse) |
void |
open(GenericInputSplit split) |
boolean |
reachedEnd() |
abstract boolean |
readBytes(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, waitForProcessToFinishcreateInputSplits, getInputSplitAssigner, getStatisticspublic static final String RECORDLENGTH_PARAMETER_KEY
protected int recordLength
public ExternalProcessFixedLengthInputFormat()
public abstract boolean readBytes(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(Configuration parameters)
configure in interface InputFormat<Record,GenericInputSplit>configure in class ExternalProcessInputFormat<T extends ExternalProcessInputSplit>public void setTargetReadBufferSize(int targetReadBufferSize)
targetReadBufferSize - The target size of the read buffer.public void open(GenericInputSplit split) throws IOException
open in interface InputFormat<Record,GenericInputSplit>open in class ExternalProcessInputFormat<T extends ExternalProcessInputSplit>IOExceptionpublic boolean reachedEnd()
throws IOException
IOExceptionpublic Record nextRecord(Record reuse) throws IOException
IOExceptionCopyright © 2015 The Apache Software Foundation. All rights reserved.