I'm a bit stuck when porting the clustering plugin to 2.0.0.rc1. Here
is the problem:
- For integration tests ESIntegTestCase's client() returns a transport
client (even if @ClusterScope's transportClientRatio is set to zero,
which kind of makes sense since it's communicating with an external
node). But when one develops custom plugins (with actions) it can be
quite surprising to receive an NPE as follows:
Throwable #1: java.lang.NullPointerException
this essentially means the action (plugin) wasn't registered in
TransportClient. There are mentions of this requirement on the mailing
list, but they're buried under tons of other stuff. I think an
exception could be improved here (essentially "action unknown").
- I can't figure out how to set up the transport client properly for
ESIntegTestCase. I passed an appropriate "plugin.types" property to
node settings in
protected Settings nodeSettings(int nodeOrdinal)
and it took me a longer while to realize that ESIntegTestCase has
two methods to initialize the settings, the other one being:
protected Settings transportClientSettings()
the thing is... even if I set plugin.types in transportClientSettings
I still get the NPE above. And this method doesn't seem to be invoked
What am I missing here?
[spent a few minutes looking at the code]
Oh, there is a third method to set up settings:
protected Settings externalClusterClientSettings()
And this one finally worked!
Could somebody who knows the code clarify what these methods actually
do and when to use which one?