You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Mingliang Liu (JIRA)" <ji...@apache.org> on 2019/06/20 19:25:00 UTC
[jira] [Updated] (HBASE-22611) hbase-common module's class
"org.apache.hadoop.hbase.io.encoding.RowIndexCodecV1" DataOutputStream is
not closed.
[ https://issues.apache.org/jira/browse/HBASE-22611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mingliang Liu updated HBASE-22611:
----------------------------------
Status: Patch Available (was: Open)
> hbase-common module's class "org.apache.hadoop.hbase.io.encoding.RowIndexCodecV1" DataOutputStream is not closed.
> -----------------------------------------------------------------------------------------------------------------
>
> Key: HBASE-22611
> URL: https://issues.apache.org/jira/browse/HBASE-22611
> Project: HBase
> Issue Type: Bug
> Components: io
> Affects Versions: 2.1.5, 2.1.4
> Reporter: yuliangwan
> Priority: Major
> Fix For: 3.0.0
>
>
>
> public ByteBuffer decodeKeyValues(DataInputStream source,
> HFileBlockDecodingContext decodingCtx) throws IOException\{...}
> DataOutputStream is not close after use.
> {code:java}
> //代码占位符
> 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());
> }
> {code}
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)