Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10194

FSDataOutputStream.write() allocates new byte buffer on each operation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 2.7.1
    • None
    • hdfs-client
    • None

    Description

      This is the code:

       private DFSPacket createPacket(int packetSize, int chunksPerPkt, long offsetInBlock, long seqno, boolean lastPacketInBlock) throws InterruptedIOException {
           final byte[] buf;
           final int bufferSize = PacketHeader.PKT_MAX_HEADER_LEN +   packetSize;
       
           try {
             buf = byteArrayManager.newByteArray(bufferSize);
           } catch (InterruptedException ie) {
             final InterruptedIOException iioe = new InterruptedIOException(
                 "seqno=" + seqno);
             iioe.initCause(ie);
             throw iioe;
           }
       
           return new DFSPacket(buf, chunksPerPkt, offsetInBlock, seqno,
                                getChecksumSize(), lastPacketInBlock);
      }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vrodionov Vladimir Rodionov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: