HBASE-22611 Close the DataOutputStream object #325
This commit is contained in:
parent
10032a11ba
commit
841b319e4d
|
@ -118,7 +118,7 @@ public class RowIndexCodecV1 extends AbstractDataBlockEncoder {
|
||||||
}
|
}
|
||||||
boolean includesMvcc = decodingCtx.getHFileContext().isIncludesMvcc();
|
boolean includesMvcc = decodingCtx.getHFileContext().isIncludesMvcc();
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
DataOutputStream out = new DataOutputStream(baos);
|
try (DataOutputStream out = new DataOutputStream(baos)) {
|
||||||
for (Cell cell : kvs) {
|
for (Cell cell : kvs) {
|
||||||
KeyValue currentCell = KeyValueUtil.copyToNewKeyValue(cell);
|
KeyValue currentCell = KeyValueUtil.copyToNewKeyValue(cell);
|
||||||
out.write(currentCell.getBuffer(), currentCell.getOffset(),
|
out.write(currentCell.getBuffer(), currentCell.getOffset(),
|
||||||
|
@ -128,6 +128,7 @@ public class RowIndexCodecV1 extends AbstractDataBlockEncoder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.flush();
|
out.flush();
|
||||||
|
}
|
||||||
return ByteBuffer.wrap(baos.getBuffer(), 0, baos.size());
|
return ByteBuffer.wrap(baos.getBuffer(), 0, baos.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue