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

next() Called On Possible Empty iterator()

    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

          People

            balakuntala Shashanka Balakuntala Srinivasa
            MaxsLi Shangru Li
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

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