Permalink
Browse files

use business marking

  • Loading branch information...
1 parent 671d4ed commit 22ecb67936b133b1900111435d2c4822b0ff3c33 Josh Hull committed Mar 5, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/main/scala/com/twitter/gizzard/scheduler/RepairJob.scala
@@ -68,8 +68,13 @@ abstract case class RepairJob[S <: Shard](shardIds: Seq[ShardId],
try {
log.info("[%s] - shard block (type %s): state=%s", label,
getClass.getName.split("\\.").last, toMap)
- val shards = shardIds.map(nameServer.findShardById(_))
- repair(shards)
+ val shardObjs = shardIds.map(nameServer.findShardById(_))
+ shardIds.foreach(nameServer.markShardBusy(_, shards.Busy.Busy))
+ repair(shardObjs)
+ this.nextJob match {
+ case None => shardIds.foreach(nameServer.markShardBusy(_, shards.Busy.Normal))
+ case _ =>
+ }
} catch {
case e: NonExistentShard =>
log.error("[%s] - failed because one of the shards doesn't exist. Terminating the repair.", label)

0 comments on commit 22ecb67

Please sign in to comment.