Uploaded image for project: 'Mahout'
  1. Mahout
  2. MAHOUT-2096

next() Called On Possible Empty iterator()

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

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • classic-15.0
    • None

    Description

      Consider this function:

       protected void reduce ( VarIntWritable index, Iterable<VarLongWritable> ids, Context
         ctx) throws IOException, InterruptedException {
           ctx.write(index, ids.iterator().next());
       }
      

      The line `ctx.write(index, ids.iterator().next());` does not check for empty iterator when calling the next() function, which could result in an exception.

      Function can be found on the GitHub repository here.

      Line 395, in file /src/main/java/org/apache/mahout/cf/taste/hadoop/als/ParallelALSFactorizationJob.java

      Attachments

        Activity

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

          People

            balakuntala Shashanka Balakuntala Srinivasa
            MaxsLi Shangru Li

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 50m
                1h 50m

                Slack

                  Issue deployment