It's all about the answers!

Ask a question

DNG 6.0 : reduce response time for retreving list of requirements from folder.


Naveen Tyagi (19778152) | asked Oct 07 '15, 2:08 a.m.
I am able to get the list of all the requirements in a folder but its taking too much time in retrieval if folder contains more than 150 requirements then response time is around 1 minutes. i am wondering what would happen when folder contains 5000 even more requirements.
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



permanent link
Donald Nong (14.5k614) | answered Oct 12 '15, 2:06 a.m.
If there are more artifacts than the given page size, there should be a "next page" link in the response. Follow the link to get the next page, and so on, till you get to the last page. If there are fewer artifacts than the given page size, all the artifacts are returned in a single response, and nothing else significant will happen.

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
Naveen Tyagi commented Oct 12 '15, 2:58 a.m. | edited Oct 12 '15, 2:59 a.m.

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);
}


Donald Nong commented Oct 14 '15, 1:22 a.m.

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.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.