My issue: “this.eventState = cluster.eventState[loop.index]” in NettyCommand.java is getting the exception. Could someone help me in this community? Thanks.
Update: I changed code from “new NioEventLoopGroup(4)” to “new NioEventLoopGroup(1)”, then the exception is gone, but the put is very slow, after insert a few records, then it just stuck at there, without any exception, do you guys know why?
My code:
AsyncClient client = new AsyncClient(null, new Host("localhost", 3000));
EventPolicy eventPolicy = new EventPolicy();
EventLoopGroup group = new NioEventLoopGroup(4);
EventLoops eventLoops = new NettyEventLoops(eventPolicy, group);
EventLoop eventLoop = eventLoops.next();
client.put(eventLoop, new WriteHandler(), writePolicy, key, bin);
Exception:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
at com.aerospike.client.async.NettyCommand.<init>(NettyCommand.java:77)
at com.aerospike.client.async.NettyEventLoop.execute(NettyEventLoop.java:60)
at com.aerospike.client.AerospikeClient.put(AerospikeClient.java:391)
version:
<dependency>
<groupId>com.aerospike</groupId>
<artifactId>aerospike-client</artifactId>
<version>4.0.7</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.14.Final</version>
</dependency>