Hello,
i'm developing a plugin for elasticsearch 7.8.0 and i'm using the NodeClient to get all the mappings from the cluster on start-up, in order to find indices with "dense_vector" field types.
I am overriding the createComponents() method of the Plugin class since it is the only one that offers me the Client (node client) instance in its signature, but when i make a GetMapping request it throws an exception that "Node Client has not been initialized" and that is to be expected.
my question is if there is a flag like Cluster Health request i.e. "wait_for_status=true" for this kind of requests? for now i run in a while loop and catch the exceptions until it succeeds. (also note that calling Cluster Health fails with the same exception...)
Hi David, Thanks for your reply.
following up, does the start() method happen after all the shards have been initialized? (and the cluster status is >= yellow?)
i am also trying to figure out the timing of onIndexModule() method, because i want to add IndexOperationListeners to specific indices according to their mapping (if they include a dense_vector or not)
ok, so the way i see it, i would have to create a class extending a Listener during createComponents() and have it store a reference to the NodeClient, and install that listener on the ClusterService to run when the Cluster status becomes yellow.
because, even though i am able to get the mapping before the NodeClient starts or the shards are initialized (during onIndexModule, by using reflection), i still need to scroll over those indices that i've found.
I can't comment on whether this you have found absolutely the best approach, but certainly the intention of passing all that junk to createComponents() is so that you can capture it and use it later.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.