tkalkirill commented on code in PR #2453:
URL: https://github.com/apache/ignite-3/pull/2453#discussion_r1296820756
##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/leases/LeaseTracker.java:
##########
@@ -154,60 +147,59 @@ public void stopTrack() {
* @param grpId Replication group id.
* @return A lease is associated with the group.
*/
- public @NotNull Lease getLease(ReplicationGroupId grpId) {
+ public Lease getLease(ReplicationGroupId grpId) {
+ Leases leases = this.leases;
+
assert leases != null : "Leases not initialized, probably the local
placement driver actor hasn't started lease tracking.";
- return leases.get1().getOrDefault(grpId, EMPTY_LEASE);
+ return leases.leaseByGroupId().getOrDefault(grpId, EMPTY_LEASE);
}
- /**
- * Returns collection of leases, ordered by replication group.
- *
- * @return Collection of leases.
- */
- public IgniteBiTuple<Map<ReplicationGroupId, Lease>, byte[]>
leasesCurrent() {
+ /** Returns collection of leases, ordered by replication group. */
+ public Leases leasesCurrent() {
return leases;
}
- /**
- * Listen lease holder updates.
- */
+ /** Listen lease holder updates. */
private class UpdateListener implements WatchListener {
@Override
public CompletableFuture<Void> onUpdate(WatchEvent event) {
- for (EntryEvent entry : event.entryEvents()) {
- Entry msEntry = entry.newEntry();
+ return inBusyLockAsync(busyLock, () -> {
Review Comment:
I think yes, we often use a similar approach in the code base, led to it.
--
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]