[ 
https://issues.apache.org/jira/browse/IMPALA-13226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17866936#comment-17866936
 ] 

ASF subversion and git services commented on IMPALA-13226:
----------------------------------------------------------

Commit 04608452d37edc9256e368bec69b23c9e989b443 in impala's branch 
refs/heads/master from stiga-huang
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=04608452d ]

IMPALA-13226: Rename TupleCacheInfo.finalize() to finalizeHash()

TupleCacheInfo.finalize() unintentionally overwrites Object.finalize()
which is called by the JVM garbage collector when garbage collection
determines that there are no more references to the object. Usually the
finalize method is overrided to dispose of system resources or to
perform other cleanup.

TupleCacheInfo.finalize() is not meant to be used during GC. We'd better
use another method name to avoid confusion. This patch renames it to
finalizeHash(). Also fixed some stale comments.

Change-Id: I657c4f14b074b7c16dc7d126b0c8b5083b8f19c6
Reviewed-on: http://gerrit.cloudera.org:8080/21588
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> TupleCacheInfo unintentionally overwrites Object.finalize()
> -----------------------------------------------------------
>
>                 Key: IMPALA-13226
>                 URL: https://issues.apache.org/jira/browse/IMPALA-13226
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>            Reporter: Quanlong Huang
>            Assignee: Quanlong Huang
>            Priority: Major
>
> Object.finalize() is called by the JVM garbage collector on an object when 
> garbage collection determines that there are no more references to the 
> object. A subclass overrides the finalize method to dispose of system 
> resources or to perform other cleanup.
> TupleCacheInfo.finalize() is not meant to be used during GC. We'd better use 
> another method name to avoid confusion.
> {code:java}
>   public void finalize() {
>     finalizedHashString_ = hasher_.hash().toString();
>     hasher_ = null;
>     finalizedHashTrace_ = hashTraceBuilder_.toString();
>     hashTraceBuilder_ = null;
>     finalized_ = true;
>   }{code}
> https://github.com/apache/impala/blob/d83b48cf72fa94ec7f6e55da409b4dff3350543b/fe/src/main/java/org/apache/impala/planner/TupleCacheInfo.java#L157-L163



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to