Package uk.ac.starlink.table
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'sRowStore.getStarTable()
method, which must be called after theendRows
method, it provides awaitForStarTable()
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
setError(java.io.IOException e)
May be called by the writing stream to set an I/O error on the pipe.StarTable
waitForStarTable()
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 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 untilTableSink.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 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
-
-