Skip to content
Browse files

use new interface

  • Loading branch information...
1 parent 7858265 commit d1612f62b8b225fe4fdf704ef697c899384e8f52 Josh Hull committed
View
2 project/build/FlockDBProject.scala
@@ -8,7 +8,7 @@ with SubversionPublisher with DefaultRepos {
override def filterScalaJars = false
val scalaTools = "org.scala-lang" % "scala-compiler" % "2.8.1"
- val gizzard = "com.twitter" % "gizzard" % "2.1.3"
+ val gizzard = "com.twitter" % "gizzard" % "2.1.4-SNAPSHOT"
val asm = "asm" % "asm" % "1.5.3" % "test"
val cglib = "cglib" % "cglib" % "2.1_3" % "test"
val hamcrest = "org.hamcrest" % "hamcrest-all" % "1.1" % "test"
View
14 src/main/scala/com/twitter/flockdb/jobs/Diff.scala
@@ -61,10 +61,10 @@ class Diff(shardIds: Seq[ShardId], cursor: Repair.RepairCursor, count: Int,
log.info("DIFF [DIFFERENT] -> table id:"+tableId+" shard:"+list._1.shardInfo.id+ "+edge:"+item)
}
- override def scheduleNextRepair(lowestCursor: Repair.RepairCursor) = {
+ override def nextRepair(lowestCursor: Repair.RepairCursor) = {
lowestCursor match {
case Repair.END => None
- case _ => scheduler.put(Repair.PRIORITY, new Diff(shardIds, lowestCursor, count, nameServer, scheduler))
+ case _ => Some(new Diff(shardIds, lowestCursor, count, nameServer, scheduler))
}
}
}
@@ -93,10 +93,10 @@ class MetadataDiff(shardIds: Seq[ShardId], cursor: MetadataRepair.RepairCursor,
log.info("DIFF [DIFFERENT] -> table id:"+tableId+" shard:"+list._1.shardInfo.id+" metadata:"+item)
}
- override def scheduleNextRepair(lowestCursor: MetadataRepair.RepairCursor) = {
- lowestCursor match {
- case MetadataRepair.END => scheduler.put(Repair.PRIORITY, new Diff(shardIds, Repair.START, Repair.COUNT, nameServer, scheduler))
- case _ => scheduler.put(Repair.PRIORITY, new MetadataDiff(shardIds, lowestCursor, count, nameServer, scheduler))
- }
+ override def nextRepair(lowestCursor: MetadataRepair.RepairCursor) = {
+ Some(lowestCursor match {
+ case MetadataRepair.END => new Diff(shardIds, Repair.START, Repair.COUNT, nameServer, scheduler)
+ case _ => new MetadataDiff(shardIds, lowestCursor, count, nameServer, scheduler)
+ })
}
}
View
8 src/main/scala/com/twitter/flockdb/jobs/Repair.scala
@@ -111,10 +111,10 @@ class Repair(shardIds: Seq[ShardId], cursor: Repair.RepairCursor, count: Int,
def serialize = Map("cursor1" -> cursor._1.position, "cursor2" -> cursor._2.position)
- def scheduleNextRepair(lowestCursor: Repair.RepairCursor) = {
+ def nextRepair(lowestCursor: Repair.RepairCursor) = {
lowestCursor match {
case Repair.END => None
- case _ => scheduler.put(Repair.PRIORITY, new Repair(shardIds, lowestCursor, count, nameServer, scheduler))
+ case _ => Some(new Repair(shardIds, lowestCursor, count, nameServer, scheduler))
}
}
}
@@ -143,8 +143,8 @@ class MetadataRepair(shardIds: Seq[ShardId], cursor: MetadataRepair.RepairCursor
override def label = "MetadataRepair"
- def scheduleNextRepair(lowestCursor: MetadataRepair.RepairCursor) = {
- scheduler.put(Repair.PRIORITY, lowestCursor match {
+ def nextRepair(lowestCursor: MetadataRepair.RepairCursor) = {
+ Some(lowestCursor match {
case MetadataRepair.END => new Repair(shardIds, Repair.START, Repair.COUNT, nameServer, scheduler)
case _ => new MetadataRepair(shardIds, lowestCursor, count, nameServer, scheduler)
})

0 comments on commit d1612f6

Please sign in to comment.
Something went wrong with that request. Please try again.