Mahout
  1. Mahout
  2. MAHOUT-807

Wrong prefixes in PrefixAdditionFilter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.6
    • Fix Version/s: 0.6
    • Component/s: Clustering
    • Labels:

      Description

      The org.apache.mahout.text.PrefixAdditionFilter is not working as intended. The prefix is computed wrong when there is recursion (this is when there is at least one subdirectory).

      I think the line:
      fs.listStatus(fst.getPath(), new PrefixAdditionFilter(getConf(), getPrefix() + Path.SEPARATOR + current.getName(), getOptions(), writer, fs));

      should better be:
      fs.listStatus(fst.getPath(), new PrefixAdditionFilter(getConf(), getPrefix() + Path.SEPARATOR + current.getName() + Path.SEPARATOR + fst.getPath().getName(), getOptions(), writer, fs));

        Activity

        Hide
        Hudson added a comment -

        Integrated in Mahout-Quality #1037 (See https://builds.apache.org/job/Mahout-Quality/1037/)
        MAHOUT-807 fix recursion

        srowen : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1170494
        Files :

        • /mahout/trunk/integration/src/main/java/org/apache/mahout/text/PrefixAdditionFilter.java
        Show
        Hudson added a comment - Integrated in Mahout-Quality #1037 (See https://builds.apache.org/job/Mahout-Quality/1037/ ) MAHOUT-807 fix recursion srowen : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1170494 Files : /mahout/trunk/integration/src/main/java/org/apache/mahout/text/PrefixAdditionFilter.java
        Hide
        Sean Owen added a comment -

        Done.

        Show
        Sean Owen added a comment - Done.
        Hide
        Florian Bausch added a comment -

        Yes, I tested it.

        I am currently using Mahout 0.5 where I stumbled over this bug.

        The PrefixAdditionFilter without the patched line creates wrong paths: /home/user/Documents/something/important.doc becomes /home/Documents/important.doc.

        Using the patched line the path is correct.
        Since the creation of the prefix does not differ to the current revision (except it uses getters instead of variables) the patch should work.

        Show
        Florian Bausch added a comment - Yes, I tested it. I am currently using Mahout 0.5 where I stumbled over this bug. The PrefixAdditionFilter without the patched line creates wrong paths: /home/user/Documents/something/important.doc becomes /home/Documents/important.doc. Using the patched line the path is correct. Since the creation of the prefix does not differ to the current revision (except it uses getters instead of variables) the patch should work.
        Hide
        Sean Owen added a comment -

        Sounds good, have you verified this by testing it out? that it recurs properly with this change?

        Show
        Sean Owen added a comment - Sounds good, have you verified this by testing it out? that it recurs properly with this change?

          People

          • Assignee:
            Sean Owen
            Reporter:
            Florian Bausch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

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

                Development