kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ewe...@apache.org
Subject kafka git commit: MINOR: add setUncaughtExceptionHandler to KafkaStreams
Date Thu, 11 Feb 2016 06:02:19 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 5092e7f83 -> 67a7ea9d6


MINOR: add setUncaughtExceptionHandler to KafkaStreams

Author: Yasuhiro Matsuda <yasuhiro@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #894 from ymatsuda/minor


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

Branch: refs/heads/trunk
Commit: 67a7ea9d6744645dd4e08b6a78dd69704a4982b3
Parents: 5092e7f
Author: Yasuhiro Matsuda <yasuhiro@confluent.io>
Authored: Wed Feb 10 22:01:56 2016 -0800
Committer: Ewen Cheslack-Postava <me@ewencp.org>
Committed: Wed Feb 10 22:01:56 2016 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/kafka/streams/KafkaStreams.java | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/67a7ea9d/streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java b/streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java
index a19f697..724daac 100644
--- a/streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java
+++ b/streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java
@@ -181,4 +181,15 @@ public class KafkaStreams {
             throw new IllegalStateException("This process has not started yet.");
         }
     }
+
+    /**
+     * Sets the handler invoked when a stream thread abruptly terminates due to an uncaught
exception.
+     *
+     * @param eh the object to use as this thread's uncaught exception handler. If null then
this thread has no explicit handler.
+     */
+    public void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh) {
+        for (StreamThread thread : threads)
+            thread.setUncaughtExceptionHandler(eh);
+    }
+
 }


Mime
View raw message