This is an automated email from the ASF dual-hosted git repository. dwysakowicz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink-benchmarks.git
commit 5becc4d2c465dd57e5f875af0cc1ff208696fdc0 Author: Dawid Wysakowicz <dwysakow...@apache.org> AuthorDate: Mon Sep 27 12:02:59 2021 +0200 [hotfix] Allow FlinkEnvironmentContext#setUp to throw Exception --- .../java/org/apache/flink/benchmark/BlockingPartitionBenchmark.java | 4 +--- .../flink/benchmark/BlockingPartitionRemoteChannelBenchmark.java | 4 +--- .../java/org/apache/flink/benchmark/FlinkEnvironmentContext.java | 4 +--- .../org/apache/flink/benchmark/MemoryStateBackendBenchmark.java | 4 +--- .../java/org/apache/flink/benchmark/RocksStateBackendBenchmark.java | 4 +--- .../java/org/apache/flink/benchmark/StateBackendBenchmarkBase.java | 6 +++++- .../apache/flink/benchmark/UnalignedCheckpointTimeBenchmark.java | 3 +-- src/main/java/org/apache/flink/benchmark/WindowBenchmarks.java | 4 +--- 8 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/main/java/org/apache/flink/benchmark/BlockingPartitionBenchmark.java b/src/main/java/org/apache/flink/benchmark/BlockingPartitionBenchmark.java index c05a9fd..4bc03ad 100644 --- a/src/main/java/org/apache/flink/benchmark/BlockingPartitionBenchmark.java +++ b/src/main/java/org/apache/flink/benchmark/BlockingPartitionBenchmark.java @@ -33,8 +33,6 @@ import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; import org.openjdk.jmh.runner.options.VerboseMode; -import java.io.IOException; - /** * JMH throughput benchmark runner. */ @@ -87,7 +85,7 @@ public class BlockingPartitionBenchmark extends BenchmarkBase { private final int parallelism = 4; @Override - public void setUp() throws IOException { + public void setUp() throws Exception { super.setUp(); env.setParallelism(parallelism); diff --git a/src/main/java/org/apache/flink/benchmark/BlockingPartitionRemoteChannelBenchmark.java b/src/main/java/org/apache/flink/benchmark/BlockingPartitionRemoteChannelBenchmark.java index 59338db..e5d3397 100644 --- a/src/main/java/org/apache/flink/benchmark/BlockingPartitionRemoteChannelBenchmark.java +++ b/src/main/java/org/apache/flink/benchmark/BlockingPartitionRemoteChannelBenchmark.java @@ -33,8 +33,6 @@ import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; import org.openjdk.jmh.runner.options.VerboseMode; -import java.io.IOException; - @OperationsPerInvocation(value = BlockingPartitionRemoteChannelBenchmark.RECORDS_PER_INVOCATION) public class BlockingPartitionRemoteChannelBenchmark extends RemoteBenchmarkBase { @@ -66,7 +64,7 @@ public class BlockingPartitionRemoteChannelBenchmark extends RemoteBenchmarkBase public static class BlockingPartitionEnvironmentContext extends FlinkEnvironmentContext { @Override - public void setUp() throws IOException { + public void setUp() throws Exception { super.setUp(); env.setParallelism(PARALLELISM); diff --git a/src/main/java/org/apache/flink/benchmark/FlinkEnvironmentContext.java b/src/main/java/org/apache/flink/benchmark/FlinkEnvironmentContext.java index 7c8c97b..60e1b0a 100644 --- a/src/main/java/org/apache/flink/benchmark/FlinkEnvironmentContext.java +++ b/src/main/java/org/apache/flink/benchmark/FlinkEnvironmentContext.java @@ -33,8 +33,6 @@ import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; -import java.io.IOException; - import static org.openjdk.jmh.annotations.Scope.Thread; @State(Thread) @@ -49,7 +47,7 @@ public class FlinkEnvironmentContext { protected final boolean objectReuse = true; @Setup - public void setUp() throws IOException { + public void setUp() throws Exception { if (miniCluster != null) { throw new RuntimeException("setUp was called multiple times!"); } diff --git a/src/main/java/org/apache/flink/benchmark/MemoryStateBackendBenchmark.java b/src/main/java/org/apache/flink/benchmark/MemoryStateBackendBenchmark.java index 406b33b..a781711 100644 --- a/src/main/java/org/apache/flink/benchmark/MemoryStateBackendBenchmark.java +++ b/src/main/java/org/apache/flink/benchmark/MemoryStateBackendBenchmark.java @@ -32,8 +32,6 @@ import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; import org.openjdk.jmh.runner.options.VerboseMode; -import java.io.IOException; - import static org.openjdk.jmh.annotations.Scope.Thread; @OperationsPerInvocation(value = MemoryStateBackendBenchmark.RECORDS_PER_INVOCATION) @@ -62,7 +60,7 @@ public class MemoryStateBackendBenchmark extends StateBackendBenchmarkBase { public StateBackend stateBackend = StateBackend.MEMORY; @Override - public void setUp() throws IOException { + public void setUp() throws Exception { super.setUp(stateBackend, RECORDS_PER_INVOCATION); } } diff --git a/src/main/java/org/apache/flink/benchmark/RocksStateBackendBenchmark.java b/src/main/java/org/apache/flink/benchmark/RocksStateBackendBenchmark.java index 0f80e37..912ac44 100644 --- a/src/main/java/org/apache/flink/benchmark/RocksStateBackendBenchmark.java +++ b/src/main/java/org/apache/flink/benchmark/RocksStateBackendBenchmark.java @@ -35,8 +35,6 @@ import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; import org.openjdk.jmh.runner.options.VerboseMode; -import java.io.IOException; - import static org.openjdk.jmh.annotations.Scope.Thread; @OperationsPerInvocation(value = RocksStateBackendBenchmark.RECORDS_PER_INVOCATION) @@ -65,7 +63,7 @@ public class RocksStateBackendBenchmark extends StateBackendBenchmarkBase { public StateBackend stateBackend = StateBackend.MEMORY; @Override - public void setUp() throws IOException { + public void setUp() throws Exception { super.setUp(stateBackend, RECORDS_PER_INVOCATION); } diff --git a/src/main/java/org/apache/flink/benchmark/StateBackendBenchmarkBase.java b/src/main/java/org/apache/flink/benchmark/StateBackendBenchmarkBase.java index 7bf24c2..1a1e82a 100644 --- a/src/main/java/org/apache/flink/benchmark/StateBackendBenchmarkBase.java +++ b/src/main/java/org/apache/flink/benchmark/StateBackendBenchmarkBase.java @@ -57,7 +57,11 @@ public class StateBackendBenchmarkBase extends BenchmarkBase { } public void setUp(StateBackend stateBackend, long recordsPerInvocation) throws IOException { - super.setUp(); + try { + super.setUp(); + } catch (Exception e) { + e.printStackTrace(); + } final AbstractStateBackend backend; String checkpointDataUri = "file://" + checkpointDir.getAbsolutePath(); diff --git a/src/main/java/org/apache/flink/benchmark/UnalignedCheckpointTimeBenchmark.java b/src/main/java/org/apache/flink/benchmark/UnalignedCheckpointTimeBenchmark.java index 7534c12..d083ae6 100644 --- a/src/main/java/org/apache/flink/benchmark/UnalignedCheckpointTimeBenchmark.java +++ b/src/main/java/org/apache/flink/benchmark/UnalignedCheckpointTimeBenchmark.java @@ -38,7 +38,6 @@ import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; import org.openjdk.jmh.runner.options.VerboseMode; -import java.io.IOException; import java.time.Duration; import static java.util.concurrent.TimeUnit.SECONDS; @@ -93,7 +92,7 @@ public class UnalignedCheckpointTimeBenchmark extends BenchmarkBase { public String timeout = "0"; @Override - public void setUp() throws IOException { + public void setUp() throws Exception { super.setUp(); env.setParallelism(parallelism); diff --git a/src/main/java/org/apache/flink/benchmark/WindowBenchmarks.java b/src/main/java/org/apache/flink/benchmark/WindowBenchmarks.java index f78b7f9..9ee542e 100644 --- a/src/main/java/org/apache/flink/benchmark/WindowBenchmarks.java +++ b/src/main/java/org/apache/flink/benchmark/WindowBenchmarks.java @@ -36,8 +36,6 @@ import org.openjdk.jmh.runner.options.Options; import org.openjdk.jmh.runner.options.OptionsBuilder; import org.openjdk.jmh.runner.options.VerboseMode; -import java.io.IOException; - @OperationsPerInvocation(value = WindowBenchmarks.RECORDS_PER_INVOCATION) public class WindowBenchmarks extends BenchmarkBase { @@ -83,7 +81,7 @@ public class WindowBenchmarks extends BenchmarkBase { public DataStreamSource<IntegerLongSource.Record> source; @Override - public void setUp() throws IOException { + public void setUp() throws Exception { super.setUp(); env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime);