Permalink
Browse files

add shouldSchedule interface

  • Loading branch information...
1 parent e55e8ff commit a7d0c9530c0e017b8911008445b2a2bf7c60bdf3 Josh Hull committed Feb 1, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/main/scala/com/twitter/gizzard/scheduler/RepairJob.scala
@@ -121,6 +121,8 @@ abstract class MultiShardRepair[S <: Shard, R <: Repairable[R], C <: Any](shardI
listCursors.filter(!_._2.isEmpty).reduceLeft((list1, list2) => if (list1._2(0).similar(list2._2(0)) < 0) list1 else list2)
}
+ def shouldSchedule(original:R, suspect: R): Boolean
+
def repairListCursor(listCursors: Seq[(S, ListBuffer[R], C)], tableIds: Seq[Int]) = {
if (tableIds.forall((id) => id == tableIds(0))) {
while (listCursors.forall(lc => !lc._2.isEmpty || cursorAtEnd(lc._3)) && listCursors.exists(lc => !lc._2.isEmpty)) {
@@ -136,7 +138,7 @@ abstract class MultiShardRepair[S <: Shard, R <: Repairable[R], C <: Any](shardI
for (list <- similarLists) {
if (firstItem == list._2(0)) {
list._2.remove(0)
- } else {
+ } else if (shouldSchedule(firstItem, list._2(0))){
if (!firstEnqueued) {
firstEnqueued = true
schedule(firstList, tableId, firstItem)

0 comments on commit a7d0c95

Please sign in to comment.