public class SimpleTweetInputFormat extends DelimitedInputFormat<Tweet> implements ResultTypeQueryable<Tweet>
FileInputFormat.FileBaseStatistics, FileInputFormat.InputSplitOpenThread
RECORD_DELIMITER
currentSplit, ENUMERATE_NESTED_FILES_FLAG, enumerateNestedFiles, filePath, INFLATER_INPUT_STREAM_FACTORIES, minSplitSize, numSplits, openTimeout, READ_WHOLE_SPLIT_FLAG, splitLength, splitStart, stream, unsplittable
Constructor and Description |
---|
SimpleTweetInputFormat() |
Modifier and Type | Method and Description |
---|---|
TypeInformation<Tweet> |
getProducedType()
Gets the data type (as a
TypeInformation ) produced by this function or input format. |
Tweet |
nextRecord(Tweet record)
Reads the next record from the input.
|
void |
open(FileInputSplit split)
Opens the given input split.
|
Tweet |
readRecord(Tweet reuse,
byte[] bytes,
int offset,
int numBytes)
This function parses the given byte array which represents a serialized record.
|
close, configure, getBufferSize, getCharset, getCurrentState, getDelimiter, getLineLengthLimit, getNumLineSamples, getStatistics, loadConfigParameters, loadGlobalConfigParams, reachedEnd, readLine, reopen, setBufferSize, setCharset, setDelimiter, setDelimiter, setDelimiter, setLineLengthLimit, setNumLineSamples
acceptFile, createInputSplits, decorateInputStream, extractFileExtension, getFilePath, getFileStats, getInflaterInputStreamFactory, getInputSplitAssigner, getMinSplitSize, getNestedFileEnumeration, getNumSplits, getOpenTimeout, getSplitLength, getSplitStart, registerInflaterInputStreamFactory, setFilePath, setFilePath, setFilesFilter, setMinSplitSize, setNestedFileEnumeration, setNumSplits, setOpenTimeout, testForUnsplittable, toString
closeInputFormat, getRuntimeContext, openInputFormat, setRuntimeContext
public void open(FileInputSplit split) throws IOException
DelimitedInputFormat
open
in interface InputFormat<Tweet,FileInputSplit>
open
in class DelimitedInputFormat<Tweet>
split
- The input split to open.IOException
- Thrown, if the spit could not be opened due to an I/O problem.FileInputFormat.open(org.apache.flink.core.fs.FileInputSplit)
public Tweet nextRecord(Tweet record) throws IOException
InputFormat
When this method is called, the input format it guaranteed to be opened.
nextRecord
in interface InputFormat<Tweet,FileInputSplit>
nextRecord
in class DelimitedInputFormat<Tweet>
record
- Object that may be reused.IOException
- Thrown, if an I/O error occurred.public Tweet readRecord(Tweet reuse, byte[] bytes, int offset, int numBytes) throws IOException
DelimitedInputFormat
readRecord
in class DelimitedInputFormat<Tweet>
reuse
- An optionally reusable object.bytes
- Binary data of serialized records.offset
- The offset where to start to read the record data.numBytes
- The number of bytes that can be read starting at the offset position.IOException
- if the record could not be read.public TypeInformation<Tweet> getProducedType()
ResultTypeQueryable
TypeInformation
) produced by this function or input format.getProducedType
in interface ResultTypeQueryable<Tweet>
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.