Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-3143

Unnecessary inclusion of empty match result in Json

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      `FindNMatches()` didn't correctly filter out empty match result in `substringSearch()` and hence send back an empty map to user. I don't know if this the desired behavior but a fix to current behavior will make metrics for logviewer easier to implement.

      An example of current behavior:

      {
          "fileOffset": 1,
          "searchString": "sdf",
          "matches": [
              {
                  "searchString": "sdf",
                  "fileName": "word-count-1-1530815972/6701/worker.log",
                  "matches": [],
                  "port": "6701",
                  "isDaemon": "no",
                  "startByteOffset": 0
              }
          ]
      }
      

      Desired behavior:

      {
          "fileOffset": 1,
          "searchString": "sdf",
          "matches": []
      }
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            zhengdai Zhengdai Hu
            zhengdai Zhengdai Hu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h

                Slack

                  Issue deployment