Permalink
Browse files

tests pass

  • Loading branch information...
1 parent ef1d078 commit cb0ead2604af3685f9e4ca152547206a5d14e22e Kyle Maxwell committed Sep 13, 2010
@@ -5,7 +5,7 @@ import com.twitter.sbt._
class FlockDBProject(info: ProjectInfo) extends StandardProject(info) with SubversionPublisher {
val configgy = "net.lag" % "configgy" % "1.6.1"
val dbcp = "commons-dbcp" % "commons-dbcp" % "1.2.2"
- val gizzard = "com.twitter" % "gizzard" % "1.3.16"
+ val gizzard = "com.twitter" % "gizzard" % "1.3.17"
val kestrel = "net.lag" % "kestrel" % "1.2"
val mysqljdbc = "mysql" % "mysql-connector-java" % "5.1.6"
val ostrich = "com.twitter" % "ostrich" % "1.2.1"
@@ -90,7 +90,7 @@ class MetadataCopy(sourceShardId: ShardId, destinationShardId: ShardId, cursor:
extends gizzard.jobs.Copy[Shard](sourceShardId, destinationShardId, count) {
def this(sourceShardId: ShardId, destinationShardId: ShardId, cursor: MetadataCopy.Cursor) =
this(sourceShardId, destinationShardId, cursor, Copy.COUNT)
-
+
def copyPage(sourceShard: Shard, destinationShard: Shard, count: Int) = {
val (items, newCursor) = sourceShard.selectAllMetadata(cursor, count)
destinationShard.writeMetadataState(items)
@@ -107,8 +107,8 @@ class CopySpec extends ConfiguredSpecification with JMocker with ClassMocker {
one(nameServer).findShardById(shard1Id) willReturn shard1
one(nameServer).findShardById(shard2Id) willReturn shard2
one(shard1).selectAllMetadata(cursor, count) willReturn (List(metadata), Cursor(cursor.position + 1))
- one(shard2).writeMetadataState(metadata)
- one(scheduler).apply(new MetadataCopy(shard1Id, shard2Id, Cursor(cursor.position + 1), count))
+ one(shard2).writeMetadataState(List(metadata))
+ one(scheduler).apply(new MetadataCopy(shard1Id, shard2Id, Cursor(cursor.position + 1), count))
}
job.apply((nameServer, scheduler))
}
@@ -120,7 +120,7 @@ class CopySpec extends ConfiguredSpecification with JMocker with ClassMocker {
one(nameServer).findShardById(shard1Id) willReturn shard1
one(nameServer).findShardById(shard2Id) willReturn shard2
one(shard1).selectAllMetadata(cursor, count) willReturn (List(metadata), Cursor.End)
- one(shard2).writeMetadataState(metadata)
+ one(shard2).writeMetadataState(List(metadata))
one(nameServer).markShardBusy(shard2Id, Busy.Busy)
one(scheduler).apply(new Copy(shard1Id, shard2Id, (Cursor.Start, Cursor.Start), Copy.COUNT))
}

0 comments on commit cb0ead2

Please sign in to comment.