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

Remove Magic Number From MapTask.java

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • 2.10.0, 3.2.0
    • None
    • mrv2
    • None
    • Patch

    Description

      FSDataOutputStream finalOut = rfs.create(finalOutputFile, true, 4096);
      

      Remove magic number of '4096'. Use default constructor so that the configurable buffer size is used instead...

        /**
         * Create an FSDataOutputStream at the indicated Path.
         * @param f the file to create
         * @param overwrite if a file with this name already exists, then if true,
         *   the file will be overwritten, and if false an exception will be thrown.
         * @throws IOException IO failure
         */
        public FSDataOutputStream create(Path f, boolean overwrite)
            throws IOException {
          return create(f, overwrite,
                        getConf().getInt(IO_FILE_BUFFER_SIZE_KEY,
                            IO_FILE_BUFFER_SIZE_DEFAULT),
                        getDefaultReplication(f),
                        getDefaultBlockSize(f));
        }
      

      Attachments

        1. MAPREDUCE-7143.1.patch
          1 kB
          David Mollitor

        Activity

          People

            belugabehr David Mollitor
            belugabehr David Mollitor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: