Skip to content

Commit

Permalink
Specification comments and method names
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyanlei-8130 committed Aug 3, 2023
1 parent 57ecaed commit f4a7c1c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2909,7 +2909,7 @@ public boolean processReport(final DatanodeID nodeID,
+ "discarded non-initial block report from {}"
+ " because namenode still in startup phase",
strBlockReportId, fullBrLeaseId, nodeID);
removeLease(node);
removeDNLeaseIfNeeded(node);
return !node.hasStaleStorages();
}

Expand Down Expand Up @@ -2957,8 +2957,8 @@ public boolean processReport(final DatanodeID nodeID,
return !node.hasStaleStorages();
}

// Remove the lease when we have received block reports for all storages for a particular DN.
void removeLease(DatanodeDescriptor node) {
// Remove the DN lease only when we have received block reports for all storages for a particular DN.
void removeDNLeaseIfNeeded(DatanodeDescriptor node) {
boolean needRemoveLease = true;
for (DatanodeStorageInfo sInfo : node.getStorageInfos()) {
if (sInfo.getBlockReportCount() == 0) {
Expand Down

0 comments on commit f4a7c1c

Please sign in to comment.