public class ElasticsearchKeyValueStore extends KeyValueStore
Constructor and Description |
---|
ElasticsearchKeyValueStore()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
<V> void |
add(String id,
V document)
This method adds a value, associated with the id.
|
void |
close()
This method closes the service.
|
<V> V |
get(String id,
Class<V> type)
default implementation of getter returns a simple .json document as String.
|
int |
getBulkSize()
This method returns the _bulkSize.
|
String |
getHosts()
Deprecated.
not required
|
String |
getIndex()
This method returns the index.
|
long |
getSchedule()
This method returns the schedule.
|
String |
getType()
This method returns the index.
|
void |
init()
This method initializes the service.
|
void |
remove(String id)
This method removes the value associated with the supplied.
|
void |
setBulkSize(int bulkSize)
This method sets the _bulkSize.
|
void |
setHosts(String hosts)
Deprecated.
should not be used. only used if need to connect directly to specific nodes over tcp. Use elasticsearch-es.properties instead
|
void |
setIndex(String index)
This method sets the index.
|
void |
setSchedule(long schedule)
This method sets the schedule.
|
void |
setType(String type)
This method sets the type.
|
String |
toString() |
<V> void |
update(String id,
V document)
This method updates the value associated with the supplied
id.
|
public ElasticsearchKeyValueStore()
public long getSchedule()
public void setSchedule(long schedule)
schedule
- the schedulepublic String getIndex()
public void setIndex(String index)
index
- The indexpublic String getType()
public void setType(String type)
type
- The typepublic String getHosts()
public void setHosts(String hosts)
hosts
- The hostspublic int getBulkSize()
public void setBulkSize(int bulkSize)
bulkSize
- The bulkSizepublic void init() throws Exception
public <V> void add(String id, V document) throws Exception
KeyValueStore
add
in class KeyValueStore
V
- The value typeid
- The iddocument
- The valueException
- Failed to add documentpublic void remove(String id) throws Exception
KeyValueStore
remove
in class KeyValueStore
id
- id of object to remove.Exception
- when cannot delete.public <V> void update(String id, V document)
KeyValueStore
update
in class KeyValueStore
V
- The value typeid
- The iddocument
- The updated valuepublic <V> V get(String id, Class<V> type)
get
in class KeyValueStore
V
- The value typeid
- The idtype
- The type to be returnedpublic void close() throws Exception
Copyright © 2013-2015 JBoss by Red Hat. All Rights Reserved.