Package uk.ac.starlink.table
Interface RowPipe
- All Superinterfaces:
TableSink
- All Known Implementing Classes:
OnceRowPipe
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 Summary
Modifier and TypeMethodDescriptionvoid
May be called by the writing stream to set an I/O error on the pipe.Returns a table whose data is supplied by that written into this sink.Methods inherited from interface uk.ac.starlink.table.TableSink
acceptMetadata, acceptRow, endRows
-
Method Details
-
waitForStarTable
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 untilTableSink.acceptMetadata(uk.ac.starlink.table.StarTable)
has been called.- Returns:
- table
- Throws:
IOException
-
setError
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 withe
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
-