kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: KAFKA-1997; Follow-up to add the shutdown hook before starting the consumers; reviewed by Guozhang Wang
Date Tue, 17 Mar 2015 21:36:05 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 1caaf6db4 -> 5bbbb7fdd


KAFKA-1997; Follow-up to add the shutdown hook before starting the consumers; reviewed by
Guozhang Wang


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/5bbbb7fd
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/5bbbb7fd
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/5bbbb7fd

Branch: refs/heads/trunk
Commit: 5bbbb7fddbddc823b0946fda6e82dfba4ab8b5fd
Parents: 1caaf6d
Author: Jiangjie Qin <becket.qin@gmail.com>
Authored: Tue Mar 17 14:22:01 2015 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Tue Mar 17 14:22:01 2015 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/tools/MirrorMaker.scala | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/5bbbb7fd/core/src/main/scala/kafka/tools/MirrorMaker.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/MirrorMaker.scala b/core/src/main/scala/kafka/tools/MirrorMaker.scala
index 87b925c..11acc31 100644
--- a/core/src/main/scala/kafka/tools/MirrorMaker.scala
+++ b/core/src/main/scala/kafka/tools/MirrorMaker.scala
@@ -170,6 +170,12 @@ object MirrorMaker extends Logging with KafkaMetricsGroup {
     offsetCommitIntervalMs = options.valueOf(offsetCommitIntervalMsOpt).intValue()
     val numStreams = options.valueOf(numStreamsOpt).intValue()
 
+    Runtime.getRuntime.addShutdownHook(new Thread("MirrorMakerShutdownHook") {
+      override def run() {
+        cleanShutdown()
+      }
+    })
+    
     // create producer
     val producerProps = Utils.loadProps(options.valueOf(producerConfigOpt))
     // Defaults to no data loss settings.
@@ -255,12 +261,6 @@ object MirrorMaker extends Logging with KafkaMetricsGroup {
       }
     }
 
-    Runtime.getRuntime.addShutdownHook(new Thread("MirrorMakerShutdownHook") {
-      override def run() {
-        cleanShutdown()
-      }
-    })
-
     mirrorMakerThreads.foreach(_.start())
     mirrorMakerThreads.foreach(_.awaitShutdown())
   }


Mime
View raw message