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()
RiverMouth
strategy
in interface RiverMouth<SimpleRiverContext>
public SimpleRiverMouth newInstance()
RiverMouth
newInstance
in interface RiverMouth<SimpleRiverContext>
public SimpleRiverMouth setRiverContext(SimpleRiverContext context)
RiverMouth
setRiverContext
in interface RiverMouth<SimpleRiverContext>
context
- the river contextpublic SimpleRiverMouth setIngestFactory(IngestFactory ingestFactory)
RiverMouth
setIngestFactory
in interface RiverMouth<SimpleRiverContext>
ingestFactory
- the ingest factorypublic Metric getMetric()
RiverMouth
getMetric
in interface RiverMouth<SimpleRiverContext>
public void beforeFetch() throws IOException
RiverMouth
beforeFetch
in interface RiverMouth<SimpleRiverContext>
IOException
public void afterFetch() throws IOException
RiverMouth
afterFetch
in interface RiverMouth<SimpleRiverContext>
IOException
public void shutdown()
RiverMouth
shutdown
in interface RiverMouth<SimpleRiverContext>
public SimpleRiverMouth setIndexSettings(org.elasticsearch.common.settings.Settings indexSettings)
RiverMouth
setIndexSettings
in interface RiverMouth<SimpleRiverContext>
indexSettings
- the index settingspublic SimpleRiverMouth setTypeMapping(Map<String,String> typeMapping)
RiverMouth
setTypeMapping
in interface RiverMouth<SimpleRiverContext>
typeMapping
- the index type mappingspublic SimpleRiverMouth setIndex(String index)
RiverMouth
setIndex
in interface RiverMouth<SimpleRiverContext>
index
- the default index namepublic String getIndex()
RiverMouth
getIndex
in interface RiverMouth<SimpleRiverContext>
public SimpleRiverMouth setType(String type)
RiverMouth
setType
in interface RiverMouth<SimpleRiverContext>
type
- the default index type name for this river mouthpublic String getType()
RiverMouth
getType
in interface RiverMouth<SimpleRiverContext>
public SimpleRiverMouth setId(String id)
RiverMouth
setId
in interface RiverMouth<SimpleRiverContext>
id
- the idpublic String getId()
RiverMouth
getId
in interface RiverMouth<SimpleRiverContext>
public void index(IndexableObject object, boolean create) throws IOException
RiverMouth
index
in interface RiverMouth<SimpleRiverContext>
object
- the indexable objectcreate
- true if the document should be createdIOException
- when indexing failspublic void delete(IndexableObject object)
RiverMouth
delete
in interface RiverMouth<SimpleRiverContext>
object
- the structured objectpublic void flush() throws IOException
RiverMouth
flush
in interface RiverMouth<SimpleRiverContext>
IOException
- when flush failspublic void suspend()
RiverMouth
suspend
in interface RiverMouth<SimpleRiverContext>
public void resume()
RiverMouth
resume
in interface RiverMouth<SimpleRiverContext>
elasticsearch-river-jdbc