Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-22611

hbase-common module's class "org.apache.hadoop.hbase.io.encoding.RowIndexCodecV1" DataOutputStream is not closed.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.4, 2.1.5
    • 3.0.0-alpha-1
    • io
    • None
    • Reviewed

    Description

       

      public ByteBuffer decodeKeyValues(DataInputStream source,
      HFileBlockDecodingContext decodingCtx) throws IOException{...}

      DataOutputStream is not close after use.

      //代码占位符
      else {
        RowIndexSeekerV1 seeker = new RowIndexSeekerV1(CellComparatorImpl.COMPARATOR,
            decodingCtx);
        seeker.setCurrentBuffer(new SingleByteBuff(sourceAsBuffer));
        List<Cell> kvs = new ArrayList<>();
        kvs.add(seeker.getCell());
        while (seeker.next()) {
          kvs.add(seeker.getCell());
        }
        boolean includesMvcc = decodingCtx.getHFileContext().isIncludesMvcc();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream out = new DataOutputStream(baos);
        for (Cell cell : kvs) {
          KeyValue currentCell = KeyValueUtil.copyToNewKeyValue(cell);
          out.write(currentCell.getBuffer(), currentCell.getOffset(),
              currentCell.getLength());
          if (includesMvcc) {
            WritableUtils.writeVLong(out, cell.getSequenceId());
          }
        }
        out.flush();
        return ByteBuffer.wrap(baos.getBuffer(), 0, baos.size());
      }
      

       

       

      Attachments

        Issue Links

          Activity

            People

              yuliangwan yuliangwan
              yuliangwan yuliangwan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: