smiklosovic commented on code in PR #3530:
URL: https://github.com/apache/cassandra/pull/3530#discussion_r1751704940
##########
src/java/org/apache/cassandra/db/commitlog/CommitLogArchiver.java:
##########
@@ -311,4 +344,64 @@ private void exec(String command) throws IOException
pb.redirectErrorStream(true);
FBUtilities.exec(pb);
}
+
+ /**
+ * We change the restore_point_in_time from configuration file into
microseconds level as Cassandra use microseconds
+ * as the timestamp.
+ *
+ * @param restorationPointInTime value of "restore_point_in_time" in
properties file.
+ * @return microseconds value of restore_point_in_time
+ */
+ @VisibleForTesting
+ public static long getRestorationPointInTimeInMicroseconds(String
restorationPointInTime)
+ {
+ assert !Strings.isNullOrEmpty(restorationPointInTime) :
"restore_point_in_time is null or empty!";
+ Instant instant = format.parse(restorationPointInTime, Instant::from);
+ return instant.getEpochSecond() * 1_000_000 + instant.getNano() / 1000;
+ }
+
+ public long getRestorePointInTimeInMicroseconds()
+ {
+ return this.restorePointInTimeInMicroseconds;
+ }
+
+ /**
+ * compare the timestamps which are all microseconds with different
precision
+ * @param left left microseconds
+ * @param right right microseconds
+ * @param precision the precision
+ * @return true if left is bigger than right
+ */
+ public boolean compareMicrosecondsWithPrecision(long left, long right,
TimeUnit precision)
Review Comment:
@Maxwell-Guo
Please remove this whole method and put it back as it was when you merged my
pull request. This is not necessary. Practically speaking, there will ever be
the resolution in PartitionUpdate either microseconds or milliseconds (if even
that). Nobody is going to put timestamps on e.g. day resolution ...
--
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]