Interface Readable<O>

  • Type Parameters:
    O - output type.
    All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    BoundedIteratorReadable

    public interface Readable<O>
    extends java.io.Serializable
    Interface for readable.
    • Method Detail

      • prepare

        void prepare()
        Prepare reading data.
      • readCurrent

        O readCurrent()
        Method to read current data from the source. The caller should check whether the Readable is finished or not by using isFinished() method before calling this method.
        Returns:
        a data read by the readable.
      • readWatermark

        long readWatermark()
        Read watermark.
        Returns:
        watermark
      • isFinished

        boolean isFinished()
        Returns:
        true if it reads all data.
      • getLocations

        java.util.List<java.lang.String> getLocations()
                                               throws java.lang.Exception
        Returns the list of locations where this readable resides. Each location has a complete copy of the readable.
        Returns:
        List of locations where this readable resides
        Throws:
        java.lang.UnsupportedOperationException - when this operation is not supported
        java.lang.Exception - any other exceptions on the way
      • close

        void close()
            throws java.io.IOException
        Close.
        Throws:
        java.io.IOException - if file-based reader throws any.