You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/07/14 13:44:05 UTC

[GitHub] [hive] pudidic opened a new pull request, #3441: HIVE-1626: stop using java.util.Stack

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.
   


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] commented on pull request #3441: HIVE-1626: stop using java.util.Stack

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #3441:
URL: https://github.com/apache/hive/pull/3441#issuecomment-1291277938

   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pudidic closed pull request #3441: HIVE-1626: stop using java.util.Stack

Posted by GitBox <gi...@apache.org>.
pudidic closed pull request #3441: HIVE-1626: stop using java.util.Stack
URL: https://github.com/apache/hive/pull/3441


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pudidic closed pull request #3441: HIVE-1626: stop using java.util.Stack

Posted by GitBox <gi...@apache.org>.
pudidic closed pull request #3441: HIVE-1626: stop using java.util.Stack
URL: https://github.com/apache/hive/pull/3441


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] cmunkey commented on pull request #3441: HIVE-1626: stop using java.util.Stack

Posted by GitBox <gi...@apache.org>.
cmunkey commented on PR #3441:
URL: https://github.com/apache/hive/pull/3441#issuecomment-1197221879

   Maybe call it RandomUpdateStack instead of MyArrayStack. 


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] closed pull request #3441: HIVE-1626: stop using java.util.Stack

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #3441: HIVE-1626: stop using java.util.Stack
URL: https://github.com/apache/hive/pull/3441


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pudidic commented on pull request #3441: HIVE-1626: stop using java.util.Stack

Posted by GitBox <gi...@apache.org>.
pudidic commented on PR #3441:
URL: https://github.com/apache/hive/pull/3441#issuecomment-1185162073

   Close/open to trigger a rebuild.


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pudidic commented on pull request #3441: HIVE-1626: stop using java.util.Stack

Posted by GitBox <gi...@apache.org>.
pudidic commented on PR #3441:
URL: https://github.com/apache/hive/pull/3441#issuecomment-1185067419

   The only failing test, TestCleanupService passes on my PC. It seems like unstable test. So I triggered a retest.


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] cmunkey commented on pull request #3441: HIVE-1626: stop using java.util.Stack

Posted by GitBox <gi...@apache.org>.
cmunkey commented on PR #3441:
URL: https://github.com/apache/hive/pull/3441#issuecomment-1197224233

   java.util.Stack uses equals() for search, so maybe it is appropriate to use equals here for indexOf().
   
   public synchronized int search(Object o)


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pudidic commented on pull request #3441: HIVE-1626: stop using java.util.Stack

Posted by GitBox <gi...@apache.org>.
pudidic commented on PR #3441:
URL: https://github.com/apache/hive/pull/3441#issuecomment-1226808614

   Close/reopen to retrigger the tests.


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pudidic commented on pull request #3441: HIVE-1626: stop using java.util.Stack

Posted by GitBox <gi...@apache.org>.
pudidic commented on PR #3441:
URL: https://github.com/apache/hive/pull/3441#issuecomment-1185060648

   retest this please


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] pudidic commented on pull request #3441: HIVE-1626: stop using java.util.Stack

Posted by GitBox <gi...@apache.org>.
pudidic commented on PR #3441:
URL: https://github.com/apache/hive/pull/3441#issuecomment-1196663673

   @cmunkey
   
   I tried to minimize indexed accessors of Stack, exposing push/pop/peek only. Because there already are several use cases of Stack#get(int), I implemented ArrayStack#get(int) also.
   
   However, LevelOrderWalker has a unique usage of Stack. LevelOrderWalker calls stack.add(0, element) and stack.remove(0) to add/remove elements at the start of the stack. They are inverse of stack.pop/push, which add/remove at the end. The rest of part still calls Stack.pop/push, as not inverse. I tried to replace stack.add(0, element) with stack.push and stack.remove(0) with stack.pop, but it behaved very differently. The inverse push/pop is not I wanted to expose. So I implemented a subclass in LevelOrderWalker to isolate its use from others. Maybe I need to document to make its purpose clear.
   
   I'll replace == with equals in indexOf(). Thank you for advice.


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org