public class IndexWriterProjector extends AbstractProjector
downstream, executionState
Constructor and Description |
---|
IndexWriterProjector(org.elasticsearch.cluster.ClusterService clusterService,
org.elasticsearch.common.settings.Settings settings,
TransportActionProvider transportActionProvider,
com.google.common.base.Supplier<java.lang.String> indexNameResolver,
BulkRetryCoordinatorPool bulkRetryCoordinatorPool,
Reference rawSourceReference,
java.util.List<ColumnIdent> primaryKeyIdents,
java.util.List<Symbol> primaryKeySymbols,
Symbol routingSymbol,
ColumnIdent clusteredByColumn,
Input<?> sourceInput,
java.lang.Iterable<? extends CollectExpression<Row,?>> collectExpressions,
java.lang.Integer bulkActions,
java.lang.String[] includes,
java.lang.String[] excludes,
boolean autoCreateIndices,
boolean overwriteDuplicates,
java.util.UUID jobId) |
Modifier and Type | Method and Description |
---|---|
void |
downstream(RowReceiver rowReceiver) |
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.
|
boolean |
setNextRow(Row row)
Feed the downstream with the next input row.
|
pause, prepare, repeat, requirements, resume, setUpstream
public IndexWriterProjector(org.elasticsearch.cluster.ClusterService clusterService, org.elasticsearch.common.settings.Settings settings, TransportActionProvider transportActionProvider, com.google.common.base.Supplier<java.lang.String> indexNameResolver, BulkRetryCoordinatorPool bulkRetryCoordinatorPool, Reference rawSourceReference, java.util.List<ColumnIdent> primaryKeyIdents, java.util.List<Symbol> primaryKeySymbols, @Nullable Symbol routingSymbol, ColumnIdent clusteredByColumn, Input<?> sourceInput, java.lang.Iterable<? extends CollectExpression<Row,?>> collectExpressions, @Nullable java.lang.Integer bulkActions, @Nullable java.lang.String[] includes, @Nullable java.lang.String[] excludes, boolean autoCreateIndices, boolean overwriteDuplicates, java.util.UUID jobId)
public void downstream(RowReceiver rowReceiver)
downstream
in interface Projector
downstream
in class AbstractProjector
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.row
- the next row - the row is usually a shared object and the instances content change after the
setNextRow call.public void finish()
RowReceiver
public void fail(java.lang.Throwable throwable)
RowReceiver
throwable
- the cause of the fail
NOTE: This method must not throw any exceptions!