jberragan commented on code in PR #44:
URL:
https://github.com/apache/cassandra-analytics/pull/44#discussion_r1508249721
##########
cassandra-bridge/src/main/java/org/apache/cassandra/spark/utils/TimeProvider.java:
##########
@@ -19,16 +19,37 @@
package org.apache.cassandra.spark.utils;
+import java.util.concurrent.TimeUnit;
+
/**
* Provides current time
*/
-@FunctionalInterface
public interface TimeProvider
{
- TimeProvider INSTANCE = () -> (int)
Math.floorDiv(System.currentTimeMillis(), 1000L);
+ TimeProvider DEFAULT = new TimeProvider()
+ {
+ private final int referenceEpoch = nowInSeconds();
Review Comment:
I worry this will be a gotcha for those unfamiliar with `referenceEpoch` and
why it is required. Many users will not realize they need to override
TimeProvider.
If they have long running Spark clusters, this `referenceEpoch` will be
defined once and never updated, potentially resulting in values appearing that
should be been TTL'ed
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]