Hide Forgot
Description of problem: According to http://rhq-project.org/display/JOPR2/Running+the+RHQ+CLI#RunningtheRHQCLI-CriteriaSearching (chapter Basic Criteria), following code should fetch all committed resources in our inventory: var criteria = new ResourceCriteria(); var resources = ResourceManager.findResourcesByCriteria(criteria); However this is not true. Returned set contains maximally 200 resources even if complete set of committed resources is larger. SELECT count(id) FROM rhq_resource WHERE ( inventory_status = 'COMMITTED' ) returns 533 Version-Release number of selected component (if applicable): Version: 4.4.0-SNAPSHOT Build Number: ca5eecb Database: postgresql-server-9.1.3-3 How reproducible: Always Steps to Reproduce: 1. Import more than 200 resources to your inventory 2. execute following: var criteria = new ResourceCriteria(); var resources = ResourceManager.findResourcesByCriteria(criteria); println("CommitedResSize: "+resources.size()); 3. execute following SQL query SELECT count(id) FROM rhq_resource WHERE ( inventory_status = 'COMMITTED' ) Actual results: CommitedResSize: 200 SQL query result: 533 Expected results: CommitedResSize and SQL query result should be the same. Additional info: hint- any default LIMIT added to the JPA-QL query??
doc issue per BZ triage 4/23 (crouch, loleary, asantos, foley) please update the JON documentation
Update: not really a bug. I didn't realize that ResourceManager.findResourcesByCriteria(criteria) returns PageList<Resource> so var resources = ResourceManager.findResourcesByCriteria(criteria); println("CommitedResSize: "+resources.size()); prints just size of the current page. However i haven't fount straightforward way to get complete list of resources. It would be nice to have something like this: resources.getCompleteList();
>I could be wrong, but is this at all related to bug 784571 where no more than >200 children are visible for a resource in the tree? Yes >If so, is it possible to disable paging in the CLI with criteria.clearPaging()? Yes So the only problem seems to be that by default this code: var criteria = new ResourceCriteria() var resources = ResourceManager.findResourcesByCriteria(criteria) returns paged list with 200 items but documentation states that this should return complete list of resources.
Thanks for the info, Filip. I think I have this right in the JON docs; I'll clear with someone when I get the new docs on staging and then update the wiki.
I added this new section: http://docs.redhat.com/docs/en-US/JBoss_Operations_Network/3.1/html/Dev_Writing_JON_Command-Line_Scripts/building-blocks.html#searches-page-results