Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-2243

Close all the file streams propely in a finally block to avoid their leakage.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.22.0, 0.23.0
    • 0.23.0
    • jobtracker, tasktracker
    • None
    • NA

    • Reviewed

    Description

      In the following classes streams should be closed in finally block to avoid their leakage in the exceptional cases.

      CompletedJobStatusStore.java
      ------------------------------------------
      dataOut.writeInt(events.length);
      for (TaskCompletionEvent event : events)

      { event.write(dataOut); }

      dataOut.close() ;

      EventWriter.java
      ----------------------
      encoder.flush();
      out.close();

      MapTask.java
      -------------------
      splitMetaInfo.write(out);
      out.close();

      TaskLog
      ------------
      1) str = fis.readLine();
      fis.close();

      2) dos.writeBytes(Long.toString(new File(logLocation, LogName.SYSLOG
      .toString()).length() - prevLogLength) + "\n");
      dos.close();

      TotalOrderPartitioner.java
      -----------------------------------
      while (reader.next(key, value))

      { parts.add(key); key = ReflectionUtils.newInstance(keyClass, conf); }

      reader.close();

      Attachments

        1. MAPREDUCE-2243.patch
          10 kB
          Devaraj Kavali
        2. MAPREDUCE-2243-1.patch
          10 kB
          Devaraj Kavali
        3. MAPREDUCE-2243-2.patch
          9 kB
          Devaraj Kavali
        4. MAPREDUCE-2243-3.patch
          10 kB
          Devaraj Kavali
        5. MAPREDUCE-2243-4.patch
          10 kB
          Devaraj Kavali

        Activity

          People

            devaraj Devaraj Kavali
            kam_iitkgp Bhallamudi Venkata Siva Kamesh
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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