uk.ac.starlink.table.OnceRowPipe2 Maven / Gradle / Ivy
package uk.ac.starlink.table;
import java.io.IOException;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.LinkedBlockingQueue;
/**
* Alternative implementation of OnceRowPipe.
*
* This should provide identical behaviour to {@link OnceRowPipe},
* but it uses java.util.concurrent
classes rather than
* doing everything by hand with java language primitives
* (synchronized/wait/notify). This implementation has not been much
* tested, but I think it looks more respectable.
* It may have different bugs to OnceRowPipe.
*
*
Streaming RowPipe
implementation which provides a one-shot
* table.
* The returned table is unusual in that it
* can only return a RowSequence
once.
* This violates the normal rules of the StarTable
interface.
* Any calls beyond the first to waitForStarTable().getRowSequence()
* will throw a {@link uk.ac.starlink.table.UnrepeatableSequenceException}.
*
* @author Mark Taylor (Starlink)
* @since 14 Nov 2014
*/
class OnceRowPipe2 implements RowPipe, RowSequence {
private final BlockingQueue