Bug 1091128

Summary: ObjectNameQueryUtility does not support query of partial value match query
Product: [Other] RHQ Project Reporter: Elias Ross <genman>
Component: Plugin ContainerAssignee: Nobody <nobody>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.9CC: hrupp, jshaughn
Target Milestone: ---   
Target Release: RHQ 4.13   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Elias Ross 2014-04-25 00:12:43 UTC
Description of problem:

Hadoop (CDH4) has ObjectNames like this:

Hadoop:name=IPCLoggerChannel-127.0.0.1-234,service=NameNode

Unfortunately, to query, this syntax is not currently supported:

<c:simple-property name="objectName"
   default="Hadoop:name=IPCLoggerChannel-%addr%,service=NameNode" />

The solution is to allow %key% to appear within an attribute value, not as the entire value.

The changes are probably supportable in ObjectNameQueryUtility itself.

    private void buildMatchMap(String objectNameQueryTemplate) {
...
        for (String key : keys) {
            Pattern p2 = Pattern.compile("^([^=]*)=\\%(.*)\\%$");
            Matcher m2 = p2.matcher(key);

maybe change to:

            Pattern p2 = Pattern.compile("^([^=]*)=(.*\\%(.*)\\%.*)$");

etc.

Comment 1 Heiko W. Rupp 2014-06-30 16:31:54 UTC
Merged in master f0a5cc74233f7e1ddf052e98834f80c238575b9d
Thanks Elias

Comment 2 Heiko W. Rupp 2014-07-03 05:46:59 UTC
I have backed this out, as it contained unforseen side effects with the as4 plugin

namely key-values of "name=*" are producing errors on as4.
This may be a bug in the as4 (more specific eap4.3) mbean server, but needs to be
addressed somehow

e5f22a889fc6e8492