diff --git a/theodolite-benchmarks/uc2-application-flink/src/main/java/theodolite/uc2/application/StatsProcessWindowFunction.java b/theodolite-benchmarks/uc2-application-flink/src/main/java/theodolite/uc2/application/StatsProcessWindowFunction.java index a5c370eeda3c0371a4cf479437774050abef544b..d422c37b667d9d3309f0dd858758db29051807b9 100644 --- a/theodolite-benchmarks/uc2-application-flink/src/main/java/theodolite/uc2/application/StatsProcessWindowFunction.java +++ b/theodolite-benchmarks/uc2-application-flink/src/main/java/theodolite/uc2/application/StatsProcessWindowFunction.java @@ -6,6 +6,10 @@ import org.apache.flink.streaming.api.functions.windowing.ProcessWindowFunction; import org.apache.flink.streaming.api.windowing.windows.TimeWindow; import org.apache.flink.util.Collector; +/** + * A {@link ProcessWindowFunction} that forwards a computed {@link Stats} object along with its + * associated key. + */ public class StatsProcessWindowFunction extends ProcessWindowFunction<Stats, Tuple2<String, Stats>, String, TimeWindow> { diff --git a/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/HourOfDayProcessWindowFunction.java b/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/HourOfDayProcessWindowFunction.java index 389b0e4a22966995731988f5010ed3ef7e8b209d..349c63413d0da792ad34e8ec8d94e7ff5dc06a42 100644 --- a/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/HourOfDayProcessWindowFunction.java +++ b/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/HourOfDayProcessWindowFunction.java @@ -7,6 +7,10 @@ import org.apache.flink.streaming.api.windowing.windows.TimeWindow; import org.apache.flink.util.Collector; import theodolite.uc3.application.util.HourOfDayKey; +/** + * A {@link ProcessWindowFunction} that forwards a computed {@link Stats} object along with its + * associated key. + */ public class HourOfDayProcessWindowFunction extends ProcessWindowFunction<Stats, Tuple2<HourOfDayKey, Stats>, HourOfDayKey, TimeWindow> { diff --git a/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/util/HourOfDayKey.java b/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/util/HourOfDayKey.java index c75bc54e023f90ea5d3487c9b7ecca8cefac27b3..5def88b404f23a59955ca2de42b91c22b7b1b53d 100644 --- a/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/util/HourOfDayKey.java +++ b/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/util/HourOfDayKey.java @@ -47,6 +47,10 @@ public class HourOfDayKey { return this.hourOfDay == k.hourOfDay && this.sensorId.equals(k.sensorId); } + /** + * Convert this {@link HourOfDayKey} into a byte array. This method is the inverse to + * {@code HourOfDayKey#fromByteArray()}. + */ public byte[] toByteArray() { final int numBytes = (2 * Integer.SIZE + this.sensorId.length() * Character.SIZE) / Byte.SIZE; final ByteBuffer buffer = ByteBuffer.allocate(numBytes).order(ByteOrder.LITTLE_ENDIAN); @@ -58,6 +62,10 @@ public class HourOfDayKey { return buffer.array(); } + /** + * Construct a new {@link HourOfDayKey} from a byte array. This method is the inverse to + * {@code HourOfDayKey#toByteArray()}. + */ public static HourOfDayKey fromByteArray(final byte[] bytes) { final ByteBuffer buffer = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN); final int hourOfDay = buffer.getInt(); diff --git a/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/util/HourOfDayKeyFactory.java b/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/util/HourOfDayKeyFactory.java index ffc3129bd070e8df9711111f671660efecc16650..bd67b2508bc91a87635c52e95b963ed908ed92bf 100644 --- a/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/util/HourOfDayKeyFactory.java +++ b/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/util/HourOfDayKeyFactory.java @@ -8,6 +8,8 @@ import java.time.LocalDateTime; */ public class HourOfDayKeyFactory implements StatsKeyFactory<HourOfDayKey>, Serializable { + private static final long serialVersionUID = 4357668496473645043L; // NOPMD + @Override public HourOfDayKey createKey(final String sensorId, final LocalDateTime dateTime) { final int hourOfDay = dateTime.getHour(); diff --git a/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/util/HourOfDayKeySerde.java b/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/util/HourOfDayKeySerde.java index b5ab5b986cf11782e465e712334649102303e781..6e3ae9f754d2b1d4ab10349040f0c9e51134c4f7 100644 --- a/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/util/HourOfDayKeySerde.java +++ b/theodolite-benchmarks/uc3-application-flink/src/main/java/theodolite/uc3/application/util/HourOfDayKeySerde.java @@ -18,6 +18,8 @@ import titan.ccp.common.kafka.simpleserdes.WriteBuffer; public class HourOfDayKeySerde extends Serializer<HourOfDayKey> implements BufferSerde<HourOfDayKey>, Serializable { + private static final long serialVersionUID = 1262778284661945041L; // NOPMD + @Override public void serialize(final WriteBuffer buffer, final HourOfDayKey data) { buffer.putInt(data.getHourOfDay());