siddharthteotia commented on a change in pull request #4418: Fix potential
resource leak in the way we close a collection of closeables
URL: https://github.com/apache/incubator-pinot/pull/4418#discussion_r302378439
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/io/writer/impl/FixedByteSingleValueMultiColWriter.java
##########
@@ -101,7 +101,9 @@ public void setBytes(int row, int col, byte[] bytes) {
public void close()
throws IOException {
- this.indexDataBuffer.close();
- this.indexDataBuffer = null;
+ if (indexDataBuffer != null) {
Review comment:
Done. I introduced the null check to make the close() is idempotent. But
since the close() on PinotDataBuffer is idempotent, calling this close()
multiple times will be a NO-OP.
Made the member variables final. rowSizeInBytes can't be final as it is
being incremented in the constructor.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]