public class SimpleRiverFlow<RC extends RiverContext> extends Object implements RiverFlow<RC>
| Constructor and Description |
|---|
SimpleRiverFlow() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterFetch(RiverContext riverContext)
After the river task has completed a single run, this method is called.
|
protected void |
beforeFetch(RC riverContext)
Before a river task (or river run) starts, this method is called.
|
protected RiverMouth |
createRiverMouth(Map<String,Object> params) |
protected RiverSource |
createRiverSource(Map<String,Object> params) |
void |
execute(RC riverContext)
Execute this river flow
|
protected void |
fetch(RiverContext riverContext)
After river context and state setup, when data should be fetched from river source, this method is called.
|
protected RC |
fillRiverContext(RC riverContext,
RiverState state,
RiverSource riverSource,
RiverMouth riverMouth) |
org.elasticsearch.client.Client |
getClient()
Get the client
|
org.elasticsearch.common.metrics.MeterMetric |
getMetric()
Get metric
|
Queue<RiverContext> |
getQueue()
Get queue for RiverContext processing
|
org.elasticsearch.river.RiverName |
getRiverName()
Gets the river name
|
org.elasticsearch.common.settings.Settings |
getSettings()
Get the settings
|
void |
logMetrics(RiverContext riverContext,
String cause)
Log metrics
|
SimpleRiverFlow<RC> |
newInstance() |
RC |
newRiverContext()
Create a new river context for a river run
|
RiverFlow |
setClient(org.elasticsearch.client.Client client) |
RiverFlow |
setIngestFactory(IngestFactory ingestFactory)
Set ingest factory
|
RiverFlow |
setMetric(org.elasticsearch.common.metrics.MeterMetric meterMetric)
Set metric
|
RiverFlow |
setQueue(Queue<RiverContext> queue)
Set queue for processing RiverContext requests
|
RiverFlow |
setRiverName(org.elasticsearch.river.RiverName riverName)
Sets the river name
|
RiverFlow |
setSettings(org.elasticsearch.common.settings.Settings settings)
Set the settings
|
String |
strategy()
The name of the strategy the river flow belongs to
|
public SimpleRiverFlow()
public String strategy()
RiverFlowstrategy in interface RiverFlow<RC extends RiverContext>public SimpleRiverFlow<RC> newInstance()
newInstance in interface RiverFlow<RC extends RiverContext>public RC newRiverContext()
RiverFlownewRiverContext in interface RiverFlow<RC extends RiverContext>public RiverFlow setRiverName(org.elasticsearch.river.RiverName riverName)
RiverFlowsetRiverName in interface RiverFlow<RC extends RiverContext>riverName - the river namepublic org.elasticsearch.river.RiverName getRiverName()
RiverFlowgetRiverName in interface RiverFlow<RC extends RiverContext>public RiverFlow setSettings(org.elasticsearch.common.settings.Settings settings)
RiverFlowsetSettings in interface RiverFlow<RC extends RiverContext>settings - the settingspublic org.elasticsearch.common.settings.Settings getSettings()
RiverFlowgetSettings in interface RiverFlow<RC extends RiverContext>public RiverFlow setIngestFactory(IngestFactory ingestFactory)
RiverFlowsetIngestFactory in interface RiverFlow<RC extends RiverContext>ingestFactory - ingest factorypublic RiverFlow setClient(org.elasticsearch.client.Client client)
setClient in interface RiverFlow<RC extends RiverContext>public org.elasticsearch.client.Client getClient()
RiverFlowgetClient in interface RiverFlow<RC extends RiverContext>public void execute(RC riverContext) throws Exception
RiverFlowexecute in interface RiverFlow<RC extends RiverContext>Exceptionprotected void beforeFetch(RC riverContext) throws Exception
Exceptionprotected void fetch(RiverContext riverContext) throws Exception
Exceptionpublic RiverFlow setMetric(org.elasticsearch.common.metrics.MeterMetric meterMetric)
RiverFlowsetMetric in interface RiverFlow<RC extends RiverContext>meterMetric - the meter metricpublic org.elasticsearch.common.metrics.MeterMetric getMetric()
RiverFlowgetMetric in interface RiverFlow<RC extends RiverContext>public RiverFlow setQueue(Queue<RiverContext> queue)
RiverFlowsetQueue in interface RiverFlow<RC extends RiverContext>queue - the queuepublic Queue<RiverContext> getQueue()
RiverFlowgetQueue in interface RiverFlow<RC extends RiverContext>protected void afterFetch(RiverContext riverContext) throws Exception
Exceptionprotected RiverSource createRiverSource(Map<String,Object> params)
protected RiverMouth createRiverMouth(Map<String,Object> params) throws IOException
IOExceptionprotected RC fillRiverContext(RC riverContext, RiverState state, RiverSource riverSource, RiverMouth riverMouth) throws IOException
IOExceptionpublic void logMetrics(RiverContext riverContext, String cause)
RiverFlowlogMetrics in interface RiverFlow<RC extends RiverContext>cause - the cause why metrics are loggedelasticsearch-river-jdbc