Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make consistentHashing to a generic tools class #17718

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

maobaolong
Copy link
Contributor

What changes are proposed in this pull request?

Make ConsistentHashing to a generic tool class, so that we can use it in various place.

@maobaolong maobaolong requested a review from dbw9580 June 30, 2023 06:52
@alluxio-bot
Copy link
Contributor

Automated checks report:

  • PR title follows the conventions: FAIL
    • The title of the PR does not pass all the checks. Please fix the following issues:
      • First word of title ("Abstract") is not an imperative verb. Please use one of the valid words
  • Commits associated with Github account: PASS

Some checks failed. Please fix the reported issues and reply 'alluxio-bot, check this please' to re-run checks.

@maobaolong maobaolong changed the title Abstract ConsistentHashing to a generic tools class Make consistentHashing to a generic tools class Jun 30, 2023
@alluxio-bot
Copy link
Contributor

Automated checks report:

  • PR title follows the conventions: PASS
  • Commits associated with Github account: PASS

All checks passed!

*
* @param nodes the nodes to select
*/
public ModularHashingNodeProvider(List<T> nodes) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the use case for this hash+mode algorithm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modular hash is simple fast and do not care the node id, ConsistentHashing is complex and have to maintain the node list dynamically.

We use these two algorithm to supply a fake file block location, so that the application can dispatch the split to the node what we want.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modular hash does not support dynamic worker membership, so I imagine you have:

  1. If you don't expect dynamic worker membership, modular hash or this jump consistent hash Support Various Kinds of Consistent Hash #17817 may be your choice
  2. If the worker memberships may change and you want consistent cache hits, consistent hash will be your choice.

I don't think I fully understood how you fake block locations by modular operation. But I think sure you can implement this, and let us know how that works out in your environment.

In #17817 we have extracted WorkerLocationPolicy interface. Could you move your implementation under WorkerLocationPolicy ? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants