aerospike / aerospike-client-java

Aerospike Java Client Library
Other
236 stars 212 forks source link

Read multi-op support in read-only scans #174

Closed kptfh closed 3 years ago

kptfh commented 3 years ago

Found that Aerospike starting from 4.9.0 version supports Read moulti-op support added to read-only scans feature. Didn't find how to use it via Java client. What is ETA of this feature support by Java client?

aerospike.com/docs/guide/scan.html#version-4-9-0-changes

Historical evolution of scan features Version 4.9.0 Changes Read multi-op support added to read-only scans.

BrianNichols commented 3 years ago

The "Read multi-op support added to read-only scans" point in the docs is incorrect. The server does not currently support any operation other than Operation.get(String binName) for read-only scans.

If the server adds scan support for different read operations, the client is already positioned to support that. Example:

Statement stmt = new Statement();
stmt.setNamespace("test");
stmt.setSetName("set");
stmt.setOperations(new Operation[] {Operation.get("bin")});  // currently supported
// stmt.setOperations(new Operation[] {ListOperation.size("bin")});  not currently supported

RecordSet rs = client.query(null, stmt);
kptfh commented 3 years ago

It doesn't look like scan API. Seems that query will load all data instead of iterating over it.

BrianNichols commented 3 years ago

If Statement.setFilter() is not called (no filter/where clause) that query turns into a scan on the server. The query() apis are a superset of scans and can use both primary key and secondary index traversal.

kptfh commented 3 years ago

Oh, I see. Not obvious. So I can't use MapOperation.getByKeyRange with client.query(null, stmt)

BrianNichols commented 3 years ago

That is correct. Server functionality needs to be added to support other operations for read-only scans.

kptfh commented 3 years ago

Is there any ETA for this?

BrianNichols commented 3 years ago

No. I suggest using standard channels for server functionality requests.