public class RowCountResultRowDownstream extends java.lang.Object implements RowReceiver
Constructor and Description |
---|
RowCountResultRowDownstream(com.google.common.util.concurrent.SettableFuture<TaskResult> result) |
Modifier and Type | Method and Description |
---|---|
void |
fail(java.lang.Throwable throwable)
Is called from the upstream in case of a failure.
|
void |
finish()
Called from the upstream to indicate that all rows are sent.
|
void |
kill(java.lang.Throwable throwable)
kill a RowReceiver to stop it's execution.
|
void |
prepare()
prepares / starts the RowReceiver, after this call it must be ready to receive rows
|
java.util.Set<Requirement> |
requirements()
specifies which requirements a downstream requires from an upstream in order to work correctly.
|
boolean |
setNextRow(Row row)
Feed the downstream with the next input row.
|
void |
setUpstream(RowUpstream rowUpstream)
an RowUpstream who wants to call
RowReceiver.setNextRow(Row) calls setUpstream before he starts sending rows
so that the RowReceiver can call pause/resume on the upstream. |
public RowCountResultRowDownstream(com.google.common.util.concurrent.SettableFuture<TaskResult> result)
public boolean setNextRow(Row row)
RowReceiver
false
,
true
otherwise.
Any upstream who calls this methods must call RowReceiver.setUpstream(RowUpstream)
exactly once
so that the receiver is able to call pause/resume on its upstream.
RowReceiver.finish()
and RowReceiver.fail(Throwable)
may be called without calling setUpstream if there are no rows.setNextRow
in interface RowReceiver
row
- the next row - the row is usually a shared object and the instances content change after the
setNextRow call.public void finish()
RowReceiver
finish
in interface RowReceiver
public void fail(java.lang.Throwable throwable)
RowReceiver
fail
in interface RowReceiver
throwable
- the cause of the fail
NOTE: This method must not throw any exceptions!public void kill(java.lang.Throwable throwable)
RowReceiver
kill
in interface RowReceiver
public void prepare()
RowReceiver
prepare
in interface RowReceiver
public java.util.Set<Requirement> requirements()
RowReceiver
requirements
in interface RowReceiver
public void setUpstream(RowUpstream rowUpstream)
RowReceiver
RowReceiver.setNextRow(Row)
calls setUpstream before he starts sending rows
so that the RowReceiver can call pause/resume on the upstream.setUpstream
in interface RowReceiver