Skip to content
Snippets Groups Projects
Commit ead33635 authored by Sören Henning's avatar Sören Henning
Browse files

Minor JavaDoc fixes

parent 3cfdc5a4
No related branches found
No related tags found
No related merge requests found
Pipeline #10416 passed
......@@ -10,8 +10,8 @@ import rocks.theodolite.benchmarks.commons.model.records.ActivePowerRecord;
/**
* TimeStampPolicy to use event time based on the timestamp of the record value.
*/
public class EventTimePolicy
extends TimestampPolicy<String, ActivePowerRecord> {
public class EventTimePolicy extends TimestampPolicy<String, ActivePowerRecord> {
protected Instant currentWatermark;
public EventTimePolicy(final Optional<Instant> previousWatermark) {
......@@ -19,7 +19,6 @@ public class EventTimePolicy
this.currentWatermark = previousWatermark.orElse(BoundedWindow.TIMESTAMP_MIN_VALUE);
}
@Override
public Instant getTimestampForRecord(final PartitionContext ctx,
final KafkaRecord<String, ActivePowerRecord> record) {
......
......@@ -9,7 +9,7 @@ import org.apache.beam.sdk.values.PCollection;
import org.apache.kafka.common.serialization.Deserializer;
/**
* Simple {@link PTransform} that read from Kafka using {@link KafkaIO}.
* Simple {@link PTransform} that reads from Kafka using {@link KafkaIO}.
*
* @param <K> Type of the Key.
* @param <V> Type of the Value.
......@@ -17,10 +17,11 @@ import org.apache.kafka.common.serialization.Deserializer;
public class KafkaGenericReader<K, V> extends PTransform<PBegin, PCollection<KV<K, V>>> {
private static final long serialVersionUID = 2603286150183186115L;
private final PTransform<PBegin, PCollection<KV<K, V>>> reader;
/**
* Instantiates a {@link PTransform} that reads from Kafka with the given Configuration.
* Instantiates a {@link PTransform} that reads from Kafka with the given configuration.
*/
public KafkaGenericReader(
final String bootstrapServer,
......@@ -30,19 +31,18 @@ public class KafkaGenericReader<K, V> extends PTransform<PBegin, PCollection<KV<
final Class<? extends Deserializer<V>> valueDeserializer) {
super();
// Check if boostrap server and inputTopic are defined
// Check if the boostrap server and the input topic are defined
if (bootstrapServer.isEmpty() || inputTopic.isEmpty()) {
throw new IllegalArgumentException("bootstrapServer or inputTopic missing");
}
this.reader =
KafkaIO.<K, V>read()
.withBootstrapServers(bootstrapServer)
.withTopic(inputTopic)
.withKeyDeserializer(keyDeserializer)
.withValueDeserializer(valueDeserializer)
.withConsumerConfigUpdates(consumerConfig)
.withoutMetadata();
this.reader = KafkaIO.<K, V>read()
.withBootstrapServers(bootstrapServer)
.withTopic(inputTopic)
.withKeyDeserializer(keyDeserializer)
.withValueDeserializer(valueDeserializer)
.withConsumerConfigUpdates(consumerConfig)
.withoutMetadata();
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment