Correcting the Batch Read Documentation


#1

Hi,

I came across the scenario to batch read from multiple namespaces.

URL: https://www.aerospike.com/docs/guide/batch.html Aerospike documentation says that we can do batch read from within a namespace. However, using the java client jar version 3.0.30 I was able to query keys from multiple namespaces in one batch get call.

Code:

AerospikeClient client = new AerospikeClient(Constants.MACHINE1, Constants.MACHINE1_PORT);
		
		Key[] keys = new Key[3];
		keys[0] = new Key("test", "demo", 1);
		keys[1] = new Key("testns", "demo", 2);
		keys[2] = new Key("testns", "demo1", 1);
		
		Record[] records = client.get(null, keys);

Request you to guide me if I am doing something wrong or there is a performance overhead. If it seems to be correct, can we correct the documentation.

Thanks.


#2

On the Server side, each batch request is specific to a namespace. The Java client add in a developer convenience and separate keys from different namespaces into separate calls.


#3

thanks wchu.

this means in the above code example it would lead to 2 different batch calls - i.e. one for test and one for testns.

Is that right?


#4

That is correct. Thanks