Permalink
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...
1 parent 4bbbbb8 commit d13683b542f65adb02c6ef811e3664e1c9f94abe ayenderahien committed Jun 7, 2009
Showing with 2 additions and 1 deletion.
  1. +2 −1 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);
}

0 comments on commit d13683b

Please sign in to comment.