Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Enable locality - the segment location will be calculated based on th…

…e last part of the key separated by a @

git-svn-id: https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/experiments/dht/dht@2198 079b0acf-d9fa-0310-9935-e5ade295c882
  • Loading branch information...
commit d13683b542f65adb02c6ef811e3664e1c9f94abe 1 parent 4bbbbb8
ayenderahien authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  Rhino.DistributedHashTable.Client/DistributedHashTable.cs
View
3  Rhino.DistributedHashTable.Client/DistributedHashTable.cs
@@ -116,7 +116,8 @@ private void RefreshTopology()
private static int GetSegmentFromKey(string key)
{
- var crc32 = (int)Crc32.Compute(Encoding.Unicode.GetBytes(key));
+ var partialKey = key.Split('@').Last();
+ var crc32 = (int)Crc32.Compute(Encoding.Unicode.GetBytes(partialKey));
return Math.Abs(crc32 % Constants.NumberOfSegments);
}
Please sign in to comment.
Something went wrong with that request. Please try again.