[ 
https://issues.apache.org/jira/browse/HIVE-1626?focusedWorklogId=803452&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-803452
 ]

ASF GitHub Bot logged work on HIVE-1626:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Aug/22 05:54
            Start Date: 25/Aug/22 05:54
    Worklog Time Spent: 10m 
      Work Description: pudidic opened a new pull request, #3441:
URL: https://github.com/apache/hive/pull/3441

   We currently use Stack as part of the generic node walking library. Stack 
should not be used for this since its inheritance from Vector incurs 
superfluous synchronization overhead. ArrayStack is implemented to replace 
Stack.
   
   ### What changes were proposed in this pull request?
   * Stack<Node> calls were replaced with ArrayStack<Node>.
   * ArrayStack has same pop, push, peek methods as Stack without 
synchronization.
   * LevelOrderWalker uses an extended ArrayStack that allows add(0, element) 
and remove(0).
   * Stack#empty was replaced with ArrayStack#isEmpty.
   
   ### Why are the changes needed?
   * Stack was used in query planning, but it's very slow because of 
synchronization overhead.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   * All existing tests passed on 
http://ci.hive.apache.org/blue/organizations/jenkins/hive-precommit/detail/PR-3434/4/pipeline/628/.
   * ArrayStackTest was added to test whether ArrayStack work same as Stack.
   




Issue Time Tracking
-------------------

    Worklog Id:     (was: 803452)
    Time Spent: 2h 20m  (was: 2h 10m)

> stop using java.util.Stack
> --------------------------
>
>                 Key: HIVE-1626
>                 URL: https://issues.apache.org/jira/browse/HIVE-1626
>             Project: Hive
>          Issue Type: Improvement
>          Components: Query Processor
>    Affects Versions: 0.7.0
>            Reporter: John Sichi
>            Assignee: Teddy Choi
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-1626.2.patch, HIVE-1626.2.patch, HIVE-1626.3.patch, 
> HIVE-1626.3.patch, HIVE-1626.3.patch
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> We currently use Stack as part of the generic node walking library.  Stack 
> should not be used for this since its inheritance from Vector incurs 
> superfluous synchronization overhead.
> Most projects end up adding an ArrayStack implementation and using that 
> instead.



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

Reply via email to