Should I regullary close the TransportClient


(Ridvan Gyundogan) #1

Hi I remember from Lucene that you have to close the reader sometimes
so that Lucene can delete the old segment files.
Does something similar apply to the TransportClient of elasticsearch?


(Lukáš Vlček) #2

No, the idea of TransportClient is to create one, keep it around and reuse
as much as possible. Typically, you keep one instance of TC for the life
time of your application. It does not impact[1] low level Lucene segment
stuff.

Regards,
Lukas

[1] in some cases I think it can have some impact, like if you open a scan
search [2] request but the impact is minimal IMO unless you do something
terribly wrong with timeout setup.
[2] http://www.elasticsearch.org/guide/reference/api/search/search-type.html(see
for scan or scroll)

On Tue, Jul 10, 2012 at 3:58 PM, Ridvan Gyundogan ridvansg@gmail.comwrote:

Hi I remember from Lucene that you have to close the reader sometimes
so that Lucene can delete the old segment files.
Does something similar apply to the TransportClient of elasticsearch?


(Ridvan Gyundogan) #3

Thanks Lukas!

On Jul 10, 5:22 pm, Lukáš Vlček lukas.vl...@gmail.com wrote:

No, the idea of TransportClient is to create one, keep it around and reuse
as much as possible. Typically, you keep one instance of TC for the life
time of your application. It does not impact[1] low level Lucene segment
stuff.

Regards,
Lukas

[1] in some cases I think it can have some impact, like if you open a scan
search [2] request but the impact is minimal IMO unless you do something
terribly wrong with timeout setup.
[2]http://www.elasticsearch.org/guide/reference/api/search/search-type.h...
for scan or scroll)

On Tue, Jul 10, 2012 at 3:58 PM, Ridvan Gyundogan ridva...@gmail.comwrote:

Hi I remember from Lucene that you have to close the reader sometimes
so that Lucene can delete the old segment files.
Does something similar apply to the TransportClient of elasticsearch?


(system) #4