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_r302378461
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/segment/creator/impl/fwd/SingleValueSortedForwardIndexCreator.java
##########
@@ -56,10 +56,13 @@ public void index(int docId, int dictId) {
public void close()
throws IOException {
int cardinality = _maxDocIds.length;
- for (int i = 0; i < cardinality; i++) {
- _writer.setInt(i, 0, _minDocIds[i]);
- _writer.setInt(i, 1, _maxDocIds[i]);
+ try {
Review comment:
May be I am missing something but how can we use try with resource here? It
can only be used if the resource is being declared/created there for immediate
usage and released thereafter soon after the try block ends. In this case, we
are dealing with resources that are member variables.
----------------------------------------------------------------
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]