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.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]