Class CollectionInputFormat<T>

java.lang.Object
org.apache.flink.api.common.io.RichInputFormat<OT,org.apache.flink.core.io.GenericInputSplit>
org.apache.flink.api.common.io.GenericInputFormat<T>
org.apache.flink.streaming.api.legacy.io.CollectionInputFormat<T>
All Implemented Interfaces:
Serializable, org.apache.flink.api.common.io.InputFormat<T,org.apache.flink.core.io.GenericInputSplit>, org.apache.flink.api.common.io.NonParallelInput, org.apache.flink.core.io.InputSplitSource<org.apache.flink.core.io.GenericInputSplit>

public class CollectionInputFormat<T> extends org.apache.flink.api.common.io.GenericInputFormat<T> implements org.apache.flink.api.common.io.NonParallelInput
An input format that returns objects from a collection.
See Also:
  • Field Summary

    Fields inherited from class org.apache.flink.api.common.io.GenericInputFormat

    partitionNumber
  • Constructor Summary

    Constructors
    Constructor
    Description
    CollectionInputFormat(Collection<T> dataSet, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <X> void
    checkCollection(Collection<X> elements, Class<X> viewedAs)
     
    nextRecord(T record)
     
    void
    open(org.apache.flink.core.io.GenericInputSplit split)
     
    boolean
     
     

    Methods inherited from class org.apache.flink.api.common.io.GenericInputFormat

    close, configure, createInputSplits, getInputSplitAssigner, getStatistics

    Methods inherited from class org.apache.flink.api.common.io.RichInputFormat

    closeInputFormat, getRuntimeContext, openInputFormat, setRuntimeContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CollectionInputFormat

      public CollectionInputFormat(Collection<T> dataSet, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer)
  • Method Details

    • reachedEnd

      public boolean reachedEnd() throws IOException
      Specified by:
      reachedEnd in interface org.apache.flink.api.common.io.InputFormat<T,org.apache.flink.core.io.GenericInputSplit>
      Throws:
      IOException
    • open

      public void open(org.apache.flink.core.io.GenericInputSplit split) throws IOException
      Specified by:
      open in interface org.apache.flink.api.common.io.InputFormat<T,org.apache.flink.core.io.GenericInputSplit>
      Overrides:
      open in class org.apache.flink.api.common.io.GenericInputFormat<T>
      Throws:
      IOException
    • nextRecord

      public T nextRecord(T record) throws IOException
      Specified by:
      nextRecord in interface org.apache.flink.api.common.io.InputFormat<T,org.apache.flink.core.io.GenericInputSplit>
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • checkCollection

      public static <X> void checkCollection(Collection<X> elements, Class<X> viewedAs)