keith-turner commented on code in PR #4821:
URL: https://github.com/apache/accumulo/pull/4821#discussion_r1727975488
##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/availability/SetTabletAvailability.java:
##########
@@ -97,7 +97,7 @@ public long isReady(FateId fateId, Manager manager) throws
Exception {
}
};
- var start = NanoTime.now();
+ var start = Timer.startNew();
Review Comment:
later in the class the `start.elapsed().toMillis()` is called. Could use
the time unit version of the method.
##########
server/manager/src/main/java/org/apache/accumulo/manager/Manager.java:
##########
@@ -1066,10 +1066,10 @@ private List<TabletMigration>
checkMigrationSanity(Set<TabletServerId> current,
// wait at least 10 seconds
final Duration timeToWait =
Comparators.max(Duration.ofSeconds(10), Duration.ofMillis(rpcTimeout /
3));
- final NanoTime startTime = NanoTime.now();
+ final Timer startTime = Timer.startNew();
// Wait for all tasks to complete
while (!tasks.isEmpty()) {
- boolean cancel = (startTime.elapsed().compareTo(timeToWait) > 0);
+ boolean cancel = (startTime.hasElapsed(timeToWait));
Review Comment:
```suggestion
boolean cancel = startTime.hasElapsed(timeToWait);
```
##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/merge/ReserveTablets.java:
##########
@@ -71,7 +71,7 @@ public long isReady(FateId fateId, Manager env) throws
Exception {
int locations = 0;
int wals = 0;
- var startTime = NanoTime.now();
+ var startTime = Timer.startNew();
Review Comment:
Later in the class `startTime.elapsed().toMillis()` is called, could use the
new TimeUnit version of elapsed.
--
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]