Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.1.4, 2.1.5
-
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
- links to