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

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.1.5
    • Fix Version/s: 3.0.0
    • Component/s: io
    • Labels:
      None
    • Hadoop Flags:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: