This is an automated email from the ASF dual-hosted git repository.

marcuse pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cassandra-in-jvm-dtest-api.git


The following commit(s) were added to refs/heads/master by this push:
     new 15d9595  Add method to ignore uncaught throwables (#18)
15d9595 is described below

commit 15d959578258d053eb66ae94a43f299e1f099814
Author: Marcus Eriksson <marc...@apache.org>
AuthorDate: Fri Sep 18 09:19:13 2020 +0200

    Add method to ignore uncaught throwables (#18)
    
    Patch by marcuse; reviewed by David Capwell for CASSANDRA-16101
---
 .../org/apache/cassandra/distributed/api/ICluster.java     | 14 ++++++++++++++
 .../org/apache/cassandra/distributed/api/IInstance.java    |  1 -
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/cassandra/distributed/api/ICluster.java 
b/src/main/java/org/apache/cassandra/distributed/api/ICluster.java
index a586311..3fc056e 100644
--- a/src/main/java/org/apache/cassandra/distributed/api/ICluster.java
+++ b/src/main/java/org/apache/cassandra/distributed/api/ICluster.java
@@ -24,6 +24,8 @@ import java.net.InetSocketAddress;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
+import java.util.function.BiPredicate;
+import java.util.function.Predicate;
 import java.util.stream.Stream;
 
 public interface ICluster<I extends IInstance> extends AutoCloseable
@@ -54,6 +56,18 @@ public interface ICluster<I extends IInstance> extends 
AutoCloseable
 
     IMessageFilters filters();
 
+    /**
+     * dynamically sets the current uncaught exceptions filter
+     *
+     * the predicate should return true if we should ignore the given 
throwable on the given instance
+     */
+    default void setUncaughtExceptionsFilter(BiPredicate<Integer, Throwable> 
ignoreThrowable) {}
+    default void setUncaughtExceptionsFilter(Predicate<Throwable> 
ignoreThrowable)
+    {
+        setUncaughtExceptionsFilter((ignored, throwable) -> 
ignoreThrowable.test(throwable));
+    }
+    default void checkAndResetUncaughtExceptions() {}
+
     static void setup() throws Throwable
     {
         setupLogging();
diff --git a/src/main/java/org/apache/cassandra/distributed/api/IInstance.java 
b/src/main/java/org/apache/cassandra/distributed/api/IInstance.java
index 5db0bcf..496d33d 100644
--- a/src/main/java/org/apache/cassandra/distributed/api/IInstance.java
+++ b/src/main/java/org/apache/cassandra/distributed/api/IInstance.java
@@ -90,5 +90,4 @@ public interface IInstance extends IIsolatedExecutor
 
     void forceCompact(String keyspace, String table);
 
-    List<Throwable> getUncaughtExceptions();
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to