Skip to content

Commit 9604ad2

Browse files
author
S O'Donnell
committed
Address review comments
1 parent 15851db commit 9604ad2

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,7 @@ public DatanodeCommand blockReport(final DatanodeRegistration nodeReg,
16531653
blocks, context));
16541654
}
16551655
} else {
1656-
throw new InvalidBlockReportLeaseException();
1656+
throw new InvalidBlockReportLeaseException(context.getReportId(), context.getLeaseId());
16571657
}
16581658
} catch (UnregisteredNodeException une) {
16591659
LOG.warn("Datanode {} is attempting to report but not register yet.",

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/InvalidBlockReportLeaseException.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public class InvalidBlockReportLeaseException extends IOException {
3434
/** for java.io.Serializable. */
3535
private static final long serialVersionUID = 1L;
3636

37-
public InvalidBlockReportLeaseException() {
38-
super("Block report was rejected as the lease is invalid");
37+
public InvalidBlockReportLeaseException(long blockReportID, long leaseID) {
38+
super("Block report 0x" + Long.toHexString(blockReportID) + " was rejected as lease 0x"
39+
+ Long.toHexString(leaseID) + " is invalid");
3940
}
4041
}

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBPOfferService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ public Object answer(InvocationOnMock invocation)
11871187
// just reject and wait until DN request for a new leaseId
11881188
if(leaseId == 1) {
11891189
firstLeaseId = leaseId;
1190-
InvalidBlockReportLeaseException e = new InvalidBlockReportLeaseException();
1190+
InvalidBlockReportLeaseException e = new InvalidBlockReportLeaseException(context.getReportId(), 1);
11911191
throw new RemoteException(e.getClass().getName(), e.getMessage());
11921192
} else {
11931193
secondLeaseId = leaseId;

0 commit comments

Comments
 (0)