Bug 1091128 - ObjectNameQueryUtility does not support query of partial value match query
Summary: ObjectNameQueryUtility does not support query of partial value match query
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugin Container
Version: 4.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified vote
Target Milestone: ---
: RHQ 4.13
Assignee: Nobody
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-25 00:12 UTC by Elias Ross
Modified: 2020-04-27 01:28 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

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


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