You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by pn...@apache.org on 2021/08/11 08:57:41 UTC

[flink-benchmarks] 01/02: [hotfix] Auto format ProcessingTimerBenchmark

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

pnowojski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-benchmarks.git

commit 92dc4d67bb6198452253e0d3481ca8b79339989b
Author: Piotr Nowojski <pi...@gmail.com>
AuthorDate: Tue Aug 10 11:52:23 2021 +0200

    [hotfix] Auto format ProcessingTimerBenchmark
---
 .../flink/benchmark/ProcessingTimerBenchmark.java  | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/flink/benchmark/ProcessingTimerBenchmark.java b/src/main/java/org/apache/flink/benchmark/ProcessingTimerBenchmark.java
index dee911e..2b8fb02 100644
--- a/src/main/java/org/apache/flink/benchmark/ProcessingTimerBenchmark.java
+++ b/src/main/java/org/apache/flink/benchmark/ProcessingTimerBenchmark.java
@@ -24,6 +24,7 @@ import org.apache.flink.streaming.api.functions.KeyedProcessFunction;
 import org.apache.flink.streaming.api.functions.sink.DiscardingSink;
 import org.apache.flink.streaming.api.functions.source.RichParallelSourceFunction;
 import org.apache.flink.util.Collector;
+
 import org.openjdk.jmh.annotations.Benchmark;
 import org.openjdk.jmh.annotations.OperationsPerInvocation;
 import org.openjdk.jmh.runner.Runner;
@@ -43,12 +44,12 @@ public class ProcessingTimerBenchmark extends BenchmarkBase {
 
     private static OneShotLatch LATCH = new OneShotLatch();
 
-    public static void main(String[] args)
-            throws RunnerException {
-        Options options = new OptionsBuilder()
-                .verbosity(VerboseMode.NORMAL)
-                .include(".*" + ProcessingTimerBenchmark.class.getCanonicalName() + ".*")
-                .build();
+    public static void main(String[] args) throws RunnerException {
+        Options options =
+                new OptionsBuilder()
+                        .verbosity(VerboseMode.NORMAL)
+                        .include(".*" + ProcessingTimerBenchmark.class.getCanonicalName() + ".*")
+                        .build();
 
         new Runner(options).run();
     }
@@ -91,7 +92,8 @@ public class ProcessingTimerBenchmark extends BenchmarkBase {
         public void cancel() {}
     }
 
-    private static class ProcessingTimerKeyedProcessFunction extends KeyedProcessFunction<Integer, String, String> {
+    private static class ProcessingTimerKeyedProcessFunction
+            extends KeyedProcessFunction<Integer, String, String> {
 
         private final long timersPerRecord;
         private long firedTimesCount;
@@ -106,7 +108,8 @@ public class ProcessingTimerBenchmark extends BenchmarkBase {
         }
 
         @Override
-        public void processElement(String s, Context context, Collector<String> collector) throws Exception {
+        public void processElement(String s, Context context, Collector<String> collector)
+                throws Exception {
             final long currTimestamp = System.currentTimeMillis();
             for (int i = 0; i < timersPerRecord; i++) {
                 context.timerService().registerProcessingTimeTimer(currTimestamp - i - 1);
@@ -114,7 +117,8 @@ public class ProcessingTimerBenchmark extends BenchmarkBase {
         }
 
         @Override
-        public void onTimer(long timestamp, OnTimerContext ctx, Collector<String> out) throws Exception {
+        public void onTimer(long timestamp, OnTimerContext ctx, Collector<String> out)
+                throws Exception {
             if (++firedTimesCount == timersPerRecord) {
                 LATCH.trigger();
             }