Closed monrealis closed 3 years ago
The eventloop argument was added to every async command because it allows the user to execute a group of related commands on the same eventloop. This allows shared data between these commands to be accessed without atomics (faster).
If round-robin distribution of commands to eventloops is desired and specifying EventLoops.next() as the argument is not desired, then perform the following:
1) Upgrade to java client 5.0.3. 2) Pass in null for eventloop argument.
The client will then call EventLoops.next() when eventloop is null.
Currently I use 4.4.18. Newer versions do not work with server versions that I have. Thanks for the info.
P.S. I see that event loops that I pass to aerospike client in this version are used (almost) only in Cluster.getStats(). But still how do you know if the same event loops that are passed to AerospikeClient are actually used when executing CRUD operations.
The client assumes that the eventloops specified in ClientPolicy contains all possible eventloops. If a different eventloop is passed to a command, an array out of bounds exception is the likely result.
EventLoops is part of client policy:
ClientPolicy is part of AerospikeClient:
Yet every time I want to execute asynchronous operation I have to pass EventLoop as a mandatory parameter.
So what's the point of passing EventLoops to the client if I have to pass EventLoop during each operation?