AHeise commented on a change in pull request #15972:
URL: https://github.com/apache/flink/pull/15972#discussion_r664270238
##########
File path:
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/source/reader/RecordsWithSplitIds.java
##########
@@ -18,12 +18,22 @@
package org.apache.flink.connector.base.source.reader;
+import org.apache.flink.metrics.groups.SourceMetricGroup;
+
import javax.annotation.Nullable;
import java.util.Set;
/** An interface for the elements passed from the fetchers to the source
reader. */
public interface RecordsWithSplitIds<E> {
+ /**
+ * Returns the timestamp of the last fetch. Will be used to automatically
set {@link
+ * SourceMetricGroup#addLastFetchTimeGauge(Gauge)}.
+ */
+ @Nullable
+ default Long lastFetchTime() {
Review comment:
Not really. Here I have just used `null` because all other methods in
this interface use it.
Tbh in Java 8 I don't see much difference between properly annotated methods
and Optional. With Java 9 most Optionals are proper monads, so it looks
different.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]