[
https://issues.apache.org/jira/browse/HIVE-1626?focusedWorklogId=790329&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-790329
]
ASF GitHub Bot logged work on HIVE-1626:
----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Jul/22 08:52
Start Date: 13/Jul/22 08:52
Worklog Time Spent: 10m
Work Description: pudidic opened a new pull request, #3434:
URL: https://github.com/apache/hive/pull/3434
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?
This PR replaces Stack with ArrayStack, which is a non-sychronized version
of Stack, for faster performance.
### Why are the changes needed?
ArrayStack has a same API with Stack, but without synchronized keyword. It
uses an internal ArrayList to keep elements.
* All Stack<Node> method parameters were replaced with ArrayStack<Node>.
* pop(), push(Object), peek(), get(int) methods work exactly same with
Stack. Their callers don't need to be changed.
* indexOf(Object) is not implemented. It's used by only one caller and
indexOf(Object) method was moved into that caller.
* empty() method was replaced by isEmpty() method, which is in the
Collection interface. Its callers were changed.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
It'll be tested by the integration test server.
Issue Time Tracking
-------------------
Worklog Id: (was: 790329)
Remaining Estimate: 0h
Time Spent: 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
> Attachments: HIVE-1626.2.patch, HIVE-1626.2.patch, HIVE-1626.3.patch,
> HIVE-1626.3.patch, HIVE-1626.3.patch
>
> Time Spent: 10m
> 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)