sashapolo commented on code in PR #2402:
URL: https://github.com/apache/ignite-3/pull/2402#discussion_r1284044421


##########
modules/core/src/main/java/org/apache/ignite/internal/hlc/HybridTimestamp.java:
##########
@@ -236,12 +236,23 @@ public String toString() {
     /**
      * Returns a new hybrid timestamp with incremented physical component.
      */
-    public HybridTimestamp addPhysicalTime(long mills) {
-        if (mills >= (1L << PHYSICAL_TIME_BITS_SIZE)) {
-            throw new IllegalArgumentException("Physical time is out of 
bounds: " + mills);
+    public HybridTimestamp addPhysicalTime(long millis) {
+        if (millis >= (1L << PHYSICAL_TIME_BITS_SIZE)) {
+            throw new IllegalArgumentException("Physical time is out of 
bounds: " + millis);
         }
 
-        return new HybridTimestamp(time + (mills << LOGICAL_TIME_BITS_SIZE));
+        return new HybridTimestamp(time + (millis << LOGICAL_TIME_BITS_SIZE));
+    }
+
+    /**
+     * Returns a new hybrid timestamp with decremented physical component.
+     */
+    public HybridTimestamp subtractPhysicalTime(long millis) {
+        if (millis >= (1L << PHYSICAL_TIME_BITS_SIZE)) {
+            throw new IllegalArgumentException("Physical time is out of 
bounds: " + millis);
+        }
+
+        return new HybridTimestamp(time - (millis << LOGICAL_TIME_BITS_SIZE));

Review Comment:
   (same for overflow in the addition method)



-- 
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]

Reply via email to