Package uk.ac.starlink.ttools.calc
Class CacheRowPipe
java.lang.Object
uk.ac.starlink.ttools.calc.CacheRowPipe
- All Implemented Interfaces:
uk.ac.starlink.table.RowPipe
,uk.ac.starlink.table.TableSink
RowPipe implementation which caches the data to provide a random-access
StarTable.
The current implementation simply delegates to a
OnceRowPipe
and caches the result before
returning it from waitForStarTable
. This is crude,
and means that the output rows don't start to come until all the input
rows have been written to the pipe (so there's not much point using a pipe).
A future implementation should get smarter with threads to improve this.
- Since:
- 14 Oct 2011
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
acceptMetadata
(uk.ac.starlink.table.StarTable meta) void
void
endRows()
void
setError
(IOException err) uk.ac.starlink.table.StarTable
Returns a multiply-readable random access table.
-
Constructor Details
-
CacheRowPipe
public CacheRowPipe()Constructor.
-
-
Method Details
-
acceptMetadata
public void acceptMetadata(uk.ac.starlink.table.StarTable meta) throws uk.ac.starlink.table.TableFormatException - Specified by:
acceptMetadata
in interfaceuk.ac.starlink.table.TableSink
- Throws:
uk.ac.starlink.table.TableFormatException
-
acceptRow
- Specified by:
acceptRow
in interfaceuk.ac.starlink.table.TableSink
- Throws:
IOException
-
endRows
- Specified by:
endRows
in interfaceuk.ac.starlink.table.TableSink
- Throws:
IOException
-
setError
- Specified by:
setError
in interfaceuk.ac.starlink.table.RowPipe
-
waitForStarTable
Returns a multiply-readable random access table.- Specified by:
waitForStarTable
in interfaceuk.ac.starlink.table.RowPipe
- Returns:
- random access, multiply readable table with the same content as the rows accepted by this pipe
- Throws:
IOException
-