Code that compiles in 2.1.1, that fails to compile in 2.2.0. It used to be that ClusterHealthResponse was Iterable, and ClusterIndexHealth no longer exists.
Is client.admin() api not covered by the backward compatibility expectation for the java api in minor releases?
Maybe I misunderstood what backward compatible java client was to mean - e.g., the expectation is limited to allowing server and client to be different, but not to code assembled that has been compiled against different versions.
The rolling release is actually not going to be a problem. The problem is that maven dependency mediation fails. If a library A is built to use these APIs 2.1.1, then trying to run them in an app that its own or other dependencies for 2.2.0, then running the app will see java.lang.NoSuchMethodError .
I am sorry that this change has caused trouble. I have an open PR that documents the change now.
While ClusterHealthResponse does not implement Iterable anymore, it is still possible to get ClusterIndexHealth (this will also be described in the breaking changes as soon as the PR is merged):
ClusterHealthResponse clusterHealthResponse = client.admin().cluster().prepareHealth().get();
for (Map.Entry<String, ClusterIndexHealth> index : clusterHealthResponse.getIndices().entrySet()) {
String indexName = index.getKey();
ClusterIndexHealth health = index.getValue();
}
If you really need the old behavior, it shouldn't be a big deal though. Just open a ticket on Github and we can get it in.
It will help the community build neat things and share with each other when the public APIs don't change. I may want to push to github some tooling around elasticsearch 2.1.1, and wouldn't it be great if another in the community could use that, but also not have to wait on me to update my codes if he wishes to continue on to 2.2.0....
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.