Permalink
Browse files

set defaults to what the FNV hash implementation in gizzard expects

  • Loading branch information...
1 parent 63c37f7 commit 4b87fd67e71e39dd4c2d2e705a25c1070ba60bbb @freels freels committed May 5, 2011
Showing with 15 additions and 15 deletions.
  1. +3 −3 lib/gizzard/commands.rb
  2. +12 −12 test/gizzmo_spec.rb
@@ -899,9 +899,9 @@ class CreateTableCommand < Command
DEFAULT_NUM_SHARDS = 1024
DEFAULT_BASE_NAME = "shard"
- FORWARDING_SPACE = 2 ** 64
- FORWARDING_SPACE_MIN = 2 ** 63 * -1
- FORWARDING_SPACE_MAX = 2 ** 63 - 1
+ FORWARDING_SPACE = 2 ** 60
+ FORWARDING_SPACE_MIN = 0
+ FORWARDING_SPACE_MAX = 2 ** 60 - 1
def generate_base_ids(num_shards, min_id, max_id)
srand(42) # consistent randomization
View
@@ -666,12 +666,12 @@ def nameserver_db
Create tables 0, 1:
ReplicatingShard(1) -> TestShard(127.0.0.1,1)
for 2 base ids:
- -4611686018427387904
- 0
+ 288230376151711744
+ 576460752303423488
ReplicatingShard(1) -> TestShard(localhost,1)
for 2 base ids:
- 4611686018427387904
- -9223372036854775808
+ 864691128455135232
+ 0
create_shard(ReplicatingShard): s_0_0003
create_shard(TestShard/127.0.0.1): s_0_0003
@@ -733,14 +733,14 @@ def nameserver_db
link(id("localhost", "s_1_0002_replicating"), id("127.0.0.1", "s_1_0002"), 1),
link(id("localhost", "s_1_0003_replicating"), id("127.0.0.1", "s_1_0003"), 1)]
- nameserver_db[:forwardings].should == [forwarding(0, -9223372036854775808, id("localhost", "s_0_0000_replicating")),
- forwarding(1, -9223372036854775808, id("localhost", "s_1_0000_replicating")),
- forwarding(0, -4611686018427387904, id("localhost", "s_0_0003_replicating")),
- forwarding(1, -4611686018427387904, id("localhost", "s_1_0003_replicating")),
- forwarding(0, 0, id("localhost", "s_0_0002_replicating")),
- forwarding(1, 0, id("localhost", "s_1_0002_replicating")),
- forwarding(0, 4611686018427387904, id("localhost", "s_0_0001_replicating")),
- forwarding(1, 4611686018427387904, id("localhost", "s_1_0001_replicating"))]
+ nameserver_db[:forwardings].should == [forwarding(0, 0, id("localhost", "s_0_0000_replicating")),
+ forwarding(1, 0, id("localhost", "s_1_0000_replicating")),
+ forwarding(0, 288230376151711744, id("localhost", "s_0_0003_replicating")),
+ forwarding(1, 288230376151711744, id("localhost", "s_1_0003_replicating")),
+ forwarding(0, 576460752303423488, id("localhost", "s_0_0002_replicating")),
+ forwarding(1, 576460752303423488, id("localhost", "s_1_0002_replicating")),
+ forwarding(0, 864691128455135232, id("localhost", "s_0_0001_replicating")),
+ forwarding(1, 864691128455135232, id("localhost", "s_1_0001_replicating"))]
end
end

0 comments on commit 4b87fd6

Please sign in to comment.