Simple question about node creation

Hello,
I have one simple question about node creation.
Java api according it creates like:

Node node = nodeBuilder().client(true).node();
Client client = node.client();

My question is: when your application will create clien node to connect and consult index to master server node,
you always must close node and client after each search query?
like:
client.close();
node.close();

Or only i must close client?

Advance thank you very much.

I suggest to close the client and the node only when your application stops.

HTH
David

Le 8 nov. 2011 à 14:35, steam grandebuzon@gmail.com a écrit :

Hello,
I have one simple question about node creation.
Java api according it creates like:

Node node = nodeBuilder().client(true).node();
Client client = node.client();

My question is: when your application will create clien node to connect and
consult index to master server node,
you always must close node and client after each search query?
like:
client.close();
node.close();

Or only i must close client?

Advance thank you very much.

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Simple-question-about-node-creation-tp3490292p3490292.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

I understand, thanks for reply )

what if my jvm crashes and I don't close the client. How do the other
nodes react. I assume (hope) everything will be ok?

thanks!

On Nov 9, 1:12 am, David Pilato da...@pilato.fr wrote:

I suggest toclosetheclientand the node only when your application stops.

HTH
David

Le 8 nov. 2011 à 14:35, steam grandebu...@gmail.com a écrit :

Hello,
I have one simple question about node creation.
Java api according it creates like:

Node node = nodeBuilder().client(true).node();
Clientclient= node.client();

My question is: when your application will create clien node to connect and
consult index to master server node,
you always mustclosenode andclientafter each search query?
like:
client.close();
node.close();

Or only i mustcloseclient?

Advance thank you very much.

--
View this message in context:http://elasticsearch-users.115913.n3.nabble.com/Simple-question-about...
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

Yes, either the socket will be broken and immediately identified as a
failed node, or the fault detection process will identify it.

On Tue, Nov 15, 2011 at 7:54 PM, Andy apryor48@gmail.com wrote:

what if my jvm crashes and I don't close the client. How do the other
nodes react. I assume (hope) everything will be ok?

thanks!

On Nov 9, 1:12 am, David Pilato da...@pilato.fr wrote:

I suggest toclosetheclientand the node only when your application stops.

HTH
David

Le 8 nov. 2011 à 14:35, steam grandebu...@gmail.com a écrit :

Hello,
I have one simple question about node creation.
Java api according it creates like:

Node node = nodeBuilder().client(true).node();
Clientclient= node.client();

My question is: when your application will create clien node to
connect and
consult index to master server node,
you always mustclosenode andclientafter each search query?
like:
client.close();
node.close();

Or only i mustcloseclient?

Advance thank you very much.

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Simple-question-about...
Sent from the Elasticsearch Users mailing list archive at Nabble.com.