forked from crossoverJie/cim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Modified the consistent hashing algorithm to fix a bug where only one real node was being accessed. 2. Updated the corresponding unit tests to reflect the changes."
- Loading branch information
Showing
6 changed files
with
162 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...t/java/com/crossoverjie/cim/common/route/algorithm/consistenthash/RangeCheckTestUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.crossoverjie.cim.common.route.algorithm.consistenthash; | ||
|
||
import org.junit.Assert; | ||
|
||
/** | ||
* @description: TODO | ||
* @author: zhangguoa | ||
* @date: 2024/9/12 9:58 | ||
* @project: cim | ||
*/ | ||
public class RangeCheckTestUtil { | ||
public static void assertInRange (int value, int l, int r) { | ||
Assert.assertTrue(value >= l && value <= r); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters