Skip to content
Permalink
Browse files
Add method to ignore uncaught throwables (#18)
Patch by marcuse; reviewed by David Capwell for CASSANDRA-16101
  • Loading branch information
krummas committed Sep 18, 2020
1 parent 2720fff commit 15d959578258d053eb66ae94a43f299e1f099814
Showing 2 changed files with 14 additions and 1 deletion.
@@ -24,6 +24,8 @@
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 @@

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();
@@ -90,5 +90,4 @@ default int nodetool(String... commandAndArgs)

void forceCompact(String keyspace, String table);

List<Throwable> getUncaughtExceptions();
}

0 comments on commit 15d9595

Please sign in to comment.