Permalink
Browse files

wip

  • Loading branch information...
Kyle Maxwell
Kyle Maxwell committed Jun 17, 2010
1 parent 14040a9 commit db061e811de57650b4114800d5af0f73cdd91cf3
View
@@ -30,22 +30,22 @@ def create_splitting_twin_of(FORWARDINGS = [a, b]) SP(___|_|_|___)
# Pros:
# - Improve system flexibility
# Cons:
- # - Additional complexity
- # - Increase in scope of gizzard tools!?
- #
- # - Maybe the splitting_shard could query the nameserver
- # such that when it's injected into the live stack, it knows
- # about its association with a, b?
- # Pros:
- # - No API changes
+ # - Additional complexity a b
+ # - Increase in scope of gizzard tools!? |___|_|_|___|
+ # | |
+ # - Maybe the splitting_shard could query the nameserver R R
+ # such that when it's injected into the live stack, it knows / \|\
+ # about its association with a, b? S2 RO S3
+ # Pros: |
+ # - No API changes S1
# Cons:
# - The query could be expensive, and/or complicated.
def add_splitting a b
add_link(R, SP, write-only) # how to specify write-only? |___|_|_|___|
copy_shard(S1, SP) \ /
R
- / \
+ / \
S1 SP
/ \
S2 S3
@@ -25,6 +25,8 @@ trait Shard[S <: shards.Shard] extends shards.Shard {
@throws(classOf[shards.ShardException]) def getChildShardsOfClass(parentId: ShardId, className: String): Seq[ShardInfo]
@throws(classOf[shards.ShardException]) def rebuildSchema()
@throws(classOf[shards.ShardException]) def reload()
+
+ // extract....
@throws(classOf[NonExistentShard]) def findShardById(id: ShardId): S
def findCurrentForwarding(address: (Int, Long)): S
}
@@ -17,22 +17,16 @@ object SplittingShardSpec extends ConfiguredSpecification with JMocker with Clas
var splittingShard = new fake.ReadWriteShardAdapter(new SplittingShard(nameServer, null, 1, shards))
"splitting behavior" in {
- "writes should only go to one shard" in {
+ "writes should go to the shard specified in the nameserver" in {
expect {
val address:(Int, Long) = (1, "a".charAt(0).asDigit)
one(nameServer).findCurrentForwarding(address).willReturn(shard1)
one(shard1).put("a", "b")
- never(shard1).put("a", "b")
+ never(shard2).put("a", "b")
}
splittingShard.put("a", "b")
}
- "split chooser should choose which shard" in {
-
- }
- "reads should happen from the same shard as the write" in {
-
- }
}
// "failover" in {

0 comments on commit db061e8

Please sign in to comment.