Permalink
Browse files

replication

  • Loading branch information...
1 parent 8f21049 commit a52761515d07c592e70eb555535ad638e3e36f01 Nick Kallen committed Apr 5, 2010
Showing with 18 additions and 4 deletions.
  1. +18 −4 src/test/scala/com/twitter/rowz/integration/RowzSpec.scala
@@ -17,10 +17,20 @@ object RowzSpec extends Specification with Eventually {
doBefore {
state.nameServer.rebuildSchema()
- val shard1 = new ShardInfo("com.twitter.rowz.SqlShard", "shard_1", "localhost")
- val shardId = state.nameServer.createShard(shard1)
- state.nameServer.setForwarding(new Forwarding(0, Math.MIN_LONG, shardId))
- // state.nameServer.createShard(shard2)
+ val partitions = 2
+ (0 until partitions) foreach { i =>
+ val shardInfoA = new ShardInfo("com.twitter.rowz.SqlShard", "shard_a" + i, "localhost")
+ val shardInfoB = new ShardInfo("com.twitter.rowz.SqlShard", "shard_b" + i, "localhost")
+ val replicatingShardInfo = new ShardInfo("com.twitter.gizzard.shards.ReplicatingShard", "replicating_" + i, "localhost")
+ val shardIdA = state.nameServer.createShard(shardInfoA)
+ val shardIdB = state.nameServer.createShard(shardInfoB)
+ val replicatingShardId = state.nameServer.createShard(replicatingShardInfo)
+
+ val weight = 1
+ state.nameServer.addChildShard(replicatingShardId, shardIdA, weight)
+ state.nameServer.addChildShard(replicatingShardId, shardIdB, weight)
+ state.nameServer.setForwarding(new Forwarding(0, Math.MIN_LONG, replicatingShardId))
+ }
state.start()
}
@@ -32,5 +42,9 @@ object RowzSpec extends Specification with Eventually {
rowzService.destroy(row, 1.second.fromNow.inSeconds)
rowzService.read(id) must eventually(throwA[Exception])
}
+
+ "shard migration" in {
+
+ }
}
}

0 comments on commit a527615

Please sign in to comment.