public class SimpleRiverMouth extends Object implements RiverMouth<SimpleRiverContext>
| Modifier and Type | Field and Description |
|---|---|
protected SimpleRiverContext |
context |
protected String |
id |
protected String |
index |
protected Map<String,String> |
indexMappings |
protected org.elasticsearch.common.settings.Settings |
indexSettings |
protected Ingest |
ingest |
protected IngestFactory |
ingestFactory |
protected Metric |
metric |
protected boolean |
suspended |
protected String |
type |
| Constructor and Description |
|---|
SimpleRiverMouth() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterFetch()
Executed after river source fetch
|
void |
beforeFetch()
Executed before river source fetch
|
void |
delete(IndexableObject object)
Delete operation.
|
void |
flush()
Flush data to the river mouth
|
String |
getId()
Get document identifier
|
String |
getIndex()
Get default index name of this river mouth
|
Metric |
getMetric()
Get the metrics of this river mouth
|
String |
getType()
Get default index type name of this river mouth
|
void |
index(IndexableObject object,
boolean create)
Index operation.
|
SimpleRiverMouth |
newInstance()
Create a new river mouth instance
|
void |
resume()
Resume river mouth after suspend.
|
SimpleRiverMouth |
setId(String id)
Set document identifier for next document to be indexed
|
SimpleRiverMouth |
setIndex(String index)
Set default index name for this river mouth
|
SimpleRiverMouth |
setIndexSettings(org.elasticsearch.common.settings.Settings indexSettings)
Set index settings
|
SimpleRiverMouth |
setIngestFactory(IngestFactory ingestFactory)
Set ingest factory
|
SimpleRiverMouth |
setRiverContext(SimpleRiverContext context)
Set the river context
|
SimpleRiverMouth |
setType(String type)
Set default index type name for this river mouth
|
SimpleRiverMouth |
setTypeMapping(Map<String,String> typeMapping)
Set index type mappings
|
void |
shutdown()
Shutdown river mouth and release all resources, e.g.
|
String |
strategy()
The river strategy
|
void |
suspend()
Suspend river mouth.
|
protected SimpleRiverContext context
protected IngestFactory ingestFactory
protected org.elasticsearch.common.settings.Settings indexSettings
protected Map<String,String> indexMappings
protected volatile boolean suspended
public SimpleRiverMouth()
public String strategy()
RiverMouthstrategy in interface RiverMouth<SimpleRiverContext>public SimpleRiverMouth newInstance()
RiverMouthnewInstance in interface RiverMouth<SimpleRiverContext>public SimpleRiverMouth setRiverContext(SimpleRiverContext context)
RiverMouthsetRiverContext in interface RiverMouth<SimpleRiverContext>context - the river contextpublic SimpleRiverMouth setIngestFactory(IngestFactory ingestFactory)
RiverMouthsetIngestFactory in interface RiverMouth<SimpleRiverContext>ingestFactory - the ingest factorypublic Metric getMetric()
RiverMouthgetMetric in interface RiverMouth<SimpleRiverContext>public void beforeFetch() throws IOException
RiverMouthbeforeFetch in interface RiverMouth<SimpleRiverContext>IOExceptionpublic void afterFetch() throws IOException
RiverMouthafterFetch in interface RiverMouth<SimpleRiverContext>IOExceptionpublic void shutdown()
RiverMouthshutdown in interface RiverMouth<SimpleRiverContext>public SimpleRiverMouth setIndexSettings(org.elasticsearch.common.settings.Settings indexSettings)
RiverMouthsetIndexSettings in interface RiverMouth<SimpleRiverContext>indexSettings - the index settingspublic SimpleRiverMouth setTypeMapping(Map<String,String> typeMapping)
RiverMouthsetTypeMapping in interface RiverMouth<SimpleRiverContext>typeMapping - the index type mappingspublic SimpleRiverMouth setIndex(String index)
RiverMouthsetIndex in interface RiverMouth<SimpleRiverContext>index - the default index namepublic String getIndex()
RiverMouthgetIndex in interface RiverMouth<SimpleRiverContext>public SimpleRiverMouth setType(String type)
RiverMouthsetType in interface RiverMouth<SimpleRiverContext>type - the default index type name for this river mouthpublic String getType()
RiverMouthgetType in interface RiverMouth<SimpleRiverContext>public SimpleRiverMouth setId(String id)
RiverMouthsetId in interface RiverMouth<SimpleRiverContext>id - the idpublic String getId()
RiverMouthgetId in interface RiverMouth<SimpleRiverContext>public void index(IndexableObject object, boolean create) throws IOException
RiverMouthindex in interface RiverMouth<SimpleRiverContext>object - the indexable objectcreate - true if the document should be createdIOException - when indexing failspublic void delete(IndexableObject object)
RiverMouthdelete in interface RiverMouth<SimpleRiverContext>object - the structured objectpublic void flush() throws IOException
RiverMouthflush in interface RiverMouth<SimpleRiverContext>IOException - when flush failspublic void suspend()
RiverMouthsuspend in interface RiverMouth<SimpleRiverContext>public void resume()
RiverMouthresume in interface RiverMouth<SimpleRiverContext>elasticsearch-river-jdbc