Is Elastic 2.2 Java Client Backward compatible?


(yana2301) #1

Hi All,
I've upgraded to elastic 2.2 java client and got following problems when
try to connect to Elastic 1.7:
1.transport client doesn't start. I create transport client as:
Settings settings = settingsBuilder()
.put("cluster.name", clusterName)
.build();
transportClient =
TransportClient.builder().settings(settings).build();
stream(InetAddress.getAllByName(host))
.forEach(address ->
transportClient.addTransportAddress(new
InetSocketTransportAddress(address, port)));

client seems to be created with no errors, but I get exception when send
request:

2016-02-22 20:16:29 DEBUG (NettyUtils.java:104) - using gathering [true]
2016-02-22 20:16:29 DEBUG (TransportClientNodesService.java:120) - [Rock
Python] node_sampler_interval[5s]
2016-02-22 20:16:29 DEBUG (NettyInternalESLogger.java:58) - Using select
timeout of 500
2016-02-22 20:16:29 DEBUG (NettyInternalESLogger.java:58) - Epoll-bug
workaround enabled = false
2016-02-22 20:16:30 DEBUG (TransportClientNodesService.java:177) - [Rock
Python] adding address [{#transport#-1}{10.2.2.141}{10.2.2.141:9300}]
2016-02-22 20:16:30 DEBUG (NettyTransport.java:914) - [Rock Python]
connected to node [{#transport#-1}{10.2.2.141}{10.2.2.141:9300}]
2016-02-22 20:16:30 WARN (NettyTransport.java:771) - [Rock Python]
exception caught on transport layer [[id: 0x9eba5b38, /10.10.0.4:64748 =>
/10.2.2.141:9300]], closing connection
java.lang.NullPointerException
at
org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:206)
at
org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:201)
at
org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:136)
at
org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at
org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
at
org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
at
org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
at
org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
at
org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at
org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
at
org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
at
org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at
org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at
org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-02-22 20:16:30 DEBUG (NettyTransport.java:1078) - [Rock Python]
disconnecting from [{#transport#-1}{10.2.2.141}{10.2.2.141:9300}], channel
closed event

In debug status code is 3 in MessageChannelHandler.

Should I pass additional parameters or java client is not compatible with
older versions?

  1. I cannot send nested or filter, filter aggregation like this fails with
    parse error:
    "filter" : {
    "filter" : {
    "bool" : {
    "must" : {
    "nested" : {
    "query" : {
    "or" : {
    "filters" : [ {
    "term" : {
    "nested_array.double_full" : "125.89935"
    }
    }, {
    "term" : {
    "nested_array.double_full" : "466.30414"
    }
    } ]
    }
    },
    "path" : "nested_array"
    }
    }
    }
    }
    if I change query to filter -- it works,but there is no way to build such
    query in java. If I use or query outside of nested -- it works too.
    3.I see that or and and filters are deprecated and I should use boolQuery
    instead. How can I build or filter with boolQuery?

(David Pilato) #2

No. It's not compatible.


(system) #4