Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-39

BufferedPositionedInputStream drastically reduces read performance because it doesn't override read([], o, l) in InputStream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.1.0
    • impl
    • None
    • Java 1.6, Mac OS X 10.5

    Description

      Simple fix can have a huge effect on performance of certain kinds of PIG programs:

      Index: src/org/apache/pig/impl/io/BufferedPositionedInputStream.java
      ===================================================================
      — src/org/apache/pig/impl/io/BufferedPositionedInputStream.java (revision 597597)
      +++ src/org/apache/pig/impl/io/BufferedPositionedInputStream.java (working copy)
      @@ -49,7 +49,14 @@
      pos += rc;
      return rc;
      }

      • +
        + @Override
        + public int read(byte b[], int off, int len) throws IOException

        { + int read = in.read(b, off, len); + pos += read; + return read; + }

        +
        /**

      • Returns the current position in the tracked InputStream.
        */

      Attachments

        Activity

          People

            Unassigned Unassigned
            spullara Sam Pullara
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: