Uploaded image for project: 'Chukwa'
  1. Chukwa
  2. CHUKWA-594

Substring matching in Row (system name) in HICC web interface (function getRows of graph_explorer.jsp)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.5.0
    • Fix Version/s: 0.5.0
    • Component/s: User Interface
    • Labels:
    • Environment:

      Ubuntu 10.04 amd64 with Java 1.6.0_24

    • Release Note:
      Hide
      CHUKWA-594. Fix row key matching in HICC web interface. (Preetam Patil via Eric Yang)
      Show
      CHUKWA-594 . Fix row key matching in HICC web interface. (Preetam Patil via Eric Yang)
    • Tags:
      hicc javascript

      Description

      In the web interface file graph_explorer.jsp, when querying the rows (system) with unique names (function getRows), the row (node) names that are substrings of existing names are dropped from the list provided by the webserver. For example, if 'node1' and 'node11' are part of the list, 'node1' is dropped and not displayed.

      I'm not a Javascript expert--perhaps the call to ": contains" matches substrings?

      1. CHUKWA-594.patch
        0.8 kB
        Eric Yang
      2. CHUKWA-594-1.patch
        2 kB
        Eric Yang

        Activity

        Hide
        eyang Eric Yang added a comment -

        Yes, contains is doing substring matching. Nice catch. A fix is on the way.

        Show
        eyang Eric Yang added a comment - Yes, contains is doing substring matching. Nice catch. A fix is on the way.
        Hide
        eyang Eric Yang added a comment -

        Fix javascript to do exact match instead of substring match for select option widget.

        Show
        eyang Eric Yang added a comment - Fix javascript to do exact match instead of substring match for select option widget.
        Hide
        ppatil Preetam Patil added a comment -

        There is a related bug in the HICC java code (ChukwaHbaseStore.java). The RowFilter in getSeries does a substring matching which means that a filter for "node1" returns all entries for "node1*".

        Here's the original code segment:
        {{if(filterByRowKey)

        { RowFilter rf = new RowFilter(CompareOp.EQUAL, new SubstringComparator(rkey)); scan.setFilter(rf); }

        }}
        A solution is to use a RegexStringComparator, as in the following (modified) segment:

        {{if(filterByRowKey)

        { RowFilter rf = new RowFilter(CompareOp.EQUAL, new RegexStringComparator("[0-9]+-"+rkey+"$")); scan.setFilter(rf); }

        }}
        I've tested it to be working okay. If it looks okay, I'll submit a patch soon.

        -preetam

        Show
        ppatil Preetam Patil added a comment - There is a related bug in the HICC java code (ChukwaHbaseStore.java). The RowFilter in getSeries does a substring matching which means that a filter for "node1" returns all entries for "node1*". Here's the original code segment: {{if(filterByRowKey) { RowFilter rf = new RowFilter(CompareOp.EQUAL, new SubstringComparator(rkey)); scan.setFilter(rf); } }} A solution is to use a RegexStringComparator, as in the following (modified) segment: {{if(filterByRowKey) { RowFilter rf = new RowFilter(CompareOp.EQUAL, new RegexStringComparator("[0-9]+-"+rkey+"$")); scan.setFilter(rf); } }} I've tested it to be working okay. If it looks okay, I'll submit a patch soon. -preetam
        Hide
        ppatil Preetam Patil added a comment -

        Sorry about the formatting of my comment above; the Wiki Syntax did not work for me.

        Show
        ppatil Preetam Patil added a comment - Sorry about the formatting of my comment above; the Wiki Syntax did not work for me.
        Hide
        eyang Eric Yang added a comment -

        Good catch. +1 on the patch.

        Show
        eyang Eric Yang added a comment - Good catch. +1 on the patch.
        Hide
        eyang Eric Yang added a comment -

        Updated patch to include Preetam's fix.

        Show
        eyang Eric Yang added a comment - Updated patch to include Preetam's fix.
        Hide
        eyang Eric Yang added a comment -

        I just committed this, thanks Preetam.

        Show
        eyang Eric Yang added a comment - I just committed this, thanks Preetam.

          People

          • Assignee:
            eyang Eric Yang
            Reporter:
            ppatil Preetam Patil
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development