Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

take min of new count and count for next job

  • Loading branch information...
commit babea193ea0efabef39890dac904a2c254aa7cc0 1 parent 2c5cc32
@ningtwitter ningtwitter authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/scala/com/twitter/flockdb/jobs/Copy.scala
View
4 src/main/scala/com/twitter/flockdb/jobs/Copy.scala
@@ -84,7 +84,7 @@ class Copy(sourceShardId: ShardId, destinationShardId: ShardId, cursor: Copy.Cur
} else {
val (items, nextCursor) = sourceShard.selectAll(cursor, count)
destinationShard.writeCopies(items)
- val newCount = (count * 1.01).toInt + 1 // Upward pressure on page size
+ val newCount = Math.min((count * 1.01).toInt + 1, Copy.COUNT) // Upward pressure on page size
Stats.incr("edges-copy", items.size)
nextCursor match {
case Copy.END => None
@@ -144,7 +144,7 @@ class MetadataCopy(sourceShardId: ShardId, destinationShardId: ShardId, cursor:
} else {
val (items, nextCursor) = sourceShard.selectAllMetadata(cursor, count)
items.foreach { item => destinationShard.writeMetadata(item) }
- val newCount = (count * 1.01).toInt + 1 // Upward pressure on page size
+ val newCount = Math.min((count * 1.01).toInt + 1, Copy.COUNT) // Upward pressure on page size
Stats.incr("metadata-copy", items.size)
nextCursor match {
case MetadataCopy.END => {
Please sign in to comment.
Something went wrong with that request. Please try again.