Navigation Menu

Skip to content
This repository has been archived by the owner on May 22, 2019. It is now read-only.

Commit

Permalink
Additional logging and stats for the JobAsyncReplicator
Browse files Browse the repository at this point in the history
  • Loading branch information
John Corwin committed Mar 27, 2012
1 parent b05816f commit 03ec3af
Showing 1 changed file with 5 additions and 2 deletions.
@@ -1,6 +1,7 @@
package com.twitter.gizzard.scheduler

import scala.annotation.tailrec
import com.google.common.util.concurrent.ThreadFactoryBuilder
import com.twitter.util.Time
import com.twitter.gizzard.nameserver.JobRelay
import com.twitter.gizzard.Stats
Expand All @@ -23,7 +24,9 @@ class JobAsyncReplicator(jobRelay: => JobRelay, queueConfig: QueueConfig, queueR
private val log = Logger.get(getClass)
private val exceptionLog = Logger.get("exception")

private val threadpool = Executors.newCachedThreadPool()
private val threadFactory =
new ThreadFactoryBuilder().setDaemon(true).setNameFormat("JobAsyncReplicator-%d").build()
private val threadpool = Executors.newCachedThreadPool(threadFactory)

def clusters = queueMap.keySet
def queues = queueMap.values.toSeq
Expand Down Expand Up @@ -85,7 +88,7 @@ class JobAsyncReplicator(jobRelay: => JobRelay, queueConfig: QueueConfig, queueR
qs.values foreach { _.setup }

for (c <- qs.keys; i <- 0 until threadsPerCluster) {
log.info("Starting processor [%d/%d] for cluster %s", i, threadsPerCluster, c)
log.info("Starting processor [%d/%d] for cluster %s", i + 1, threadsPerCluster, c)
threadpool.submit(newProcessor(c))
}
}
Expand Down

0 comments on commit 03ec3af

Please sign in to comment.