Class TimestampedFileInputSplit
- java.lang.Object
-
- org.apache.flink.core.io.LocatableInputSplit
-
- org.apache.flink.core.fs.FileInputSplit
-
- org.apache.flink.streaming.api.functions.source.TimestampedFileInputSplit
-
- All Implemented Interfaces:
Serializable
,Comparable<TimestampedInputSplit>
,InputSplit
,TimestampedInputSplit
public class TimestampedFileInputSplit extends FileInputSplit implements TimestampedInputSplit
AFileInputSplit
withTimestampedInputSplit
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TimestampedFileInputSplit(long modificationTime, int num, Path file, long start, long length, String[] hosts)
Creates aTimestampedFileInputSplit
based on the file modification time and the rest of the information of theFileInputSplit
, as returned by the underlying filesystem.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(TimestampedInputSplit o)
boolean
equals(Object o)
long
getModificationTime()
Serializable
getSplitState()
int
hashCode()
void
setSplitState(Serializable state)
Sets the state of the split.String
toString()
-
Methods inherited from class org.apache.flink.core.fs.FileInputSplit
getLength, getPath, getStart
-
Methods inherited from class org.apache.flink.core.io.LocatableInputSplit
getHostnames, getSplitNumber
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.core.io.InputSplit
getSplitNumber
-
Methods inherited from interface org.apache.flink.streaming.api.functions.source.TimestampedInputSplit
resetSplitState
-
-
-
-
Constructor Detail
-
TimestampedFileInputSplit
public TimestampedFileInputSplit(long modificationTime, int num, Path file, long start, long length, String[] hosts)
Creates aTimestampedFileInputSplit
based on the file modification time and the rest of the information of theFileInputSplit
, as returned by the underlying filesystem.- Parameters:
modificationTime
- the modification file of the file this split belongs tonum
- the number of this input splitfile
- the file namestart
- the position of the first byte in the file to processlength
- the number of bytes in the file to process (-1 is flag for "read whole file")hosts
- the list of hosts containing the block, possiblynull
-
-
Method Detail
-
setSplitState
public void setSplitState(Serializable state)
Sets the state of the split. This information is used when restoring from a checkpoint and allows to resume reading the underlying file from the point we left off.* This is applicable to
FileInputFormats
that implement theCheckpointableInputFormat
interface.- Specified by:
setSplitState
in interfaceTimestampedInputSplit
-
getSplitState
public Serializable getSplitState()
- Specified by:
getSplitState
in interfaceTimestampedInputSplit
- Returns:
- the state of the split.
-
getModificationTime
public long getModificationTime()
- Specified by:
getModificationTime
in interfaceTimestampedInputSplit
- Returns:
- The modification time of the file this split belongs to.
-
compareTo
public int compareTo(TimestampedInputSplit o)
- Specified by:
compareTo
in interfaceComparable<TimestampedInputSplit>
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classFileInputSplit
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classFileInputSplit
-
toString
public String toString()
- Overrides:
toString
in classFileInputSplit
-
-