|
@@ -82,8 +82,6 @@ class BPServiceActor implements Runnable {
|
|
HAServiceState state;
|
|
HAServiceState state;
|
|
|
|
|
|
final BPOfferService bpos;
|
|
final BPOfferService bpos;
|
|
-
|
|
|
|
- volatile long lastDeletedReport = 0;
|
|
|
|
|
|
|
|
volatile long lastCacheReport = 0;
|
|
volatile long lastCacheReport = 0;
|
|
private final Scheduler scheduler;
|
|
private final Scheduler scheduler;
|
|
@@ -385,10 +383,10 @@ class BPServiceActor implements Runnable {
|
|
@VisibleForTesting
|
|
@VisibleForTesting
|
|
void triggerDeletionReportForTests() {
|
|
void triggerDeletionReportForTests() {
|
|
synchronized (pendingIncrementalBRperStorage) {
|
|
synchronized (pendingIncrementalBRperStorage) {
|
|
- lastDeletedReport = 0;
|
|
|
|
|
|
+ sendImmediateIBR = true;
|
|
pendingIncrementalBRperStorage.notifyAll();
|
|
pendingIncrementalBRperStorage.notifyAll();
|
|
|
|
|
|
- while (lastDeletedReport == 0) {
|
|
|
|
|
|
+ while (sendImmediateIBR) {
|
|
try {
|
|
try {
|
|
pendingIncrementalBRperStorage.wait(100);
|
|
pendingIncrementalBRperStorage.wait(100);
|
|
} catch (InterruptedException e) {
|
|
} catch (InterruptedException e) {
|
|
@@ -421,7 +419,6 @@ class BPServiceActor implements Runnable {
|
|
*/
|
|
*/
|
|
List<DatanodeCommand> blockReport() throws IOException {
|
|
List<DatanodeCommand> blockReport() throws IOException {
|
|
// send block report if timer has expired.
|
|
// send block report if timer has expired.
|
|
- final long startTime = scheduler.monotonicNow();
|
|
|
|
if (!scheduler.isBlockReportDue()) {
|
|
if (!scheduler.isBlockReportDue()) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -433,7 +430,6 @@ class BPServiceActor implements Runnable {
|
|
// or we will report an RBW replica after the BlockReport already reports
|
|
// or we will report an RBW replica after the BlockReport already reports
|
|
// a FINALIZED one.
|
|
// a FINALIZED one.
|
|
reportReceivedDeletedBlocks();
|
|
reportReceivedDeletedBlocks();
|
|
- lastDeletedReport = startTime;
|
|
|
|
|
|
|
|
long brCreateStartTime = monotonicNow();
|
|
long brCreateStartTime = monotonicNow();
|
|
Map<DatanodeStorage, BlockListAsLongs> perVolumeBlockLists =
|
|
Map<DatanodeStorage, BlockListAsLongs> perVolumeBlockLists =
|
|
@@ -624,7 +620,6 @@ class BPServiceActor implements Runnable {
|
|
*/
|
|
*/
|
|
private void offerService() throws Exception {
|
|
private void offerService() throws Exception {
|
|
LOG.info("For namenode " + nnAddr + " using"
|
|
LOG.info("For namenode " + nnAddr + " using"
|
|
- + " DELETEREPORT_INTERVAL of " + dnConf.deleteReportInterval + " msec "
|
|
|
|
+ " BLOCKREPORT_INTERVAL of " + dnConf.blockReportInterval + "msec"
|
|
+ " BLOCKREPORT_INTERVAL of " + dnConf.blockReportInterval + "msec"
|
|
+ " CACHEREPORT_INTERVAL of " + dnConf.cacheReportInterval + "msec"
|
|
+ " CACHEREPORT_INTERVAL of " + dnConf.cacheReportInterval + "msec"
|
|
+ " Initial delay: " + dnConf.initialBlockReportDelay + "msec"
|
|
+ " Initial delay: " + dnConf.initialBlockReportDelay + "msec"
|
|
@@ -679,10 +674,8 @@ class BPServiceActor implements Runnable {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (sendImmediateIBR ||
|
|
|
|
- (startTime - lastDeletedReport > dnConf.deleteReportInterval)) {
|
|
|
|
|
|
+ if (sendImmediateIBR || sendHeartbeat) {
|
|
reportReceivedDeletedBlocks();
|
|
reportReceivedDeletedBlocks();
|
|
- lastDeletedReport = startTime;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
List<DatanodeCommand> cmds = blockReport();
|
|
List<DatanodeCommand> cmds = blockReport();
|