DNG 6.0 : reduce response time for retreving list of requirements from folder.
After pulling out all these requirements , i have to show them on a third party tool in a table format but i don't want user to wait for more a minute after selecting a folder to pull out the requirements from. Is there any way to reduce this response time. I have posted the Query i am using to get the list of requirements from a folder.
==> Second query : what would be the page size, just like now i have given 1000 but what if my folder contains more than that? and how would it impact if i give page size 10 thousand and my folder contains only 5-10 requirements ?
queryParams.setPrefix("nav=<http://com.ibm.rdm/navigation#>,rdf=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>");
queryParams.setWhere("nav:parent=<"+ folderUri +">, rdf:type=<http://open-services.net/ns/rm#Requirement>");
OslcQuery query =new OslcQuery(client, queryCapability, 1000, queryParams);
OslcQueryResult result = query.submit();
One answer
You need to be cautious about the page size as it translates to the amount of required memory. If you set the page size too large and there are indeed that many artifacts returned, you may face memory issues such "out of memory".
Comments
Thanks!!! Donald,
can you please tell me know how get the artifacts for next page in OSLC API.Since i don't know how to traverse trough the multiple pages right now so i am giving more page size(1000) than requirements in my folder but seems like it is worst practise.
OslcQuery query = new OslcQuery(client, queryCapability, 1000, queryParams);
OslcQueryResult result = query.submit();
//result.getMembersUrls() contains list of uri for all the artifacts in folder but i want it page by page.then i am wondering to get next page values.
for (String resultsUrl : result.getMembersUrls()) {
response = client.getResource(resultsUrl, OSLCConstants.CT_RDF);
Requirement requirement = response.getEntity(Requirement.class);
}
If you're using Lyo OSLC4j, check out the OslcQueryResult class. It has a function getNextPageUrl() that you can use to do pagination. Do not set too large a page size as it will cripple your server.