Interface RowPipe

  • All Superinterfaces:
    TableSink
    All Known Implementing Classes:
    OnceRowPipe

    public interface RowPipe
    extends TableSink
    TableSink implementation whose returned table reads concurrently from rows written into it. Some of the methods may block, and the reading and writing have to be done in different threads.

    This serves almost the same purpose as a RowStore, but has a subtly different contract. Instead of RowStore's RowStore.getStarTable() method, which must be called after the endRows method, it provides a waitForStarTable() method which may be called before any or all rows have been written, but on a different thread. This blocks until the metadata has been supplied.

    Since:
    9 Aug 2007
    Author:
    Mark Taylor
    • Method Detail

      • waitForStarTable

        StarTable waitForStarTable()
                            throws java.io.IOException
        Returns a table whose data is supplied by that written into this sink. Reads from this table should be called on a separate thread from the one which is writing into this sink. It will block until TableSink.acceptMetadata(uk.ac.starlink.table.StarTable) has been called.
        Returns:
        table
        Throws:
        java.io.IOException
      • setError

        void setError​(java.io.IOException e)
        May be called by the writing stream to set an I/O error on the pipe. This error should be passed on to the reading end by throwing an error with e as its cause from one of the read methods. If an error has already been set by a previous call of this method, this has no effect (only the first error is set).
        Parameters:
        e - exception to pass to readers