Hi,
I am trying to optimize the call to our backend storage.
Current implementation is it will create scan request (which will return
iterator) for each binding.
For example if the SPARQL query is something like:
SELECT ?vendor
WHERE
{
?vendor p:product category:electronic .
?vendor p:country country:US .
}
And let say the first line returns 100 vendors, then my current code will
generate 100 scan requests to backend, after binding the value with second line.
There seems optimization from the backend feature to batch those 100 scan
requests into 1 request, hence will reduce the network call and also the
backend may be able to optimize the actual read.
My current code implements StageGenerator which its execute method will return
our custom iterator which implements Jena's QueryIterRepeatApply.
I think the code inside nextStage() is the right place where I could implement
the batch logic, is that correct?
Thanks,
Z