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>, org.apache.flink.core.io.InputSplit, TimestampedInputSplit

public class TimestampedFileInputSplit extends org.apache.flink.core.fs.FileInputSplit implements TimestampedInputSplit
A FileInputSplit with TimestampedInputSplit.
See Also:
  • Constructor Details

    • TimestampedFileInputSplit

      public TimestampedFileInputSplit(long modificationTime, int num, org.apache.flink.core.fs.Path file, long start, long length, String[] hosts)
      Creates a TimestampedFileInputSplit based on the file modification time and the rest of the information of the FileInputSplit, as returned by the underlying filesystem.
      Parameters:
      modificationTime - the modification file of the file this split belongs to
      num - the number of this input split
      file - the file name
      start - the position of the first byte in the file to process
      length - the number of bytes in the file to process (-1 is flag for "read whole file")
      hosts - the list of hosts containing the block, possibly null
  • Method Details

    • 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 the CheckpointableInputFormat interface.

      Specified by:
      setSplitState in interface TimestampedInputSplit
    • getSplitState

      public Serializable getSplitState()
      Specified by:
      getSplitState in interface TimestampedInputSplit
      Returns:
      the state of the split.
    • getModificationTime

      public long getModificationTime()
      Specified by:
      getModificationTime in interface TimestampedInputSplit
      Returns:
      The modification time of the file this split belongs to.
    • compareTo

      public int compareTo(TimestampedInputSplit o)
      Specified by:
      compareTo in interface Comparable<TimestampedInputSplit>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class org.apache.flink.core.fs.FileInputSplit
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.apache.flink.core.fs.FileInputSplit
    • toString

      public String toString()
      Overrides:
      toString in class org.apache.flink.core.fs.FileInputSplit