I am getting the following error:
java.lang.InstantiationError: org.elasticsearch.common.transport.TransportAddress
I am using 7.2.0 which is many versions ahead from what I had been using but in earlier versions same error. I think in some versions the class was abstract and not instantiable.
I am attempting to instantiate the class as follows:
new TransportAddress(host, port);
Is there a fundamental reason why this would not work or would the error come from, e.g., a bad host or port?
I did not explicitly mention TransportClient; my problem was with TransportAddress which I am trying to instantiate using a constructor I think I saw in the documentation. Is TransportClient relevant to this?
I think I might not be able to instantiate TransportAddress (which I am doing from cached data) but instead need to use InetSocketTransportAddress since apparently (at least in some versions of the library) TransportAddress is abstract.
The constructor use as shown in the first post:
TransportAddress t = new TransportAddress(host, port);
is the what I am trying to do. I do not get a compile but rather a runtime error. If TransportAddress is abstract, maybe I should just use a concrete subclass, specifically InetSocketTransportAddress? I am not sure what led us to try TransportAddress.
Using this because we are storing strings representing host and port and want to recreate the TransportAddress from cache.
TransportAddress is the type of a List which is a field in TransportClient which are updating.
So have you been saying all along we should be using RestClient instead which maybe does not have this List? And if there is no List in RestClient, how do we do the equivalent of adding/removing elements from this list?
Strictly speaking i want to modify an existing client object. We are invoking on the TransportClient object the methods addTransportAddress() and removeTransportAddress(). These two methods take TransportAddress objects that I am trying to recreate from cached values.
It is not clear to me at this point how to do this with the Rest Client -- it does not appear to have a list of such addresses.
May be the sniffer is what you want. Hard to say as I have no idea of what you really want to do at the end. Which problem do you think you would solve?
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.