Reload configuration settings of river at runtime


(Alexander Reelsen) #1

Hi there,

I am currently implementing a river, which reads product data from a
remote system via XML export.
While this river is running, I would like to be able to configure in
which index the river is indexing in at runtime.

So when changing the "_river" index settings, they should be reflected
in my river.

When using a constructor like the one used in couchdb:

@Inject public MyRiver(RiverName riverName, RiverSettings settings,
@RiverIndexName String riverIndexName, Client client, ScriptService
scriptService) { }

the settings are not updated, after the configuration is changed on
runtime?

Should I do this programmatically every time my indexer thread is
running or is this possible with the help of an annotation?

Thanks for helping!

--Alexander


(Clinton Gormley) #2

Hi Alexander

I am currently implementing a river, which reads product data from a
remote system via XML export.
While this river is running, I would like to be able to configure in
which index the river is indexing in at runtime.

So when changing the "_river" index settings, they should be reflected
in my river.

I don't know the answer to your question, but an easier approach would
be to use aliases.

For example, you set your river to index to 'my_index'. However
'my_index' is actually an alias which points to the real index
'my_index_2011'.

Now, when you want to write to 'my_index_2011' instead, all you have to
do is create the index 'my_index_2011' and update the 'my_index' alias
to point to that one instead.

http://www.elasticsearch.org/guide/reference/api/admin-indices-aliases.html

clint


(Shay Banon) #3

There is no built in support for refreshing river settings, but at the end,
they are just documents in the index. You can periodically check for it in
your river.

On Mon, Jul 18, 2011 at 12:12 PM, Alexander Reelsen <
alexander.reelsen@googlemail.com> wrote:

Hi there,

I am currently implementing a river, which reads product data from a
remote system via XML export.
While this river is running, I would like to be able to configure in
which index the river is indexing in at runtime.

So when changing the "_river" index settings, they should be reflected
in my river.

When using a constructor like the one used in couchdb:

@Inject public MyRiver(RiverName riverName, RiverSettings settings,
@RiverIndexName String riverIndexName, Client client, ScriptService
scriptService) { }

the settings are not updated, after the configuration is changed on
runtime?

Should I do this programmatically every time my indexer thread is
running or is this possible with the help of an annotation?

Thanks for helping!

--Alexander


(system) #4