Bug 820716 - search bar code for availability querying looks broken
search bar code for availability querying looks broken
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: SearchBar (Show other bugs)
4.4
Unspecified Unspecified
urgent Severity medium (vote)
: ---
: ---
Assigned To: John Mazzitelli
Mike Foley
:
Depends On:
Blocks: jon310-sprint11/rhq44-sprint11 825318
  Show dependency treegraph
 
Reported: 2012-05-10 14:37 EDT by John Mazzitelli
Modified: 2013-09-02 03:23 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 825318 (view as bug list)
Environment:
Last Closed: 2013-09-02 03:23:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description John Mazzitelli 2012-05-10 14:37:20 EDT
see this:

 org.rhq.enterprise.server.search.translation.GroupSearchTranslator.getSearchFragment

specifically this code:

            return new SearchFragment( //
                SearchFragment.Type.PRIMARY_KEY_SUBQUERY, "SELECT rg.id" //
                    + "  FROM ResourceGroup rg " //
                    + " WHERE ( SELECT AVG( iavail.availabilityType ) " //
                    + "           FROM rg.explicitResources ires " //
                    + "           JOIN ires.currentAvailability iavail ) " + numericAvailabilityFragment);


We can't do AVG on avail type anymore - since we have more than 0 (down) and 1 (up). We have 2 (unknown) and 3 (disabled) so averaging won't give us what we are expecting.

I think this is code that lets us use "availability" in the search bar to search for availability=UP and availabiltiy=DOWN (and whatever else we allow.. MIXED??? DISABLED??? UNKNOWN???)

We need to double check the search bar ability to query on avaialbilty and get it to work for groups.
Comment 1 John Mazzitelli 2012-05-10 14:39:13 EDT
we also have to make sure we filter out uncommitted resources (which is how I originally found this - I was looking at queries accessing the explicitResources and implicitResources and seeing if they need to add a where clause for res.inventoryStatus = 'COMMITTED'
Comment 2 Charles Crouch 2012-05-11 15:18:19 EDT
We should investigate if this is an issue
Comment 3 John Mazzitelli 2012-05-15 12:05:24 EDT
git commit to master: 6641616

when viewing group lists, in the search bar, you can now specify "availability=down" for example and the only groups you will see are those groups where all members are down. Same with "up" and "disabled"

This also supports != as before.
Comment 4 John Mazzitelli 2012-05-24 17:33:12 EDT
will try to write a unit test for this. if all goes well in master, will clone and put in jon 3.1.0
Comment 5 John Mazzitelli 2012-05-25 12:21:57 EDT
git commit to master f4c13d0 - this is some new unit tests for the availability keyword in the search expression
Comment 6 Jeeva Kandasamy 2012-08-29 08:48:50 EDT
Verified on the build:
JBoss Operations Network 
Version: 3.1.1.ER3
Build Number: 37108ca:67c6de8
GWT Version: 2.4.0
SmartGWT Version: 3.0
Comment 7 Heiko W. Rupp 2013-09-02 03:23:36 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.

Note You need to log in before you can comment on or make changes to this bug.