Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
replication
  • Loading branch information
Nick Kallen authored and Nick Kallen committed Apr 5, 2010
1 parent 8f21049 commit a527615
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/test/scala/com/twitter/rowz/integration/RowzSpec.scala
Expand Up @@ -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()
}

Expand All @@ -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.