xtern commented on code in PR #4929:
URL: https://github.com/apache/ignite-3/pull/4929#discussion_r1895533792
##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java:
##########
@@ -993,9 +1024,11 @@ private long observableTimestamp(@Nullable
ClientMessagePacker out) {
if (meta instanceof HybridTimestamp) {
return ((HybridTimestamp) meta).longValue();
}
+ } else {
+ return clockService.currentLong();
}
- return clockService.currentLong();
+ return HybridTimestamp.MIN_VALUE.longValue();
Review Comment:
I suggest rework a bit this method to see the code branching more clearly.
```java
private long observableTimestamp(@Nullable ClientMessagePacker out) {
// Certain operations can override the timestamp and provide it in
the meta object.
if (out == null) {
return clockService.currentLong();
}
Object meta = out.meta();
if (meta instanceof HybridTimestamp) {
return ((HybridTimestamp) meta).longValue();
}
return HybridTimestamp.MIN_VALUE.longValue();
}
```
##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientInboundMessageHandler.java:
##########
@@ -993,9 +1024,11 @@ private long observableTimestamp(@Nullable
ClientMessagePacker out) {
if (meta instanceof HybridTimestamp) {
return ((HybridTimestamp) meta).longValue();
}
+ } else {
+ return clockService.currentLong();
}
- return clockService.currentLong();
+ return HybridTimestamp.MIN_VALUE.longValue();
Review Comment:
I suggest to rework a bit this method to see the code branching more clearly.
```java
private long observableTimestamp(@Nullable ClientMessagePacker out) {
// Certain operations can override the timestamp and provide it in
the meta object.
if (out == null) {
return clockService.currentLong();
}
Object meta = out.meta();
if (meta instanceof HybridTimestamp) {
return ((HybridTimestamp) meta).longValue();
}
return HybridTimestamp.MIN_VALUE.longValue();
}
```
--
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]